S2 Generator with Usericons - for platypus and anyone else interested.
Jun 10, 2005 22:33
First, make sure your journal is set to use S2. Go to the Customization page and choose the "New System (S2)" and press the Change button.
Next, click on the link at the bottom of the Customization page that says "visit the advanced customization center". Then, click the link under Advanced Options that says "Your Layers" to make a new customized layer.
On the "Your Layers" page, go to the bottom of the page, look for where it says "Create top-level layer". Choose "Layout" for the type. Click the "Create" button. You will return to the "Your Layers" page.
Near the top, you'll see a table with LayerID, Type, Name, Actions. Find the one closest to the top of the page that has a Type of "layout" and a Name of "(none)". Click the button that says "Edit" next to this layer.
On the "Edit layer source" page, you'll see a giant text box. Delete all the text in this box (probably just two lines) then copy all of this (select all):
# -*-s2-*-
layerinfo type = "layout"; layerinfo name = "Generator with Usericons";
propgroup colors { property Color entry_back { des = "Entry background"; s1color = "page_back"; } property Color entry_text { des = "Entry text color"; s1color = "page_text"; } property Color page_link { des = "Link color"; s1color = "page_link"; } property Color page_vlink { des = "Visited link color"; s1color = "page_vlink"; } property Color page_alink { des = "Active link color"; s1color = "page_alink"; } property Color page_back { des = "Page background color (and around userpics)"; s1color = "strong_back"; } property Color stronger_back { des = "Background color for the bar above entries"; s1color = "strong_back"; } property Color stronger_text { des = "Text color for the bar above entries"; s1color = "stronger_text"; } property Color weak_back { des = "Background color for the bar below entries"; s1color = "weak_back"; } property Color weak_text { des = "Text color for the bar below entries"; s1color = "weak_text"; } property Color comment_bar_one_bgcolor { des = "Alternating background color for comment bars (one)"; } property Color comment_bar_two_fgcolor { des = "Text color on alternating comment bars (one)"; } property Color comment_bar_two_bgcolor { des = "Alternating background color for comment bars (two)"; } property Color comment_bar_one_fgcolor { des = "Text color on alternating comment bars (two)"; } property Color comment_bar_screened_bgcolor { des = "Background bar color for screened comments"; } property Color comment_bar_screened_fgcolor { des = "Text color on background bar for screened comments"; } }
propgroup fonts { property use font_base; property use font_fallback; }
propgroup presentation { property use page_recent_items; property use page_friends_items; property int box_width { des = "Box width (pixels)"; }
property use view_entry_disabled; property use use_shared_pic; property use comment_userpic_style; property bool show_entrynav_icons { des = "Toggle to show the next, memory, edit, etc icons on the entry view page"; } property string page_background_image { des = "URL to an image to be used for the page background"; } property use external_stylesheet; property use linklist_support; }
propgroup text { property use text_post_comment; property use text_read_comments; property use text_post_comment_friends; property use text_read_comments_friends; property use text_meta_music; property use text_meta_mood;
property string text_website { des = "The label for the 'website' field"; noui = 1; } }
# Set default colors set entry_back = "#ffffff"; set entry_text = "#000000"; set page_link = "#0000ff"; set page_vlink = "#0000ff"; set page_alink = "#00ffff"; set page_back = "#2d4f89"; set stronger_back = "#000000"; set stronger_text = "#ffffff"; set weak_back = "#aaaaaa"; set weak_text = "#000000"; set comment_bar_one_bgcolor = "#aaaaaa"; set comment_bar_one_fgcolor = "#000000"; set comment_bar_two_bgcolor = "#dddddd"; set comment_bar_two_fgcolor = "#000000"; set comment_bar_screened_bgcolor = "#5f6f99"; set comment_bar_screened_fgcolor = "#000000";
set box_width = 600; set show_entrynav_icons = true; set page_background_image = "";
set font_base = "Verdana"; set font_fallback = "sans-serif";
# Customize the view names to be short and lowercase # (Sorry translators, you'll have to do these again - keep them short!) set text_view_recent = "entries"; set text_view_friends = "friends"; set text_view_archive = "archive"; set text_view_userinfo = "userinfo";
"""; if (size $.linklist > 0 and $*linklist_support) { $this->print_linklist(); } """
"""; $this->print_body();
"""
"""; }
function print_entry (Page p, Entry e, Color bgcolor, Color fgcolor, bool hide_text) { var string datetime; $datetime = $e.time->date_format("med")+"|" + $e.time->time_format() + "";
"""
""";
if ($e.security != "") { $e.security_icon->print(); }
""" $e.subject
[$datetime]
""";
if ($p.view == "entry" and $*show_entrynav_icons) { print "
"; $e->print_linkbar(); print "
"; }
if ($p.view == "friends" or $p.journal_type == "C" or $e.poster.username != $e.journal.username) { var UserLite linkto; var bool showposter; if ($p.view == "recent" and $p.journal_type == "C") { $linkto = $e.poster; $showposter = false; } else { $linkto = $e.journal; $showposter = true; }
""; if ($e.poster.username != $e.journal.username and $showposter) { " [ $e.poster->base_url() + "/\">$e.poster.username]"; } "
"; }
var string metadata; if ($e.metadata) { $metadata = """
"""; foreach var string k ($e.metadata) { var string text = $k; var string val = $e.metadata{$k}; if ($k == "mood") { $text = $*text_meta_mood; } elseif ($k == "music") { $text = $*text_meta_music; } if ($k == "mood" and defined $e.mood_icon) { var Image i = $e.mood_icon; $val = " $val"; } $metadata = """$metadata\n
[
$text
|
$val
]
"""; } $metadata = """$metadata
"""; }
if (not $hide_text) { print $metadata; print $e.text; } """
function FriendsPage::print_entry (Entry e) { var Friend f = $.friends{$e.journal.username}; print_entry($this, $e, $f.bgcolor, $f.fgcolor, false); }
function RecentPage::print_body () { foreach var Entry e ($.entries) { $this->print_entry($e); }
var string range = "most recent entries"; if ($.nav.skip > 0) { $range = "$.nav.skip entries back"; }
"""
border="0" summary="">
border="0" summary="">
navigation
cellpadding="0" border="0" summary="">
[
viewing
|
$range
]
""";
# go forward/backward if possible if ($.nav.forward_url != "" or $.nav.backward_url != "") { var string sep; var string back; var string forward; if ($.nav.backward_url != "") { $back = """earlier"""; } if ($.nav.forward_url != "") { $forward = """later"""; } if ($back != "" and $forward != "") { $sep = "/"; } """
[
go
|
$back$sep$forward
]
"""; }
""; }
function CommentInfo::print () { if (not $.enabled) { return; } if ($.count > 0 or $.screened) { ""; $this->print_readlink(); ""; "|"; } $this->print_postlink(); }
function YearPage::print_year_links () { """
Years
"""; foreach var YearYear y ($.years) { if ($y.displayed) { "$y.year "; } else { "$y.year "; } } """
""";
}
function YearPage::print_month (YearMonth m) { if (not $m.has_entries) { return; } """
function EntryPage::print_comment (Comment c) { var Color background; var Color color; if ($c.screened) { $background = $*comment_bar_screened_bgcolor; $color = $*comment_bar_screened_fgcolor; } elseif ($c.depth % 2) { $background = $*comment_bar_one_bgcolor; $color = $*comment_bar_one_fgcolor; } else { $background = $*comment_bar_two_bgcolor; $color = $*comment_bar_two_fgcolor; } var string poster = defined $c.poster ? $c.poster->as_string() : "(Anonymous)"; var string sub_icon; if (defined $c.subject_icon) { $sub_icon = $c.subject_icon->as_string(); } "
"; "
"; if (defined $c.userpic and $*comment_userpic_style != "off") { var int w = $c.userpic.width; var int h = $c.userpic.height; # WARNING: this will later be done by the system (it'll be a # constructional property), so don't copy this hack into your # layout layers or you'll be messed up later. if ($*comment_userpic_style == "small") { $w = $w / 2; $h = $h / 2; } print "
and paste it in the giant box on the Edit layer source page. Press the button near the top of the page that says "Compile".
Now, go to the regular old Customization page. Under Step 1: Layout, click the dropdown menu and go all the way to the bottom. Choose the option that says "Generator with Usericons" (your newly created layout!). Then click the button that says "Change".
Voila! You are using the new layout.
Now, if you want to customize further, go back to the Customization page and go down towards the bottom. Click the button that says Edit Customizations. From here you can choose different colors (you don't have to know the hex#, just click the colored box and pick a new color), you can change the text on "leave a comment", change the number of entries per page, etc.
Let me know if you have any questions or problems or whatever. And enjoy!