S2 (FotoBilder)
From No LJ Ads Wiki
Contents |
[edit] General Information
S2 also exists in FotoBilder but it's different than the S2 classes that are on LiveJournal.
Revision #1.74 can be found here. The live version can be found here.
[edit] Layer Info
| majorversion | 1 |
| name | FotoBilder Core, version 1 |
| redist_uniq | core1 |
| type | core |
[edit] Properties Set
| font_base* | |
| font_fallback* | none |
| gallery_page_max_size | 25 |
| gallery_page_min_size | 1 |
| index_page_max_size | 25 |
| show_exif | no |
| text_link_gallery | Back to Gallery |
| text_link_index | Back to Index |
| text_months_short | List: (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) |
| text_nogalleries | There are no galleries to display. |
| text_nopictures | There are no pictures to display. |
| text_range_first | First |
| text_range_last | Last |
| text_range_next | Next |
| text_range_prev | Previous |
[edit] Properties Not Set
| PALIMGROOT+ | [returns string to PALIMG directory] |
| thumbnails | [?] |
| thumbnail_size | [general size of thumbnails] |
| thumbnail_style | [general focus of thumbnails] |
[edit] Default Propgroups
| background | Background |
| colors | Colors |
| fonts | Fonts |
| presentation | Presentation |
| text | Text |
[edit] Global Functions
PalItem(int index, Color c) : PalItem*
| Convenience constructor to make populating an array of PalItems (like in palimg_modify) easy. |
alter_url(string url, string{} newargs) : string
| Returns a URL, modifying the given $url, changing or adding the given arguments. |
alter_url(string{} new_args) : string
| Returns a URL, modifying the URL of the current page, changing or adding the given arguments. |
ehtml(string text) : string*
| Escapes all tags & quotes from the text. |
ejs(string text) : string
| Escapes a string so it can be put into a JavaScript variable. |
get_page() : Page*
| Gets the top-level Page instance that FotoBilder ran the Page::print() method on. |
int(string s) : int*
| Returns an integer from a string. |
linkif(bool linkcond, string text, string url) : string
| Convenience function for optionally making a link to a piece of $text. If $linkcond is true, then an anchor tag to $url is wrapped around $text and returned. Otherwise, $text is returned. |
linkif(string text, string url) : string
| Returns $text linked to $url if $url is not an empty string. |
load_gallery_previews(Gallery[] gals, bool recurse) : void
| Pre-loads the preview image data for the given galleries. If $recurse is true, then the previews for gallery children are loaded too. |
palimg_create(string spec) : Image
| Returns an Image object representing an image with its palette table modified. The $spec is pipe-delimited with joined arguments being: resource name, width, height, and then property names representing the color to replace for each palette index. The resource name can be either a full URL or a relative one from the site's /img/ directory. Example spec: "simplecontrols/up.gif|32|32|fgcolor|bgcolor" would mean, take $SITEROOT/img/simplecontrols/up.gif and return a 32x32 image with palette index #0 being color $*fgcolor and palette index #1 being color $*bgcolor. If the palette indexes you want to modify are not contiguous, just leave the field blank for that property name and it won't be modified. |
palimg_gradient(string filename, PalItem start, PalItem end) : string*
| Return 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) : string*
| Return 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) : string*
| Return 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) : string*
| Return 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_stylesheet() : void*
| Prints a stylesheet, the URL of which can be referenced by Page.stylesheeturl. This is another S2 entry point, in addition to Page::print(). |
prop_init() : void*
| This 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 like $*gallery_page_max_size based on your own custom properties, do it here. You can't print from this function. |
rand(Picture[] pics) : int
| Returns a random index into the given $pics array. |
rand(int high) : int*
| Returns a random integer between 1 and $high, inclusive. |
rand(int low, int high) : int*
| Returns a random integer between $low and $high, inclusive. |
rand_pic(Picture[] pics) : Picture
| Returns a random picture from the given $pics array. |
set_content_type(string text) : void
| Sets the content type for the page being returned. Must be called before anything is printed. |
set_http_status(int num) : void
| Sets the HTTP status to be returned. Must be called before anything is printed. |
string(int i) : string*
| Returns a string from a integer. |
viewer_is_owner() : bool*
| Returns true if the user viewing the page is both logged in, and is the owner of the picture/gallery being viewed. If so, it's recommended you link to the management area for that picture/gallery. |
viewer_logged_in() : bool*
| Returns true if the user viewing the page is logged in. It's recommended that your page links to the site login page if user isn't logged in. |
[edit] Classes
| Alphabetical | Hierarchical |
[edit] Footnotes
[edit] diff
+: Different from LJ S2.
[edit] same
*: Same as LJ S2.

