S2:Page/MonthPage

From No LJ Ads Wiki

Jump to: navigation, search

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

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.
Date date Date of this month, with day of zero.
MonthDay[] days One element for each day of the month.
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 MonthPage.print_head())
User journal User whose journal is being viewed.
string journal_type Journal type, ex: 'P' (personal) 'C' (community), etc. (Read-only)
UserLink[] linklist An array of UserLink objects defined by the user to be displayed on their journal. (Read-only)
MonthEntryInfo months Other months this journal has entries.
Date next_date Date of next month, with day of zero, or null if none.
string next_url URL of next month, or empty string if none. (Read-only)
Date prev_date Date of previous month, with day of zero, or null if none.
string prev_url URL of previous month, or empty string if none. (Read-only)
Redirector redir Necessary to make a form which POSTs to a redirector.
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 MonthPage.print_stylesheets())
DateTime time A DateTime object filled with the time (GMT) when the page was created. (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 == MonthPage.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 MonthPage.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 MonthPage.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 MonthPage.print_custom_head() and prints MonthPage.head_content)
print_linklist() : void Print the list of UserLink objects specified by the user.
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 MonthPage.global_title and MonthPage.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 MonthPage.title().
visible_tag_list() : TagDetail[] Returns an array of tags that the remote viewer can see for the journal being viewed.