LiveJournal Server

Technical Info

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in in the section entitled “Appendix A, GNU Free Documentation License”.

Abstract

This documentation intends to cover everything related to installing, administrating, and programming the LiveJournal Server software.


Table of Contents

LiveJournal Server
Preface
I. Introduction to LiveJournal
1. What is LiveJournal?
2. The Story Behind LiveJournal
3. Why Use LiveJournal?
1. Features
4. Frank the Goat
II. LiveJournal Installation
5. Requirements
6. Perl
1. Installing Perl
2. Installing Perl Modules
7. General Setup
1. $LJHOME Environment Variable
2. Installing the files
8. MySQL
1. Install MySQL
2. Secure your MySQL installation
3. Create the LiveJournal Database
4. Configuring %LJ::DBINFO
5. Populate the Database
9. Supplemental Software
1. Install extra required packages and modules
2. Setting up multiple database servers
3. Configure memcached and SSL
4. Configure Perlbal
4.1. Install Perlbal
4.2. Set up Perlbal
4.3. Example perlbal.conf
4.4. SSL steps and startup
5. Configure MogileFS
5.1. Install MogileFS
5.2. Set up MogileFS
6. Set up LJ <=> FotoBilder Integration
10. Configuring ljconfig.pl
1. $LJ:: Variables
1.1. Auto-Configured
1.2. User-Configurable
2. %LJ::HELPURLS
3. %LJ::DISABLED
4. Setting Capabilities
11. Apache
1. Installation
1.1. mod_perl
1.2. Apache suEXEC Support
1.3. Virtual Hosts
2. Example httpd.conf
12. Configure Gearman / TheSchwartz
1. Install Gearman / TheSchwartz
2. Set up Gearman / TheSchwartz
13. Scheduling Maintenance tasks
14. Finishing Up
III. Customizing Your Installation
15. Using your own SVN directory
1. cvsreport.pl (vcv) : Adding & Overlaying
16. Using your own images and icons
1. Using imageconf.pl
17. Customizing LJ's Content
1. Using site-specific text
18. Setting your own Limits
19. Setting and using Hooks
1. Writing Hooks
2. Hooks Reference
20. BML Schemes
1. Writing a BML Scheme
2. BML Template Reference
21. Running your own Maintenance Tasks
IV. Administering a LiveJournal Site
22. Creating Users
23. Capabilities Classes
1. Introduction
2. Setting Capabilities
3. Capabilities Reference
24. Administrating Privileges
1. Using privs effectively
2. A list of all Privs
25. The Administrative Console
1. Taking control of the Console
2. Console Command Reference
26. Banning Users
27. Running a Busy Site
V. LiveJournal Features
28. Internal Support System
1. Introduction
A. GNU Free Documentation License
B. Documentation Contributors
Glossary
BML
Preface
1. A Brief Tutorial
1. Introducing BML
1.1. Blocks
1.2. BML Files
2. Block Parameters
2.1. The DATA Block Parameter
2.2. Block Flags and Passing Multiple Parameters
2.3. Parameterized Output: Positional Parameters
3. Static Blocks
3.1. Fully-Static Blocks
3.2. Semi-static Blocks
4. A Full Example
2. BML Block Types
3. Core BML blocks
I. API Documentation
BML::self_link — Takes the URI of the current page, and adds the current form data to the URL, then adds any additional data to the URL.
BML::set_status — Takes a number to indicate a status (e.g. 404, 403, 410, 500, etc.) and sets that to be returned to the client when the request finishes.
LiveJournal Programming
I. Programming Guidelines
1. General Guidelines
1. Key points to remember
2. Trailing whitespace
3. Best Practices: Functions
4. Perl Style
2. Working with the Sources
3. Team Player Guidelines
1. Be a good camper
2. Nearby Code
3. Return early when possible
4. Security
5. Database
6. Performance & Scalability
7. Coding Specifics
1. Accessor names
2. if, unless, else
3. Ternary Operator
8. Patches
9. Focus on the broad picture
1. Don't hard-code URLs in translation strings
2. Deleting and changing translation strings
3. Be smart to site schemes
10. Internationalization
1. Removing hard-coded English text
2. The /translate/ system - English-stripping
II. Internals
11. Capabilities Classes
12. Portal Modules
13. Cookie Scheme
14. Creating & Using Breadcrumbs
15. Statusvis Codes
16. Dversion Values
17. XML Userdata
1. Data Formats
2. Rates & Limits
18. ESN - Event Subscription Notification
19. Advertising Lexicon
20. memcached data - storage & identification
1. data storage format: keys
2. memcached keys reference
21. MogileFS keys
22. Multihomed Userprops
III. Client/Server Protocol
23. Client / Server Protocol - Quick Reference
1. Introduction to the Protocol
2. Working with Proxies
24. Authentication in the Client Server Protocol
1. Clear
2. HTTP Cookies
3. Challenge-Response
I. Flat Client/Server Protocol Reference
checkfriends — Mode that clients can use to poll the server to see if their Friends list has been updated. This request is extremely quick, and is the preferred way for users to see when their Friends list is updated, rather than pounding on reload in their browser, which is stressful on the servers.
consolecommand — Run an administrative command. The LiveJournal server has a text-based shell-like administration console where less-often used commands can be entered. There is a web interface to this shell online; this is another gateway to that. The mode is limited to one server-parsed command only. The command should be sent with double quotes around any arguments with spaces, with double quotes escaped by backslashes, and backslashes escaped with backslashes. Optionally, you can send a listref instead of a string for this argument, in which case, we will use your argument separation and not parse it ourselves.
editevent — Edit or delete a user's past journal entry
editfriendgroups — Edit the user's defined groups of friends.
editfriends — Add, edit, or delete friends from the user's Friends list.
friendof — Returns a list of which other LiveJournal users list this user as their friend.
getchallenge — Generate a one-time, quick expiration challenge to be used in challenge/response authentication methods.
getdaycounts — This mode retrieves the number of journal entries per day. Useful for populating calendar widgets in GUI clients.
getevents — Download parts of the user's journal. See also syncitems protocol mode.
getfriendgroups — Retrieves a list of the user's defined groups of friends.
getfriends — Returns a list of which other LiveJournal users this user lists as their friend.
getusertags — Retrieves a list of the user's defined tags.
login — Log in to the server, while announcing your client version. The server returns with whether the password is good or not, the user's name, an optional message to be displayed to the user, and the list of the user's friend groups. (friend groups can also be retrieved using the getfriendgroups mode)
postevent — The most important mode, this is how a user actually submits a new log entry to the server.
sessionexpire — Expires one or more sessions that a user has active within the system. This can be used to log a user out of any browsers they are logged in from, as well as to cancel any sessions created with the sessionexpire mode.
sessiongenerate — Generates a session that can be used to setup a cookie for accessing the site with a user's privileges.
syncitems — Returns a list (or part of a list) of all the items (journal entries, to-do items, comments) that have been created or updated on LiveJournal since you last downloaded them. Note that the items themselves are not returned --- only the item type and the item number. After you get this you have to go fetch the items using another protocol mode. For journal entries (type "L"), use the getevents mode with a selecttype of "syncitems".
II. XML-RPC Client/Server Protocol Reference
checkfriends — Checks to see if your Friends list has been updated since a specified time.
consolecommand — Run an administrative command.
editevent — Edit or delete a user's past journal entry
editfriendgroups — Edit the user's defined groups of friends.
editfriends — Add, edit, or delete friends from the user's Friends list.
friendof — Returns a list of which other LiveJournal users list this user as their friend.
getchallenge — Generate a server challenge string for authentication.
getdaycounts — This mode retrieves the number of journal entries per day.
getevents — Download parts of the user's journal. See also syncitems mode.
getfriends — Returns a list of which other LiveJournal users this user lists as their friend.
getfriendgroups — Retrieves a list of the user's defined groups of friends.
getusertags — Retrieves a list of the user's defined tags.
login — validate user's password and get base information needed for client to function
postevent — The most important mode, this is how a user actually submits a new log entry to the server.
sessionexpire — Expires session cookies.
sessiongenerate — Generate a session cookie.
syncitems — Returns a list of all the items that have been created or updated for a user.
25. Supporting the Blogger API
26. Supporting the Atom API
27. Protocol Versions
28. Downloading Entries
29. Exporting Comments
30. Journal Item Meta-data
A. Frequently Asked Questions
IV. Making Journal Styles
31. Comparing Style Systems
32. Style System 1 (S1)
1. S1 Introduction
B. S1 Variable Reference: Most Recent Entries
GLOBAL_HEAD — Any arbitrary HTML you want placed in the <HEAD> of the page being displayed. This is a good place to put CSS or META tags. Being global, this will be placed in any view type. If you want to add tags for a specific view type, use LASTN_HEAD, DAY_HEAD, FRIENDS_HEAD, or CALENDAR_HEAD.
LASTN_5LINKUNIT_AD — The HTML tag needed to show a 5 link unit ad on your journal.
LASTN_ALTPOSTER — When a user other than the journal owner posts a top-level journal entry in a journal, this variable is inserted into the %%altposter%% property of LASTN_EVENT.
LASTN_ALTPOSTER_PIC — Goes into %%pic%% in LASTN_ALTPOSTER.
LASTN_CLOSE_SKYSCRAPER_AD — Conditional close wrapper around ad and/or user content.
LASTN_CURRENT — When a user has specified "current" information (like current music or current mood), this variable is added to the %%currents%% property of LASTN_CURRENTS.
LASTN_CURRENTS — When a user has specified "current" information (like current music or current mood), this variable separates those entries from the rest of the journal entry in LASTN_EVENT.
LASTN_DATE_FORMAT — Describes how dates/times are formatted in each LASTN_EVENT variable.
LASTN_END_DAY — The opposite of LASTN_NEW_DAY. This variable is inserted into %%events%% in the LASTN_PAGE.
LASTN_EVENT — An event from the user's journal. A bunch of these (as specified by LASTN_OPT_ITEMS) get put together to form the %%events%% property of the LASTN_PAGE variable. See also LASTN_EVENT_PRIVATE and LASTN_EVENT_PROTECTED.
LASTN_EVENT_PRIVATE — An optional specialized form of LASTN_EVENT to be used on entries that are marked as "private" (only the original poster can see them). If you leave this blank, the standard event variable will be used instead.
LASTN_EVENT_PROTECTED — An optional specialized form of LASTN_EVENT to be used on entries that are marked as "friends" or "custom" (only a select group of people can see them). If you leave this blank, the standard event variable will be used instead.
LASTN_HEAD — Any arbitrary HTML you want placed in the <HEAD> of the lastn page. This is a good place to put CSS or META tags. If you want to add the same tags to all your pages, use GLOBAL_HEAD.
LASTN_NEW_DAY — Before any LASTN_EVENT that's on a day that no other event has been shown before, this block is inserted into %%events%% in the LASTN_PAGE.
LASTN_OPEN_SKYSCRAPER_AD — Conditional open wrapper around ad and/or user content.
LASTN_OPT_ITEMS — This is an integer value between 1 and 50 that sets how many items are shown in the "events" property of the LASTN_PAGE variable.
LASTN_PAGE — The HTML for the most recent journal entries page (lastn mode) that's sent to the browser. Customize this as you'd like your page to look.
LASTN_RANGE_HISTORY — This should be the text that says the user is not viewing the most recent entries, but is instead viewing back into the history.
LASTN_RANGE_MOSTRECENT — This should be the text that says the user is viewing the top (most recent) entries, and there are %%numitems%% of them.
LASTN_SKIP_BACKWARD — The HTML to make the link to the next (less recent) page of the lastn view... going back in time.
LASTN_SKIP_FORWARD — The HTML to make the link to the previous (more recent) page of the lastn view... going forward in time.
LASTN_SKIP_LINKS — If the user can go back a page or forward a page, this variable is inserted into the %%skiplinks%% property of LASTN_PAGE.
LASTN_SKIP_SPACER — The HTML shown if both the skip backward and skip forward elements are displayed.
LASTN_SKYSCRAPER_AD — The HTML tag needed to show a skyscraper ad on your journal.
LASTN_SUBJECT — When a journal entry has a subject, this variable is inserted into the %%subject%% property of LASTN_EVENT.
LASTN_TALK_LINKS — Define here HTML (if any) that you want to be displayed for the links to read comments and post comments on the current event. The contents of this variable are inserted into %%talklinks%% in LASTN_EVENT, if the user has commenting enabled.
LASTN_TALK_READLINK — If there are comments on the existing journal entry being displayed, then one of these variables is inserted into the %%readlink%% property of LASTN_TALK_LINKS.
LASTN_USERPIC — Creates the IMG tag needed to show your picture on the last-n page.
LASTN_WEBSITE — When the user has specified their website URL, this variable goes into the %%website%% property of LASTN_PAGE.
C. S1 Variable Reference: Calendar view
CALENDAR_5LINKUNIT_AD — The HTML tag needed to show a 5 link unit ad on your journal.
CALENDAR_CLOSE_SKYSCRAPER_AD — Conditional close wrapper around ad and/or user content.
CALENDAR_DAY — This is a block of HTML for a day on the calendar, which gets inserted into %%days%% in the CALENDAR_WEEK variable.
CALENDAR_DAY_EVENT — Some HTML that gets inserted into CALENDAR_DAY variables when the number of events (journal entries) for that day is non-zero. For instance, this is useful if you want to display a link to the day view to see what the user's events for that day were. On a day with zero events, you wouldn't want a link, so you'd put your HTML into this variable, not in CALENDAR_DAY. However, in CALENDAR_DAY, make sure you use %%dayevent%% somewhere.
CALENDAR_DAY_NOEVENT — Some HTML that gets inserted into CALENDAR_DAY variables when the number of events (journal entries) for that day is zero.
CALENDAR_EMPTY_DAYS — At the beginning and end of the month, there may be blank squares on the calendar. For instance, if the 1st of the month lands on a Wednesday, the Sunday-Tuesdays squares are non-existent. In the construction of a pretty HTML table, it will be necessary to make a TD cell with a COLSPAN equal to the number of empty days. If you are not making your calendar view look like a calendar, just leave this variable blank. Note: this variable is used in the %%emptydays_beg%% and %%emptydays_end%% properties of the CALENDAR_WEEK variable.
CALENDAR_HEAD — Any arbitrary HTML you want placed in the <HEAD> of the calendar page. This is a good place to put CSS or META tags. If you want to add the same tags to all your pages, use GLOBAL_HEAD.
CALENDAR_MONTH — The HTML for a month in the calendar view. A bunch of these variables as well as CALENDAR_NEW_YEAR variables form the %%months%% property of the CALENDAR_PAGE variable.
CALENDAR_NEW_YEAR — Before any CALENDAR_MONTH HTML for a month of a year that hasn't been shown yet, one of these variables gets inserted into %%months%% of CALENDAR_PAGE.
CALENDAR_OPEN_SKYSCRAPER_AD — Conditional open wrapper around ad and/or user content.
CALENDAR_PAGE — The HTML page layout for the calendar view.
CALENDAR_SKYSCRAPER_AD — The HTML tag needed to show a skyscraper ad on your journal.
CALENDAR_SORT_MODE — Determines whether months in the calendar mode (variable: CALENDAR_MONTH) are shown in "reverse" order (most recent month at top) or in "forward" order (oldest months at top). The value of this variable should be either "forward" or "reverse", without quotes. By default, reverse will be assumed.
CALENDAR_WEBSITE — When the user has specified their website URL, this variable goes into the %%website%% property of CALENDAR_PAGE.
CALENDAR_WEEK — HTML for a week in the calendar. 4-5 of these week objects get concatenated together into the %%weeks%% property of the CALENDAR_MONTH.
CALENDAR_YEAR_DISPLAYED — Some HTML that goes in the CALENDAR_YEAR_LINKS for the displayed year.
CALENDAR_YEAR_LINK — A link to view a different year in the calendar.
CALENDAR_YEAR_LINKS — When there are more than 1 year of entries to be shown, this variable is inserted into the %%yearlinks%% property of CALENDAR_PAGE. Its purpose is to indicate which year is selected and let you move between the different years by clicking links.
D. S1 Variable Reference: Day view
DAY_5LINKUNIT_AD — The HTML tag needed to show a 5 link unit ad on your journal.
DAY_CLOSE_SKYSCRAPER_AD — Conditional close wrapper around ad and/or user content.
DAY_CURRENT — When a user has specified "current" information (like current music or current mood), this variable is added to the %%currents%% property of DAY_CURRENTS.
DAY_CURRENTS — When a user has specified "current" information (like current music or current mood), this variable separates those entries apart from the rest of the journal entry in DAY_EVENT.
DAY_DATE_FORMAT — Describes how dates/times are formatted in each DAY_EVENT variable.
DAY_EVENT — An event in the journal, which goes in %%events%% of DAY_PAGE. See also DAY_EVENT_PRIVATE and DAY_EVENT_PROTECTED.
DAY_EVENTS — When events occur on a given day in the day view, this variable gets inserted into %%events%% of DAY_PAGE.
DAY_EVENT_PRIVATE — An optional specialized form of DAY_EVENT to be used on entries that are marked as "private" (only the original poster can see them). If you leave this blank, the standard event variable will be used instead.
DAY_EVENT_PROTECTED — An optional specialized form of DAY_EVENT to be used on entries that are marked as "friends" or "custom" (only a select group of people can see them). If you leave this blank, the standard event variable will be used instead.
DAY_HEAD — Any arbitrary HTML you want placed in the <HEAD> of the day page. This is a good place to put CSS or META tags. If you want to add the same tags to all your pages, use GLOBAL_HEAD.
DAY_NOEVENTS — When no events occur on a given day in the day view, this variable gets inserted into %%events%% of DAY_PAGE.
DAY_OPEN_SKYSCRAPER_AD — Conditional open wrapper around ad and/or user content.
DAY_PAGE — The HTML for the day view, after somebody clicks a day on the calendar.
DAY_SKYSCRAPER_AD — The HTML tag needed to show a skyscraper ad on your journal.
DAY_SORT_MODE — Determines whether events in the day view (variable: DAY_PAGE) are shown in "forward" order (earlier events first) or in "reverse" order (newest events shown first). The value of this variable should be either "forward" or "reverse", without quotes.
DAY_SUBJECT — When a journal entry has a subject, this variable is inserted into the %%subject%% property of DAY_EVENT.
DAY_TALK_LINKS — Define here HTML (if any) that you want to be displayed for the links to read comments and post comments on the current event. The contents of this variable are inserted into %%talklinks%% in DAY_EVENT if the user has commenting enabled.
DAY_TALK_READLINK — If there are comments on the existing journal entry being displayed, then one of these variables is inserted into the %%readlink%% property of DAY_TALK_LINKS.
DAY_WEBSITE — When the user has specified their website URL, this variable goes into the %%website%% property of DAY_PAGE.
E. S1 Variable Reference: Friends View
FRIENDS_5LINKUNIT_AD — The HTML tag needed to show a 5 link unit ad on your journal.
FRIENDS_ALTPOSTER — When a user other than the journal owner posts a top-level journal entry in a journal, this variable is inserted into the %%altposter%% property of FRIENDS_EVENT.
FRIENDS_CLOSE_SKYSCRAPER_AD — Conditional close wrapper around ad and/or user content.
FRIENDS_CURRENT — When a user has specified "current" information (like current music or current mood), this variable is added to the %%currents%% property of FRIENDS_CURRENTS.
FRIENDS_CURRENTS — When a user has specified "current" information (like current music or current mood), this variable separates those entries apart from the rest of the journal entry in FRIENDS_EVENT.
FRIENDS_DATE_FORMAT — Describes how dates/times are formatted in each FRIENDS_EVENT variable.
FRIENDS_END_DAY — The opposite of FRIENDS_NEW_DAY. This variable is inserted into %%events%% in the FRIENDS_EVENTS.
FRIENDS_EVENT — An event from the user's journal. A bunch of these (as specified by FRIENDS_OPT_ITEMS) get put together to form the %%events%% property of the FRIENDS_EVENTS variable. See also FRIENDS_EVENT_PRIVATE and FRIENDS_EVENT_PROTECTED.
FRIENDS_EVENTS — A container for a bunch of FRIENDS_EVENT variables. Gets inserted into %%events%% of FRIENDS_PAGE.
FRIENDS_EVENT_PRIVATE — An optional specialized form of FRIENDS_EVENT to be used on entries that are marked as "private" (only the original poster can see them). If you leave this blank, the standard event variable will be used instead.
FRIENDS_EVENT_PROTECTED — An optional specialized form of FRIENDS_EVENT to be used on entries that are marked as "friends" or "custom" (only a select group of people can see them). If you leave this blank, the standard event variable will be used instead.
FRIENDS_FRIENDPIC — Creates the IMG tag needed to show your friend's picture on the friends view page.
FRIENDS_HEAD — Any arbitrary HTML you want placed in the <HEAD> of the friends page. This is a good place to put CSS or META tags. If you want to add the same tags to all your pages, use GLOBAL_HEAD.
FRIENDS_NEW_DAY — Before any FRIENDS_EVENT that's on a day that no other event has been shown before, this block is inserted into %%events%% in the FRIENDS_EVENTS.
FRIENDS_NOFRIENDS — This variable is used as %%events%% in FRIENDS_PAGE if the user has not defined any friends.
FRIENDS_NO_SUBJECT — When a journal entry does NOT have a subject, this variable is inserted into the %%subject%% property of FRIENDS_EVENT.
FRIENDS_OPEN_SKYSCRAPER_AD — Conditional open wrapper around ad and/or user content.
FRIENDS_OPT_ITEMS — This is an integer value between 1 and 50 that sets how many items are shown in the "events" property of the FRIENDS_PAGE variable.
FRIENDS_PAGE — The HTML for the friends' most recent journal entries page (friends view) that's sent to the browser. Customize this as you'd like your page to look.
FRIENDS_RANGE_HISTORY — This should be the text that says the user is not viewing the most recent entries, but is instead viewing back into the history.
FRIENDS_RANGE_MOSTRECENT — This should be the text that says the user is viewing the top (most recent) entries, and there are %%numitems%% of them.
FRIENDS_SKIP_BACKWARD — The HTML to make the link to the next (less recent) page of the friends view... going back in time.
FRIENDS_SKIP_FORWARD — The HTML to make the link to the previous (more recent) page of the friends view... going forward in time.
FRIENDS_SKIP_LINKS — If the user can go back a page or forward a page, this variable is inserted into the %%skiplinks%% property of FRIENDS_PAGE.
FRIENDS_SKIP_SPACER — The HTML shown if both the skip backward and skip forward elements are displayed.
FRIENDS_SKYSCRAPER_AD — The HTML tag needed to show a skyscraper ad on your journal.
FRIENDS_SUBJECT — When a journal entry has a subject, this variable is inserted into the %%subject%% property of FRIENDS_EVENT.
FRIENDS_TALK_LINKS — Define here HTML (if any) that you want to be displayed for the links to read comments and post comments on the current event. The contents of this variable are inserted into %%talklinks%% in FRIENDS_EVENT if the user has commenting enabled.
FRIENDS_TALK_READLINK — If there are comments on the existing journal entry being displayed, then one of these variables is inserted into the %%readlink%% property of FRIENDS_TALK_LINKS.
FRIENDS_WEBSITE — When the user has specified their website URL, this variable goes into the %%website%% property of FRIENDS_PAGE.
V. Application Programming Interface
III. API Documentation
LJ::CleanHTML::clean — Multi-faceted HTML parse function
LJ::Cmdbuffer::flush — Flush up to 500 rows of a given command type from the cmdbuffer table.
LJ::Cmdbuffer::get_property — Get a property of an async job type, either built-in or site-specific.
LJ::Comment::create — Create a new comment. Add them to DB.
LJ::Comment::new — Gets a comment given journal_u entry and jtalkid.
LJ::DB::time_range_to_ids — Performs a binary search on a table's primary id key looking for time boundaries as specified. Returns the boundary ids that were found, effectively simulating a key on 'time' for the specified table.
LJ::Entry::new — Gets a journal entry.
LJ::FBUpload::do_upload — Uploads an image to FotoBilder from LiveJournal.
LJ::Faq::has_summary — Tests whether instance has a summary
LJ::Faq::lang_update_in_place — Fill in question, summary and answer from database for one or more FAQs.
LJ::Faq::load — Creates a LJ::Faq object and populates it from the database.
LJ::Faq::load_all — Creates LJ::Faq objects from all FAQs in the database.
LJ::Faq::load_matching — Finds all FAQs containing a search term and ranks them by relevance.
LJ::Faq::new — Creates a LJ::Faq object from supplied information.
LJ::Faq::render_in_place — Render one or more FAQs by expanding FAQ-specific mark-up.
LJ::JSUtil::autocomplete — given the name of a form filed and a list of strings, return the JavaScript needed to turn on autocomplete for the given field.
LJ::Memories::add_hash — Add values of one hash, to the corresponding entries in another.
LJ::Memories::clear_memcache — Deletes memcached keyword data.
LJ::Memories::count — Returns the number of memories that a user has.
LJ::Memories::create — Create a new memory for a user.
LJ::Memories::delete_by_id — Deletes a bunch of memories by memid.
LJ::Memories::get_by_ditemid — Get memory for a given journal entry.
LJ::Memories::get_by_id — Get memories given some memory ids.
LJ::Memories::get_by_keyword — Get memories given a user and a keyword/keyword id.
LJ::Memories::get_by_user — Get memories given a user.
LJ::Memories::get_keyword_counts — Get a list of keywords and the counts for memories, showing how many memories are under each keyword.
LJ::Memories::get_keywordids — Get all keyword ids a user has used for a certain memory.
LJ::Memories::get_keywords — Retrieves keyword/keyids without big joins, returns a hashref.
LJ::Memories::update_memory — Updates the description and security of a memory.
LJ::Memories::updated_keywords — Deletes memcached keyword data.
LJ::ParseFeed::parse_feed — Parses an RSS/Atom feed.
LJ::S1::get_themeid — Loads or returns cached version of given color theme data.
LJ::S1w2::date_s2_to_s1 — Convert an S2 Date or DateTime object into an S1 date hash.
LJ::S1w2::prepare_currents — do all the current music/mood/weather/whatever stuff. only used by ljviews.pl.
LJ::S2::get_tags_text — Gets text for display in entry for tags compatibility.
LJ::Schools::add_pending_school — Adds a school from a user to the pending list of schools.
LJ::Schools::approve_pending — Takes a bunch of pending rows and approves them as a new target school.
LJ::Schools::canonical_city_name — Canonicalizes a cities name to a standard format.
LJ::Schools::canonical_school_name — Canonicalizes a school name to a standard format.
LJ::Schools::delete_attended — Removes an attended edge from a user/school.
LJ::Schools::delete_school — Deletes an approved school
LJ::Schools::determine_location_opts — Internal; used to perform the logic to determine the location codes to use for a record based on the inputs.
LJ::Schools::edit_school — Edits the information for a school.
LJ::Schools::expand_codes — Expands country, state, and city codes into actual names.
LJ::Schools::find_existing — Finds an existing school by given criteria.
LJ::Schools::get_attended — Gets a list of schools a user has attended.
LJ::Schools::get_attendees — Gets a list of users that attended a school.
LJ::Schools::get_cities — Gets information about what cities have been populated with schools.
LJ::Schools::get_countries — Get a list of countries that we have schools in.
LJ::Schools::get_pending — Returns the next "potentially good" set of records to be processed.
LJ::Schools::get_schools — Gets schools defined in a given area.
LJ::Schools::get_states — Gets information about what states have been populated with schools. States and provinces are considered the same thing.
LJ::Schools::load_schools — Returns detailed information about schools.
LJ::Schools::merge_schools — Merges schools into one record.
LJ::Schools::reject_pending — Deletes pending schools.
LJ::Schools::rename_city — Renames a city within a country and state.
LJ::Schools::rename_state — Renames a state within a country.
LJ::Schools::set_attended — Lists a school as being attended by a user or updates an existing edge.
LJ::Support::Stats::comma_formatter — Format a number with commas
LJ::Support::Stats::date_formatter — Format a date
LJ::Support::Stats::filter_support_by_category — Filter Support by Category ID.
LJ::Support::Stats::get_grains_from_seconds — Determine the grains (day/week/month/year) of given a date
LJ::Support::Stats::percent_formatter — Format a percentage: Take integer portion and append percent sign.
LJ::Support::get_support_by_daterange — Get all the support rows based on a date range.
LJ::Support::get_support_by_ids — Get all the support rows based on a list of Support IDs
LJ::Support::get_supportlogs — Get all the supportlog rows for a list of Support IDs.
LJ::Support::get_touch_supportlogs_by_user_and_date — Get all touch (non-req) supportlogs based on User ID and Date Range.
LJ::Support::slow_query_dbh — Retrieve a database handle to be used for support-related slow queries... defaults to 'slow' role but can be overriden by @LJ::SUPPORT_SLOW_ROLES.
LJ::Tags::can_add_tags — Determines if one account is allowed to add tags to another's entry.
LJ::Tags::can_control_tags — Determines if one account is allowed to control (add, edit, delete) the tags of another.
LJ::Tags::create_usertag — Creates tags for a user, returning the keyword ids allocated.
LJ::Tags::delete_logtags — Deletes all tags on an entry.
LJ::Tags::delete_usertag — Deletes a tag for a user, and all mappings.
LJ::Tags::deleted_friend_group — Called from ljprotocol when a friends group is deleted.
LJ::Tags::get_entry_tags — Gets tags that have been used on an entry.
LJ::Tags::get_logtagsmulti — Load tags on a given set of entries
LJ::Tags::get_permission_levels — Gets the permission levels on an account.
LJ::Tags::get_security_breakdown — Returns a list of security levels that apply to the given security information.
LJ::Tags::get_usertags — Returns the tags that a user has defined for their account.
LJ::Tags::get_usertagsmulti — Gets a bunch of tags for the specified list of users.
LJ::Tags::is_valid_tagstring — Determines if a string contains a valid list of tags.
LJ::Tags::rename_usertag — Deletes a tag for a user, and all mappings.
LJ::Tags::reset_cache — Clears out all cached information for a user's tags.
LJ::Tags::set_usertag_display — Set the display bool for a tag.
LJ::Tags::update_logtags — Updates the tags on an entry. Tags not in the list you provide are deleted.
LJ::Tags::validate_tag — Check the validity of a single tag.
LJ::Talk::can_delete — Determines if a user can delete a comment or entry: You can delete anything you've posted. You can delete anything posted in something you own (i.e. a comment in your journal, a comment to an entry you made in a community). You can also delete any item in an account you have the "A"dministration edge for.
LJ::Talk::delete_comment — Deletes a single comment.
LJ::Talk::delete_thread — Deletes an entire thread of comments.
LJ::Talk::freeze_comments — Freezes comments. This is the internal helper function called by freeze_thread/unfreeze_thread. Use those if you wish to freeze or unfreeze a thread. This function just freezes specific comments.
LJ::Talk::freeze_thread — Freezes an entire thread of comments.
LJ::Talk::get_comments_in_thread — Gets a list of comment ids that are contained within a thread, including the comment at the top of the thread. You can also limit this to only return comments of a certain state.
LJ::Talk::get_talk2_row — Gets a row of data from talk2.
LJ::Talk::get_talk2_row_multi — Gets multiple rows of data from talk2.
LJ::Talk::screening_level — Determines the screening level of a particular post given the relevant information.
LJ::Talk::unfreeze_thread — unfreezes an entire thread of comments.
LJ::User::activate_userpics — Sets/unsets userpics as inactive based on account caps.
LJ::User::caps_icon — get the icon for a user's cap.
LJ::User::dudata_set — Record or delete disk usage data for a journal.
LJ::User::get_friends_birthdays — get the upcoming birthdays for friends of a user. shows birthdays 3 months away by default pass in full => 1 to get all friends' birthdays.
LJ::User::large_journal_icon — get the large icon by journal type.
LJ::User::mogfs_userpic_key — Make a mogilefs key for the given pic for the user.
LJ::_friends_do — Runs given SQL, then deletes the given userid's friends from memcache.
LJ::_get_rel_memcache — Helper function: returns memcached value for a given (userid, targetid, type) triple, if valid.
LJ::_mod_rel_multi — Sets/Clears relationship edges for lists of user tuples.
LJ::_set_rel_memcache — Helper function: sets memcache values for a given (userid, targetid, type) triple
LJ::accept_comm_invite — Accepts an invitation a user has received. This does all the work to make the user join the community as well as sets up privileges.
LJ::acct_code_check — Checks the validity of a given account code
LJ::acct_code_decode — Breaks an account code down into its two parts
LJ::acct_code_encode — Given an account ID integer and a 5 digit auth code, returns a 12 digit account code.
LJ::acct_code_generate — Creates invitation code(s) from an optional userid for use by anybody.
LJ::acid_decode — Given an acid encoding from LJ::acid_encode, returns the original decimal number.
LJ::acid_encode — Given a decimal number, returns base 30 encoding using an alphabet of letters & numbers that are not easily mistaken for each other.
LJ::activate_userpics — Wrapper around LJ::User->activate_userpics for compatibility.
LJ::add_friend — Simple interface to add a friend edge.
LJ::ago_text — Converts integer seconds to English time span
LJ::alldatepart_s1 — Gets date in MySQL format, produces s1dateformat.
LJ::alldatepart_s2 — Gets date in MySQL format, produces s2dateformat.
LJ::alldateparts_to_hash — Given a date/time format from MySQL, breaks it into a hash.
LJ::approve_pending_member — Approves someone's request to join a community. This updates the authactions table as appropriate as well as does the regular join logic. This also generates an e-mail to be sent to the user notifying them of the acceptance.
LJ::are_hooks — Returns true if the site has one or more hooks installed for the given hookname.
LJ::auth_okay — Validates a user's password. The "clear" or "md5" argument must be present, and either the "actual" argument (the correct password) must be set, or the first argument must be a user object ($u) with the 'password' key set. This is the preferred way to validate a password (as opposed to doing it by hand), since this function will use a pluggable authenticator, if one is defined, so LiveJournal installations can be based off an LDAP server, for example.
LJ::auto_linkify — Takes a plain-text string and changes URLs into <a href> tags (auto-linkification).
LJ::bad_input — Returns common BML for reporting form validation errors in a bulleted list.
LJ::bit_breakdown — Breaks down a bitmask into an array of bits enabled.
LJ::blocking_report — Log a report on the total amount of time used in a slow operation to a remote host via UDP.
LJ::can_manage — Given a user and a target user, will determine if the first user is an admin for the target user.
LJ::can_manage_other — Given a user and a target user, will determine if the first user is an admin for the target user, but not if the two are the same.
LJ::can_use_journal
LJ::can_view — Checks to see if the remote user can view a given journal entry. Note: This is meant for use on single entries at a time, not for calling many times on every entry in a journal.
LJ::canonical_username — normalizes username.
LJ::check_email — checks for and rejects bogus e-mail addresses.
LJ::check_form_auth — Verifies form authentication created with LJ::form_auth.
LJ::check_priv — Check to see if a user has a certain privilege.
LJ::check_referer — Checks if the user is coming from a given URI.
LJ::check_rel — Checks whether two users are in a specified relationship to each other.
LJ::clear_caches — This function is called from a HUP signal handler and is intentionally very very simple (1 line) so we don't core dump on a system without reentrant libraries. It just sets a flag to clear the caches at the beginning of the next request (see LJ::handle_caches). There should be no need to ever call this function directly.
LJ::clear_hooks — Removes all hooks.
LJ::clear_rel — Deletes a relationship between two users or all relationships of a particular type for one user, on either side of the relationship.
LJ::clear_rel_multi — Clear relationship edges for lists of user tuples.
LJ::cmd_buffer_add — Schedules some command to be run sometime in the future which would be too slow to do synchronously with the web request. An example is deleting a journal entry, which requires recursing through a lot of tables and deleting all the appropriate stuff.
LJ::cmize::display_current_summary — HTML helper function: Returns a block of HTML that summarizes the user's current display options.
LJ::cmize::get_moodtheme_select_list — Spoof checking for mood theme ids
LJ::cmize::get_style_thumbnails — Get style thumbnail information from per-process caches, or load if not available.
LJ::cmize::html_save — HTML helper function: Common HTML for the "save changes" button in a tab.
LJ::cmize::html_tablinks — HTML helper function: Common HTML for links on top of tabs.
LJ::cmize::js_redirect — Function to determine the correct redirect when clicking on a tab link.
LJ::cmize::s1_get_customcolors — Gets style list (S1).
LJ::cmize::s1_get_style_list — Gets style list (S1).
LJ::cmize::s1_get_theme_list — Gets style list (S1).
LJ::cmize::s2_custom_layer_list — custom layers will be shown in the "Custom Layers" and "Disabled Layers" groups depending on the user's account status. if they don't have the s2styles cap, then they will have all layers disabled, except for the one they are currently using.
LJ::cmize::s2_get_lang — Gets the lang code for the user's style
LJ::cmize::s2_implicit_style_create — Common "create s2 style" skeleton.
LJ::cmize::validate_moodthemeid — Spoof checking for mood theme ids
LJ::color_fromdb — Takes a value of unknown type from the DB and returns an #rrggbb string.
LJ::color_todb — Takes an #rrggbb value and returns a 24-bit decimal number.
LJ::comm_join_request — Registers an authaction to add a user to a community and sends an approval email to the maintainers
LJ::create_account — Creates a new basic account. Note: This function is not really too useful but should be extended to be useful so htdocs/create.bml can use it, rather than doing the work itself.
LJ::create_qr_div — Creates the hidden div that stores the QuickReply form.
LJ::date_to_view_links — Returns HTML of date with links to user's journal.
LJ::days_in_month — Figures out the number of days in a month.
LJ::decode_url_string — Parse URL-style arg/value pairs into a hash.
LJ::delete_all_comments — deletes all comments from a post, permanently, for when a post is deleted
LJ::delete_comments — deletes comments, but not the relational information, so threading doesn't break
LJ::delete_entry — Deletes a user's journal entry
LJ::did_post — Cookies should only show pages which make no action. When an action is being made, check the request coming from the remote user is a POST request.
LJ::disconnect_dbs — Clear cached DB handles
LJ::do_to_cluster — Given a subref, this function will pick a random cluster and run the subref, passing it the cluster id. If the subref returns a 1, this function will exit with a 1. Else, the function will call the subref again, with the next cluster.
LJ::durl — Decodes a value that's URL-escaped. See also LJ::eurl.
LJ::ehtml — Escapes a value before it can be put in HTML.
LJ::ejs — Escapes a string value before it can be put in JavaScript.
LJ::end_request — Clears cached DB handles (if $LJ::DISCONNECT_DBS is true), and disconnects memcached handles (if $LJ::DISCONNECT_MEMCACHE is true).
LJ::entry_form — Returns a properly formatted form for creating/editing entries.
LJ::entry_form_decode — Decodes an entry_form into a protocol-compatible hash.
LJ::error_list — Returns an error bar with bulleted list of errors.
LJ::error_noremote — Returns an error telling the user to log in.
LJ::etags — Escapes < and > from a string
LJ::eurl — Escapes a value before it can be put in a URL. See also LJ::durl.
LJ::event_register — Logs a subscribable event, if anybody is subscribed to it.
LJ::exml — Escapes a value before it can be put in XML.
LJ::expand_embedded — Used for expanding embedded content like polls, for entries.
LJ::expunge_userpic — Expunges a userpic so that the system will no longer deliver this userpic. If your site has off-site caching or something similar, you can also define a hook "expunge_userpic" which will be called with a picid and userid when a pic is expunged.
LJ::fill_groups_xmlrpc — Fills a hashref (presumably to be sent to an XML-RPC client, e.g. FotoBilder) with user friend group information
LJ::fill_var_props — S1 utility function to interpolate %%variables%% in a variable. If a modifier is given like %%foo:var%%, then LJ::fvp_transform is called.
LJ::flush_cleanup_handlers — Runs all cleanup handlers registered in @LJ::CLEANUP_HANDLERS
LJ::form_auth — Creates an authentication token to be used later to verify that a form submission came from a particular user.
LJ::fvp_transform — Called from LJ::fill_var_props to do transformations.
LJ::get_authas_list — Get a list of usernames a given user can authenticate as.
LJ::get_authas_user — Given a username, will return a user object if remote is an admin for the username. Otherwise returns undef.
LJ::get_bio — gets a user bio, from DB or memcache.
LJ::get_cap — Given a user object, capability class key or capability class bit mask and a capability/limit name, returns the maximum value allowed for given user or class, considering all the limits in each class the user is a part of.
LJ::get_cap_min — Just like LJ::get_cap, but returns the minimum value. Although it might not make sense at first, some things are better when they're low, like the minimum amount of time a user might have to wait between getting updates or being allowed to refresh a page.
LJ::get_cluster_def_reader — Returns a definitive cluster reader for a given user, used when the caller wants the master handle, but will only use it to read.
LJ::get_cluster_description — Get descriptive text for a cluster id.
LJ::get_cluster_master — Returns a cluster master for a given user, used when the caller might use it to do a write (insert/delete/update/etc...)
LJ::get_cluster_reader — Returns a cluster slave for a user, or cluster master if no slaves exist.
LJ::get_community_row — Gets data relevant to a community such as their membership level and posting access.
LJ::get_dbh — Given one or more roles, returns a database handle.
LJ::get_dbirole_dbh — Internal function for get_dbh(). Uses the DBIRole to fetch a dbh, with hooks into db stats-generation if that's turned on.
LJ::get_friend_group — Returns friendgroup row(s) for a given user.
LJ::get_friend_items — Return friend items for a given user, filter, and period.
LJ::get_friendofs — Returns userids of friendofs for a given user.
LJ::get_friends — Returns friends rows for a given user.
LJ::get_keyword_id — Get the id for a keyword.
LJ::get_lastcomment — Looks up the last talkid and journal the remote user posted in.
LJ::get_lock — get a MySQL lock on a given key/dbrole combination.
LJ::get_logtext2 — Efficiently retrieves a large number of journal entry text, trying first slave database servers for recent items, then the master in cases of old items the slaves have already disposed of. See also: LJ::get_talktext2.
LJ::get_logtext2multi — Gets log text from clusters.
LJ::get_mood_picture — Loads a mood icon hashref given a themeid and moodid.
LJ::get_newids — Lookup an old global ID and see what journal it belongs to and its new ID.
LJ::get_pending_invites — Gets a list of pending invitations for a user to join a community.
LJ::get_pending_members — Gets a list of userids for people that have requested to be added to a community but have not yet actually been approved or rejected.
LJ::get_pic_from_keyword — Given a userid and keyword, returns the pic row hashref.
LJ::get_post_ids — Given a user object and some options, return the number of posts or the posts'' IDs (jitemids) that match.
LJ::get_posts_raw — Gets raw post data (text and props) efficiently from clusters.
LJ::get_postto_list — Get the list of usernames a given user can post to.
LJ::get_prop — This is used to retrieve a hashref of a row from the given tablename's proplist table. One difference from getting it straight from the database is that the 'id' key is always present, as a copy of the real proplist unique id for that table.
LJ::get_recent_items — Returns journal entries for a given account.
LJ::get_recommended_communities — Get communities associated with a user.
LJ::get_reluser_id — for reluser2, numbers 1 - 31999 are reserved for livejournal stuff, whereas numbers 32000-65535 are used for local sites.
LJ::get_remote — authenticates the user at the remote end based on their cookies and returns a hashref representing them.
LJ::get_sent_invites — Get a list of sent invitations from the past 30 days.
LJ::get_shared_journals — Gets an array of shared journals a user has access to.
LJ::get_talktext2 — Retrieves comment text. Tries slave servers first, then master.
LJ::get_timeupdate_multi — Get the last time a list of users updated.
LJ::get_timezone — Gets the timezone offset for the user.
LJ::get_urls — Returns a list of all referenced URLs from a string.
LJ::get_userid — Returns a userid given a username.
LJ::get_username — Returns a username given a userid.
LJ::get_userpic_info — Given a user, gets their userpic information.
LJ::handle_caches — clears caches if the CLEAR_CACHES flag is set from an earlier HUP signal that called LJ::clear_caches, otherwise does nothing.
LJ::help_icon — Returns BML to show a help link/icon given a help topic, or nothing if the site hasn't defined a URL for that topic. Optional arguments include HTML/BML to place before and after the link/icon, should it be returned.
LJ::html_check — Creates HTML checkbox button, and radio button controls.
LJ::html_color — A text field with attached color preview and button to choose a color.
LJ::html_datetime — Creates date and time control HTML form elements.
LJ::html_datetime_decode — Parses output of HTML form controls generated by LJ::html_datetime.
LJ::html_hidden — Makes the HTML for a hidden form element.
LJ::html_newlines — Replace newlines with HTML break tags.
LJ::html_select — Creates a drop-down box or listbox HTML form element (the <select> tag).
LJ::html_submit — Makes the HTML for a submit button.
LJ::html_text — Creates a text input field, for single-line input.
LJ::html_textarea — Creates a text box for multi-line input (the <textarea> tag).
LJ::http_to_time — Converts HTTP date to Unix time.
LJ::img — Returns an HTML <img> or <input> tag to an named image code, which each site may define with a different image file with its own dimensions. This prevents hard-coding filenames & sizes into the source. The real image data is stored in LJ::Img, which has default values provided in cgi-bin/imageconf.pl but can be overridden in etc/ljconfig.pl.
LJ::infohistory_add — Add a line of text to the table for an account.
LJ::is_ascii — checks if text is pure ASCII.
LJ::is_banned — Checks to see if a user is banned from a journal.
LJ::is_friend — Checks to see if a user is a friend of another user.
LJ::is_utf8 — check text for UTF-8 validity.
LJ::is_valid_authaction — Validates a shared secret (authid/authcode pair)
LJ::item_link — Returns URL to view an individual journal item.
LJ::item_toutf8 — convert one item's subject, text and props to UTF-8. item can be an entry or a comment (in which cases props can be left empty, since there are no 8bit talkprops).
LJ::join_community — Makes a user join a community. Takes care of all reluser relationships and friend stuff.
LJ::journal_base — Returns URL of a user's journal.