LiveJournal Programming

Goathacking For a Better World

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 B, GNU Free Documentation License”.

Abstract

This book covers all LiveJournal Programming topics!


Table of Contents

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 Entries 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::Abuse::get_policy — Gets policy structures to be used by other parts of this system. Uses an in process cache to maintain data.
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::RelationService::MysqlAPI::_mod_rel_multi — Sets/Clears relationship edges for lists of user tuples.
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_category_stocks — Get stock answers for specified category
LJ::Support::get_latest_screen — Get screened replies between approve one and the previous answer
LJ::Support::get_latest_touch — Get latest touch of any time for specified reuqest
LJ::Support::get_mapped_admin_urls — Return a list of admin tools from the map, available to user
LJ::Support::get_previous_screened_replies — Get screened replies between approve one and the previous answer
LJ::Support::get_request_log — Get data from supportlog with special mark to
LJ::Support::get_stock_answer_catid — Get support category id for specified stock answer
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::get_touches_by_type — Get support request replies of particular type
LJ::Support::is_helper — Check if user answered to the request
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_entry_tags — Determines if user is allowed to add tags to (edit tags of) an individual entry.
LJ::Tags::can_add_new_tag — Determines if journal's tags limit is not exceeded
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::can_merge_tags — Determines if one account is allowed to merge (merge or rename) the tags of another.
LJ::Tags::clean_logtagsrecent — Clean logtagsrecent table
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_usertags — 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_logtags — 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::merge_usertags — Merge tags
LJ::Tags::recalculate_logkwsum — Recalculate count of entries for tag
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::Post::require_captcha_test — returns true if user must answer CAPTCHA (human test) before posting a comment
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_author — Deletes all comments of one author for one entry.
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::get_thread_html
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::Text->wrap_urls — Wrap URLs into "a href" <a href="[URL]">[URL]</a>
LJ::TimeUtil->ago_text — Converts integer seconds to English time span
LJ::TimeUtil->alldatepart_s1 — Gets date in MySQL format, produces s1dateformat.
LJ::TimeUtil->alldatepart_s2 — Gets date in MySQL format, produces s2dateformat.
LJ::TimeUtil->days_in_month — Figures out the number of days in a month.
LJ::TimeUtil->http_to_time — Converts HTTP date to Unix time.
LJ::TimeUtil->mysql_time
LJ::TimeUtil->statushistory_time — Convert a time like "20070401120323" to "2007-04-01 12:03:23".
LJ::TimeUtil->time_to_cookie — Converts Unix time to format expected in a Set-Cookie header.
LJ::TimeUtil->time_to_http — Converts a Unix time to a HTTP date.
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::get_reader_weight — returns reader_weight of user
LJ::User::get_renamed_user — Get the actual user of a renamed user
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::User::rename_identity — Change an identity user's 'identity', update DB, clear memcache and log change.
LJ::_get_rel_memcache — Helper function: returns memcached value for a given (userid, targetid, type) triple, if valid.
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 — des: Wrapper around LJ::User::activate_userpics for compatibility.
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::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_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_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::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::convert_href_props
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::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::dhtml — Remove HTML-escaping
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::display_soccap — Encode social capital into nice look text
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::ecvs — Escapes a string value before it can be put in .csv file.
LJ::ehtm — Escapes a value before it can be put in HTML. Modified ehtml. Don't encode & if it parth of mnemonic.
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::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::fetch_userpic — Fetch source content of userpic by url or post
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_moderation_queue — Gets a list of hashrefs for posts that people have requested to be posted to a community but have not yet actually been approved or rejected.
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_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_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_times_multi — Get the last update time and time create.
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::html_trim_4gadgets — truncate string according to requirements on char length.
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::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.
LJ::leave_community — Makes a user leave a community. Takes care of all reluser relationships and friend stuff.
LJ::ljuser — Make link to userinfo/journal of user.
LJ::load_codes — Populates hashrefs with lookup data from the database or from memory, if already loaded in the past. Examples of such lookup data include state codes, country codes, color name/value mappings, etc.
LJ::load_log_props2
LJ::load_log_props2multi
LJ::load_mood_theme — Loads and caches a mood theme, or returns immediately if already loaded.
LJ::load_moods
LJ::load_props — Loads and caches one or more of the various *proplist tables: logproplist, talkproplist, and userproplist, which describe the various meta-data that can be stored on log (journal) items, comments, and users, respectively.
LJ::load_rel_target — Load user relationship information. Loads all relationships of type 'type' in which user 'targetid' participates on the right side (is the target of the relationship).
LJ::load_rel_user — Load user relationship information. Loads all relationships of type 'type' in which user 'userid' participates on the left side (is the source of the relationship).
LJ::load_rel_user_cache — Loads user relationship information of the type 'type' where user 'targetid' participates on the left side (is the source of the relationship) trying memcache first. The results from this sub should be treated as inaccurate and out of date.
LJ::load_state_city_for_zip — Fetches state and city for the given zip-code value
LJ::load_talk_props2
LJ::load_user — Loads a user record, from the user table, given a username.
LJ::load_user_privs — loads all of the given privs for a given user into a hashref, inside the user record. See also LJ::check_priv.
LJ::load_user_props — Given a user hashref, loads the values of the given named properties into that user hashref.
LJ::load_userid — Loads a user record, from the user table, given a userid.
LJ::load_userids — Simple interface to LJ::load_userids_multiple.
LJ::load_userids_multiple — Loads a number of users at once, efficiently.
LJ::load_userpics — Loads a bunch of userpics at once.
LJ::make_auth_code — Makes a random string of characters of a given length.
LJ::make_authas_select — Given a u object and some options, determines which users the given user can switch to. If the list exists, returns a select list and a submit button with labels. Otherwise returns a hidden element.
LJ::make_cookie — Prepares cookie header lines.
LJ::make_link — Takes a group of key=value pairs to append to a URL.
LJ::make_postto_select — Given a u object and some options, determines which users the given user can post to. If the list exists, returns a select list and a submit button with labels. Otherwise returns a hidden element.
LJ::make_qr_link — Creates the link to toggle the QR reply form or if JavaScript is not enabled, then forwards the user through to replyurl.
LJ::make_qr_target — Returns a div usable for QuickReply boxes.
LJ::make_user_active — Record user activity per cluster, on clustertrack2, to make per-activity cluster stats easier.
LJ::mark_as_spam — Copies a message into the global spamreports table.
LJ::mark_authaction_used — Marks an authaction as being used.
LJ::mark_comment_as_spam — Copies a comment into the global spamreports table.
LJ::mark_entry_as_spam — Copies an entry in a community into the global spamreports table.
LJ::may_lock — see if we could get a MySQL lock on a given key/dbrole combination, but don't actually get it.
LJ::memcache_kill — Kills a memcache entry, given a userid and type.
LJ::modify_caps — Given a list of caps to add and caps to remove, updates a user's caps.
LJ::name_caps — Given a user's capability class bit mask, returns a site-specific string representing the capability class name.
LJ::name_caps_short — Given a user's capability class bit mask, returns a site-specific short string code.
LJ::new_account_cluster — Which cluster to put a new account on. $DEFAULT_CLUSTER if it's a scalar, random element from $LJ::DEFAULT_CLUSTER if it's arrayref. also verifies that the database seems to be available.
LJ::parse_vars — Parses S1 style data into hashref.
LJ::prepare_currents — do all the current music/mood/weather/whatever stuff. only used by ljviews.pl.
LJ::procnotify_add — Sends a message to all other processes on all clusters.
LJ::procnotify_callback — Call back function process notifications.
LJ::ratecheck_multi — takes a list of msg objects and sees if they will collectively pass the rate limit check.
LJ::record_anon_comment_ip — Records the IP address of an anonymous comment.
LJ::register_authaction — Registers a secret to have the user validate.
LJ::register_hook — Installs a site-specific hook.
LJ::register_setter — Installs code to run for the "set" command in the console.
LJ::reject_comm_invite — Rejects an invitation a user has received.
LJ::reject_pending_member — Rejects someone's request to join a community. Updates authactions and generates an e-mail to the user.
LJ::release_lock — release a MySQL lock on a given key/dbrole combination.
LJ::remote_has_priv — Check to see if the given remote user has a certain privilege.
LJ::repost_auth — Creates an authentication token to be used later to verify that a form hidden field "repost" not modified by user
LJ::revoke_invites — Revokes a list of outstanding invitations to a community.
LJ::robot_meta_tags — Returns meta tags to instruct a robot/crawler to not index or follow links.
LJ::run_hook — Runs single site-specific hook of the given name.
LJ::run_hooks — Runs all the site-specific hooks of the given name.
LJ::send_comm_invite — Sends an invitation to a user to join a community with the passed abilities.
LJ::send_mail — Sends email. Character set will only be used if message is not ASCII.
LJ::server_down_html — Returns an HTML server down message.
LJ::set_interests — Change a user's interests.
LJ::set_lastcomment — Sets the lastcomm memcached key for this user's last comment.
LJ::set_rel — Sets relationship information for two users.
LJ::set_rel_multi — Sets relationship edges for lists of user tuples.
LJ::shared_member_request — Registers an authaction to add a user to a shared journal and sends an approval e-mail.
LJ::site_schemes — Returns a list of available BML schemes.
LJ::start_request — Before a new web request is obtained, this should be called to determine if process should die or keep working, clean caches, reload config files, etc.
LJ::statushistory_add — Adds a row to a user's statushistory
LJ::strip_bad_code — Removes malicious/annoying HTML.
LJ::sysban_block — Notes a sysban in statushistory and returns a fake HTTP error message to the user.
LJ::sysban_check — Given a 'what' and 'value', checks to see if a ban exists.
LJ::sysban_create — creates a sysban.
LJ::sysban_note — Inserts a properly-formatted row into statushistory noting that a ban has been triggered.
LJ::sysban_validate — determines whether a sysban can be added for a given value.
LJ::text_compress — Compresses a chunk of text, to gzip, if configured for site. Can compress a scalarref in place, or return a compressed copy. Won't compress if value is too small, already compressed, or size would grow by compressing.
LJ::text_convert — convert old entries/comments to UTF-8 using user's default encoding.
LJ::text_in — do appropriate checks on input text. Should be called on all user-generated text.
LJ::text_length — returns both byte length and character length of a string. In a non-Unicode environment, this means byte length twice. In a Unicode environment, the function assumes that its argument is a valid UTF-8 string.
LJ::text_out — force outgoing text into valid UTF-8.
LJ::text_trim — truncate string according to requirements on byte length, char length, or both. "char length" means number of UTF-8 characters if $LJ::UNICODE is set, or the same thing as byte length otherwise.
LJ::text_uncompress — Uncompresses a chunk of text, from gzip, if configured for site. Can uncompress a scalarref in place, or return a compressed copy. Won't uncompress unless it finds the gzip magic number at the beginning of the text.
LJ::trim — Removes whitespace from left and right side of a string.
LJ::trusted — Checks to see if the remote user can use javascript in S2 layers.
LJ::u_equals — Compares two user objects to see if they are the same user.
LJ::use_diff_db — given two DB roles, returns true only if it is certain the two roles are served by different database servers.
LJ::user_caps_icon — Given a user's capability class bit mask, returns site-specific HTML with the capability class icon.
LJ::userpic_count — Gets a count of userpics for a given user.
LJ::want_user — Returns user object when passed either userid or user object. Useful to functions that want to accept either.
LJ::want_userid — Returns userid when passed either userid or the user hash. Useful to functions that want to accept either. Forces its return value to be a number (for safety).
LJ::warning_list — Returns a warning bar with bulleted list of warnings.
LJ::wipe_major_memcache — invalidate all major memcache items associated with a given user.
PersonalStats::Ratings::Journals::get_rating_position — make request to rating db to take position of journal
PersonalStats::Ratings::Journals::get_rating_segment — make request to rating db and prepare response
PersonalStats::Ratings::Journals::get_rating_total — make request to rating db to take count of rating rows
PersonalStats::Ratings::Posts::Page::get_rating_position — make request to rating db to take position of entry
PersonalStats::Ratings::Posts::get_rating_position — make request to rating db to take position of entry
PersonalStats::Ratings::Posts::get_rating_segment — make request to rating db to take segment of rating
PersonalStats::Ratings::Posts::get_rating_total — make request to rating db to take count of rating rows
_get_upf_scaled — Crop and scale images returns status 'small' source => \$content, size => [ "140x105" ], save_to_FB => 1, fb_gallery => 'test_gal', auto_crop => 1,
get_ad_html — returns ad html for a given ad location
ljuser_display — Make link to userinfo/journal of user.
should_show_ad — returns if there is ad html for a given ad location
VI. Database Schema
33. Relationships between users
IV. Database Schema Browser
abuse_mail
acctcode — Stores data on valid invite codes and who has used them. The acctinvite table stores the data on why they were made.
acctinvite — Keeps track of generated invite codes.
acctpay — Keeps track of relationship between invite codes and payments. Some people pay to join the site before they have an account, so their invite code carries with it the knowledge that it comes with paid time.
acctpayitem
actionhistory — Global. Stores a count of generic actions. A nightly maintenance task (clean_caches) summarizes the clustered recentactions tables data here.
active_user — Clustered. Stores user activity data, such as tracking types of user activity on a per-hour basis (example: $u had login activity during this hour). An "active user" is a user who has hit a LiveJournal page while logged-in, within the specified time period. Only used if memcached servers are available, and the site administrator has not disabled active user tracking. Clustered activity data from the current or previous hour is not harvested, to avoid counting duplicates. The year, month, day, hour, and userid columns make up the primary key, for duplicate checking. Please see also active_user_summary and clustertrack2.
active_user_summary — Global. Stores user activity data. A maintenance task (clean_caches) summarizes the clustered active_user tables data here. It is indexed by year, month, day, hour, to allow multiple rows per clusterid, per hour. Only used if memcached servers are available.
adopt — Unused. Designed for the "Adopt-a-newbie" system, but never fully implemented.
adoptlast — Unused. Designed for the "Adopt-a-newbie" system, but never fully implemented.
adsense_stat
amort_current
amort_summary
authactions — Global. Stores shared secret (authaction ID + authcode pair) data. When authenticating certain actions, the server generates an authaction along with some random characters (the authcode) and e-mails the aaid+authcode to the user to confirm they actually got it.
backupdirty — Global. Stores per-user backup status.
birthdays — Clustered. Stores unixtime of the user's next birthday. Used for sending out birthday notifications.
blobcache — Global. Generic place for code to cache blobs.
blockedcontent
blockwatch_events
botreports
botwhitelist
bzrbalance
bzrs
bzrvote
bzrvoter
captcha_session — Clustered.
captchas — Global. Stores CAPTCHAs metadata.
category
category_recent_posts
categoryjournals
categoryjournals_pending
categoryprop
categoryproplist
cc_lock
cc_usage
ccfail
cdn_map
challenges — Global. Stores data for RFC 2617 challenge-response digest authentication support - used on-site for logins, commenting, etc. Please see also secrets.
changed_profiles_list
clients — Global. Stores a record of clients that access the protocol. Whenever the protocol encounters a new client, a new row (and thus a new clientid) is generated.
clientusage — Global. Stores data of when different users use which clients, for purposes of statistics.
clustermove — Global. Stores start/completion of a user move, by moveucluster script, between database clusters. Future mass cleanings can be made during scheduled downtime using this log of where undeleted data is. It is also noted in this table if the user is to be expunged ('purged'); a note is made in the expunged_users table when the user and its data has been expunged.
clustermove_inprogress — Global. Required for user-mover script (ljumover). The script performs mass user-move operations between various clusters.
clustertrack2 — Clustered. Stores data on where users are active, for per-activity user cluster statistics. The LJ::make_user_active function updates into this table, so long as it has not already been updated for the same user within the last hour. For sites not using memcached, the table is always updated. Please see also active_user.
cmdbuffer — Clustered. This replaced the global querybuffer table. That table was used to hold queries to do later, in an efficient batch under an explicit table lock. By contrast, this table is used with specialized commands rather than general table locking.
codes — Lookup table for states, countries, languages, etc...
comet_history
comm_reader_users
commenturlsext
commercialpromo
comminterests — Global. Stores community interests. Please see also interests, which stores interest data for normal user accounts.
community — Global. Stores community accounts (which are just normal user accounts with some extra behavior) properties used.
content_flag — Global. Stores flagged content metadata. Content can be flagged as adult content, etc.
contributed
contributedack
counter — Global. Stores counter information allocated by the LJ::alloc_global_counter function. Please see also usercounter.
coupon
cprod — Clustered. Stores contextual product prodding history. This makes sure people are not pestered by specific prodding when they do not want it anymore.
cprodlist — Global. Stores contextual product prodding items. ("Hey, you've never used polls, wanna learn how?")
dbinfo — Global. Stores database connection and replication info, instead of in the %LJ::DBINFO hash, for easier (web-based) management of LiveJournal installations with many databases.
dbweights — Global. Stores each database's roles and weights. The dbinfo table keeps track of which databases exist.
delayedblob2
delayedlog2
deletion_feedback
deletion_tasks
dirmogsethandles — Global. Stores MogileFS sethandles for the Directory Search.
dirsearchres2 — Global. Stores the results of a Directory Search query.
discovery_announce_history
discovery_categories
discovery_categories_history
domains — Global. Stores user-owned domain names, and which journals they map to when pointed at the LiveJournal installation's IP address.
dudata — Clustered. Stores user-based disk usage totals.
duplock — Global. Stores a record that an action has been done, so it doesn't get done a second time later by a user accidentally double-clicking a single-click button in their browser. The idea is that the application should grab a write lock for both the table it's inserting into, and the duplock table. Then, check the duplock table for a duplicate. If it's already in there, unlock the tables and remember the dupid to tell the user (app should pretend it was the first time... don't show an error message!), or if it's not in there, put it in the table, and then put the resulting uniqueid from the table handler into the duplock table (as dupid). This table is purged every hour or so of all locks older than an hour.
email — Global. Stores user e-mail addresses, which were historically stored in the user table.
email_aliases
email_status
emailstocks
embed_whitelist
embedcontent — Clustered.
embedcontent_preview — Clustered.
entryurlsext
eventrates
eventratescounters
eventtypelist — Global.
expunged_users — Global. Stores a log of when a user is expunged ('purged'), by the moveucluster script, so they can be queried later by time or username.
external_sites_articles_map
extuser — Global. Stores external user mappings. Note: extuser/extuserid are expected to sometimes be NULL, even though they are keyed. (Null values are not taken into account when using indexes).
faq — Global. Stores Frequently Asked Question information and their optional summaries for the FAQ section of the Support system. Alternate text can be loaded for the questions if available.
faqcat — Global. Stores categories under which Frequently Asked Questions can be classified.
faquses — Global. Stores log of viewings of individual faqs by logged-in users.
featured_photos
files
fotki_album_backup
fotki_album_prop
fotki_albums
fotki_migration_log
fotki_photo_backup
fotki_photo_prop
fotki_photos
fotki_photos_data
fotki_tag_prop
fotki_tags
fotki_tags_map
frank_text
fraudsuspects
free2pay_trx
friendgroup — Global. Stores data on a user's custom friends groups. Friends groups are used to restrict who can see an individual entry, or to filter the friends view. Please see also friendgroup2.
friendgroup2 — Clustered. Stores data on user custom friends groups.
friending_actions_q
friends — Global. Stores data of which users someone has listed as a "friend". Also stores the preferences on the friend item.
friendsfeed_ads
friendsfeed_ads_changelog
friendstimes
friendstimes2_unwatched
has_subs — Clustered. Stores ESN journal subscriptions data. A flag on event target (a journal) is written here saying whether there are known listeners out there.
homepage_cat_posts
homepage_category
homepage_items
homepage_logs
homepage_posts
identitymap — Global. Stores data for mapping a userid to an external identity and its type. This focuses on OpenID consumer support, and was introduced so infrastructure was in place to make it completely identity-system neutral rather than OpenID-specific. In theory, eventually, this will allow people to log in with TypeKey, LID, etc.
inactive_user
includetext — Global. Stores special "include" file contents used in sections of the site (like the "known issues" box in Support). Useful for keeping clusters of web servers in sync easier.
incoming_email_handle
independent_mapping
infohistory — Global. Stores a history log of certain types of changes (like user e-mail changes), so the old values can be looked at by administrators or automatically retrieved. Please see also statushistory.
interests — Global. Stores the different interests listed, and the number of users listing each interest. Please see also comminterests.
inventory
inviterecv — Clustered. Stores community invitations received.
invitesent — Clustered. Stores community invitations sent.
jabcluster — Global. Stores Jabber cluster tracking data.
jablastseen — Clustered.
jabpresence — Global. Stores Jabber presence data.
jabroster — Clustered. Stores Jabber roster data.
jabroster2
jabrostergroups2
jamrewards
jobstatus — Global. Stores worker(s) result storage status.
journal_spotlight
journalpromo
journalpromo_slot
keywords — Global. Stores userpic keywords. Please see also the clustered userkeywords table, used from data version 7.
knob — Global. Stores data for LJ::Knob, a class to efficiently support web/config-based tunables.
known_isp2
last_promotion
links — Clustered. Stores data for links users place in their Links List (“blogroll”), used in S2 styles.
ljart_artist
log2 — Clustered. Stores metadata about all journal entries. The actual content is stored in logtext2.
logbackup
loginlog — Clustered. Stores data to give users access to view their logins in the past 30 days, if they're at all afraid that their account has been compromised.
loginstall — Clustered. Stores data of failed logins, for use with the rate-limiting system.
logkwsum — Clustered. Stores the summary counts for security on entry keywords (tags).
logleft
logprop2 — Clustered. Stores metadata of entries, from possibilities stored in logproplist.
logprop_history
logproplist — Global. Stores list of possible metadata for journal entries.
logsec2 — Clustered. Stores data for mapping an entry to its security filtering. A row is added here whenever an entry with security of "usemask" (which is Friends-only and Custom) is posted. Used for speedier deleting of a friend group, which was slow since old entries needed the bit turned off in allowmask.
logtags — Clustered. Stores data for mapping of tags applied to an entry.
logtagsbackup
logtagsrecent — Clustered. Stores data for mapping tags; like logtags, but only for the most recent 100 tags-to-entry.
logtext2 — Clustered. Stores the actual text of journal entries. Data is compressed if $LJ::COMPRESS_TEXT site variable is on.
logtextbackup
loyalty_userpic_history
mailout_log
mailout_unsubscribed
manage_ratings_log
massmail_history
meetup_ints
meme
memkeyword — Global. Stores data for mapping memories to keywords. Please see also memkeyword2.
memkeyword2 — Clustered. Stores data for mapping memories to keywords.
memorable — Stores metadata for entries users mark as "Memories". Please see also the clustered memorable2 table.
memorable2 — Clustered. Stores metadata for entries users mark as "Memories".
ml_domains — Global. Stores domains of translation system
ml_items
ml_langdomains
ml_langs
ml_latest
ml_text
modblob — Clustered. Stores moderated community entry Storable objects (all props/options).
modlog — Clustered. Stores moderated community entry summary information.
moods
moodthemedata
moodthemes
mustread_block
navtag — Global. Stores data for site pages tagged using the htdocs/admin/navtag.bml tool. Site administrators can tag any URL. The tag itself is lowercase UTF-8. Some are recognized as special (FAQs, user profile pages, etc.), and users can then search by tag.
needed_backups
news_sent — Obsolete. Historic. Was used by mailusers script for sending out LiveJournal.com newsletters by e-mail.
noderefs
notificationpromo
notifyarchive — Clustered.
notifybookmarks — Clustered.
notifyqueue — Clustered. ESN event queue notification method.
notifytypelist — Global. Stores list of ESN notification class types.
offerpal
offerpal_failures
oldids — Stores globally-unique itemid and talkid ID (entries and comments), for URL compatibility. These were used pre-clustering. The LJ::get_newids function uses this table to find out what journal an old global ID belongs to and maps it to its new ID.
openid_endpoint
openid_trust
openproxy — Global. Stores open HTTP proxies data. Site administrators can set open proxy lookup sources using the @LJ::RBL_LIST site variable.
overrides — Global. Stores user S1 style system override customizations. Please see also the clustered s1overrides table.
paid_invites
paidexp
paidrepost_audience
paidrepost_settings_history
paiduser
partialstats — Global. Stores partialstats calculation times.
partialstatsdata — Global. Stores per-cluster partialstats data.
partner_registration_users
partner_registration_visits
password — Global. Stores user login passwords, which were historically stored in the user table.
payitemprop
payitems
payments
paymentsearch
paystates
paytrans
payvars
pendcomments — Clustered. Stores comments, such as OpenID comments, awaiting user approval.
perm_sale
perm_sale_200706
persistent_queue — Global table for persistent queues.
personifi_ads_cat
personifi_categories
phonepostdests
phonepostentry
phonepostlogin
phoneposttrans
pics_fotki_migrated
pics_fotobilder_migrated
pics_fotobilder_migrated_gals
pingback_history
pingrel
poll
poll2 — Clustered.
pollitem
pollitem2 — Clustered.
pollowner — Global. Stores data for mapping pollid <=> journalid.
pollprop2 — Clustered. Stores metadata of poll props used, from possibilities stored in pollproplist2.
pollproplist2 — Global. Stores list of possible metadata for polls.
pollquestion
pollquestion2 — Clustered.
pollresult
pollresult2 — Clustered.
pollresultaggregated2
pollsubmission
pollsubmission2 — Clustered.
pollsubmissionprop2
pollsubmissionproplist
portal — Historic. Stored data for old '1.0' version of the Portal; used before the Portal was re-designed.
portal_box_prop — Clustered.
portal_config — Clustered.
portal_typemap
priv_list — Global. Stores list of different admin privileges that users can have.
priv_map
priv_packages
priv_packages_content
procnotify — Global. Table required by DBI::Role for procnotify - the function used to pass a message to all web processes on all clusters.
promo_item
promo_set
qotd — Global. Stores data for the Question of the Day ("Writer's Block") widget.
qotd_imported
random_user_set — Clustered. Stores data about entries for the random user search. On posting an entry (public, to personal journal, and not opted out (using latest_optout option at the console)) a user may end up with a row in this table. The htdocs/random.bml page returns a random user that is both 1) publicly listed in the directory, and 2) updated within the past 24 hours. If a user changes their privacy setting using the console to not be in this table, it will take up to 24 hours for them to be removed from the random.bml listing; a maintenance task builds/cleans the table. The information row is kept for seven days by default. Site administrators can adjust this using the $LJ::RANDOM_USER_PERIOD site variable.
ratelist — Global. Stores the different rate-limited actions a user can make. Used for rate-limiting infrastructure: denying fast failed logins (password brute-forcing), user-to-user messaging, rate-limiting on friend additions, etc.
ratelog — Clustered.
readonly_user — Global. Used by the move user cluster script. Both before and after updating a user's read-only flag we add the user to this table, which is just an index onto users who - might - be in read-only. A maintenance task will periodically clean those and make sure nobody is stranded in read-only, without resorting to a full tablescan of the user table, by checking if users are still locked, removing those that are not from this table, querying the job server (if up) for users that are still locked and unlocking those that can be unlocked.
recbill
recbill_cc
recbill_items
recbill_log
recbill_pendtime
recbill_promo
recentactions — Clustered. Stores a log count of generic actions that have happened, like a post action (which calls LJ::note_recent_action()). A maintenance task moves these logged summaries from the various clusters to the global actionhistory table.
reluser — Global. Stores the special links ("reluser relationships") between accounts, such as community maintainers/moderators. A relationship "type" is a single character. Please see also reluser2.
reluser2 — Clustered. Stores the special links ("reluser relationships") between accounts. Relationship type IDs are defined in the LJ::get_reluser_id function. A relationship "typeid" cannot be a single character. Please see also reluser.
renames
repost2
restore_tasks
s1overrides — Clustered. Stores user S1 style system override customizations. This - clustered - table was used from data version 5. Please see also the global overrides table.
s1style — Clustered. Stores S1 style system user style data. This - clustered - table was used from data version 5. Please see also the global style table.
s1stylecache — Clustered. Stores cached Storable-frozen pre-cleaned style variables.
s1stylemap
s1usercache — Clustered. Stores cached Storable-frozen pre-cleaned S1 user-related style data: overrides and colors.
s2checker
s2compiled — Global. Stores S2 layer data (compdata is not gzipped). Please see also s2compiled2.
s2compiled2 — Clustered. Stores user (not system) S2 layers, and is lazily migrated. This table is indexed by userid, layerid, and contains data that is compressed when it's put in. (Tests show this reduces data size by about 75 percent.) New saves go here. Loads try this table first (unless user is system) and if miss, then try the s2compiled table on the global.
s2info
s2layers
s2source — Global. Stores S2 layer sources. Please see also the newer global InnoDB table s2source_inno.
s2source_inno — Global. Stores new S2 layer sources, and those lazily migrated from s2source. Created to do a live migration from the old MyISAM table (s2source) to this new InnoDB table without requiring downtime.
s2stylelayers — Global. Please see also the clustered s2stylelayers2 table.
s2stylelayers2 — Clustered.
s2styles
sch_exitstatus
sch_funcmap
sch_job
sch_mass_exitstatus
sch_mass_funcmap
sch_mass_job
sch_mass_note
sch_note
sch_reminders
schemacols — Stores the documentation for the individual columns of the database tables.
schematables — Stores the documentation for the database tables.
schools
schools_attended
schools_log
schools_pending
schools_stats
seconddomains
secret_questions — List of system secret questions
secrets — Global. Stores data for a rotating secret value on the server, for auth support. Please see also challenges.
selfpromo
send_email_errors
sessions — Clustered. Stores web sessions data. Optionally tied to IPs and with expiration times. Whenever a session is okayed, expired ones or ones created over 30 days ago are deleted. A live session can't change e-mail address or password. Digest authentication will be required for that, or JavaScript MD5 challenge-response.
sessions_data — Clustered.
shipping
shop_tags
shop_themes
shop_themes_cats
shop_themes_files
shop_userheads
shop_vgift_tagmap
shop_vgifts
site_messages — Global. Stores data for SiteMessages widget (used to post announcements to users).
sms_msg — Clustered. Stores log of SMS message data.
sms_msgack — Clustered. Stores the acknowledgments received for a given message.
sms_msgerror — Clustered. Stores SMS errors if they exist.
sms_msgprop — Clustered.
sms_msgproplist — Global. Stores list of possible metadata for SMS messages. Unlike most other *proplist tables, this one is auto-populated by the LiveJournal application.
sms_msgtext — Clustered. Stores the raw and decoded SMS text content.
sms_promo
sms_quota
smsru
smsru_phones
smsru_vercodes
smsuniqmap — Global. Stores data for mapping remote-party msg unique ids to our userid/msgid tuples; similar to smsusermap.
smsusermap — Stores data for mapping of userid <=> (SMS) number.
spamreports — Global. Stores content marked as spam by users when they delete it, for administrator review. A reported comment, user-to-user message, or community entry is copied into this table, by the LJ::mark_comment_as_spam, LJ::mark_as_spam, or LJ::mark_entry_as_spam function, respectively. The admin tool (/admin/spamreports.bml hinging on siteadmin:spamreports priv) allows spam report viewing: top 10 reported IPs, top 10 reported users (and showing if someone has received a spam warning before), last 10 reports, reports in last 1 hour, 6 hours, and 24 hours; the page supports sorting by open/closed. The 'spamreport_notification' hook exists for optionally notifying people about spamming. A maintenance task cleans out data older than 90 days. Please see also the tempanonips table.
spinvox_msg
splittest
splittest_log
stats
statushistory — Global. Stores an internal log of a user for Support purposes. For example, suspensions and unsuspensions are recorded for the abuse prevention team, and privilege granting/removing is logged. Please see also infohistory.
style — Global. Stores S1 style system user style data. Please see also the clustered s1style table.
subs — Clustered. Stores metadata details about a user's ESN subscriptions. Please see also has_subs.
subscribers2
subscribersleft
subscriptionfilter2
subsprop — Clustered. Stores metadata of a user's ESN subscriptions, from possibilities stored in subsproplist.
subsproplist — Global. Stores list of possible metadata for ESN subscriptions. Unlike most other *proplist tables, this one is auto-populated by the LiveJournal application.
sup_extblocks
sup_sponsor_stats
sup_sponsored_bans
sup_sponsored_user_history
sup_sponsored_users
sup_sponsors
support — Global. Stores data for the Support system. Allows users with the supporthelp priv to see links to support/history.bml, when viewing a Support request, where they can pull up a list of all past requests opened by that user or by that e-mail address.
support_answers — Global. Stores stock answers for Support system. Answers are viewable by those with the "supporthelp" priv, and editable by people who have the ability to grant privileges in their category.
support_answers_backup
support_youreplied — Global. Stores data for which Support tickets a user responded to. Used for speedier querying for the Support system "You Replied" filter.
supportcat — Global. Stores Support system categories.
supportlog
supportlogprop
supportnotify — Global. Stores user subscriptions to Support request categories for e-mail notification of new requests.
supportpoints
supportpointsum — Global. Stores user Support points data. Used for speedier querying for htdocs/support/highscores.bml.
supportprop — Global. Stores metadata on Support requests.
supporttag
supporttagmap
survey_v0_8bit
suspend_history
suspicious_logins
suspicious_logins_api
suspicious_pay_log
syndicated — Global. Stores information on syndicated accounts like feed URI, readership, polling, etc.
synitem
sysban — Global. Stores 'sysban' data - the mechanism for banning users from portions of the site based on certain criteria.
syslog
talk2 — Clustered. Stores metadata about all comments to journal entries. Indexes are all on this table.
talkbackup
talkleft — Clustered. Stores references to where a user has posted comments. Used for comments (user left in other journals) counter on user profile page.
talkleft_xfp — Historic. Global. Stores a user's posts on other clusters, when either 1) that user isn't clustered themselves yet, or 2) we're doing a mass conversion (moveucluster.pl) and don't want to look it up. A maintenance task (clean_caches) moves data from here to talkleft on clusters.
talkprop2 — Clustered. Stores metadata of comments, from possibilities stored in talkproplist.
talkproplist — Global. Stores list of possible metadata for comments.
talktext2 — Clustered. Stores the actual text of comments to journal entries.
talktextbackup
tempanonips — Clustered. Stores IP addresses for spam reports, temporarily, whether the journal in which the anonymous comment was posted in has enabled IP tracking or not. Used with the spamreports table. The LJ::record_anon_comment_ip function gets the anonymous comment IP, and records it here. A maintenance task cleans out IPs after 5 days - so anonymous comments deleted after 5 days are fairly useless, and reports about them are quietly discarded by the comment deletion system.
themecustom
themedata — Global. Stores list of the system colors themes available to users.
themelist — Global. Stores the different S1 style system color schemes.
todo
tododep
todokeyword
tokens_daily_amount
transferinfo
twitter_digest_status
twitter_request_tokens
txtmsg
underage — Global. Stores the data of which accounts are marked as underage.
uniqmap — Global. Stores data for mapping value of unique cookie <=> userid.
urimap — Clustered. Stores data for mapping a named URI permalink - that is: http://somejournal.example.com/this_is_a_named_uri.html (not-yet-implemented), to the respective entry.
user
user_account
user_account_history
user_active_until
user_reginfo_log
user_schools — Clustered.
user_wallet
user_wallet_history
userapps
userapps_items
userapps_payments
userapps_view_html
userapps_views
userbio — Clustered.
userblob — Clustered. Stores blobs (binary large objects) of on-disk data. Blob* files/classes for storing Blobs need to be added either to a local path or a remote Blob server ("remote Blob server" support has since been removed in favor of MogileFS). Notes: blobids aren't necessarily unique between domains; global userpicids may collide with the counter used for the rest. So, the type must be in the key. domain IDs are set up in ljconfig.pl.
userblobcache — Clustered.
usercounter — Stores per-user counters on the global (contrary to the name). These are allocated by the LJ::alloc_user_counter function. Please see also counter.
useridmap — Global. Stores data for mapping userid <=> user(name).
userinterests
userkeywords — Clustered. Stores userpic (userpic2) keywords. Also stores entry keywords (tags), and memory keywords. A site-configurable limit to the number of keywords for each userpic exists; default is 5. This table never gets deleted from, except if the user itself gets deleted. Please see also userpicmap2.
userlog — Clustered. Stores general purpose status log data, such as when an entry is deleted or logging post-by-e-mail activity. The initiator of the event is stored here so we can look back and say, for example: "this person deleted the entry". This works for communities and individual journals, and the actions are logged on the account that lost the entry. The basic format is [ action, actiontarget ].
usermsg — Clustered. Stores metadata about all user-to-user messages. The actual content is stored in usermsgtext.
usermsgbookmarks
usermsgprop — Clustered. Stores metadata of user-to-user messages, from possibilities stored in usermsgproplist.
usermsgproplist — Global. Stores list of possible metadata for user-to-user messages.
usermsgtext — Clustered. Stores the actual text of user-to-user messages.
userpic — Global. Stores userpic metadata. For sites using data version 7 or greater, the clustered userpic2 table is used. Please see also userpicmap and keywords.
userpic2 — Clustered. Stores userpic metadata. The actual userpics are stored in either the database (userpicblob2) or on a blob server. From data version 7 userpics are clustered; the global userpic table is used prior to data version 7. Please see also userpicmap2/userkeywords.
userpicblob2 — Clustered. Stores the actual userpic blobs. Optionally a blob server can be used instead of storing them here in the database.
userpicmap — Global. Stores data for mapping userpic keywords to userpics. Please see also the clustered userpicmap2 table, used from data version 7.
userpicmap2 — Clustered. Stores data for mapping userpic keywords (userkeywords) to userpics (userpic2).
userprop — Global, indexed.
userpropblob — Clustered. Stores user properties greater than 255 bytes.
userproplist — Global. Stores list of possible metadata on users. Allows for having userprops stored globally for indexing; and, by way of the multihomed column, on a cluster as "multihomed userprops", for easy access on user profile pages and such.
userproplite — Global, not indexed.
userproplite2 — Clustered, not indexed.
usersearch_packdata — Global. Stores Directory Search information: userid, a "pack" of information - time of last update, age, journal type, country, state, and city; row modification time, and expiry information.
usersingroups2
usertags — Clustered. Stores metadata of what tags a user has. Please see also userkeywords.
usertrans — Global. Stores user account transitions data (e.g. "free" to "plus", or whatever site-specific capability classes exist).
usertrans_churn
usertrans_sum
userusage — Global. Stores record of when users did certain things.
ver_tags
vertical
vertical2
vertical_comms
vertical_editorials
vertical_entries
vertical_keymap
vertical_keywords
vertical_posts
vertical_rules
vgift_in_cats
vgifts — Stores the history of vgifts sent
vgifts_adnectar
virusgame
virusgame_rating
wallet_blocking
wallet_blocking_history
weekuserusage — Obsolete. It was used to keep track of user activity, such as latest time a user posted in a week, for a given week. Used from data version 3, but ceased to be used later, when the Friends view algorithm was re-designed.
wishlist2
wishrecommendation
zip — Global. ZIP Code table used to validate and auto-complete user-entered location data. More data can be found in the (redundant) table zips, which was imported later.
zips — Global. ZIP Code data for the United States that includes geographic co-ordinates. Only used with an ljcom maintenance script that generates marker files for use in making Xplanet maps. Most of the LJ code uses the zip table instead.

List of Examples

24.1. Using Wget 1.10 with auth_method=cookie in flat protocol
24.2. Sample Perl script using getchallenge
3. Sample call to LJ.XMLRPC.checkfriends
4. Sample return value for LJ.XMLRPC.checkfriends
5. Sample call to LJ.XMLRPC.consolecommand
6. Sample return value for LJ.XMLRPC.consolecommand
7. Sample call to LJ.XMLRPC.editevent
8. Sample return value for LJ.XMLRPC.editevent
9. Sample call to LJ.XMLRPC.editfriendgroups
10. Sample return value for LJ.XMLRPC.editfriendgroups
11. Sample call to LJ.XMLRPC.editfriends
12. Sample return value for LJ.XMLRPC.editfriends
13. Sample call to LJ.XMLRPC.friendof
14. Sample return value for LJ.XMLRPC.friendof
15. Sample call to LJ.XMLRPC.getchallenge
16. Sample return value for LJ.XMLRPC.getchallenge
17. Sample call to LJ.XMLRPC.getdaycounts
18. Sample return value for LJ.XMLRPC.getdaycounts
19. Sample call to LJ.XMLRPC.getevents
20. Sample return value for LJ.XMLRPC.getevents
21. Sample call to LJ.XMLRPC.getfriends
22. Sample return value for LJ.XMLRPC.getfriends
23. Sample call to LJ.XMLRPC.getfriendgroups
24. Sample return value for LJ.XMLRPC.getfriendgroups
25. Sample call to LJ.XMLRPC.getusertags
26. Sample return value for LJ.XMLRPC.getusertags
27. Sample call to LJ.XMLRPC.login
28. Sample return value for LJ.XMLRPC.login
29. Sample call to LJ.XMLRPC.postevent
30. Sample return value for LJ.XMLRPC.postevent
31. Sample call to LJ.XMLRPC.sessionexpire
32. Sample return value for LJ.XMLRPC.sessionexpire
33. Sample call to LJ.XMLRPC.sessiongenerate
34. Sample return value for LJ.XMLRPC.sessiongenerate
35. Sample call to LJ.XMLRPC.syncitems
36. Sample return value for LJ.XMLRPC.syncitems