S2:Page/MessagePage

From No LJ Ads Wiki

Jump to: navigation, search

A page showing an error or confirmation message.

S2 - Page

[edit] Members

string{} args Arguments 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_url The base URL of the journal being viewed. (Read-only)
Link{} data_link Links to various machine-readable data sources relating to this page.
string[] data_links_order An array of data views which can be used to order the data_link hash.
string global_subtitle A sub-title selected by the user for their whole journal. (Read-only)
string global_title A title selected by the user for their whole journal. (Read-only)
string head_content Extra 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) (Editor's note: This is printed by MessagePage.print_head())
User journal User whose journal is being viewed.
string journal_type Journal type, ex: 'P' (personal) 'C' (community), etc. (Read-only)
string[] link_keyseq A list of links, indicated by key, that should be displayed alongside this error. They should ideally be displayed in a way similar to the entry links displayed on the entry page.
UserLink[] linklist An array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
Link{} links An associative array of links to be displayed alongside this message. Iterate over MessagePage.link_keyseq to find the keys.
string message The body of the message. Do not print this directly; use MessagePage.print_body() instead. (Read-only)
string stylesheet_url The URL to use in a link element for the esrver-supported external stylesheet to put stuff in it. (Read-only) (Editor's note: This is printed by MessagePage.print_stylesheets())
DateTime time A DateTime object filled with the time (GMT) when the page was created. (Read-only)
string title The title of the message (Read-only)
string view The view type (recent, friends, archive, month, day, entry, tags) (Read-only)
string{} view_url Links to top-level views where id equals the name of the view being linked to. (if one of views == MessagePage.view, already looking at that view) (Read-only)
string[] views_order An array of view identifiers which can be used to order the views hash. (Read-only)

[edit] Methods

get_latest_month() : YearMonth Returns 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.
print() : void The 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->print_body() to include view-specific content into the template.
print_ad(string type) : void Deprecated function. Use print_hbox_(toplbottom) or print_vbox() from now on.
print_body() : void Call from MessagePage.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_control_strip() : void Prints a control strip for the user's convenience
print_custom_head() : void Layers 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. (Editor's note: This is called by MessagePage.print_head())
print_entry(Entry e) : void Output 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) : void Output a line of text which says who posted an entry (just "user", or "user posting in somejournal")
print_hbox_bottom() : void Prints an horizontal bar of site-specific content at the bottom of a journal.
print_hbox_top() : void Prints an horizontal bar of site-specific content at the top of a journal.
print_head() : void Print 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. (Editor's note: This calls MessagePage.print_custom_head() and prints MessagePage.head_content)
print_linklist() : void Print the list of UserLink objects specified by the user.
print_links() : void Print the links from the MessagePage.links and MessagePage.link_keyseq members. Layouts will probably want to override this.
print_message() : void Print the message. Call this rather than printing MessagePage.message directly.
print_reply_container(string{} opts) : void Prints 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) : void Prints 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_stylesheets() : void Prints all defined stylesheets, including default and user-defined ones.
print_trusted(string key) : void Prints a trusted string by key.
print_vbox() : void Prints a vertical bar of site-specific content on a journal.
title() : string Return a relevant combination of MessagePage.global_title and MessagePage.view_title(). May be overridden in layout layers or left untouched for the core layer to handle.
view_title() : string Return 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 MessagePage.title().
visible_tag_list() : TagDetail[] Returns an array of tags that the remote viewer can see for the journal being viewed.