layerinfo "type" = "theme"; layerinfo "name" = "seattle_tranqii_customizations"; layerinfo "source_viewable" = 1; set tags_aware = true; # Page::print_custom_head() # add frozen comments css class # alter css for frozen/screened comments # alter width of reply form # print_entry() # add tags to entries # add full linkbar to entries # change printing of user/journal in entries # print_entry(), EntryPage::print_comment(), ReplyPage::print_body() # link userpics to allpics pages # EntryPage::print_body(), EntryPage::print_comment() # add colors to ajax comments # EntryPage::print_comment() # fix comment times # add freeze links to comments # EntryPage::print_comment(), ReplyPage::print_body() # use properties in comments for from and date headers # EntryPage::print_comment_partial() # add anchor tag # add date/time function Page::print_custom_head() { var Color c_comment_frozen_background = "#aaaaff"; var Color c_comment_frozen_border = $*c_comment_one_border->clone(); var Color c_comment_frozen_text_color = $*c_comment_one_text_color->clone(); var Color c_comment_frozen_title_color = $*c_comment_one_title_color->clone(); var Color c_comment_frozen_link = "#eeeeff"; var Color c_comment_frozen_link_visited = "#eeeeff"; var Color c_comment_frozen_link_hover = "#eeeeff"; var Color c_comment_frozen_link_active = "#eeeeff"; """ """; } function Entry::print_metadata() { var string tags_header = "tags"; var string tags_joiner = ":"; var Link edit_tags = $this->get_link("edit_tags"); if ((size $.metadata > 0) or ((size $.tags > 0) and ($*tags_aware))){ var string currents = ""; $currents = """
"""; foreach var string k ($.metadata){ var string text = $k; var string val = $.metadata{$k}; if ($k == "mood"){ $text = $*text_meta_mood; } elseif ($k == "music") { $text = $*text_meta_music; } if ($k == "mood" and defined $.mood_icon){ var Image i = $.mood_icon; $val = " $val"; } $currents = $currents + """
$text: $val
"""; } if ((size $.tags > 0) and $*tags_aware) { var int tcount = 0; if($edit_tags.url != "") { $tags_header = """$tags_header"""; } $currents = $currents + """$tags_header$tags_joiner """; foreach var Tag t ($.tags) { $currents = $currents + """"""; $tcount++; if ($tcount != size $.tags) { $currents = $currents + ", "; } } } $currents = $currents + "
"; println "$currents"; } } function print_entry ( Page p, Entry e ) { # get date/time var string datetime; $datetime = $e.time->date_format($*date_format) + " | " + $e.time->time_format($*time_format); # get any extra user info (if posting to community, etc) var string poster = ""; var string userpic = ""; if ( $p.view == "friends" or $p.journal_type == "C" or $e.poster.username != $e.journal.username ) { if ( $e.poster.username != $e.journal.username ) { $poster = "$e.poster in $e.journal"; } else { $poster = $e.poster->as_string(); } $poster = "posted by: $poster"; if ( defined $e.userpic ) { $userpic = """

$e.poster.username's user pictures

"""; } } # print the entry now: print "
"; # print icon (if needed) if ( $userpic != "" ) { print "$userpic"; } print "

"; if ( $e.security != "" ) { $e.security_icon->print(); print " "; } if ( $e.subject == "" ) { print "$*text_nosubject"; } else { print "$e.subject"; } print "

"; print "

"; if ( $p.view == "entry" and $*show_entrynav_icons ) { var string item_link = ""; foreach var string key (["nav_prev","nav_next"]) { var Link link = $e->get_link($key); if ( $link ) { if ( $key == "nav_prev" ) { $item_link = $item_link + "lower() + "\">« " + $link.caption->lower() + " | "; } elseif ( $key == "nav_next" ) { $item_link = $item_link + "lower() + "\">" + $link.caption->lower() + " »"; } } } print $item_link; print "
"; } print "$datetime
"; $e->print_metadata(); if ( $poster != "" ) { print "$poster"; } print "

"; print "
$e.text
\n"; print "

"; # print get_permalink($e.permalink_url); if ( $p.view != "entry" and $p.view != "reply" ) { # print " | "; $e.comments->print(); } elseif ( $e.comments.enabled ) { # print " | "; $e.comments->print_postlink(); } var Link tmp; var string[] link_keyseq = ["edit_entry", "edit_tags", "mem_add"]; foreach var string key ($link_keyseq) { $tmp = $e->get_link($key); if($tmp.caption != "" and $tmp.url != "") { print """ | $tmp.caption"""; } } print "

"; print "
"; print "
"; } function EntryPage::print_body ( ) { print "
\n"; $this->print_entry ( $.entry ); if ( $.entry.comments.enabled ) { print "

Comments {$.entry.comments.count}

"; print "
"; if ( $.comment_pages.total_subitems > 0 ) { if ( $this.multiform_on ) { $this->print_multiform_start(); } $.comment_pages->print(); set_handler("unscreen_comment_#", [ [ "style_bgcolor", "cmtbar#", "$*c_comment_one_background", ], [ "style_color", "cmtbar#", "$*c_comment_one_text_color", ], ]); set_handler("screen_comment_#", [ [ "style_bgcolor", "cmtbar#", "$*c_comment_screened_background", ], [ "style_color", "cmtbar#", "$*c_comment_screened_text_color", ], ]); set_handler("unfreeze_comment_#", [ [ "style_bgcolor", "cmtbar#", "$*c_comment_one_background", ], [ "style_color", "cmtbar#", "$*c_comment_one_text_color", ], ]); set_handler("freeze_comment_#", [ [ "style_bgcolor", "cmtbar#", "#aaaaff", ], [ "style_color", "cmtbar#", "$*c_comment_one_text_color", ], ]); $this->print_comments($.comments); if ( $this.multiform_on ) { $this->print_multiform_actionline(); $this->print_multiform_end(); } } print "
"; } print "
"; print "

"; print "$*text_post_comment\n"; print "

"; } function EntryPage::print_comment ( Comment c ) { #################################################################### #GMT -- Timezone fix #Original Component version by lj:zzyzx (component_help/224755) #Opalified by lj:kunzite1 (s2layers / 7591) #Unearthified by lj:kunzite1 (s2layers / 8227) #TranqIIified by lj:kunzite1 (s2layers / 32100) #################################################################### var int timezone = 08; #Offset from GMT in hours. (NO NEGATIVES!) If your offset from GMT is -0730, this value would be "07". var int timezone_min = 00; #Offset from GMT in minutes. If your offset from GMT is -0730, this value would be "30". var int tz_neg = 1; #Offset is negative = 1 (USA is = 1) or positive = 0 If your offset from GMT is -0730, this value would be "1". var int dst = 1; #Is your timezone currently observing DST (Daylight Saving Time)? (0 is No. 1 is Yes.) var int timezone_fix = 7; #Hours to add to fix timezone printing var bool timezone_fix_on = true; #Activate timezone fix? var int[] total_month_days = [0, 31, 28, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31]; var string comment_date = $c.time->date_format(); var string comment_time = $c.time->time_format(); var string comment_dayname = $c.time->date_format("%%da%%"); var int comment_year = 0; var int comment_month = 0; var int comment_day = 0; var int comment_hour = 0; var int time_iso = 0; var int comment_min = 0; var string negpos = "+"; if ($tz_neg == 1){ $negpos = "-"; } if ($dst == 1){ $timezone = $timezone - 1; } if ($timezone < 00 or $timezone > 12){ $timezone = 00; } if ($timezone_min >= 60 or $timezone_min < 00){ $timezone_min = 00; } ## TIMEZONE FIX if ($timezone_fix != 0 and $timezone_fix_on) { $timezone = $timezone + $timezone_fix; } ## /TIMEZONE FIX $comment_year = int( $c.time->date_format("%%yyyy%%")); $comment_month = int(0+$c.time->date_format("%%mm%%")); $comment_day = int(0+$c.time->date_format("%%dd%%")); $comment_hour = int(0+$c.time->date_format("%%HH%%")); $comment_min = int(0+$c.time->date_format("%%min%%")); var int tz_year = $comment_year; var int tz_hour = $comment_hour; var int tz_min = $comment_min; var int tz_day = $comment_day; var int tz_mon = $comment_month; var int prev_month_days = 30; var int feb_days = 28; var int day_num = 1; var int month_days = 31; var int year_days = 365; var int prev_year_days = 365; var int prev_year = $comment_year - 1; if ($comment_year % 4 == 0){ $year_days = 366; } if ($prev_year % 4 == 0){ $prev_year_days = 366; } $month_days = $total_month_days[$comment_month]; $prev_month_days = ($comment_month > 1) ? $total_month_days[$comment_month - 1] : $total_month_days[12]; if ($comment_year % 4 == 0){ $feb_days = 29; } if ($comment_month == 03){ $prev_month_days = $feb_days; } else { if ($comment_month == 02){ $month_days = $feb_days; } } if ($tz_neg == 1){ $tz_hour = $comment_hour - $timezone; $tz_min = $tz_min - $timezone_min; } else { $tz_hour = $comment_hour + $timezone; $tz_min = $tz_min + $timezone_min; } ## TIMEZONE FIX if ($timezone_fix != 0 and $timezone_fix_on) { $timezone = $timezone - $timezone_fix; } ## /TIMEZONE FIX if ($comment_dayname == $*lang_dayname_short[1]){ $day_num = 1; } else { if ($comment_dayname == $*lang_dayname_short[2]){ $day_num = 2; } else { if ($comment_dayname == $*lang_dayname_short[3]){ $day_num = 3; } else { if ($comment_dayname == $*lang_dayname_short[4]){ $day_num = 4; } else { if ($comment_dayname == $*lang_dayname_short[5]){ $day_num = 5; } else { if ($comment_dayname == $*lang_dayname_short[6]){ $day_num = 6; } else { if ($comment_dayname == $*lang_dayname_short[7]){ $day_num = 7; } } } } } } } if ($tz_min >= 60){ $tz_min = $tz_min - 60; $tz_hour = $tz_hour + 1; } else { if ($tz_min < 00){ $tz_min = $tz_min + 60; $tz_hour = $tz_hour - 1; } } if ($tz_hour >= 24){ $tz_hour = $tz_hour - 24; $tz_day = $tz_day + 1; $day_num = $day_num + 1; } else { if ($tz_hour < 00){ $tz_hour = $tz_hour + 24; $tz_day = $tz_day - 1; $day_num = $day_num - 1; } } if ($tz_day > $month_days){ $tz_day = $tz_day - $month_days; $tz_mon = $tz_mon + 1; } if ($tz_day <= 00){ $tz_day = $tz_day + $prev_month_days; $tz_mon = $tz_mon - 1; } if ($tz_mon > 12){ $tz_mon = $tz_mon - 12; $tz_year = $tz_year + 1; } else { if ($tz_mon <= 0){ $tz_mon = $tz_mon + 12; $tz_year = $tz_year - 1; } } if ($day_num <= 0){ $day_num = 7 + $day_num; } var string AMPM = "PM"; if ($tz_hour >= 00 and $tz_hour < 12){ $AMPM = "AM"; } var int tw_hour = $tz_hour; if ($AMPM == "PM"){ $tw_hour = $tw_hour - 12; } var int yy_year = $tz_year - 1900; if ($yy_year >= 100){ $yy_year = $yy_year - 100; } var string day_ordinal = lang_ordinal($tz_day); $comment_dayname = $*lang_dayname_long[$day_num]; var string comment_monthname = $*lang_monthname_long[$tz_mon]; var string str_yy_year = string($yy_year); var string str_year = string($tz_year); var string str_mon = string($tz_mon); var string str_day = string($tz_day); var string str_padmon = zeropad($str_mon, 2); var string str_padday = zeropad($str_day, 2); var string tz_date = $comment_dayname + ", " + $comment_monthname + ", " + $day_ordinal + ", " + $str_year; var string str_hour = string($tw_hour); var string str_padhour = zeropad($str_hour, 2); var string str_milhour = string($tz_hour); var string str_padmilhour = zeropad($str_hour, 2); var string str_min = string($tz_min); var string str_padmin = zeropad($str_min, 2); var string str_timezone = string($timezone); var string str_timezone_min = string($timezone_min); var string str_offset = $negpos + zeropad($str_timezone, 2) + zeropad($str_timezone_min, 2); var string tz_time = $str_hour + ":" + $str_padmin + " " + $AMPM + " (" + $str_offset + " GMT)"; var string tz_datetime = $tz_date + " - " + $tz_time; ######### #Available formats: #Date #$str_yy_year = two-digit year #$str_year = four-digit year #$str_mon = month number #$str_day = day number #$str_padmon = month number with leading zero #$str_padday = day number with leading zero #$comment_dayname = long day name #$comment_monthname = full month name #$day_ordinal = day ordinal number + st, nd, rd, etc #Time #$str_hour = twelve hour #$str_padhour = twelve hour with leading zero #$str_milhour = 24 hour #$str_padmilhour = 24 hour with leading zero #$str_padmin = minutes with leading zero #$AMPM = AM or PM #$str_offset = prints current offset $tz_date = $comment_dayname + ", " + $comment_monthname + ", " + $day_ordinal + ", " + $str_year; $tz_time = $str_padhour + ":" + $str_padmin + " " + $AMPM->lower() + (($.args{"gmt"}) ? (" (" + $str_offset + " GMT)") : ""); $tz_datetime = $tz_date + " - " + $tz_time; # make same as tranqii time $tz_datetime = $*lang_monthname_short[int($str_mon)] + ". $day_ordinal, $str_year | $tz_time"; #################################################################### var string comment_class = ""; if ( $c.screened ) { $comment_class = "ind-comment-screened"; } elseif ( $c.frozen ) { $comment_class = "ind-comment-frozen"; } elseif ( $c.depth % 2 == 0 ) { $comment_class = "ind-comment-two"; } else { $comment_class = "ind-comment-one"; } var string poster = defined $c.poster ? $c.poster->as_string() : "$*text_comment_anonymous"; var string poster_text = defined $c.poster ? $c.poster.name : "$*text_comment_anonymous"; var string sub_icon; var int indent = (($c.depth - 1) * 5); if ( defined $c.subject_icon ) { $sub_icon = $c.subject_icon->as_string(); } print "
\n"; var string userpic; if ( defined $c.userpic and $*comment_userpic_style != "off" ) { $userpic = """

$c.poster.username's user pictures

"""; } var string commentdate = ""; # default tranqii format # $commentdate = $c.time->date_format($*date_format) + " - " + $c.time->time_format($*time_format); $commentdate = $tz_datetime; #userpic print "$userpic\n"; # subject: if ( $c.subject == "" ) { print "

$c.subject_icon $*text_nosubject

"; } else { print "

$c.subject_icon $c.subject

"; } print "

"; print "$*text_comment_from $poster
\n"; print "$*text_comment_date $commentdate
\n"; if ( $c.metadata{"poster_ip"} ) { print "$*text_comment_ipaddr " + $c.metadata{"poster_ip"} + "
"; } print get_permalink($c.permalink_url) + "
\n"; var Link lnk; foreach var string key ($c.link_keyseq) { $lnk = $c->get_link($key); if ( $lnk.url != "" ) { if($lnk.icon.url != "") { print """$lnk.caption """; } } } print "

\n"; if ( $this.multiform_on ) { print ""; $c->print_multiform_check(); } print "
$c.text
\n"; print "

"; print "$*text_comment_reply"; if ( $c.parent_url != "" ) { print " | $*text_comment_parent"; } if ( $c.thread_url != "" ) { print " | $*text_comment_thread"; } print "

"; print "
\n\n"; print "
"; } function EntryPage::print_comment_partial (Comment c) { var string poster = defined $c.poster ? $c.poster->as_string() : "$*text_poster_anonymous"; var string subj = $c.subject != "" ? $c.subject : $*text_nosubject; var int timezone = 08; #Offset from GMT in hours. (NO NEGATIVES!) If your offset from GMT is -0730, this value would be "07". var int timezone_min = 00; #Offset from GMT in minutes. If your offset from GMT is -0730, this value would be "30". var int tz_neg = 1; #Offset is negative = 1 (USA is = 1) or positive = 0 If your offset from GMT is -0730, this value would be "1". var int dst = 1; #Is your timezone currently observing DST (Daylight Saving Time)? (0 is No. 1 is Yes.) var int timezone_fix = 7; #Hours to add to fix timezone printing var bool timezone_fix_on = true; #Activate timezone fix? var int[] total_month_days = [0, 31, 28, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31]; var string comment_date = $c.time->date_format(); var string comment_time = $c.time->time_format(); var string comment_dayname = $c.time->date_format("%%da%%"); var int comment_year = 0; var int comment_month = 0; var int comment_day = 0; var int comment_hour = 0; var int time_iso = 0; var int comment_min = 0; var string negpos = "+"; if ($tz_neg == 1){ $negpos = "-"; } if ($dst == 1){ $timezone = $timezone - 1; } if ($timezone < 00 or $timezone > 12){ $timezone = 00; } if ($timezone_min >= 60 or $timezone_min < 00){ $timezone_min = 00; } ## TIMEZONE FIX if ($timezone_fix != 0 and $timezone_fix_on) { $timezone = $timezone + $timezone_fix; } ## /TIMEZONE FIX $comment_year = int( $c.time->date_format("%%yyyy%%")); $comment_month = int(0+$c.time->date_format("%%mm%%")); $comment_day = int(0+$c.time->date_format("%%dd%%")); $comment_hour = int(0+$c.time->date_format("%%HH%%")); $comment_min = int(0+$c.time->date_format("%%min%%")); var int tz_year = $comment_year; var int tz_hour = $comment_hour; var int tz_min = $comment_min; var int tz_day = $comment_day; var int tz_mon = $comment_month; var int prev_month_days = 30; var int feb_days = 28; var int day_num = 1; var int month_days = 31; var int year_days = 365; var int prev_year_days = 365; var int prev_year = $comment_year - 1; if ($comment_year % 4 == 0){ $year_days = 366; } if ($prev_year % 4 == 0){ $prev_year_days = 366; } $month_days = $total_month_days[$comment_month]; $prev_month_days = ($comment_month > 1) ? $total_month_days[$comment_month - 1] : $total_month_days[12]; if ($comment_year % 4 == 0){ $feb_days = 29; } if ($comment_month == 03){ $prev_month_days = $feb_days; } else { if ($comment_month == 02){ $month_days = $feb_days; } } if ($tz_neg == 1){ $tz_hour = $comment_hour - $timezone; $tz_min = $tz_min - $timezone_min; } else { $tz_hour = $comment_hour + $timezone; $tz_min = $tz_min + $timezone_min; } ## TIMEZONE FIX if ($timezone_fix != 0 and $timezone_fix_on) { $timezone = $timezone - $timezone_fix; } ## /TIMEZONE FIX if ($comment_dayname == $*lang_dayname_short[1]){ $day_num = 1; } else { if ($comment_dayname == $*lang_dayname_short[2]){ $day_num = 2; } else { if ($comment_dayname == $*lang_dayname_short[3]){ $day_num = 3; } else { if ($comment_dayname == $*lang_dayname_short[4]){ $day_num = 4; } else { if ($comment_dayname == $*lang_dayname_short[5]){ $day_num = 5; } else { if ($comment_dayname == $*lang_dayname_short[6]){ $day_num = 6; } else { if ($comment_dayname == $*lang_dayname_short[7]){ $day_num = 7; } } } } } } } if ($tz_min >= 60){ $tz_min = $tz_min - 60; $tz_hour = $tz_hour + 1; } else { if ($tz_min < 00){ $tz_min = $tz_min + 60; $tz_hour = $tz_hour - 1; } } if ($tz_hour >= 24){ $tz_hour = $tz_hour - 24; $tz_day = $tz_day + 1; $day_num = $day_num + 1; } else { if ($tz_hour < 00){ $tz_hour = $tz_hour + 24; $tz_day = $tz_day - 1; $day_num = $day_num - 1; } } if ($tz_day > $month_days){ $tz_day = $tz_day - $month_days; $tz_mon = $tz_mon + 1; } if ($tz_day <= 00){ $tz_day = $tz_day + $prev_month_days; $tz_mon = $tz_mon - 1; } if ($tz_mon > 12){ $tz_mon = $tz_mon - 12; $tz_year = $tz_year + 1; } else { if ($tz_mon <= 0){ $tz_mon = $tz_mon + 12; $tz_year = $tz_year - 1; } } if ($day_num <= 0){ $day_num = 7 + $day_num; } var string AMPM = "PM"; if ($tz_hour >= 00 and $tz_hour < 12){ $AMPM = "AM"; } var int tw_hour = $tz_hour; if ($AMPM == "PM"){ $tw_hour = $tw_hour - 12; } var int yy_year = $tz_year - 1900; if ($yy_year >= 100){ $yy_year = $yy_year - 100; } var string day_ordinal = lang_ordinal($tz_day); $comment_dayname = $*lang_dayname_long[$day_num]; var string comment_monthname = $*lang_monthname_long[$tz_mon]; var string str_yy_year = string($yy_year); var string str_year = string($tz_year); var string str_mon = string($tz_mon); var string str_day = string($tz_day); var string str_padmon = zeropad($str_mon, 2); var string str_padday = zeropad($str_day, 2); var string tz_date = $comment_dayname + ", " + $comment_monthname + ", " + $day_ordinal + ", " + $str_year; var string str_hour = string($tw_hour); var string str_padhour = zeropad($str_hour, 2); var string str_milhour = string($tz_hour); var string str_padmilhour = zeropad($str_hour, 2); var string str_min = string($tz_min); var string str_padmin = zeropad($str_min, 2); var string str_timezone = string($timezone); var string str_timezone_min = string($timezone_min); var string str_offset = $negpos + zeropad($str_timezone, 2) + zeropad($str_timezone_min, 2); var string tz_time = $str_hour + ":" + $str_padmin + " " + $AMPM + " (" + $str_offset + " GMT)"; var string tz_datetime = $tz_date + " - " + $tz_time; ######### #Available formats: #Date #$str_yy_year = two-digit year #$str_year = four-digit year #$str_mon = month number #$str_day = day number #$str_padmon = month number with leading zero #$str_padday = day number with leading zero #$comment_dayname = long day name #$comment_monthname = full month name #$day_ordinal = day ordinal number + st, nd, rd, etc #Time #$str_hour = twelve hour #$str_padhour = twelve hour with leading zero #$str_milhour = 24 hour #$str_padmilhour = 24 hour with leading zero #$str_padmin = minutes with leading zero #$AMPM = AM or PM #$str_offset = prints current offset $tz_date = $comment_dayname + ", " + $comment_monthname + ", " + $day_ordinal + ", " + $str_year; $tz_time = $str_padhour + ":" + $str_padmin + " " + $AMPM->lower() + (($.args{"gmt"}) ? (" (" + $str_offset + " GMT)") : ""); $tz_datetime = $tz_date + " - " + $tz_time; # make same as tranqii time $tz_datetime = $*lang_monthname_short[int($str_mon)] + ". $day_ordinal, $str_year | $tz_time"; ######################################################################################################### print """$subj - $poster - $tz_datetime"""; } function ReplyPage::print_body ( ) { if ( not $.entry.comments.enabled ) { print "
\n"; print "
"; print "

$*text_reply_nocomments_header

"; print "$*text_reply_nocomments"; print "
"; print "
"; } else { print "
\n"; # get date var string datetime; if($.replyto.depth > 0) { var EntryLite c = $.replyto; var int timezone = 08; #Offset from GMT in hours. (NO NEGATIVES!) If your offset from GMT is -0730, this value would be "07". var int timezone_min = 00; #Offset from GMT in minutes. If your offset from GMT is -0730, this value would be "30". var int tz_neg = 1; #Offset is negative = 1 (USA is = 1) or positive = 0 If your offset from GMT is -0730, this value would be "1". var int dst = 1; #Is your timezone currently observing DST (Daylight Saving Time)? (0 is No. 1 is Yes.) var int timezone_fix = 7; #Hours to add to fix timezone printing var bool timezone_fix_on = true; #Activate timezone fix? var int[] total_month_days = [0, 31, 28, 31, 30, 31, 31, 30, 31, 30, 31, 30, 31]; var string comment_date = $c.time->date_format(); var string comment_time = $c.time->time_format(); var string comment_dayname = $c.time->date_format("%%da%%"); var int comment_year = 0; var int comment_month = 0; var int comment_day = 0; var int comment_hour = 0; var int time_iso = 0; var int comment_min = 0; var string negpos = "+"; if ($tz_neg == 1){ $negpos = "-"; } if ($dst == 1){ $timezone = $timezone - 1; } if ($timezone < 00 or $timezone > 12){ $timezone = 00; } if ($timezone_min >= 60 or $timezone_min < 00){ $timezone_min = 00; } ## TIMEZONE FIX if ($timezone_fix != 0 and $timezone_fix_on) { $timezone = $timezone + $timezone_fix; } ## /TIMEZONE FIX $comment_year = int( $c.time->date_format("%%yyyy%%")); $comment_month = int(0+$c.time->date_format("%%mm%%")); $comment_day = int(0+$c.time->date_format("%%dd%%")); $comment_hour = int(0+$c.time->date_format("%%HH%%")); $comment_min = int(0+$c.time->date_format("%%min%%")); var int tz_year = $comment_year; var int tz_hour = $comment_hour; var int tz_min = $comment_min; var int tz_day = $comment_day; var int tz_mon = $comment_month; var int prev_month_days = 30; var int feb_days = 28; var int day_num = 1; var int month_days = 31; var int year_days = 365; var int prev_year_days = 365; var int prev_year = $comment_year - 1; if ($comment_year % 4 == 0){ $year_days = 366; } if ($prev_year % 4 == 0){ $prev_year_days = 366; } $month_days = $total_month_days[$comment_month]; $prev_month_days = ($comment_month > 1) ? $total_month_days[$comment_month - 1] : $total_month_days[12]; if ($comment_year % 4 == 0){ $feb_days = 29; } if ($comment_month == 03){ $prev_month_days = $feb_days; } else { if ($comment_month == 02){ $month_days = $feb_days; } } if ($tz_neg == 1){ $tz_hour = $comment_hour - $timezone; $tz_min = $tz_min - $timezone_min; } else { $tz_hour = $comment_hour + $timezone; $tz_min = $tz_min + $timezone_min; } ## TIMEZONE FIX if ($timezone_fix != 0 and $timezone_fix_on) { $timezone = $timezone - $timezone_fix; } ## /TIMEZONE FIX if ($comment_dayname == $*lang_dayname_short[1]){ $day_num = 1; } else { if ($comment_dayname == $*lang_dayname_short[2]){ $day_num = 2; } else { if ($comment_dayname == $*lang_dayname_short[3]){ $day_num = 3; } else { if ($comment_dayname == $*lang_dayname_short[4]){ $day_num = 4; } else { if ($comment_dayname == $*lang_dayname_short[5]){ $day_num = 5; } else { if ($comment_dayname == $*lang_dayname_short[6]){ $day_num = 6; } else { if ($comment_dayname == $*lang_dayname_short[7]){ $day_num = 7; } } } } } } } if ($tz_min >= 60){ $tz_min = $tz_min - 60; $tz_hour = $tz_hour + 1; } else { if ($tz_min < 00){ $tz_min = $tz_min + 60; $tz_hour = $tz_hour - 1; } } if ($tz_hour >= 24){ $tz_hour = $tz_hour - 24; $tz_day = $tz_day + 1; $day_num = $day_num + 1; } else { if ($tz_hour < 00){ $tz_hour = $tz_hour + 24; $tz_day = $tz_day - 1; $day_num = $day_num - 1; } } if ($tz_day > $month_days){ $tz_day = $tz_day - $month_days; $tz_mon = $tz_mon + 1; } if ($tz_day <= 00){ $tz_day = $tz_day + $prev_month_days; $tz_mon = $tz_mon - 1; } if ($tz_mon > 12){ $tz_mon = $tz_mon - 12; $tz_year = $tz_year + 1; } else { if ($tz_mon <= 0){ $tz_mon = $tz_mon + 12; $tz_year = $tz_year - 1; } } if ($day_num <= 0){ $day_num = 7 + $day_num; } var string AMPM = "PM"; if ($tz_hour >= 00 and $tz_hour < 12){ $AMPM = "AM"; } var int tw_hour = $tz_hour; if ($AMPM == "PM"){ $tw_hour = $tw_hour - 12; } var int yy_year = $tz_year - 1900; if ($yy_year >= 100){ $yy_year = $yy_year - 100; } var string day_ordinal = lang_ordinal($tz_day); $comment_dayname = $*lang_dayname_long[$day_num]; var string comment_monthname = $*lang_monthname_long[$tz_mon]; var string str_yy_year = string($yy_year); var string str_year = string($tz_year); var string str_mon = string($tz_mon); var string str_day = string($tz_day); var string str_padmon = zeropad($str_mon, 2); var string str_padday = zeropad($str_day, 2); var string tz_date = $comment_dayname + ", " + $comment_monthname + ", " + $day_ordinal + ", " + $str_year; var string str_hour = string($tw_hour); var string str_padhour = zeropad($str_hour, 2); var string str_milhour = string($tz_hour); var string str_padmilhour = zeropad($str_hour, 2); var string str_min = string($tz_min); var string str_padmin = zeropad($str_min, 2); var string str_timezone = string($timezone); var string str_timezone_min = string($timezone_min); var string str_offset = $negpos + zeropad($str_timezone, 2) + zeropad($str_timezone_min, 2); var string tz_time = $str_hour + ":" + $str_padmin + " " + $AMPM + " (" + $str_offset + " GMT)"; var string tz_datetime = $tz_date + " - " + $tz_time; ######### #Available formats: #Date #$str_yy_year = two-digit year #$str_year = four-digit year #$str_mon = month number #$str_day = day number #$str_padmon = month number with leading zero #$str_padday = day number with leading zero #$comment_dayname = long day name #$comment_monthname = full month name #$day_ordinal = day ordinal number + st, nd, rd, etc #Time #$str_hour = twelve hour #$str_padhour = twelve hour with leading zero #$str_milhour = 24 hour #$str_padmilhour = 24 hour with leading zero #$str_padmin = minutes with leading zero #$AMPM = AM or PM #$str_offset = prints current offset $tz_date = $comment_dayname + ", " + $comment_monthname + ", " + $day_ordinal + ", " + $str_year; $tz_time = $str_padhour + ":" + $str_padmin + " " + $AMPM->lower() + (($.args{"gmt"}) ? (" (" + $str_offset + " GMT)") : ""); $tz_datetime = $tz_date + " - " + $tz_time; # make same as tranqii time $tz_datetime = $*lang_monthname_short[int($str_mon)] + ". $day_ordinal, $str_year | $tz_time"; $datetime = $tz_datetime; #################################################################### } else { $datetime = $.replyto.time->date_format($*date_format) + " | " + $.replyto.time->time_format($*time_format); } # get any extra user info (if posting to community, etc) var string poster = ""; var string userpic = ""; if ( defined $.replyto.poster ) { $poster = $.replyto.poster->as_string(); if ( defined $.replyto.userpic ) { $userpic = """

$.replyto.poster.username's user pictures

"""; } } else { $poster = "$*text_comment_anonymous"; } # print the entry now: print "
"; # print icon (if needed) if ( $userpic != "" ) { print "$userpic"; } print "

"; if ( $.replyto.subject == "" ) { print "$*text_nosubject"; } else { print "$.replyto.subject"; } print "

"; print "

\n"; print "$datetime
"; print "$*text_comment_from $poster"; if ( $.replyto.metadata{"poster_ip"} ) { print "$*text_comment_ipaddr " + $.replyto.metadata{"poster_ip"} + "
"; } print "

"; print "
$.replyto.text
\n"; print "

"; print get_permalink($.replyto.permalink_url) + " | $*text_comment_viewall\n"; print "

"; print "
\n"; print "
"; print "
\n"; print "

Reply

\n"; $.form->print(); print "
"; print "
"; } } function Page::print ( ) { var string title = $this->title(); # generate page id: var string current_view = $.view; if ( $.view == "month" or $.view == "day" ) { $current_view = "archive"; } if ( $.view == "entry" or $.view == "reply" ) { $current_view = "recent"; } # begin main page html: print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; $this->print_head(); print "\n"; print "\n"; print "\n"; print "\n"; print "$title\n"; print "\n"; print "\n"; print "
\n"; print "
\n"; print "
\n"; print "

$title

\n"; print "
"; print "
\n"; print "
\n"; print "
\n"; # print userpic $this->lay_top_userpic(); print "\n"; # print navigation print_lj_links($this); # print summary print($this->lay_sidebar_view_summary()); # print linklist $this->print_linklist(); # print tags list var Tag[] tags = $this->visible_tag_list(); if(size $tags) { "

Tags:

"; var string height = "200px"; """
"""; "
    "; foreach var Tag tag ($tags) { """
  • $tag.name
  • """; } "
"; "
"; "
"; } print "
\n"; print "
\n"; $this->print_body(); print "
\n"; print "
\n"; print "\n"; print "\n"; }