?

LiveJournal S2 Core, v1

[<< Advanced Customization]
[<< Public Layers] [View source: Raw Source Code | Syntax Highlighted]

Layer Info

author_emailwebmaster@livejournal.com
author_nameLiveJournal Webmaster
majorversion1
nameLiveJournal S2 Core, v1
redist_uniqcore1
typecore

Properties Set

color_comment_bar  #d0d0ff
comment_userpic_style(empty)
control_strip_bgcolor(empty)
control_strip_bordercolor(empty)
control_strip_fgcolor(empty)
control_strip_linkcolor(empty)
custom_control_strip_colorsoff
custom_css(empty)
external_stylesheet0
font_base(empty)
font_fallbacknone
include_default_stylesheet1
is_page_adaptive0
lang_currenten
lang_dayname_long[
  • (empty),
  • Sunday,
  • Monday,
  • Tuesday,
  • Wednesday,
  • Thursday,
  • Friday,
  • Saturday,
]
lang_dayname_short[
  • (empty),
  • Sun,
  • Mon,
  • Tue,
  • Wed,
  • Thu,
  • Fri,
  • Sat,
]
lang_dayname_shorter[
  • (empty),
  • S,
  • M,
  • T,
  • W,
  • T,
  • F,
  • S,
]
lang_fmt_date_long%%month%% %%dayord%%, %%yyyy%%
lang_fmt_date_long_day%%day%%, %%month%% %%dayord%%, %%yyyy%%
lang_fmt_date_med%%mon%%. %%dayord%%, %%yyyy%%
lang_fmt_date_med_day%%da%%, %%mon%%. %%dayord%%, %%yyyy%%
lang_fmt_date_short%%m%%/%%d%%/%%yy%%
lang_fmt_month_long%%month%% %%yyyy%%
lang_fmt_month_med%%mon%% %%yyyy%%
lang_fmt_month_short%%m%%/%%yy%%
lang_fmt_time_short%%hh%%:%%min%% %%a%%m
lang_monthname_long[
  • (empty),
  • January,
  • February,
  • March,
  • April,
  • May,
  • June,
  • July,
  • August,
  • September,
  • October,
  • November,
  • December,
]
lang_monthname_short[
  • (empty),
  • Jan,
  • Feb,
  • Mar,
  • Apr,
  • May,
  • Jun,
  • Jul,
  • Aug,
  • Sep,
  • Oct,
  • Nov,
  • Dec,
]
linked_stylesheet(empty)
linklist_support1
page_day_sortorderforward
page_friends_items10
page_month_textsubjects1
page_recent_items10
page_year_sortorderforward
reg_firstdayofweeksunday
show_title_on_tagpage0
tag_cloud_tagsall
tags_aware0
text_addcomment_idadd_comment
text_comment_collapseCollapse
text_comment_dateDate:
text_comment_deleted(Deleted comment)
text_comment_edittimeEdited at
text_comment_expandExpand
text_comment_fromFrom:
text_comment_frozenFrozen
text_comment_ipaddrIP Address:
text_comment_parentParent
text_comment_postedComment successfully posted.
text_comment_replyReply
text_comment_screened(Screened comment)
text_comment_threadThread
text_comments_idcomments
text_copyr_agreeHereinafter I give my permission to reproduce in any form
text_copyr_disagreeThe reproduction is prohibited in any form
text_day_nextNext Day
text_day_prevPrevious Day
text_delete_repostDelete repost
text_duplicate_entryDuplicate Entry
text_edit_entryEdit Entry
text_edit_tagsEdit Tags
text_entries_bytagEntries by tag // Entries by tags
text_entries_bytag_andand
text_entries_bytag_oror
text_entry_nextNext Entry
text_entry_prevPrevious Entry
text_fbpost_supportlinkNeed help?
text_feedpromo_control_hideHide advert
text_feedpromo_control_titleFeed Promo
text_feedpromo_control_whyWhy am I seeing this?
text_flagFlag
text_hidespamHide spam
text_i_like_thisPlease click Track this if you want to receive all comments to this entry
text_icon_alt_delayed[delayed post]
text_icon_alt_groups[custom friends groups post]
text_icon_alt_private[private post]
text_icon_alt_protected[protected post]
text_icon_alt_reposted[reposted post]
text_icon_alt_sticky[sticky post]
text_linksLinks
text_max_commentsMaximum comments reached
text_mem_addAdd to Memories
text_meta_groupsCustom Friends Groups
text_meta_locationCurrent Location
text_meta_moodCurrent Mood
text_meta_musicCurrent Music
text_meta_origin_urlOriginal entry at
text_month_form_btnView
text_month_nextNext Month
text_month_prevPrevious Month
text_month_screened_commentsw/ Screened
text_multiform_btnPerform Action
text_multiform_checkSelect:
text_multiform_check_cleanSelect
text_multiform_conf_deleteDelete selected comments?
text_multiform_desMass action on comments:
text_multiform_no_actionYou have not selected one of the actions
text_multiform_no_commentsYou have not selected any comments
text_multiform_opt_allAll
text_multiform_opt_deleteDelete
text_multiform_opt_deletespamDelete as Spam
text_multiform_opt_editEdit
text_multiform_opt_freezeFreeze
text_multiform_opt_please(Select action)
text_multiform_opt_screenScreen
text_multiform_opt_selectedSelected
text_multiform_opt_spamSpam
text_multiform_opt_trackTrack This
text_multiform_opt_unfreezeUnfreeze
text_multiform_opt_unscreenUnscreen
text_multiform_opt_unscreen_to_replyUnscreen to reply
text_multiform_opt_unspamUnspam
text_multiform_opt_untrackUntrack This
text_noentries_dayThere were no entries on this day.
text_noentries_recentThere are no entries to display.
text_nosubject(no subject)
text_page_summaryPage Summary
text_permalinkLink
text_post_commentLeave a comment
text_post_comment_friendsLeave a comment
text_poster_anonymous(Anonymous)
text_rating_position# position in rating
text_rating_typeentry is in top# rating
text_read_all_commentsRead # comment // Read # comments
text_read_all_spam_commentsRead # suspicious comment // Read # suspicious comments
text_read_comments# comment // # comments
text_read_comments_friends# comment // # comments
text_read_spam_comments# suspicious comment // # suspicious comments
text_reply_backRead Comments
text_reply_nocommentsComments have been disabled for this post.
text_reply_nocomments_headerComments Disabled:
text_replyform_headerComment Form
text_shareShare
text_share_emailSend by e-mail
text_share_facebookPost to Facebook
text_share_thisShare
text_share_twitterTweet this
text_showspamShow spam
text_skiplinks_backPrevious #
text_skiplinks_forwardNext #
text_spam_comment(Suspicious comment)
text_syndicateSyndicate
text_tag_uses# use // # uses
text_tagsTags: #
text_tags_page_headerVisible Tags
text_tags_section_headerTags
text_tell_friendTell a Friend
text_threeposts_title_bytag_communityPosts from This Community by “#” Tag
text_threeposts_title_bytag_journalPosts from This Journal by “#” Tag
text_threeposts_title_featured_communityFeatured Posts from This Community
text_threeposts_title_featured_journalFeatured Posts from This Journal
text_threeposts_title_recent_communityRecent Posts from This Community
text_threeposts_title_recent_journalRecent Posts from This Journal
text_totopBack to top
text_unwatch_commentsUntrack This
text_view_archiveArchive
text_view_friendsFriends
text_view_friends_commMembers
text_view_friends_filterFriends (Custom filter)
text_view_friendsfriendsFriends of Friends
text_view_friendsfriends_filterFriends of Friends (Custom filter)
text_view_gamesMy Games
text_view_memoriesMemories
text_view_monthView Subjects
text_view_recentRecent Entries
text_view_usergamesMy Games
text_view_userinfoProfile
text_watch_commentsTrack This
text_we_like_thisView people who like it
text_website_default_nameMy Website
text_year_nextNext Year
text_year_prevPrevious Year
theme_bgcolor(empty)
theme_bordercolor(empty)
theme_linkcolor(empty)
use_shared_pic0
view_comment_subject0
view_entry_disabled0

Global Functions

Event(string username) : EventConstructor for making a Event object from a username
Institution(string username) : InstitutionConstructor for making a Institution object from a username
PalItem(int index, Color c) : PalItemConvenience constructor to make populating an array of PalItems (like in palimg_modify(string,PalItem[])) easy.
Person(string username) : PersonConstructor for making a Person object from a username
ThreePosts(Entry e, ThreePostsEntry[] entries) : void 
User(string username) : UserConstructor for making a User object from a username
UserExtended(string username) : UserExtendedConstructor for making a UserExtended object from a username
UserLite(string username) : UserLiteConstructor for making a UserLite object from a username
_ruMonth(Date time) : string 
alternate(string a, string b) : stringWith each call, this function will alternate between the two values and return one of them. Useful for making tables whose rows alternate in background color.
bool_as_string(bool input) : string 
clean_url(string s) : stringReturns the given URL back if it's a valid URL.
comment_count(Comment[] comments) : int 
control_strip_logged_out_full_userpic_css() : stringReturns CSS for the loggedout_userpic div in the logged out version of the control strip.
control_strip_logged_out_userpic_css() : stringReturns CSS for the userpic div in the logged out version of the control strip.
ehtml(string s) : stringEscapes all HTML tags and entities from the text
end_css() : voidDeclare that you're done printing CSS and the output thus buffered should be cleaned and printed.
etags(string s) : stringEscapes all HTML tags (but not entities) from text
eurl(string s) : stringURL escape
get_extra(string{} extra) : string 
get_extra_by_selector(string{} extra, string selector) : string 
get_fbmigration() : stringReturns div with facebook-migration markup
get_feedpromo_control(string tag, string class, string entry_selector, int promoid, int itemid, int journalid) : string 
get_first_image(Entry e) : string 
get_first_image_url(Entry e) : string 
get_fromfacebook_supportlink(bool is_fbpost) : string 
get_fullimage_wrapper() : string 
get_lang_text_multi(string lang, string[] variables) : string{}Returns list of values of lang variables. Lang in lowercase, example 'ru'
get_lj_bubble() : string 
get_lj_entry_likus(string tag, int journal_id, int post_id, string post_uri) : string 
get_lj_entry_likus(string tag, string class, int journal_id, int post_id, string post_uri) : string 
get_ljart_artists() : User[]Returns all LJArt artists
get_metadata(string s) : string{}Extracts metadata from p-tags
get_page() : PageGets the top-level Page instance that LiveJournal ran the Page.print() method on.
get_partnermaterial_label(string tag, string class) : string 
get_plural_phrase(int n, string prop) : stringPicks the phrase with the proper plural form from those in the property $prop, passing $n to lang_map_plural(int) to get the proper form for the current language, and then substituting the # character with $n. Also, returned string is HTML-escaped.
get_rating_position_label(int pos, string tag, string class, string delimeter) : string 
get_remote() : UserReturns an object of remote user in trusted styles only. See also: viewer_logged_in(), viewer_is_owner() etc.
get_remote_lang() : stringReturns remote's language
get_remote_ljart_town() : stringReturns remote's LJArt town
get_telegram_userpromo() : string 
get_threeposts_title(Entry e) : string 
get_url(UserLite user, string view) : stringReturns a URL to the specified view for the specified user. Views use the same names as elsewhere. (recent, friends, archive, month, userinfo)
get_url(string user, string view) : stringReturns a URL to the specified view for the specified user. Views use the same names as elsewhere. (recent, friends, archive, month, userinfo)
html_get_img_urls(string s) : string[]Returns an array of URLs of images from given HTML
htmlattr(string name, int value) : stringIf the value isn't blank, return in HTML attribute format with a leading space. HTML of name is not escaped.
htmlattr(string name, string value) : stringIf the value isn't blank, return in HTML attribute format with a leading space. HTML of name is not escaped.
int(string s) : intConvert the string to an integer and return
is_enabled(string s) : boolReturn enabled/disabled flag
is_likes_display() : boolReturn value of likes_display enabled
is_pocket() : boolTrue if useragent belongs to service Pocket
journal_current_datetime() : DateTimeReturns the current datetime in the timezone of the journal being viewed.
lang_at_datetime(DateTime d) : stringReturns a string saying "at {the data and time given}". Used in the core implementation of EntryPage and ReplyPage. i18nc layers should override this.
lang_map_plural(int n) : int 
lang_metadata_title(string which) : stringGet a human-readable caption for a metadata key. Layers shouldn't override this, but should instead set the relevant string properties.
lang_ordinal(int num) : stringMake an ordinal number from a cardinal number
lang_ordinal(string num) : stringMake an ordinal number from a cardinal number. Don't override this, since the core layer implementation just calls lang_ordinal(int), which i18nc layers should override.
lang_page_of_pages(int pg, int pgs) : string 
lang_user_wrote(UserLite u) : stringReturns text describing that the user wrote something. i18nc layers should override this.
lang_viewname(string viewid) : stringGet some words representing a view
ljart_artist_specs() : string[]Returns list of specializations of ljart artists
ljart_event_types() : string[]Returns list of types of ljart events
ljart_institut_types() : string[]Returns list of types of ljart institut
need_adaptive() : boolReturns if the page must be shown as adaptive
pageview_unique_string() : stringReturns a unique string for the remote user.
palimg_gradient(string filename, PalItem start, PalItem end) : stringReturn a URL to the specified filename (relative to the palimg root) with its palette table made into a gradient. All palette entries between the inclusive indexes of $start and $end will fade from the colors in $start and $end. The palette indexes for the start and end can be between 0 and 255.
palimg_modify(string filename, PalItem[] items) : stringReturn a URL to the specified filename (relative to the palimg root) with its palette table altered, once for each provided PalItem. Restrictions: only 7 palette entries may be modified, and the PalItem indexes must be 0-15.
palimg_tint(string filename, Color bright) : stringReturn a URL to the specified filename (relative to the palimg root) with its palette table tinted. The given 'bright' color will be the new white, and darkest color remains black.
palimg_tint(string filename, Color bright, Color dark) : stringReturn a URL to the specified filename (relative to the palimg root) with its palette table tinted. The given 'bright' color will be the new white, and the given 'dark' color is the new black.
print_custom_control_strip_css() : voidPrints the CSS for custom control strip colors, if the option is enabled. This should be called by print_stylesheet().
print_stylesheet() : voidPrints a stylesheet, the URL of which can be referenced by Page.stylesheet_url. This is another S2 entry point, in addition to Page.print().
prop_init() : voidThis function is the first thing called and is the place to set properties based on the values of other properties. It's called before the style system looks at its builtin properties, so if you need to conditionally setup something based on your own custom properties, do it here. You can't print from this function.
rand(int high) : intReturns a random integer between 1 and $high, inclusive.
rand(int low, int high) : intReturns a random integer between $low and $high, inclusive.
remove_unusable_images(string[] images) : string[] 
secs_to_string(int sec) : string 
server_sig() : void 
set_content_type(string text) : voidSet the HTTP Content-type response header (for example, if outputting XML). Must be called before printing any data.
set_handler(string eventname, string[][] commands) : void 
start_css() : voidDeclare that you're about to start printing out CSS that should be buffered, then later cleaned when you call end_css(). WARNING: this is not re-entrant. You can't call start_css recursively.
string(int i) : stringReturn the given integer as a string
striphtml(string s) : stringSimilar to ehtml, but the HTML tags are stripped rather than escaped.
style_is_active() : boolReturns if the style (layout and theme) calling it is active based on a hook. If hook isn't defined, returns true always.
truncate_to_paragraph(string s, string m) : stringTruncates given string to p/br tag or first delimiter. Depends on the mode (p|br|first)
userinfoicon(UserLite user) : Image 
userlite_as_string(UserLite ul) : stringDeprecated function. Use ljuser() from now on.
userlite_base_url(UserLite ul) : string 
viewer_can_post() : boolReturns true if the user can post in journal
viewer_is_cyrillic() : boolReturns true if the user is cyrillic.
viewer_is_friend() : boolReturns true if the user viewing the page is both logged in, and is a friend of the journal being viewed. Always returns false for communities, since they cannot have friends.
viewer_is_friendof() : boolReturns true if the user viewing the page is both logged in, and journal is a friend of user. Always returns false for communities.
viewer_is_maintainer() : boolReturns true if the user viewing community page, and is the maintainer of this community. Useful for returning links to manage information, or edit entries.
viewer_is_member() : boolReturns true if the user viewing the page is both logged in, and is a member of the community being viewed. Always returns false for personal journals, since they cannot have members.
viewer_is_moderator() : boolReturns true if the user viewing community page, and is the moderator of this community. Useful for returning links to manage information, or edit entries.
viewer_is_owner() : boolReturns true if the user viewing the page is both logged in, and is the owner of the content in question. Useful for returning links to manage information, or edit entries.
viewer_logged_in() : boolReturns true if the user viewing the page is logged in. It's recommended that your page links to the site login page if the user isn't logged in.
viewer_sees_ad_box(string type) : boolTrue if opaque sidebar site-specific content box should be displayed to the user.
viewer_sees_ads() : boolDeprecated function. Use viewer_sees_hbox_(top|bottom) or viewer_sees_vbox from now on.
viewer_sees_control_strip() : boolReturns true if reader will see the built in control strip.
viewer_sees_ebox() : boolTrue if the user has selected to see opaque content boxes between entries.
viewer_sees_hbox_bottom() : boolTrue if opaque horizontal site-specific content box should be displayed to the user at the bottom of the page.
viewer_sees_hbox_top() : boolTrue if opaque horizontal site-specific content box should be displayed to the user at the top of the page.
viewer_sees_sidebar_ads() : bool 
viewer_sees_sidebar_ads(string[] sidebar_slots) : bool 
viewer_sees_tour() : boolReturns true if reader will see the tour.
viewer_sees_vbox() : boolTrue if opaque vertical site-specific content box should be displayed to the user.
weekdays() : int[]Integers representing the days of the week. This will start on Monday (2) or Sunday (1) depending on the property setting for start-of-week and go to Sunday (1) or Saturday (7)
zeropad(int n, int digits) : stringReturns the number padded with zeroes so it has the amount of digits indicated.
zeropad(string n, int digits) : stringReturns the number padded with zeroes so it has the amount of digits indicated.

Classes

AlphabeticalHierarchical

Color Class

Represents a color.

Members

string as_stringHTML hex encoded: #rrggbb
int bBlue value, 0-255. (Read-only)
int gGreen value, 0-255. (Read-only)
int rRed value, 0-255. (Read-only)

Methods

Color(string s) : ColorConstructor for color class. Lets you make a Color object from a string of form #rrggbb
average(Color other) : ColorReturns color averaged with $other color.
blend(Color other, int value) : ColorReturns color blended with $other color by percentage value (int between 0 and 100).
blue() : intGet the blue value.
blue(int b) : voidSet the blue value. (0-255)
clone() : ColorReturns identical color.
darker() : ColorReturns a new color with lightness decreased by 30.
darker(int amt) : ColorReturns a new color with lightness decreased by amount given.
green() : intGet the green value.
green(int g) : voidSet the green value. (0-255)
hue() : intGet the hue value. (0-255)
hue(int h) : voidSet the hue value. (0-255)
inverse() : ColorReturns inverse of color.
lighter() : ColorReturns a new color with lightness increased by 30.
lighter(int amt) : ColorReturns a new color with lightness increased by amount given.
lightness() : intGet the lightness value. (0-255)
lightness(int v) : voidSet the lightness value. (0-255)
red() : intGet the red value.
red(int r) : voidSet the red value. (0-255)
saturation() : intGet the saturation value. (0-255)
saturation(int s) : voidSet the saturation value. (0-255)
set_hsl(int h, int s, int v) : voidSet the HSL value for a color class.

Comment Class

Child class of EntryLite. A comment to a journal entry, or to another comment.

Members

int _show_expand_collapseIs there an expand link or not.
string anchorDirect link to comment, via HTML name anchors (Read-only)
bool can_marked_as_spamComments can be marked as spam (Read-only)
bool comment_postedTrue if comment was just posted by the current user. (Read-only)
bool deletedTrue if comment has been deleted. Deleted comments still show up if they are the parent of a thread. (Read-only)
int depthVisual depth of entry. Top-level journal entries are always depth zero. Comments have a depth greater than or equal to one, depending on where the thread is rooted at.
string dom_idThe DOM 'id' attribute you should put on your outer-most element (Read-only)
bool editedTrue if the comment has been edited. (Read-only)
DateTime edittimeThe GMT time the comment was edited. Or undef if the comment hasn't been edited. (Read-only)
DateTime edittime_posterThe local time the comment was edited, in the commenter's timezone. Or undef if anonymous comment, or commenter's timezone is unknown, or the comment hasn't been edited. (Read-only)
DateTime edittime_remoteThe local time the comment was edited, in the remote user's (reader's) timezone. Or undef if no remote user, or remote user hasn't set their timezone, or the comment hasn't been edited. (Read-only)
bool frozenTrue if comment is in frozen state. (Read-only)
bool fullTrue if all information is available for this comment. False if only the subject, poster, and date are available. (collapsed threads)
string htmlHTML code for this comment.
bool is_fbpostIndicates that this entry from facebook post (Read-only)
bool is_instagramIndicates that this entry is digest from instagram (Read-only)
UserLite journalJournal the entry has been posted to
string[] link_keyseqAn array of keys which you should pass to EntryLite.get_link(string key) to produce an entry 'toolbar'. Does not contain nav_next and nav_prev for entries; you should retrieve those separately and put them somewhere appropriate for your layout.
string{} metadataPost metadata. Keys: 'music', 'mood' (Read-only)
string parent_urlURL to parent comment, or blank if a top-level comment. (Read-only)
string permalink_urlA URL at which this specific entry can be viewed, for linking purposes. (Read-only)
UserLite posterAuthor of the entry, or null if an anonymous comment
int rating_positionPosition of entry in rating (Read-only)
Comment[] repliesComments replying to this comment.
string reply_urlURL to reply to this comment. (Read-only)
string reposted_byThe string about reposter (Read-only)
bool screenedTrue if comment is in screened state. (Read-only)
int seconds_since_entryThe number of elapsed seconds from the time of the journal entry until the comment was initially posted. (Read-only)
bool spamThis is spam message. (Read-only)
string subjectSubject. May contain HTML. Don't do substring chops on this. (Read-only)
Image subject_iconSubject icon, or null.
DateTime system_timeThe system time (in GMT) this entry or comment was posted.
Tag[] tagsArray of tags applied to this entry. (Read-only)
int talkidServer stored ID number for this comment.
string textEntry Text; Use EntryLite.print_text() to print this so that the entry's trust level is not affected by your layer's trust level. (Read-only)
bool text_must_print_trustedIndicates that this entry's text contains some content that must be printed trusted, with EntryLite.print_text(), rather than printed directly from an untrusted context. Use this to fall back to a plain trusted print if you are doing something unusual with EntryLite.text. Most layers can just ignore this and always use EntryLite.print_text(). (Read-only)
string thread_urlURL to view threaded rooted at this comment, or blank if comment has no children. (Read-only)
DateTime timeThe user-specified time of the post, or the GMT time if it's a comment.
DateTime time_posterThe local time the comment appeared, in the commenter's timezone. Or undef if anonymous comment, or commenter's timezone is unknown. (Read-only)
DateTime time_remoteThe local time the comment appeared, in the remote user's (reader's) timezone. Or undef if no remote user, or remote user hasn't set their timezone. (Read-only)
Image userpicThe userpic selected to relate to this entry.

Methods

edittime_display() : stringShow the time that this comment was edited, with most useful information for user. Empty string if the comment hasn't been edited.
edittime_display(string datefmt, string timefmt) : stringedittime_display, with customized date/time formats.
expand_link() : stringReturns a link to expand a collapsed comment. Uses the value of the 'text_comment_expand' property as the text. Will not work in untrusted layers.
expand_link(string{} opts) : stringReturns a link to expand a collapsed comment. Can pass options 'text', 'title', 'class', and 'img_url' (and other 'img_*' options). Will not work in untrusted layers.
formatted_subject(string{} opts) : stringformats subject - outputs subject as html-link, gets hash of attributes - class and(or) style
get_link(string key) : LinkGet a link to some action related to this entry or comment. You can iterate over EntryLite.link_keyseq to get keys to pass in here to produce a 'toolbar' of links.
get_plain_subject() : stringFor Entries that can contain HTML subjects, this returns the subject without HTML. Comments can't have HTML in subjects, so this is equivalent to just using $.subject. The returned 'plain' subject may still contain HTML entities, so don't do substring chops on it either.
get_tags_text() : stringReturns a string containing a div of class 'ljtags' with the tags for the entry. If there are no tags on the entry, returns a blank string. The string is formatted according to the 'text_tags' property.
print_edit_text() : voidPrint the text that says when this comment was edited.
print_expand_collapse_links() : voidPrints links to expand and to collapse this comment.
print_expand_collapse_links(string{} template) : stringPrints links to expand and to collapse this comment (output with template).
print_expand_link() : stringPrints a link to expand a collapsed comment. Uses the value of the 'text_comment_expand' property as the text.
print_expand_link(string{} opts) : stringPrints a link to expand a collapsed comment. Can pass options 'text', 'title', 'class', and 'img_url' (and other 'img_*' options).
print_give_button(string type) : stringGet a button or link to Give features. Type can be 'button' or 'link'
print_give_button(string type, string img_url) : stringGet a button or link to Give features. Type can be 'button' or 'link'
print_linkbar() : voidPrint the link bar for this entry or comment.
print_multiform_check() : voidPrints the select checkbox in CSS class 'ljcomsel' with DOM id 'ljcomsel_$talkid' for a multi-action form started with EntryPage.print_multiform_start().
print_multiform_check(string{} opts) : stringReturn the select checkbox in CSS class 'ljcomsel' with DOM id 'ljcomsel_$talkid' for a multi-action form started with EntryPage.print_multiform_start().
print_reply_container() : voidPrints the area in which the quickreply box will go. If no container is available, quickreply will not work.
print_reply_container(string{} opts) : stringPrints the area in which the quickreply box will go. You may 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : stringPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, and the link CSS class in 'class'. You may also specify the url of an image to use as a button in 'img_url'.
print_text() : voidPrint the entry text. Doesn't print anything in some contexts, such as on a month view or in a collapsed comment.
render_linkbar() : stringRender the link bar for this entry or comment and return it as string.
render_text() : stringReturns the text of comment.
time_display() : stringShow the time of this post, with most useful information for user, and with tooltip for more.
time_display(string datefmt, string timefmt) : stringtime_display, with customized date/time formats.
time_display(string datefmt, string timefmt, bool edittime) : stringSame as EntryLite::time_display, except can pass in if we want the edit time or not.

CommentInfo Class

Information about comments attached to something.

Members

int countCurrent number of comments available to be read by the viewer.
bool enabledSet to false if comments disabled journal-wide or just on this item.
bool lockedSet to true if no further comments can be left on this entry.
bool maxcommentsSet to true if entry has reached a comment maximum.
string post_urlURL pointer to the 'Post Comments' view. (Read-only)
string read_spam_urlURL pointer to the 'Show/Hide Spam' view. (Read-only)
string read_urlURL pointer to the 'Read Comments' view. (Read-only)
bool screenedSet to true if there are screened comments and remote user can unscreen them.
bool show_postlinkIndicates whether the Post Comment link for this entry should be shown.
bool show_readlinkIndicates whether the Read Comments link for this entry should be shown.
int spam_counterCurrent number of spam comments.

Methods

print() : voidPrint all comment related links
print_postlink() : voidPrint the formatted link to the 'Post Comments' view
print_readlink() : voidPrint the formatted link to the 'Read Comments' view
print_spamlink() : voidPrint the formatted link to the 'Show spam' view

Date Class

Represents a date.

Members

int dayDay; 1-31.
int monthMonth; 1-12.
int yearYear; 4 digits.

Methods

compare(Date d) : intCompare two dates. Returns a negative number if d is before the subject in time, positive if it is after, or zero if the two dates are equal. When comparing a Date with a DateTime, the time on the bare Date value is assumed to be midnight.
compare(DateTime d) : intCompare two dates. Returns a negative number if d is before the subject in time, positive if it is after, or zero if the two dates are equal. When comparing a Date with a DateTime, the time on the bare Date value is assumed to be midnight.
date_format() : stringReturns date formatted as normal. /// SeeAlso: siteapi.core1.dateformats
date_format(string fmt) : stringReturns date formatted as indicated by $fmt. One of: short, med, long, med_day, long_day. Or a custom format. Default is 'short'. /// SeeAlso: siteapi.core1.dateformats
day_of_week() : intReturns the day of the week this date falls on, from Sunday=1 to Saturday=7

DateTime Class

Child class of Date. Represents both a date and time.

Members

int dayDay; 1-31.
int hourHour; 0-23.
int minMinute; 0-59.
int monthMonth; 1-12.
int secSecond; 0-59.
int yearYear; 4 digits.

Methods

compare(Date d) : intCompare two dates. Returns a negative number if d is before the subject in time, positive if it is after, or zero if the two dates are equal. When comparing a Date with a DateTime, the time on the bare Date value is assumed to be midnight.
compare(DateTime d) : intCompare two dates. Returns a negative number if d is before the subject in time, positive if it is after, or zero if the two dates are equal. When comparing a Date with a DateTime, the time on the bare Date value is assumed to be midnight.
date_format() : stringReturns date formatted as normal. /// SeeAlso: siteapi.core1.dateformats
date_format(string fmt) : stringReturns date formatted as indicated by $fmt. One of: short, med, long, med_day, long_day. Or a custom format. Default is 'short'. /// SeeAlso: siteapi.core1.dateformats
day_of_week() : intReturns the day of the week this date falls on, from Sunday=1 to Saturday=7
time_format() : stringReturns time formatted as normal. /// SeeAlso: siteapi.core1.dateformats
time_format(string fmt) : stringReturns time formatted as indicated by $fmt, or normal if blank. /// SeeAlso: siteapi.core1.dateformats

DayPage Class

Child class of Page. View entries by specific day

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Date dateDate of the current day
Entry[] entriesArray of entries available to be seen by the viewer of the page
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
bool has_entriesTrue if there are entries on the specified day
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
Date next_dateNext day
string next_urlURL to next day (Read-only)
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
Date prev_datePrevious day
string prev_urlURL to previous day (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

Entry Class

Child class of EntryLite. A journal entry

Members

CommentInfo commentsComment information on this entry
bool delayedIndicates that this entry is delayed (Read-only)
Image delayed_iconA little icon which should be displyaed somewhere on an entry to represent the delayed entry
int depthVisual depth of entry. Top-level journal entries are always depth zero. Comments have a depth greater than or equal to one, depending on where the thread is rooted at.
string dom_idThe DOM 'id' attribute you should put on your outer-most element (Read-only)
bool end_dayIs this the last entry of a day?
string eventEntry is event
string event_date_from 
string event_date_to 
string event_descShort description of event
string event_imageUrl to small image of event
string event_locationLocation of event
string event_paidEvent is paid or free
string event_pricePrice of event if paid
string event_time_from 
string event_time_to 
string event_townTown of event
string event_typeType of event
string event_usersMembers of event
bool is_fbpostIndicates that this entry from facebook post (Read-only)
bool is_instagramIndicates that this entry is digest from instagram (Read-only)
int itemidServer stored ID number for this entry
UserLite journalJournal the entry has been posted to
string[] link_keyseqAn array of keys which you should pass to EntryLite.get_link(string key) to produce an entry 'toolbar'. Does not contain nav_next and nav_prev for entries; you should retrieve those separately and put them somewhere appropriate for your layout.
string{} metadataPost metadata. Keys: 'music', 'mood' (Read-only)
Image mood_iconMood icon, or null.
bool new_dayIs this entry on a different day to the previous one?
bool partnerIndicates that this entry contains partner content (Read-only)
string permalink_urlA URL at which this specific entry can be viewed, for linking purposes. (Read-only)
string portfolioEntry used for portfolio of artist
string portfolio_thumbnailUrl to image for portfolio of artist
UserLite posterAuthor of the entry, or null if an anonymous comment
bool promoIndicates that this entry is promo (Read-only)
string promo_typePromoted object type (entry/site) (Read-only)
int promoidPromoid if entry is promo (Read-only)
int rating_positionPosition of entry in rating (Read-only)
bool repostIndicates that this entry is repost (Read-only)
Image repost_iconA little icon which should be displyaed somewhere on an entry to represent the reposted entry
string reposted_byThe string about reposter (Read-only)
string securityThe security level of the entry ('private', 'protected'), or blank if public. (Read-only)
Image security_iconA little icon which should be displayed somewhere on an entry to represent the security setting
bool stickyIndicates that this entry is sticky (Read-only)
Image sticky_iconA little icon which should be displyaed somewhere on an entry to represent the sticky setting
string subjectSubject. May contain HTML. Don't do substring chops on this. (Read-only)
DateTime system_timeThe system time (in GMT) this entry or comment was posted.
Tag[] tagsArray of tags applied to this entry. (Read-only)
string textEntry Text; Use EntryLite.print_text() to print this so that the entry's trust level is not affected by your layer's trust level. (Read-only)
bool text_must_print_trustedIndicates that this entry's text contains some content that must be printed trusted, with EntryLite.print_text(), rather than printed directly from an untrusted context. Use this to fall back to a plain trusted print if you are doing something unusual with EntryLite.text. Most layers can just ignore this and always use EntryLite.print_text(). (Read-only)
string threeposts_sourceSource of threeposts: tag, url, recent
string threeposts_tagTag for threeposts if threeposts_source eq tag
DateTime timeThe user-specified time of the post, or the GMT time if it's a comment.
Image userpicThe userpic selected to relate to this entry.
int versionVersion of post - old or new editor (post_2017) (Read-only)

Methods

formatted_subject(string{} opts) : stringformats subject - outputs subject as html-link, gets hash of attributes - class and(or) style
get_authors_comments() : Comment[]Returns community authors last comments
get_cutted_text() : stringReturns text withiout text that has been cutted. Doesn't print anything in some contexts, such as on a month view or in a collapsed comment.
get_eventrates() : UserLite[]Id list of users who rates this entry.
get_eventratescounters() : intHow many users rates this entry.
get_link(string key) : LinkGet a link to some action related to this entry or comment. You can iterate over EntryLite.link_keyseq to get keys to pass in here to produce a 'toolbar' of links.
get_lj_embeds() : string[]Returns an array of tags <lj-embed>
get_plain_subject() : stringFor Entries that can contain HTML subjects, this returns the subject without HTML. Comments can't have HTML in subjects, so this is equivalent to just using $.subject. The returned 'plain' subject may still contain HTML entities, so don't do substring chops on it either.
get_tags_text() : stringReturns a string containing a div of class 'ljtags' with the tags for the entry. If there are no tags on the entry, returns a blank string. The string is formatted according to the 'text_tags' property.
get_threeposts() : ThreePostsEntry[]Returns ThreePostsEntry[] params from a Entry object
is_eventrate_enable() : boolTrue if users can rate entry.
is_myvoice() : boolIs my voice already counted by the system.
plain_subject() : stringReturn entry's subject as plain text, with all HTML removed.
print_ebox() : voidPrints a small horizontal bar of site-specific content between entries in a journal.
print_give_button(string type) : stringGet a button or link to Give features. Type can be 'button' or 'link'
print_give_button(string type, string img_url) : stringGet a button or link to Give features. Type can be 'button' or 'link'
print_link_next() : voidPrint the link to the next entry in this journal.
print_link_prev() : voidPrint the link to the previous entry in this journal.
print_linkbar() : voidPrint the link bar for this entry or comment.
print_metadata() : void 
print_text() : voidPrint the entry text. Doesn't print anything in some contexts, such as on a month view or in a collapsed comment.
render_linkbar() : stringRender the link bar for this entry or comment and return it as string.
time_display() : stringShow the time of this post, with most useful information for user, and with tooltip for more.
time_display(string datefmt, string timefmt) : stringtime_display, with customized date/time formats.
truncate_text(int limit) : stringTruncates entry text to limit chars and adds ellipsis
viewer_sees_ebox() : boolTrue if opaque horizontal site-specific content boxes between entries should be displayed to the user.

EntryLite Class

Base class for both journal entries and comments.

Members

int depthVisual depth of entry. Top-level journal entries are always depth zero. Comments have a depth greater than or equal to one, depending on where the thread is rooted at.
string dom_idThe DOM 'id' attribute you should put on your outer-most element (Read-only)
bool is_fbpostIndicates that this entry from facebook post (Read-only)
bool is_instagramIndicates that this entry is digest from instagram (Read-only)
UserLite journalJournal the entry has been posted to
string[] link_keyseqAn array of keys which you should pass to EntryLite.get_link(string key) to produce an entry 'toolbar'. Does not contain nav_next and nav_prev for entries; you should retrieve those separately and put them somewhere appropriate for your layout.
string{} metadataPost metadata. Keys: 'music', 'mood' (Read-only)
string permalink_urlA URL at which this specific entry can be viewed, for linking purposes. (Read-only)
UserLite posterAuthor of the entry, or null if an anonymous comment
int rating_positionPosition of entry in rating (Read-only)
string reposted_byThe string about reposter (Read-only)
string subjectSubject. May contain HTML. Don't do substring chops on this. (Read-only)
DateTime system_timeThe system time (in GMT) this entry or comment was posted.
Tag[] tagsArray of tags applied to this entry. (Read-only)
string textEntry Text; Use EntryLite.print_text() to print this so that the entry's trust level is not affected by your layer's trust level. (Read-only)
bool text_must_print_trustedIndicates that this entry's text contains some content that must be printed trusted, with EntryLite.print_text(), rather than printed directly from an untrusted context. Use this to fall back to a plain trusted print if you are doing something unusual with EntryLite.text. Most layers can just ignore this and always use EntryLite.print_text(). (Read-only)
DateTime timeThe user-specified time of the post, or the GMT time if it's a comment.
Image userpicThe userpic selected to relate to this entry.

Methods

formatted_subject(string{} opts) : stringformats subject - outputs subject as html-link, gets hash of attributes - class and(or) style
get_link(string key) : LinkGet a link to some action related to this entry or comment. You can iterate over EntryLite.link_keyseq to get keys to pass in here to produce a 'toolbar' of links.
get_plain_subject() : stringFor Entries that can contain HTML subjects, this returns the subject without HTML. Comments can't have HTML in subjects, so this is equivalent to just using $.subject. The returned 'plain' subject may still contain HTML entities, so don't do substring chops on it either.
get_tags_text() : stringReturns a string containing a div of class 'ljtags' with the tags for the entry. If there are no tags on the entry, returns a blank string. The string is formatted according to the 'text_tags' property.
print_give_button(string type) : stringGet a button or link to Give features. Type can be 'button' or 'link'
print_give_button(string type, string img_url) : stringGet a button or link to Give features. Type can be 'button' or 'link'
print_linkbar() : voidPrint the link bar for this entry or comment.
print_text() : voidPrint the entry text. Doesn't print anything in some contexts, such as on a month view or in a collapsed comment.
render_linkbar() : stringRender the link bar for this entry or comment and return it as string.
time_display() : stringShow the time of this post, with most useful information for user, and with tooltip for more.
time_display(string datefmt, string timefmt) : stringtime_display, with customized date/time formats.

EntryPage Class

Child class of Page. A page with a single journal entry and associated comments.

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
ItemRange comment_pagesRepresents what comment page is being displayed.
Comment[] commentsComments to journal entry, or at least some of them.
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Entry entryJournal entry being viewed
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
bool multiform_onSet to true if the multi-action is to be printed, which requires both comments and applicable permissions for the remote user.
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
bool viewing_threadTrue if viewing a specific sub-thread of the comments. Style may which to hide the journal entry at this point, since the focus is the comments.
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_comment(Comment comment) : voidPrints a full comment
print_comment_full(Comment comment) : voidPrints a expanded comment
print_comment_partial(Comment comment) : voidPrints a collapsed comment
print_comments(Comment[] comments) : voidPrints comments
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_multiform_actionline() : voidPrints the line of the multiform giving instructions, options, and the submit button, using the text of the different $*text_multiform_ properties.
print_multiform_end() : voidPrints end of form tag to do a multi-comment action.
print_multiform_start() : voidPrints start of form tag and hidden elements to do a multi-comment action (multiple delete, screen, unscreen, etc...)
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_comment(Comment c, int _show_expand_collapse) : stringReturn comment as string
render_comment_full(Comment comment) : stringReturn content of a expanded comment
render_comment_partial(Comment comment) : stringReturn content of a collapsed comment
render_comments(Comment[] comments) : Comment{}Return a list of comments
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

Event Class

Child class of UserLite. Lj art or other event. Created from community

Members

Link{} data_linkLinks to various machine-readable data sources relating to this user
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Image default_picInformation about default userpic
string eventCommunity is event? (Read-only)
string event_date_fromDate of event from (Read-only)
string event_date_toDate of event to (Read-only)
string event_locationWhere an event will be taken place (Read-only)
string event_organizerOrganizer of event (Read-only)
string event_paidPaid or free (Read-only)
string event_pricePrice of event (Read-only)
string event_townTown of an event (Read-only)
string event_typeType of event: exhibition, presentation, festival, play, meeting, perfomance,... (Read-only)
string journal_typeType of account: P (personal), C (community), Y (syndicated), S (shared), I (external identity) etc (Read-only)
string[] link_keyseqArray of keys which can be passed into the get_link
string nameUser's formatted name, ex: John Q. Public (Read-only)
int useridNumeric ID of the account (Read-only)
string usernameCanonical Username, ex: johnqpub. Note that if journal_type is an external identity, there will be no username, so this field will be a display version of their URL, longer than 15 characters, and with characters other than a-z, 0-9 and underscore. (Read-only)

Methods

as_string() : string 
base_url() : stringReturns URL of user's journal.
equals(UserLite u) : boolReturns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.
get_link(string key) : LinkReturns a link based on the given key, or null if the link is unavailable
ljuser() : stringReturns an LJ user tag for the user.
ljuser(Color link_color) : stringReturns an LJ user tag for the user. The color of the link will be link_color.
ljuser(string{} opts) : stringReturns an LJ user tag with journal attribute for the user.
print() : void 
print_linkbar() : voidPrint the link bar for this user/journal.
tag_manage_url() : stringReturns URL to user's tag management page.

Friend Class

Child class of UserLite. Represents a friends or friendof list

Members

Color bgcolorBackground color selected for friend
Link{} data_linkLinks to various machine-readable data sources relating to this user
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Color fgcolorForeground color selected for friend
string journal_typeType of account: P (personal), C (community), Y (syndicated), S (shared), I (external identity) etc (Read-only)
string[] link_keyseqArray of keys which can be passed into the get_link
string nameUser's formatted name, ex: John Q. Public (Read-only)
int useridNumeric ID of the account (Read-only)
string usernameCanonical Username, ex: johnqpub. Note that if journal_type is an external identity, there will be no username, so this field will be a display version of their URL, longer than 15 characters, and with characters other than a-z, 0-9 and underscore. (Read-only)

Methods

as_string() : string 
base_url() : stringReturns URL of user's journal.
equals(UserLite u) : boolReturns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.
get_link(string key) : LinkReturns a link based on the given key, or null if the link is unavailable
ljuser() : stringReturns an LJ user tag for the user.
ljuser(Color link_color) : stringReturns an LJ user tag for the user. The color of the link will be link_color.
ljuser(string{} opts) : stringReturns an LJ user tag with journal attribute for the user.
print() : void 
print_linkbar() : voidPrint the link bar for this user/journal.
tag_manage_url() : stringReturns URL to user's tag management page.

FriendsPage Class

Child class of RecentPage. Friends most recent entries

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Entry[] entriesArray of entries available to be seen by the viewer of the page.
bool filter_activeIf true, some kind of filter is in effect. If this filter has a name, it will be included in FriendsPage.filter_name
string filter_nameThe name of the filter in effect, if it has a name. This is only used when 'custom' FriendsPage.filter_active is true.
Friend{} friendsA mapping from friend username to color association information. There will only be keys for friends whose entries are in the entries array.
string friends_modeThe 'mode' of this view. An empty string indicates a normal friends view, while 'friendsfriends' indicates the Friends-of-friends view.
string friends_titleA user-selected title for their friends page. (Read-only)
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
RecentNav nav 
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
bool tagfilter_active 
string tagfilter_mode 
Tag[] tagfilter_tags 
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

Image Class

Represents an image.

Members

string alttextDefault alternative text for image
string{} extraExtra params for img tag (Read-only)
int heightHeight in pixels
string urlURL of the image (Read-only)
int widthWidth in pixels

Methods

as_string() : stringReturn the HTML tag for this image
as_string(string alttext) : stringReturn an HTML tag for this Image with given alttext
as_string(string{} opts) : stringReturn the HTML for an image, Supported keys are 'href' to create a link to the image source and 'a_attr' which adds attributes to the anchor tag if a link is to be printed.
as_string_ex(string alttext, string attributes) : stringReturn an HTML tag for this Image with given alttext and given additional HTML tag attributes
print() : voidPrint an HTML tag for this Image
print(string alttext) : voidPrint an HTML tag for this Image with given alttext
print(string{} opts) : voidPrint the HTML for an image, Supported keys are 'href' to create a link to the image source and 'a_attr' which adds attributes to the anchor tag if a link is to be printed.
set_url(string url) : voidSets the URL, doing any necessary escaping.

Institution Class

Child class of UserLite. Lj art or other institution. Created from community

Members

Link{} data_linkLinks to various machine-readable data sources relating to this user
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Image default_picInformation about default userpic
string institutionCommunity is institution? (Read-only)
string institution_designationDesignation of institution (Read-only)
string institution_typeType of institution (Read-only)
string journal_typeType of account: P (personal), C (community), Y (syndicated), S (shared), I (external identity) etc (Read-only)
string[] link_keyseqArray of keys which can be passed into the get_link
string nameUser's formatted name, ex: John Q. Public (Read-only)
int useridNumeric ID of the account (Read-only)
string usernameCanonical Username, ex: johnqpub. Note that if journal_type is an external identity, there will be no username, so this field will be a display version of their URL, longer than 15 characters, and with characters other than a-z, 0-9 and underscore. (Read-only)

Methods

as_string() : string 
base_url() : stringReturns URL of user's journal.
equals(UserLite u) : boolReturns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.
get_link(string key) : LinkReturns a link based on the given key, or null if the link is unavailable
ljuser() : stringReturns an LJ user tag for the user.
ljuser(Color link_color) : stringReturns an LJ user tag for the user. The color of the link will be link_color.
ljuser(string{} opts) : stringReturns an LJ user tag with journal attribute for the user.
print() : void 
print_linkbar() : voidPrint the link bar for this user/journal.
tag_manage_url() : stringReturns URL to user's tag management page.

int Class

An integer number. This isn't really a class, as suggested by its lower-case name. Parameters of type int pass by value, unlike all variables of real object types, which pass by reference. Instead, this is just a pseudo-class which provides convenience methods on instances of integers. The other pseudo-class is string.

Methods

compare(int n) : intCompare one integer with another. Returns a negative number if n is less than the subject, positive if greater or zero if the two are numerically equal.
zeropad(int digits) : stringReturn the integer as a string formatted at least $digits characters long, left-padded with zeroes.

ItemRange Class

Represents a range of items which optionally contain items.

Members

bool all_subitems_displayedTrue if the subitems in this range represent the entire set. In this case, all of the URL members are blank.
int currentThe currently-active item.
int from_subitemThe index of the first subitem in this range.
int num_subitems_displayedThe number of subitems in this range.
int to_subitemThe index of the last subitem in this range.
int totalThe total number of items that are navigable to.
int total_subitemsThe number of subitems.
string url_firstURL for the 'first' link. Blank if already on the first page. (Read-only)
string url_lastURL for the 'last' link. Blank if already on the last page. (Read-only)
string url_nextURL for the 'next' link. Blank if there isn't a next URL. (Read-only)
string url_prevURL for the 'previous' link. Blank if there isn't a previous URL. (Read-only)

Methods

print() : voidPrints the item range links
print(string labeltext) : voidPrints the item range links with the given $labeltext
url_of(int n) : stringReturns the URL to use to link to the nth item

Link Class

A link or button

Members

string captionThe caption for the link (Read-only)
string{} extraExtra params for link tag (Read-only)
Image iconA suggestion from the server as to which icon to use. layouts/users can override this of course. alt text works similarly to Link.caption.
string urlURL which the link points to (Read-only)

Methods

as_string() : stringReturn the button HTML link.
print_button() : voidOutput this Link as a clickable button using Link.icon
print_raw() : voidOutput additional link HTML code.

MessagePage Class

Child class of Page. A page showing an error or confirmation message.

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
string[] link_keyseqA list of links, indicated by key, that should be displayed alongside this error. They should ideally be displayed in a similar way to the entry links displayed on the entry page.
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
Link{} linksAn associative array of links to be displayed alongside this message. Iterate over MessagePage.link_keyseq to find the keys.
string messageThe body of the message. Do not print this directly; use MessagePage.print_body() instead. (Read-only)
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string titleThe title of the message. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_links() : voidPrint the links from the MessagePage.links and MessagePage.link_keyseq members. Layouts will probably want to override this.
print_message() : voidPrint the message. Call this rather than printing MessagePage.message directly.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

MonthDay Class

Child class of YearDay. Summaries of posts on a given day on the MonthPage.

Members

Date dateDate of day
int dayDay of month number
Entry[] entriesOnly populated on the month view. Entry text not present.
bool has_entriesTrue if there are entries on this day.
int num_entriesNumber of entries made on this day
string urlA URL to view the day, if there are entries, else blank. (Read-only)

Methods

print_subjectlist() : voidPrint a list of entry summaries including subjects

MonthEntryInfo Class

A month the user has journal entries, along with information to link to it.

Members

Date dateDate of month, with day of zero.
string redir_keyThe 'redir_key' parameter for a Redirector instance. (Read-only)
string urlURL for the MonthPage month view. (Read-only)

MonthPage Class

Child class of Page. A page which contains a list of posts made in that month

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Date dateDate of this month, with day of zero.
MonthDay[] daysOne entry for each day of the month.
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
MonthEntryInfo[] monthsOther months this journal has entries.
Date next_dateDate of next month, with day of zero, or null if none.
string next_urlURL of next month, or empty string if none. (Read-only)
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
Date prev_dateDate of previous month, with day of zero, or null if none.
string prev_urlURL of previous month, or empty string if none. (Read-only)
Redirector redirNecessary to make a form which POSTs to a redirector
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

OptionsBasicAlert Class

Alert for basic accounts

OptionsDelimeter Class

Delimeters for options page.

Page Class

Base template for all views

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

PalItem Class

A specification for a numbered palette index in a GIF or PNG to be changed to a certain color

Members

Color colorColor to put at specified index.
int indexInteger palette index.

Person Class

Child class of UserLite. Lj artist or other person. Created from user

Members

Link{} data_linkLinks to various machine-readable data sources relating to this user
string[] data_links_orderAn array of data views which can be used to order the data_link hash
string journal_typeType of account: P (personal), C (community), Y (syndicated), S (shared), I (external identity) etc (Read-only)
string[] link_keyseqArray of keys which can be passed into the get_link
string nameUser's formatted name, ex: John Q. Public (Read-only)
string person_ml_specializationPerson specialization ml variable (Read-only)
string person_namePerson name (Read-only)
string person_photoPerson photo (Read-only)
string person_specializationPerson specialization (Read-only)
string person_townPerson town (Read-only)
int useridNumeric ID of the account (Read-only)
string usernameCanonical Username, ex: johnqpub. Note that if journal_type is an external identity, there will be no username, so this field will be a display version of their URL, longer than 15 characters, and with characters other than a-z, 0-9 and underscore. (Read-only)

Methods

as_string() : string 
base_url() : stringReturns URL of user's journal.
equals(UserLite u) : boolReturns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.
get_events() : Event[]Return list of communities, where user is member and community is ljart event
get_link(string key) : LinkReturns a link based on the given key, or null if the link is unavailable
ljuser() : stringReturns an LJ user tag for the user.
ljuser(Color link_color) : stringReturns an LJ user tag for the user. The color of the link will be link_color.
ljuser(string{} opts) : stringReturns an LJ user tag with journal attribute for the user.
print() : void 
print_linkbar() : voidPrint the link bar for this user/journal.
tag_manage_url() : stringReturns URL to user's tag management page.

RecentNav Class

Navigation position within a RecentPage or FriendsPage and URLs to move about.

Members

int backward_countNumber of items we'd be potentially seeing going backward.
int backward_skipNumber of items we'd be skipping going back more.
string backward_urlURL to go backward in time, or blank if furthest back server will allow. (Read-only)
int countIndicates how many entries we're currently seeing
int forward_countNumber of items we'd be potentially seeing going forward.
int forward_skipNumber of items we'd be skipping going forward.
string forward_urlURL to go forward in time, or blank if furthest forward. (Read-only)
int skipIndicates how many entries are being skipped back.
int versionCurrently version 1. A new method of navigation has been frequently discussed, so this is planning for the future

RecentPage Class

Child class of Page. Most recent entries page, formerly known as the LASTN view in the previous style system

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Entry[] entriesArray of entries available to be seen by the viewer of the page.
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
RecentNav nav 
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
bool tagfilter_active 
string tagfilter_mode 
Tag[] tagfilter_tags 
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

Redirector Class

A redirector makes either a GET URL which redirects to a pretty URL or an HTML form which posts to a URL that redirects to a pretty URL. This class exists because it's often desirable to use a form to end up at a URL, instead of doing a GET request. It's also used in cases where finding the previous or next URL would incur database overhead which would be wasteful, considering most people don't click previous/next links. Instead, the system will give you a Redirector object which has a URL that'll do the lookup for you later, followed by a redirect.

Members

string type  (Read-only)
string url  (Read-only)
string user  (Read-only)
string vhost  (Read-only)

Methods

end_form() : voidPrints a form close tag.
get_url(string redir_key) : voidReturns a GET URL, given a redir_key
print_hiddens() : voidPrints the necessary hidden elements for a form. Called automatically by Redirector.start_form().
start_form() : voidStarts an inline HTML form, then calls Redirector.print_hiddens(). You can also make it yourself, using Redirector.url, if you need special form attributes.

ReplyForm Class

This class will be used more in the future to set options on the reply form before it's printed out by the system. The system has to print it since it contains sensitive information which can't be made available to S2.

Members

bool subj_iconsWhether user has enabled subject icons or not. Currently read-only until policy is decided on whether layers should be able to change it (rather than changing it in the user preferences) (Read-only)

Methods

print() : voidPrints the reply form

ReplyPage Class

Child class of Page. A page to reply to a journal entry or comment

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Entry entryThe journal entry for this talk page
ReplyForm formThe reply form.
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
EntryLite replytoThe object which is being replied to, either the entry or a comment
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

string Class

A series of characters. This isn't really a class, as suggested by its lower-case name. Parameters of type string pass by value, unlike all variables of real object types, which pass by reference. Instead, this is just a pseudo-class which provides convenience methods on instances of strings. The other pseudo-class is int.

Methods

compare(string s) : intCompare one string with another. Returns a negative number if n is alphabetically before the subject, positive if greater or zero if the two are equal. Note that this function currently does a simple ASCII compare, not a proper unicode-aware sort.
contains(string sub) : boolReturn true if string contains $sub
css_keyword() : stringIf the string is syntactically valid as a CSS keyword (only letters and spaces) returns it, else returns an empty string.
css_keyword(string[] allowed) : stringSame as string.css_keyword() except also imposes a whitelist of valid keywords given in $allowed.
css_keyword_list() : stringAnalyses the string as a space-separated list of CSS keywords and returns a string containing the items that are syntactically acceptable.
css_keyword_list(string[] allowed) : stringSame as string.css_keyword_list() except also imposes a whitelist of valid keywords given in $allowed.
css_length_value() : stringIf the string contains a valid CSS length value, returns a canonical version. Else returns an empty string.
css_string() : stringReturns the string escaped and quoted as a CSS string literal, safe for insertion into a stylesheet.
css_url_value() : stringIf the string contains a valid HTTP or HTTPS URL it is returned. Otherwise, an empty string is returned.
ends_with(string sub) : boolReturns true if string ends in $sub
length() : intReturn the number of characters in the string.
length_utf8() : intReturn the number of characters in the string.
lower() : stringReturns string in lower case.
repeat(int n) : stringReturns the string repeated n times
split(string separator) : string[]Returns array of separated elements
starts_with(string sub) : boolReturns true if string begins with $sub
substr(int start, int length) : stringReturns up to $length characters from string, skipping $start characters from the beginning.
upper() : stringReturns string in upper case
upperfirst() : stringReturn string with the first character capitalized.

Tag Class

Represents a tag in its most basic form.

Members

string nameTextual representation of this tag. (Read-only)
string urlURL to view entries with this tag. (Read-only)

TagDetail Class

Child class of Tag. A rich structure with lots of information about a Tag.

Members

string nameTextual representation of this tag. (Read-only)
int{} security_countsHow many times this tag has used this security. The keys are which security, one of: public, private, friends, group. The value is the count of times the tag is used on entries with that security level. (Read-only)
string urlURL to view entries with this tag. (Read-only)
int use_countCount of how many times this tag has been used. (Read-only)
string visibilityThe visibility level for this tag. Based on the entries it's used on. Can be one of: public, private, friends, group. (Read-only)

TagsPage Class

Child class of Page. A detail page listing a user's tags.

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
TagDetail[] tagsList of tags visible to the user viewing the page.
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

ThreePostsEntry Class

Members

string permalink_urlUrl to entry (Read-only)
Image picPicture from text of entry
string subjectSubject of entry (Read-only)
string textEntry Text (Read-only)
bool videoExists video in post (Read-only)

User Class

Child class of UserLite. A more information-rich userinfo structure

Members

Link{} data_linkLinks to various machine-readable data sources relating to this user
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Image default_picInformation about default userpic
string journal_typeType of account: P (personal), C (community), Y (syndicated), S (shared), I (external identity) etc (Read-only)
string[] link_keyseqArray of keys which can be passed into the get_link
string medius_category_keywordmedius category keyword for user profile (Read-only)
string medius_category_namemedius category name for user profile (Read-only)
string nameUser's formatted name, ex: John Q. Public (Read-only)
int useridNumeric ID of the account (Read-only)
string usernameCanonical Username, ex: johnqpub. Note that if journal_type is an external identity, there will be no username, so this field will be a display version of their URL, longer than 15 characters, and with characters other than a-z, 0-9 and underscore. (Read-only)
string userpic_listing_urlURL of a page listing this user's userpics (Read-only)
string website_name'pretty' name of user's website (Read-only)
string website_urlURL pointer to user's website (Read-only)

Methods

as_string() : string 
base_url() : stringReturns URL of user's journal.
equals(UserLite u) : boolReturns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.
get_link(string key) : LinkReturns a link based on the given key, or null if the link is unavailable
ljuser() : stringReturns an LJ user tag for the user.
ljuser(Color link_color) : stringReturns an LJ user tag for the user. The color of the link will be link_color.
ljuser(string{} opts) : stringReturns an LJ user tag with journal attribute for the user.
print() : void 
print_linkbar() : voidPrint the link bar for this user/journal.
tag_manage_url() : stringReturns URL to user's tag management page.

UserExtended Class

Child class of UserLite. A more information-rich userinfo structure

Members

Link{} data_linkLinks to various machine-readable data sources relating to this user
string[] data_links_orderAn array of data views which can be used to order the data_link hash
Image default_picInformation about default userpic
string entry_countCount entries of user (Read-only)
string friendof_countCount friends of user (Read-only)
string friends_countCount user's personal/identity/shared friends (Read-only)
string journal_typeType of account: P (personal), C (community), Y (syndicated), S (shared), I (external identity) etc (Read-only)
DateTime last_entry_timeTime of last posted entry (Read-only)
string[] link_keyseqArray of keys which can be passed into the get_link
string nameUser's formatted name, ex: John Q. Public (Read-only)
int social_capitalSocial capital of user (Read-only)
DateTime timecreateDate of creating account (Read-only)
int useridNumeric ID of the account (Read-only)
string usernameCanonical Username, ex: johnqpub. Note that if journal_type is an external identity, there will be no username, so this field will be a display version of their URL, longer than 15 characters, and with characters other than a-z, 0-9 and underscore. (Read-only)

Methods

as_string() : string 
base_url() : stringReturns URL of user's journal.
equals(UserLite u) : boolReturns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.
get_link(string key) : LinkReturns a link based on the given key, or null if the link is unavailable
ljuser() : stringReturns an LJ user tag for the user.
ljuser(Color link_color) : stringReturns an LJ user tag for the user. The color of the link will be link_color.
ljuser(string{} opts) : stringReturns an LJ user tag with journal attribute for the user.
print() : void 
print_linkbar() : voidPrint the link bar for this user/journal.
tag_manage_url() : stringReturns URL to user's tag management page.

UserLink Class

A user-defined link to an outside resource.

Members

string attributesThe link attributes for 'a' tag (Read-only)
UserLink[] childrenNot Implemented: An array of child UserLink objects. (Read-only)
bool is_headingIs this link a heading or category name? If so, it has no url and a list of children. (Read-only)
string titleThe title or label for the link (Read-only)
string urlThe url to which the link points (Read-only)

UserLite Class

A 'lite' version of a User which the system often has more readily-available than a full version.

Members

Link{} data_linkLinks to various machine-readable data sources relating to this user
string[] data_links_orderAn array of data views which can be used to order the data_link hash
string journal_typeType of account: P (personal), C (community), Y (syndicated), S (shared), I (external identity) etc (Read-only)
string[] link_keyseqArray of keys which can be passed into the get_link
string nameUser's formatted name, ex: John Q. Public (Read-only)
int useridNumeric ID of the account (Read-only)
string usernameCanonical Username, ex: johnqpub. Note that if journal_type is an external identity, there will be no username, so this field will be a display version of their URL, longer than 15 characters, and with characters other than a-z, 0-9 and underscore. (Read-only)

Methods

as_string() : string 
base_url() : stringReturns URL of user's journal.
equals(UserLite u) : boolReturns true if the two user objects refer to the same user. Use this rather than comparing usernames, since usernames aren't globally unique.
get_link(string key) : LinkReturns a link based on the given key, or null if the link is unavailable
ljuser() : stringReturns an LJ user tag for the user.
ljuser(Color link_color) : stringReturns an LJ user tag for the user. The color of the link will be link_color.
ljuser(string{} opts) : stringReturns an LJ user tag with journal attribute for the user.
print() : void 
print_linkbar() : voidPrint the link bar for this user/journal.
tag_manage_url() : stringReturns URL to user's tag management page.

YearDay Class

Information on how to link to a day in the year archive

Members

Date dateDate of day
int dayDay of month number
int num_entriesNumber of entries made on this day
string urlA URL to view the day, if there are entries, else blank. (Read-only)

YearMonth Class

A month on the YearPage.

Members

bool has_entriesIf this is false, you probably don't want to display this month.
int monthThe number of the month
Date next_dateDate of next month, with day of zero, or null if none.
string next_urlA url to link to in order to view the next month. (Read-only)
Date prev_dateDate of previous month, with day of zero, or null if none.
string prev_urlA url to link to in order to view the previous month. (Read-only)
string urlA url to link to in order to view this month. (Read-only)
YearWeek[] weeksAn array of the weeks of the month (for ease of building a row-per-week calendar)
int yearThe number of the year

Methods

month_format() : stringReturns month formatted long (February 1980) /// SeeAlso: siteapi.core1.dateformats
month_format(string fmt) : stringReturns time formatted as indicated by $fmt, or 'long' if blank. /// SeeAlso: siteapi.core1.dateformats

YearPage Class

Child class of Page. Entire calendar page for a single year.

Members

string{} argsArguments from the URL's query string (after the question mark). S2 code can only access arguments starting with a period, and this period is not included in the hash key. (Read-only)
string base_urlThe base URL of the journal being viewed. (Read-only)
Link{} data_linkLinks to various machine-readable data sources relating to this page
string[] data_links_orderAn array of data views which can be used to order the data_link hash
string global_subtitleA sub-title selected by the user for their whole journal. (Read-only)
string global_titleA title selected by the user for their whole journal. (Read-only)
string head_contentExtra tags supplied by the server to go in the <head> section of the output HTML document. Layouts should include this in the head section if they are writing HTML. (Read-only)
User journalUser whose journal is being viewed
string journal_facebook_linkUrl to linked Facebook account (Read-only)
string journal_telegram_channel_linkUrl to linked Telegram channel (Read-only)
string journal_twitter_linkUrl to linked Twitter account (Read-only)
string journal_typeJournal type, ex: 'P' (personal), 'C' (community), etc. (Read-only)
string journal_vkontakte_linkUrl to linked Vkontakte account (Read-only)
UserLink[] linklistAn array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
YearMonth[] months12 months objects, even if no entries are in that month.
string page_idThe page identifier- what to pass to /identity/login.bml so that it returns to this page after a successfull authorization. (Read-only)
bool showspamSet to true if need show only spam messages.
string stylesheet_urlThe URL to use in a link element for the server-supported external stylesheet to put stuff in it) (Read-only)
DateTime timeA DateTime object filled with the time (GMT) when the page was created. (Read-only)
string viewThe view type (recent, friends, archive, month, day, entry) (Read-only)
bool view_my_gamesView my games on profilepage.
string{} view_urlLinks to top-level views where id equals the name of the view being linked to. (if one of views == $.view, already looking at that view) (Read-only)
string[] views_orderAn array of view identifiers which can be used to order the views hash. (Read-only)
int yearThe year being viewed
YearYear[] yearsInformation for linking to other years

Methods

appview(string{} opts) : stringReturns rendered aplication(s) view(s).
bool_as_string(bool input) : stringReturns bool as string. This allows to print the bool variable value
get_alien_post(string url) : EntryReturns any public entry from any journal having give_posts_to_alien prop. Recipient must have get_alien_posts prop
get_entries_by_ids(int[] ids) : Entry{}Returns entries by the specified ids
get_entries_by_tag_lite(string tag, int count, bool preload_text) : Entry[]Returns last 'count' entries with the specified tag; lite version of method get_entries_by_tags; make object Entry with minimum parameters
get_entries_by_tags(string[] taglist, string mode, int count) : Entry[]Returns last 'count' entries with the specified tag(s); returns the entries containing all of them or any of them, depending on 'mode'; does not work in untrusted journals
get_entry_by_id(int id) : EntryReturns entry by the specified id
get_first_image(Entry e) : stringReturns first image in entry as img tag
get_first_image_url(Entry e) : stringReturns url of the first image in entry
get_fullimage_wrapper() : stringReturns markup for full size image view
get_last_entries(string ljname, int count) : Entry[]Returns last 'count' entries from selected journal for LJTimes verticals.
get_latest_month() : YearMonthReturns information about the latest month the user posted (or the current month, if no posts), so that the page may include a mini-calendar or similar features.
get_lj_bubble() : stringReturns div with lj-buble markup
get_lj_entry_likus() : stringReturns div with lj-likus markup
init_appviews() : voidInclude JS/CSS for application view(s).
is_journalpromo() : boolReturn true if journal promo is not empty and was not shown.
journalpromo() : stringReturns rendered journal promo.
need_res(string[] resources) : voidAppends resoures to header content with correct timestamp.
need_res(string{} options, string[] resources) : voidAppends resoures to header content with correct timestamp.
print() : voidThe main entry point that LiveJournal calls. Layouts should override this to create HTML that's the same for all view types, and use $this->title, $this->head and $this->body to include view-specific content into the template.
print_ad(string type) : voidDeprecated function. Use print_hbox_(top|bottom) or print_vbox from now on.
print_ad_box(string type) : voidPrints an side bar of site-specific content on a journal.
print_body() : voidCall from Page.print() to render parts of the view that are specific to the view, eg print the recent set of journal entries, recent friends entries, or rows of user information
print_button(string type, string title, string class) : stringReturns a structure for button
print_button(string type, string title, string class, string{} args) : stringReturns a structure for button
print_control_strip() : voidPrints a control strip for the user's convenience
print_custom_head() : voidLayers can override this to add extra HTML to the head section of the HTML document. Note that layouts are not intended to override this method.
print_entry(Entry e) : voidOutput a journal entry. Layouts should override this and the inherited versions in RecentPage, FriendsPage and DayPage to change how entries display.
print_entry_poster(Entry e) : voidOutput a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : voidPrints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : voidPrints an horizontal bar of site-specific content at the top of a journal.
print_head() : voidPrint server side supplied head content. This is a fixed function, so you can't override it. See Page.print_custom_head() if you want to supply custom head content.
print_linklist() : voidPrint the list of UserLink objects specified by the user.
print_month(YearMonth m) : voidPrint the calendar cell for the given month
print_pagewide_slot() : voidPrints page-wide slot.
print_reply_container(string{} opts) : voidPrints the area in which the quickreply box will go. Options you may specify are 'target' which will be the target id, and 'class' which will be the CSS class used by the container. If no container is available, quickreply will not work.
print_reply_link(string{} opts) : voidPrints a link to reply to the comment. You may specify the link text in the 'linktext' option, the link CSS class in 'class', and the target container in the 'target' option. You may also specify the url of an image to use as a button in 'img_url'.
print_show_spam_button() : voidShow Spam Button.
print_stylesheets() : voidPrints all defined stylesheets, including default and user-defined ones.
print_svg(string name) : stringReturns a contents of svg file
print_trusted(string key) : voidPrints a trusted string by key.
print_vbox() : voidPrints an vertical bar of site-specific content on a journal.
print_yacontext_slot() : voidPrints slot for slot yandex context.
print_yacontext_slot(string custom_class, string slot) : voidPrints slot for slot yandex context.
print_year_links() : voidPrint the navigation links to move between years
remove_unusable_images(string[] images) : string[]Removes userheads and polls images from array of images urls
render_appview(string{} opts) : voidPrint rendered application(s) view(s).
render_journalpromo() : boolPrint rendered journal promo and return true if journal promo is not empty.
render_resource(int{} opts) : stringReturns a string containing external resources and meta information (js, css, meta, rss).
render_widget(string{} opts) : voidPrints rendered widget body.
str_comment_page(string type) : stringReturn current number page as string for current page comments. Parameter type may be "desc" or "title"
svg_icon(string name) : stringReturns a structure for one svg icon
svg_icon(string name, string class) : stringReturns a structure for one svg icon
title() : stringReturn a relevant combination of Page.global_title and Page.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : stringReturn a title for this particular page, such as "Friends' Recent Entries" for the friends view, or a date for the day view. Should be overridden in i18n layers. Ideally, layout layers should never override this. See Page.title().
viewer_sees_journalpromo() : boolReturn true if journal promo is not empty.
viewer_sees_sidebar_ads() : boolReturns true if viewer sees any slots in sidebar
visible_tag_list() : TagDetail[]Returns an array of tags that the logged in user can see for the journal being viewed.
widget(string{} opts) : stringReturns rendered widget body.

YearWeek Class

Represents a week on the YearMonth on the YearPage.

Members

YearDay[] daysAn array of the days of the week (0=sunday)
int post_emptyHow many days at the end of the week are blank? (From next month)
int pre_emptyHow many days at the start of the week are blank? (From previous month)

Methods

print() : voidPrint formatted week

YearYear Class

Information on how to link to a year in the year archive

Members

bool displayedIf this is the year currently being displayed, this will be true.
string urlURL to link to for this year. (Read-only)
int yearNumber of the year, eg 2001.