[theme] - [tranqii] - [sticky entry]

Apr 01, 2007 07:12

in response to sdlucly's comment in jdark's s2tranquility2 post.


# -------------------------------
# main page display entries and
# footer
# -------------------------------
function RecentPage::print_body () {
var bool enable_sticky = true;
var string sticky_subject = ""; # Welcome
var string sticky_date = ""; # Apr. 1st, 2007
var string sticky_location = ""; # San Francisco, CA
var string sticky_mood = ""; # creative
var string sticky_music = ""; # Mirrors on Shoes - LiveJournal
var string sticky_permalink = ""; # http://exampleusername.livejournal.com/289.html
var string sticky_posturl = ""; # http://exampleusername.livejournal.com/289.html?mode=reply
var string sticky_poster = ""; # exampleusername
var string sticky_userpic = ""; # http://stat.livejournal.com/img/goat-normal.gif
var string sticky_userpic_alt = ""; # $.journal.username

var bool print_sticky = (not $this isa FriendsPage) and ($.nav.skip == 0) and $enable_sticky;

# print all entries
"""

""";

if($print_sticky) {
var string sticky_meta = "";
if($sticky_subject == "") {
$sticky_subject = """$*text_nosubject""";
}
foreach var string k (["location", "mood", "music"]) {
var string text = lang_metadata_title($k);
var string val = "";
if($k == "location") {
$val = $sticky_location;
if($val != "") {
$val = """$sticky_location""";
}
} elseif ($k == "mood") {
$val = $sticky_mood;
} elseif ($k == "music") {
$val = $sticky_music;
}
if($val != "") {
$sticky_meta = $sticky_meta + "\n" + " " + $text + ": " + $val + "
";
}
}
if($sticky_poster != "") {
var UserLite u = UserLite($sticky_poster);
$sticky_poster = $u->ljuser();
if($u.username != $.journal.username) {
$sticky_poster = $sticky_poster + " in " + $.journal->as_string();
}
$sticky_poster = "\n" + " " + $sticky_poster;
}
if($sticky_userpic != "") {
$sticky_userpic = """


""";
}

"""

""";

print $sticky_userpic;

"""
$sticky_subject
""";

var bool h4 = ($sticky_date != "") or ($sticky_meta != "") or ($sticky_poster != "");
if($h4) {
"""
""";
if($sticky_date != "") {
"""
$sticky_date
""";
}

print $sticky_meta;

print $sticky_poster;

"""

""";
}

"""

""";

"""
Entry text here
""";

"""
""";

$h4 = ($sticky_permalink != "") or (($sticky_permalink != "") and ($sticky_posturl != ""));

if($h4) {
"""
""";
"\n";
" ";
var bool print_permalink = get_permalink($sticky_permalink) != "";
var bool print_posturl = $sticky_posturl != "";
if($print_permalink) {
print get_permalink($sticky_permalink);
}
if($print_permalink and $print_posturl) {
" | ";
}
if($print_posturl) {
""" $*text_post_comment""";
}
"""

""";
}

"""
""";
}

foreach var Entry e ( $.entries ) {
$this->print_entry($e);
if ($e->viewer_sees_ebox()) {
"""

""";
$e->print_ebox();
"";
}
}
"""
""";

var string range = "most recent entries";
if ( $.nav.skip > 0 ) {
$range = "$.nav.skip entries back";
}

"""

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 print_body, class recentpage, layout tranqii

Previous post Next post
Up