comment links help.

May 18, 2009 18:49

i recently edited my opal layout on dreamwidth to move my comment links to the lower right hand corner of the entry. after much fiddling, it finally worked. however, in doing so, i lost my edit entry link. if anyone could help me figure out how to get it back, i'd greatly appreciate it. here is the code i am using:

layout layer:

# -*-s2-*-
layerinfo type = "layout";
layerinfo name = "Opal (Libra OSWD)";
layerinfo lang = "en";

layerinfo author_name = "Ported by Kevin Phillips";
layerinfo author_email = "xevinx@livejournal.com";
layerinfo des = "Based on the Libra and Pasilda design available from Open Source Web Designs. Originally written by whompy.";
layerinfo redist_uniq = "opal/layout";
layerinfo previews = "opal/opal.jpg";

################################################################################
#
# Properties
#

propgroup presentation {

property use page_recent_items;
property use page_friends_items;
property use use_shared_pic;
property use view_entry_disabled;

property bool show_entry_userpic {
des = "Always display userpic?";
}

property int summary_items {
des = "Summary Items";
note="Maximum number of items in the Page Summary list. Set to 0 to turn off the Page Summary. Set to 100 to show all available items.";
}

property bool use_count {
noui=1;
}

property use linklist_support;
property use custom_control_strip_colors;

set summary_items = 100;
set show_entry_userpic = false;
set font_fallback = "sans-serif";
}

propgroup colors {
property Color color_bg {
des = "Background Color";
}

property Color color_bg_font {
des = "Background Font Color";
note = "The color of any font appearing on the background color.";
}

property Color color_med {
des = "Page Holder Background";
note = "This is the background of the main body, but within the outer borders.";
}

property Color color_med_font {
des = "Page Holder Font Color";
note="The color of the font appearing on the Page Holder Background color.";
}

property Color color_fg {
des = "Content Background Color";
note = "This is the background to the main content where the entries and side elements are.";
}

property Color color_fg_font {
des = "Content Font Color";
note = "The color of the font that appears on in the main Content area.";
}

property Color color_link {
des = "Link Color";
}

property Color color_visited {
des = "Visited Link Color";
}

property use control_strip_bgcolor;
property use control_strip_fgcolor;
property use control_strip_bordercolor;
property use control_strip_linkcolor;

set color_bg = "#2d3851";
set color_bg_font = "#ffffff";
set color_med = "#7C8AA4";
set color_med_font = "#e9f2fc";
set color_fg = "#BFC4CB";
set color_fg_font = "#333333";
}

propgroup fonts {
property use font_base;
property use font_fallback;
property string static_font_size { noui = 1; }
property string static_font_measurement { noui = 1; }
set static_font_size = "12";
set static_font_measurement = "px";
}

propgroup text {

property string free_text_header {
des = "Free Text Header";
}

property string free_text_text {
des = "Free Text Text";
cols = 30;
rows = 10;
string_mode = "html";
}

property string links_header {
des = "Links Header";
}

property string page_summary_title {
des = "Page Summary Header";
}

property use text_view_userinfo;
property use text_view_recent;
property use text_view_friends;
property use text_view_archive;
property string text_forward {
des = "Text to show in a link to skip forward through entries";
}
property string text_back {
des = "Text to show in a link to skip backward through entries";
}
property use text_read_comments;
property use text_read_comments_friends;
property use text_post_comment;
property use text_post_comment_friends;
property use text_comment_reply;
property use text_reply_back;
property use text_nosubject;
property use text_noentries_day;
property use text_meta_music;
property use text_meta_mood;
property use text_meta_location;
property use text_meta_groups;

set page_summary_title = "page summary";
set links_header = "links";
set free_text_header = "about this journal";
set free_text_text = "";
set text_back = "back";
set text_forward = "forward";
}

propgroup customcss {
property use include_default_stylesheet;
property use linked_stylesheet;
property use custom_css;
}

set external_stylesheet = true;
set tags_aware = true;

function getAltColor (Color color, string dir, int num) : Color {
var int lt = $color->lightness();
if($dir == "light") {
if($lt > 200) {
$color = $color->darker($num);
} else {
$color = $color->lighter($num);
}
} elseif($dir == "dark") {
if($lt < 55) {
$color = $color->lighter($num);
} else {
$color = $color->darker($num);
}
}
return $color;
}

################################################################################
#
# Prop Init
#

function prop_init () {
if($*color_bg.as_string == "") { $*color_bg = "#000000"; }
if($*color_fg.as_string == "") { $*color_fg = "#000000"; }
if($*color_fg_font.as_string == "") { $*color_fg_font = "#000000"; }

var Color color_fg_dk = getAltColor($*color_fg, "dark", 20);
var Color alt_link_color = "#0000ff";

if ($*control_strip_bgcolor.as_string == "") {
$*control_strip_bgcolor = $*color_fg;
}
if ($*control_strip_fgcolor.as_string == "") {
$*control_strip_fgcolor = $*color_fg_font;
}
if ($*control_strip_bordercolor.as_string == "") {
$*control_strip_bordercolor = getAltColor($color_fg_dk, "dark", 30);
}
if ($*control_strip_linkcolor.as_string == "") {
$*control_strip_linkcolor = ($*color_link.as_string == "" ? $alt_link_color : $*color_link);
}

$*theme_bgcolor = $*color_fg;
$*theme_fgcolor = $*color_fg_font;
$*theme_bordercolor = getAltColor($color_fg_dk, "dark", 30);
$*theme_linkcolor = ($*color_link.as_string == "" ? $alt_link_color : $*color_link);
}

################################################################################
#
# Stylesheet
#

function print_stylesheet () {

var Color color_bg_lt = getAltColor($*color_bg, "light", 30);
var Color color_fg_dk = getAltColor($*color_fg, "dark", 20);
var Color color_fg_dk_font = getAltColor($*color_fg_font, "dark", 20);
var Color color_divider = getAltColor($color_fg_dk, "dark", 30);
var Color color_fg_dk_dk_font = getAltColor($color_fg_dk, "dark", 50);
var Color color_border = getAltColor($*color_bg, "light", 90);
var string base = ($*font_base != "") ? "$*font_base, " : "";

"""
body {
font-family: $base $*font_fallback;
background-color: $*color_bg;
margin: 10px;
}

.border4 { border: 1px solid $*color_bg; width: 214px;}
.border3 { border: 1px solid $*color_fg; }
.border2 { border: 2px solid $color_border; }

""";
if($*color_link.as_string != "") {
"""
A { color: $*color_link; }
""";
}

if($*color_visited.as_string != "") {
"""
A:Visited { color: $*color_visited; }
""";
}
"""
#bodycontent"""; if (viewer_sees_vbox() or viewer_sees_hbox_top() or viewer_sees_hbox_bottom()) { ", .adcontent"; } """ { background-color: $*color_med; border: 1px solid $*color_bg; padding: 3px; }

#headerinfo {
background-color: $*color_bg;
color: $*color_bg_font;
text-align: right;
font-size: 10px;
padding: 2px;
margin-top: 1px;
}
#header { color: $*color_med_font; }
#header h3 { font-weight: normal; }
#userpic { float: right; }

.userpic2 {
float: right;
text-align: right;
margin-top: 2px;
margin-right: 3px;
}

#nav {
white-space: nowrap;
margin-bottom: 10px;
font-size: $*static_font_size$*static_font_measurement;
}

#nav A {
border: 1px solid $*color_bg;
padding-left: 10px;
padding-right: 10px;
padding-top: 2px;
padding-bottom: 2px;
height: 20px;
text-decoration: none;
color: $*color_bg_font;
background-color: $color_bg_lt;
}

#nav A:Hover { background-color: $*color_bg; }

#content {
background-color: $*color_fg;
border: 1px solid $color_fg_dk;
padding: 4px;
}

.columncontent {
background-color: $color_bg_lt;
border: 1px solid $*color_bg;
padding: 3px;
width: 200px;
font-size: $*static_font_size$*static_font_measurement;
color: $*color_bg_font;
}
.columnitem {
background-color: $color_fg_dk;
padding: 3px;
margin-top: 5px;
color: $*color_fg_font;
border-top: 1px solid $color_divider;
border-bottom: 1px solid $color_divider;
overflow: hidden;
}

.entries { color: $*color_fg_font; }

.entrydivider {
border-top: 1px solid $color_divider;
border-bottom: 1px solid $*color_fg;
}

.minicomment {
background-color: $color_fg_dk;
padding: 4px;
color: $*color_fg_font;
border: 1px solid $*color_fg;
font-size: $*static_font_size$*static_font_measurement;
}

.minicommentholder { border: 1px solid $color_divider; }

.entryinfo {
background-color: $color_fg_dk;
font-size: $*static_font_size$*static_font_measurement;
padding: 4px;
color: $*color_fg_font;
}

.postedby {
background-color: $color_fg_dk;
padding: 6px;
font-size: $*static_font_size$*static_font_measurement;
}

.entrylinks {
border-bottom: 1px solid $*color_fg;
background-color: $color_fg_dk;
padding-top: 4px;
padding-bottom: 4px;
font-size: $*static_font_size$*static_font_measurement;
}

.entrylinks A {
text-decoration: none;
padding-top: 4px;
padding-bottom: 4px;
white-space: nowrap;
color: $*color_fg_font;
border-right: 1px solid $*color_fg;
}

.entrylinks A:Hover {
background-color: $*color_fg;
}

.messageholder {
border: 1px solid $*color_bg;;
margin-bottom: 5px;
margin-top: 5px;
}

.systemmessage {
background-color: $color_bg_lt;
color: $*color_bg_font;
border: 1px solid $color_border;
font-size: $*static_font_size$*static_font_measurement;
}

.systemtext {
font-weight: normal;
padding-left: 10px;
padding-right: 10px;
}

.systemmessage A {
text-decoration: none;
padding-left: 10px;
padding-right: 10px;
color: $*color_bg_font;
padding-top: 4px;
padding-bottom: 4px;
}

.systemmessage A:Hover {
background-color: $*color_bg;
}

.systemmessage input, .systemmessage textarea, .systemmessage select {
background-color: $*color_fg;
color: $*color_fg_font;
}

.systemmessage TD {
padding: 4px;
font-size: $*static_font_size$*static_font_measurement;
color: $*color_bg_font;
}

.entry { margin-bottom: 30px; }
.entrytext { margin: 10px; }
.subject { font-weight: bold; }

.meta {
font-size: $*static_font_size$*static_font_measurement;
padding: 4px;
}

.meta A {
text-decoration: none;
color: $*color_link;
}

.subject A, .subject A:hover, .subject A:visited {
color: $*color_fg_font;
text-decoration: none;
}

.systemmessage A:Hover {
background-color: $*color_bg;
}

#sidecolumn TD { color: $*color_bg_font; }

#sidecolumn A {
text-decoration: none;
color: $*color_fg_font;
}

.sidetd {
width: 200px;
}

.backtop {
text-align: right;
}

.backtop A {
color: $*color_fg_font;
font-size: $*static_font_size$*static_font_measurement;
text-decoration: none;
padding-bottom: 1px;
}

#cal A {
text-decoration: none;
color: $*color_fg_font;
}

.calrow {
clear: both;
font-family: Arial, sans-serif;
}

.calempty {
width: 25px;
font-size: 11px;
margin: 1px;
float: left;
padding: 3px 0;
}

.calactitem {
float: left;
margin: 1px;
width: 24px;
font-size: 11px;
text-align: center;
background-color: $color_fg_dk;
border-right: 1px solid $color_bg_lt;
border-bottom: 1px solid $color_bg_lt;
padding: 3px 0;
}

.calinitem {
float: left;
margin: 1px;
width: 24px;
font-size: 11px;
text-align: center;
border-right: 1px solid $color_fg_dk;
border-bottom: 1px solid $color_fg_dk;
padding: 3px 0;
}

.friendcolor {
width: 10px;
height: 10px;
border: 2px solid $*color_fg;
}

.multiform {
font-weight: bold;
}

.ip {
color: $color_fg_dk_dk_font;
}

.friendname {
padding: 4px;
text-decoration: none;
border-left: 1px solid $*color_fg;
border-right: 1px solid $*color_fg;
}

.bigday {
font-size: 2em;
color: $color_fg_dk;
float: right;
font-weight: bolder;
}

.notablemessage {
padding: 4px;
}
.quickreply { margin-top: 5px;}
.reply_link { padding: 0 1em;}
""";

print_custom_control_strip_css();
}

################################################################################
#
# Global functions
#

function generateDots (string un) : string {
var string dots;
if($un != "") {
foreach var string s ($un) {
if($s == "a" or $s == "c" or $s == "e" or $s == "f" or $s == "h" or $s == "k" or $s == "m" or $s == "n" or $s == "p" or $s == "r" or $s == "t" or $s == "v" or $s == "x" or $s == "z") {
$dots = $dots + ":";
} elseif($s == " ") {
$dots = $dots + " ";
} else {
$dots = $dots + ".";
}
}
}
return $dots;
}

function print_box (string header, string text) {
"""





""";
print safe """$header""";
print safe """$text""";

"""





""";

}

function box_item (string text) : string {
return """
$text
\n""";
}

function num_comments_in_thread (Comment[] comments) : int {
var int total = 0;
foreach var Comment c ($comments) {
$total = $total + 1;
if (size $c.replies > 0) {
$total = $total + num_comments_in_thread($c.replies);
}
}
return $total;
}

################################################################################
#
# Layout specific functions
#

function Page::lay_print_userpic() {
if(defined $.journal.default_pic) {
"""
$.journal.name

""";
}
}

function Page::lay_print_username () {

var string dots = generateDots($.global_title);

print safe """

$.journal.username
$dots

""";
}

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

""";
}

function Page::lay_print_freetext () {
if($*free_text_text != "") {
var string text = box_item($*free_text_text);
print_box($*free_text_header, $text);
}
}

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

var string links;
foreach var UserLink l ($.linklist) {
if ($l.title) {
if ($l.is_heading) {
$links = $links + """
$l.title
""";
} else {
$links = $links + box_item("""$l.title""");
}
}
}

print_box($*links_header, $links);
}

function Page::lay_print_calendar () {
var YearMonth m = $this->get_latest_month();
var string mon = $m->month_format();
var string text;
$text = """
""";
foreach var YearWeek w ($m.weeks) {
$text = $text + """
""";
if($w.pre_empty > 0) {
foreach var int empty (1..$w.pre_empty) {
$text = $text + """
""";
}
}
foreach var YearDay d ($w.days) {
if($d.num_entries > 0) {
$text = $text + """
""";
} else {
$text = $text + """
""";
}
}
$text = $text + "\n";
}
$text = $text + "
  $d.day $d.day
";
print_box($mon, $text);
}

function Page::lay_entry_nav (Entry e) : string {

var string line;
var string date;
if($e.new_day) {
$date = $e.time->date_format("short");
}
var string time = $e.time->time_format();
var string subject = ($e.subject != "") ? " :: $e.subject" : """ :: $*text_nosubject""";
var string j = ($.view == "friends" and $e.journal.username != $e.poster.username) ? " : $e.journal " : "";
var string item = ($.view == "friends" or $e.journal.username != $e.poster.username) ? $e.poster->as_string() + """$j """ : """$date $time""";
$line = """
""";

return $line;
}

function Page::lay_print_summary () {
#blank because there's shouldn't be a box if there's nothing specific about the page.
}

function RecentPage::lay_print_summary () {
var int count = $*summary_items;
if($count == 0) { return; }

var string text;
foreach var Entry e ($.entries) {
if($count > 0) {
$text = $text + $this->lay_entry_nav($e);
}
$count = $count - 1;
}
if($text != "") {
if($count < 0) {
$count = $count * -1;
$text = $text + """
+$count more
""";
}
print_box($*page_summary_title, $text);
}
}

function EntryPage::lay_print_summary () {
var int count = $*summary_items;
if($count == 0) { return; }

var string text;
$text = $this->lay_entry_nav($.entry);
$count = $count - 1;

foreach var Comment c ($.comments) {
if($count > 0) {
var string subject = ($c.subject != "") ? $c.subject : """$*text_nosubject """;
$text = $text + """
$c.poster :: $subject""";
var int num = num_comments_in_thread($c.replies);
if($num > 0) {
$text = $text + " [+" + string($num) + "] ";
}
$text = $text + """
""";
}
$count = $count - 1;
}

if($text != "") {
if($count < 0) {
$count = $count * -1;
$text = $text + """
+$count more
""";
}
if($count != ($*summary_items - 1)) {
print_box($*page_summary_title, $text);
}
}
}

function YearPage::lay_print_summary () {
var int count = $*summary_items;
if($count == 0) { return; }

var string text;
var int num_entries;
foreach var YearMonth m ($.months) {
if($count > 0) {
var string mon = $m->month_format();
if($m.has_entries) {
$num_entries = 0;
foreach var YearWeek w ($m.weeks) {
foreach var YearDay d ($w.days) {
$num_entries = $num_entries + $d.num_entries;
}
}
$text = $text + """""";
}
}
$count = $count - 1;
}
if($text != "") {
if($count < 0) {
$count = $count * -1;
$text = $text + """
+$count more
""";
}
print_box($*page_summary_title, $text);
}

}

function MonthPage::lay_print_summary () {
var int count = $*summary_items;
if($count == 0) { return; }

var string text;
foreach var MonthDay d ($.days) {
if($count > 0) {
var string day = lang_ordinal($d.day);
if ($d.has_entries) {
$text = $text + """""";
}
}
}

if($text != "") {
if($count < 0) {
$count = $count * -1;
$text = $text + """
+$count more
""";
}
print_box($*page_summary_title, $text);
}
}

function DayPage::lay_print_summary () {
var int count = $*summary_items;
if($count == 0) { return; }

var string text;
foreach var Entry e ($.entries) {
$text = $text + $this->lay_entry_nav($e);
}

if($text != "") {
if($count < 0) {
$count = $count * -1;
$text = $text + """
+$count more
""";
}
print_box($*page_summary_title, $text);
}
}

function Page::lay_print_subnav () {
#
}

function RecentPage::lay_print_subnav () {
var string back;
if($.nav.backward_url != "") {
$back = """$*text_back""";
} else {
$back = " ";
}
var string forward;
if($.nav.forward_url != "") {
$forward = """$*text_forward""";
} else {
$forward = " ";
}

var int start = $.nav.skip;
var int end = $.nav.skip + size $.entries;
var string text = "Viewing $start - $end";
print safe """







$back $text $forward


""";
}

function DayPage::lay_print_subnav () {
var string back;
if($.prev_url != "") {
$back = """$*text_back""";
} else {
$back = " ";
}
var string forward;
if($.next_url != "") {
$forward = """$*text_forward""";
} else {
$forward = " ";
}

var string text = $.date->date_format("long");

print safe """







$back $text $forward


""";

}

function Page::lay_print_sidebar () {
$this->lay_print_summary();
$this->print_linklist();
$this->lay_print_freetext();
$this->lay_print_calendar();
}

function Page::lay_make_username(Entry e) {
"""


""";
}

function FriendsPage::lay_make_username (Entry e) {
var Friend f = $.friends{$e.journal.username};
var string url = $e.poster->base_url();
"""


""";
}

function Page::print_entry (Entry e) {

print """""";
var string time = $e.time->time_format();
var string date = $e.time->date_format();
var string security;
if ($e.security != "") {
$security = """ """width="$e.security_icon.width" height="$e.security_icon.height" """+
"""alt="[$e.security]" />""";
}

var UserLite name;
var string pname;

var bool show_name = ($.view == "friends" or $e.poster.username != $.journal.username or $.view == "entry") ? true : false;
var bool show_pic = (defined $e.userpic and ($.view == "friends" or $*show_entry_userpic or $e.poster.username != $e.journal.username or $.view == "entry")) ? true : false;

"""


""";
if($show_pic) {
"""

$e.poster.name [userpic]

""";
}

if($show_name) {
$this->lay_make_username($e);
}
"""


""";
$this->print_reply_container({"target" => "topcomment"});
"""

""";
if ($.view != "entry") {
print $e->formatted_subject({"class"=>"subj-link"});
} else { "$e.subject"; }
"""

""";
"

"; $e->print_text(); "

";

$e->print_metadata();
"""





""";
}

function CommentInfo::print() {
if ($.enabled) {
$this->print_postlink();
if ($.count > 0 or $.screened) {
$this->print_readlink();
}
}
}

function CommentInfo::print_postlink() {
var Page p = get_page();
if ($.maxcomments) {
print safe "$*text_max_comments";
} else {
if ($p.view == "entry") {
$p->print_reply_link({"target" => "topcomment", "linktext" => "$*text_post_comment", "class" => "reply_link"});
} else {
print safe "  "+($p.view == "friends" ? $*text_post_comment_friends : $*text_post_comment)+"  ";
}
}
}

function CommentInfo::print_readlink {
var Page p = get_page();
print safe "   "+
get_plural_phrase($.count, $p.view == "friends" ?
"text_read_comments_friends" : "text_read_comments")+
"  
";
}

function print_ebox (Entry e) {
if ($e->viewer_sees_ebox()) {
"""
""";
$e->print_ebox();
"
";
}
}

################################################################################
#
# EntryPage and Comments
#

function EntryPage::print_body() {
"""
""";
$this->print_entry($.entry);
print_ebox($.entry);
if ($this.multiform_on) {
$this->print_multiform_start();
}

if ($.entry.comments.count > 0) {
"""
comments

""";
}

if ($.comment_pages.total_subitems > 0) {
$.comment_pages->print();
}

if ($.entry.comments.enabled) {
$this->print_comments($.comments);
}

if ($.entry.comments.count > 0) {
"""



""";

$.entry.comments->print();

"""



""";
}

if ($.comment_pages.total_subitems > 0) {
$.comment_pages->print();
}

if ($this.multiform_on and ($.comment_pages.total_subitems > 0)) {
"""




""";
$this->print_multiform_actionline();
"""




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

function EntryPage::print_comments(Comment[] cs) {
if (size $cs == 0) { return; }
foreach var Comment c ($cs) {
if ($c.full) {
$this->print_comment($c);
} else {
$this->print_comment_partial($c);
}
}
}

function EntryPage::print_comment(Comment c) {

var string datetime;
$datetime = $c->time_display();

var string parent;
var string thread;
var string expand = "";
if($c.parent_url != "") {
$parent = """   $*text_comment_parent   """;
}
if($c.thread_url != "") {
$thread = """   $*text_comment_thread   """;
var Link expand_link = $c->get_link("expand_comments");
if (defined $expand_link) {
$expand = $c->expand_link({ "text" => "   $*text_comment_expand   " });
}
}

var string subjecticon;
if (defined $c.subject_icon) {
$subjecticon = """""";
}

var string ip;
if ($c.metadata{"poster_ip"}) {
$ip = """   """ + $c.metadata{"poster_ip"};
}

var string poster = defined $c.poster ? $c.poster->as_string() : "(anonymous)";

var string pic;
if (defined $c.userpic and $*comment_userpic_style != "off") {
$pic = """
""";
}

var string indent = ($c.depth - 1) * 25 + "px";

"""


$pic


$poster $ip





""";

if ($.multiform_on) {
"""

""";
}

var string replyurl;
if ($c.frozen) {
$replyurl = """   $*text_comment_frozen   """;
} else {
### $replyurl = """   $*text_comment_reply   """;
}

print safe """
""";
if (not $c.frozen) {
$c->print_reply_container({"class" => "quickreply"});
}

"""

$c.subject

"""; $c->print_text(); """



""";
"
";

if ((size $c.replies) > 0 and $c.replies[0].full == false) {
"""
\n""";
$this->print_comments($c.replies);
"
\n";
}

"""


""";

if ((size $c.replies) > 0 and $c.replies[0].full == true) {
$this->print_comments($c.replies);
}

}

function EntryPage::print_comment_partial(Comment c) {
var string poster = defined $c.poster ? $c.poster->as_string() : "(anonymous)";
var string subj = $c.subject != "" ? $c.subject : """$*text_nosubject""";
var string indent = ($c.depth - 1) * 25 + "px";
print safe """
$poster - $subj
""";
var Link expand_link = $c->get_link("expand_comments");
if ($c.thread_url != "" and defined $expand_link) {
" " + $c->expand_link();
}
print """
""";
$this->print_comments($c.replies);
}

function ItemRange::print() {
if ($.all_subitems_displayed) { return; }
"""

""";
print lang_page_of_pages($.current, $.total);
"
- ";
foreach var int i (1..$.total) {
if ($i == $.current) { """[$i]""";

} else {
var string url_of = $this->url_of($i);
"[$i]";
}
}
"""
""";
}

################################################################################
#
# ReplyPage
#

function ReplyPage::print_body() {

var EntryLite e = $.replyto;
var string poster = defined $e.poster ? $e.poster->as_string() : "(anonymous)";
var string time = $e.time->time_format();
var string date = $e.time->date_format();

"""
""";

var UserLite name;
if(defined $e.userpic and $*comment_userpic_style != "off") {
$name = $e.poster;
"""
""";
if (defined $e.userpic or (defined $e.userpic and $.view == "entry" and $*show_entry_userpic)) {
"""""";
}
"""
""";
}

if ($.replyto isa Entry) {
var Entry en = $.replyto as Entry;

print safe """


""";

$this->print_entry($en);
"""
""";
} else {
print safe """







""";

"""

$e.subject


""";
$e->print_text();
"""


""";
}
print_ebox($.entry);

"""

""";
$.form->print();
"""

""";
}

function Entry::print_metadata() {
var string caption;
var string val;
var Image i;
if ($this.tags) {
"""
""";
print $this->get_tags_text();
"
";
}
if (size $.metadata == 0) { return; }
foreach var string k ($.metadata) {
$caption = $k;
$val = $.metadata{$k};
if ($k == "music") {
$caption = $*text_meta_music;
}
elseif ($k == "location") {
$caption = $*text_meta_location;
}
elseif ($k == "groups") {
$caption = $*text_meta_groups;
}
elseif ($k == "mood") {
$caption = $*text_meta_mood;
if (defined $.mood_icon) {
$i = $.mood_icon;
$val = """$val $val""";
}
}
println safe """
$caption: $val
""";
}
}

################################################################################
#
# RecentPage
#
function RecentPage::print_body () {
"""


""";

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

"""

""";
}

################################################################################
#
# YearPage
#

function YearPage::print_body {
$this->print_year_links();
"""
""";
foreach var YearMonth m ($.months) {
$this->print_month($m);
}
"""
""";
}

function YearPage::print_year_links() {
"""
""";
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; }

"""









""";

foreach var int d (weekdays()) {
"""

""";
}
"""

""";
foreach var YearWeek w ($m.weeks) {
$w->print();
}
"""
$*lang_dayname_short[$d]




""";

}

function YearWeek::print() {
"""

""";
if ($.pre_empty > 0) {
"""

""";
}

foreach var YearDay d ($.days) {
var string day = zeropad($d.day, 2);
"""

$day

""";
if ($d.num_entries > 0) {
var string num = $d.num_entries < 10 ? " " + string($d.num_entries) : string($d.num_entries);
"""

""";
}
"""

""";
}
"""

""";
}

################################################################################
#
# MonthPage
#

function MonthPage::view_title : string {
return $.date->date_format($*lang_fmt_month_long);
}

function MonthPage::print_body {
"
";
$.redir->print_hiddens();
var string back;
var string forward;
if ($.prev_url != "") { $back = """$*text_back"""; }
if ($.next_url != "") { $forward = """$*text_forward"""; }
var string select;
if (size $.months > 1) {
$select = "\n";
}

print safe """







$back $select $forward


""";
"
";
foreach var MonthDay d ($.days) {
if ($d.has_entries) {
"""






""";
$d->print_subjectlist();
"""




""";
}
}
}

function MonthDay::print_subjectlist() {
# Too many tables...
foreach var Entry e ($.entries) {
print $e.time->time_format("short") + ": ";
if ($e.poster.username != $e.journal.username) {
$e.poster->print(); " ";
}
"$e.security_icon";
if ($e.subject != "") {
" $e.subject";
} else {
print safe """ $*text_nosubject""";
}
if ($e.comments.count > 0) {
print safe " - " + get_plural_phrase($e.comments.count, "text_read_comments");
}
if ($e.comments.screened) {
" $*text_month_screened_comments";
}
"
\n";
}
}

################################################################################
#
# DayPage
#

function DayPage::print_body() {

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

} else {
print safe "

$*text_noentries_day

";
}
"""
""";
}

################################################################################
#
# TagsPage
#

function TagsPage::print_body() {
"""


$*text_tags_page_header


    """;

    foreach var TagDetail td ($this->visible_tag_list()) {
    var string uses = get_plural_phrase($td.use_count, "text_tag_uses");
    print """
  • $td.name - $uses
  • """;
    }

    """





""";
}

################################################################################
#
# Page
#

function Page::print () {

var string title = $this->title();

"""
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
http://www.w3.org/1999/xhtml">


""";

$this->print_head();
$this->print_stylesheets();

"""
$title



""";
$this->print_control_strip();
if (viewer_sees_vbox()) {
"""""";
"""";
"""
""";
}
if (viewer_sees_hbox_top()) {
"""
""";
"""
""";
$this->print_hbox_top();
"
";
"
";
}
"""








""";

$this->lay_print_userpic();
$this->lay_print_username();
$this->lay_print_header();

"""









""";

$this->lay_print_sidebar();

"""


""";

$this->lay_print_subnav();
$this->print_body();
$this->lay_print_subnav();

"""






""";
if (viewer_sees_hbox_bottom()) {
"""
""";
"""
""";
$this->print_hbox_bottom();
"
";
"
";
}
if (viewer_sees_vbox()) {
"
""";
"""
""";
"""
""";
"""
""";
$this->print_vbox();
"
";
"
";
"
";
"
";
}
"""


""";
}

function print_theme_preview() {

var Color color_bg_lt = getAltColor($*color_bg, "light", 30);
var Color color_fg_dk = getAltColor($*color_fg, "dark", 20);
var Color color_fg_dk_font = getAltColor($*color_fg_font, "dark", 20);
var Color color_divider = getAltColor($color_fg_dk, "dark", 30);
var Color color_fg_dk_dk_font = getAltColor($color_fg_dk, "dark", 50);
var Color color_border = getAltColor($*color_bg, "light", 90);

"""


Username - Title





Welcome
This is my new journal using a cool new style!



""";

}

theme layer:

layerinfo "type" = "theme";
layerinfo "name" = "opal layout";

set page_recent_items = 10;
set page_friends_items = 10;
set include_default_stylesheet = false;
set lang_fmt_date_short = "%%day%%, %%month%% %%dayord%%, %%yyyy%%";
set lang_fmt_time_short = "%%h%%:%%min%%%%A%%M";
set show_entry_userpic = true;
set tags_aware = true;
set linklist_support = true;
set summary_items = 0;
set links_header = "links";
set text_back = "back";
set text_forward = "forward";
set text_skiplinks_back= "previous #";
set text_skiplinks_forward= "next #";
set text_post_comment = "comment";
set text_max_comments = "maximum comments reached";
set text_read_comments = "read";
set text_post_comment_friends = "comment";
set text_read_comments_friends = "read";
set text_edit_entry = "edit";
set text_edit_tags = "tags";
set text_mem_add = "memories";
set text_permalink = "";
set text_tell_friend = "";
set text_watch_comments = "";
set text_unwatch_comments = "";
set text_month_screened_comments = "(screened)";
set text_meta_music = "music";
set text_meta_mood = "mood";
set text_meta_location = "location";
set text_meta_groups = "groups";
set text_tags_section_header = "tags";

function Page::print_custom_head() {"""

i thought our story was epic.

http://img.photobucket.com/albums/v216/galeforce/1548210.jpg">



""";}

#==================================
# SIDEBAR / FREE TEXT BOXES #
#==================================
function Page::lay_print_sidebar {var string header; var string text;

$header = "LoVe";
$text = """
"i thought our story was epic, you know, you and me."
"epic how?"
"spanning years and continents. lives ruined, bloodshed. epic. but summer's almost here, and we won't see each other at all. and then you leave town...and then it's over."
"logan..."
"i'm sorry about last summer. you know, if i could do it over..."
"come on. ruined lives? bloodshed? you really think a relationship should be that hard?"
"no one writes songs about the ones that come easy."
"""; print_box($header, $text);

$this->lay_print_calendar();

$this->print_linklist();

$header = "";
$text = """
"""; print_box($header, $text);
}

#==================================
# METADATA #
#==================================
function Entry::print_metadata() {var string[] metadata = []; var string{} meta_images = {}; var string{} meta_labels = {}; $metadata = ["location", "mood", "music", "tags", "groups"]; var bool wrap_metadata = true; $meta_labels = {"tags" => "Tags:", "location" => $*text_meta_location, "mood" => $*text_meta_mood, "music" => $*text_meta_music, "groups" => $*text_meta_groups,}; $meta_images = { "tags" => "",
"location" => "",
"mood" => "",
"music" => "",
"groups" => "",};

var bool show_edit_tags_link = false; var string tags_separator = ", "; var bool vanilla_location = true; var bool vanilla_groups= true; var string meta_label_open = """"""; var string meta_label_close = """ """; var string meta_val_open= ""; var string meta_val_close = """
"""; var string currents_open = """
"""; var string currents_close= """
"""; var bool have_meta = (size($.metadata) > 0); var bool have_tags = ((size($.tags) > 0) and $*tags_aware); var int tcount = 0; var string currents = ""; var string image = ""; var string k = ""; var string label = ""; var string meta = ""; var string tag = ""; var string val = ""; var Tag t = new Tag; var Link edit_tags = $this->get_link("edit_tags"); if ($have_meta or $have_tags) {$currents = $currents + $currents_open; if ($wrap_metadata and defined $.mood_icon) {var Image i = $.mood_icon; $currents = $currents + """
$*text_meta_mood $.metadata{""";} foreach $k ($metadata) {$label = $meta_labels{$k} != "" ? $meta_labels{$k} : lang_metadata_title($k); $image = $meta_images{$k} != "" ? $meta_images{$k} : ""; $val = $.metadata{$k}; if ($image != "") {$label = """$label""";}if (($k=="location") and $vanilla_location) {$val = striphtml($val);} if (($k=="groups ") and $vanilla_groups ) {$val = striphtml($val);} if ($k=="mood") { if (defined $.mood_icon) {var Image i = $.mood_icon; if (not $wrap_metadata) {$val = """$*text_meta_mood $.metadata{ $val""";}}}
if (($k=="tags") and ($have_tags==true)) {if($edit_tags.url != "" and $show_edit_tags_link) {$label = """$label""";}
foreach $t ($.tags) {$tag = """$t.name"""; $val = $val + $tag; $tcount++; if ($tcount < size($.tags)) {$val = $val + "$tags_separator";}}}
if ($val != "") { $meta = $meta_label_open + $label + $meta_label_close + $meta_val_open + $val + $meta_val_close;} else {$meta = "";}$currents = $currents + $meta;}if ($wrap_metadata and defined $.mood_icon) {$currents = $currents + """
""";}
$currents = $currents + $currents_close;println "$currents";}}

#==================================
# FIX DOUBLE USERPIC ERROR ON REPLY PAGE #
#==================================
function ReplyPage::print_body() {var EntryLite e = $.replyto; var string poster = defined $e.poster ? $e.poster->as_string() : "(Anonymous)"; var string time = $e.time->time_format(); var string date = $e.time->date_format();"""
""";var UserLite name;"""
""";if ($.replyto isa Entry) {var Entry en = $.replyto as Entry;print safe """""";$this->print_entry($en);"""
""";} else {print safe """
""";"""
$e.subject

""";$e->print_text();"""

""";} """
""";$.form->print();"""
""";}

comments-page