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";

set text_website = "website";

function print_stylesheet () {
print clean_url($*page_background_image) != "" ? "body { background-image: url($*page_background_image); }" : "";
"""body, td {
""";
if ($*font_base != "" or $*font_fallback != "none") {
"font-family: ";
if ($*font_base != "") {
"\"$*font_base\"";
if ($*font_fallback != "none") {
", ";
}
}
if ($*font_fallback != "none") {
print $*font_fallback;
}
";\n";
}
"""font-size: 10pt;
}
tt, pre {
font-family: monospace;
}
a {
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
.shadowed {
font-size: 8pt;
background: $*weak_back;
}
.meta {
font-size: 8pt;
}
.index {
font-size: 8pt;
}
.caption, .index {
color: $*stronger_text;
}
.comments {
font-size: 8pt;
}

""";
}

function Page::lay_top_userpic () {
var Image up_img = $.journal.default_pic;
if (defined $up_img) {
"""


""";
}
}
function FriendsPage::lay_top_userpic () { }

function Page::print_linklist() {
if (size $.linklist <= 0) {
return;
}

println """


border='0'
summary=''>


border='0'
summary=''>


Links

border='0'
summary=''>




cellpadding='0'
border='0'
summary=''>
""";
var bool section_open = false;
if (not $.linklist[0].is_heading) {
println """""";
}
println """""";

"
[Links:|""";
$section_open = true;
}
foreach var UserLink l ($.linklist) {
if ($l.title) {
if ($l.is_heading) {
if ($section_open) {
println """
]
[$l.title|""";
$section_open = true;
} else {
println """$l.title """;
}
}
}
println """
]




";
}

function Page::print ()
{
var string title = $this->title();

var string website_name = $.journal.website_name ? $.journal.website_name : $*text_website_default_name;
var string website;
if ($.journal.website_url != "") {
$website = """[
$*text_website
|
$website_name
]""";
}

var string links;
var bool firstlink = true;
foreach var string v ($.views_order) {
if ($firstlink == false) {
$links = "$links|";
}
else {
$firstlink = false;
}
$links = $links + ($.view == $v ?
""+lang_viewname($v)+"" :
""+lang_viewname($v)+"");
}

"""http://www.w3.org/TR/html4/loose.dtd">\n\n\n""";

if ($*external_stylesheet) {
println """""";
} else {
println """";
}
$this->print_head();

"""$title



border="0"
summary="">


border="0"
summary="">



$title[$links]

border="0"
summary="">



cellpadding="0"
border="0"
summary="" style="margin-left: auto; margin-right: auto;">
""";
$this->lay_top_userpic();

var string sitename_lc = $*SITENAMESHORT->lower();

"""


$.journal.name


cellpadding="0"
border="0"
summary="">
$website














["""+lang_viewname("userinfo")+"""|$sitename_lc userinfo]
["""+lang_viewname("archive")+"""|journal archive]





""";
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 ($p.view != "entry" and $p.view != "reply") {
"";
} elseif ($e.comments.enabled) {
"";
} else {
"";
}
"""
""";

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;
}

"""
""";
"""""";
"""
base_url() + "\">";
if (defined $e.userpic) {
"""
""";
}

"$linkto.username
";
if ($e.poster.username != $e.journal.username and $showposter) {
"
[ $e.poster->base_url() + "/\">$e.poster.username]";
}
"
";
}

if ($p.view == "recent")
{
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;
}

"""
""";
"""""";
"""
base_url() + "\">";
if (defined $e.userpic) {
"""
""";
}

"
";
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
""";
}
$metadata = """$metadata
[$text |$val]

""";
}

if (not $hide_text) { print $metadata; print $e.text; }
"""


$*text_permalink
"; $e.comments->print(); ""; $e.comments->print_postlink(); "

""";

} # print_entry(Page,Entry,Color,Color,bool)

function Page::print_entry (Entry e) {
print_entry($this, $e, null Color, null Color, false);
}

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="">







""";

# 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 = "/"; }
"""





""";
}

"
[viewing|$range]
[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; }
"""









""";
print $m->month_format();
"""
[subjects]




""";
foreach var int d (weekdays()) {
"\n";
}

"";

foreach var YearWeek w ($m.weeks) {
$w->print();
}

"""
"+$*lang_dayname_short[$d]+"

""";
}

function YearWeek::print () {
"";
if ($.pre_empty) { ""; }
foreach var YearDay d ($.days) {
"""

$d.day
""";
if ($d.num_entries) {
"""""";
} else {
" ";
}
"";
}
if ($.post_empty) { ""; }
"";
}

function DayPage::print_body() {

"""


""";

if ($.has_entries) {
print $.date->date_format("long");
} else {
print ehtml($*text_noentries_day);
}

"""

""";

foreach var Entry e ($.entries) {
$this->print_entry($e);
}

var string tprev = ehtml($*text_day_prev);
var string tnext = ehtml($*text_day_next);
var string daylong = $.date->date_format("long");

"""










navigation

















[viewing|$daylong]
[go|$tprev|$tnext]


""";

}

function MonthPage::print_body () {
"""






""";

print $.date->date_format($*lang_fmt_month_long);

"""
""";

#Lifted from core, looks decent:
"
";
$.redir->print_hiddens();
if ($.prev_url != "") { "[<<<]\n"; }
if (size $.months > 1) {
"\n";
}
if ($.next_url != "") { "\n[>>>]\n"; }
"
\n
";
foreach var MonthDay d ($.days) {
if ($d.has_entries) {
"
";
print lang_ordinal($d.day);
"
\n
";
$d->print_subjectlist();
"
\n";
}
}
"
\n";
"""

""";
}

function EntryPage::print_body () {

print_entry($this, $.entry, null Color, null Color, $.viewing_thread);

if ($.entry.comments.enabled and $.comment_pages.total_subitems > 0)
{
$this->print_multiform_start();
"""






""";

"""
Comments:
""";

$.comment_pages->print();

set_handler("unscreen_comment_#", [
[ "style_bgcolor", "cmtbar#", "$*comment_bar_one_bgcolor", ],
[ "style_color", "cmtbar#", "$*comment_bar_one_fgcolor", ],
]);
set_handler("screen_comment_#", [
[ "style_bgcolor", "cmtbar#", "$*comment_bar_screened_bgcolor", ],
[ "style_color", "cmtbar#", "$*comment_bar_screened_fgcolor", ],
]);

$this->print_comments($.comments);
$.comment_pages->print();
"""

""";

if ($this.multiform_on) {
"""






""";

"""
Mass Action:
""";
$this->print_multiform_actionline();
"""

""";
$this->print_multiform_end();
}
}
}

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 "";
}

"
[User Picture]";

### From, date, etc
"";

### Gadgets
"";

### Subject / icon
print "";

### Permalink
print "";

print "
";
print "";
print "\n";
print "";
if ($c.metadata{"poster_ip"}) { print ""; }
"
From:$poster
Date:";
print $c.time->date_format("long") + " - " + $c.time->time_format() + "
IP Address:(" + $c.metadata{"poster_ip"} + ")
";
if ($this.multiform_on) {
" ";
$c->print_multiform_check();
}
$c->print_linkbar();
"
";
print (defined $c.subject_icon or $c.subject != "") ? "

$c.subject_icon $c.subject

" : "";
print "
(Link)
";
print "
$c.text
";
print "
";

"";
if ($c.frozen) {
"(Replies frozen) ";
} else {
"(Reply to this) ";
}
"
";

if ($c.parent_url != "") { "(Parent) "; }
if ($c.thread_url != "") { "(Thread) "; }
"
";
}

function ReplyPage::print_body () {
if (not $.entry.comments.enabled) {
"""






$*text_reply_nocomments_header
""";

print "

$*text_reply_nocomments

";
"""

""";
return;
}
var string datetime;
$datetime = $.replyto.time->date_format("med")+"|" + $.replyto.time->time_format() + "";
"""












$.replyto.subject$datetime




""";

if (defined $.replyto.poster) {
"";
if (defined $.replyto.userpic) {
""" """height="$.replyto.userpic.height" alt="">
""";
}
"$.replyto.poster.username
";
} else {
print "Anonymous";
}

"""
$.replyto.text

$*text_permalink
Read Comments

""";

"""








Reply:
""";

$.form->print();

"""

""";
}

function print_theme_preview () {
"""











Preview Subject[Feb. 5th, 2002|8:46 pm]

Preview text, preview text, etc, etc..... words, words and more words.


$*text_permalink

1 comment|post comment




""";
}

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!

geek

Previous post Next post
Up