Atrisināts, 19.09.2005.
http://klab.lv/community/pajautaa/524408.h
tml
Skatos, cibai laikam jau kods atjaunots vai kaa - un nu jaa, mana
stilam radushaas probleemas. Nav jau nekas briesmiigs - visus ierakstus
izlasiit var, komenteet var utt. Iztruukst kodaa pirms ierakstiem
gjenereejamais - virsraksti un sidebar-i.
Kompileejas it kaa bez probleemaam.
Vietas taupiibas noluukos - function print_stylesheet kodā izlaists.
Varbūt kāds varētu norādīt, kur tā problēma slēpjas?
(layout - "smooth sailing")
layerinfo "type" = "theme";
layerinfo "name" = "erroneous";
function Entry::print_metadata() {
var Page p = get_page();
if ($p.view=="friends" or
$p.journal_type=="C" or ($this->lay_show_usericon() and defined
$.userpic))
{
"""<div class="entryUserinfo">""";
if (defined
$.userpic and $this->lay_show_usericon() and
$*layout_position_usernames_entry=="belo
w")
{
"""<div class="entryUserinfo-usericon"><a
href="$*SITEROOT/allpics.bml?user=$.post
er.username">""";
if($.userpic.height > 50) {
"""<img src="$.userpic.url" height="50px" alt="$.poster.name
($.poster.username)" />""";
} else {
"""<img
src="$.userpic.url" height="$.userpic.height" alt="$.poster.name
($.poster.username)" />""";
}
"""</a></div>""";
}
if ($p.view=="friends" or $p.journal_type=="C") {
"""<div class="entryUserinfo-username">""";
"""<span class="ljuser"
style="white-space:nowrap;">$.poster</sp
an>""";
if
($.journal->as_string()!=$.poster->as_st
ring() and
$p.view=="friends") {
print "<br />";
if ($*text_entry_username_seperator != "") {
print $*text_entry_username_seperator + "<br />";
}
"""<span class="ljuser"
style="white-space:nowrap;">$.journal</s
pan>""";
}
"""</div>""";
}
if (defined
$.userpic and $this->lay_show_usericon() and
$*layout_position_usernames_entry=="abov
e") { """<div
class="entryUserinfo-usericon">""";
if($.userpic.height > 50) {
"""<img
src="$.userpic.url" height="50px" alt="$.poster.name
($.poster.username)" />""";
} else {
"""<img
src="$.userpic.url" height="$.userpic.height" alt="$.poster.name
($.poster.username)" />""";
}
"""</div>"""; }
}
"""<dl class="entryMetadata">
<dt class="entryMetadata-label">""";
#
print "<a
href=\""+$.journal->base_url()+"/calenda
r/$.time.year/"+zeropad($.time.month,2)+
"/"+zeropad($.time.day,2)+"/\">"+$.time-
>date_format("%%dayord%%")+"</a>-";
#
print "<a
href=\""+$.journal->base_url()+"/calenda
r/$.time.year/"+zeropad($.time.month,2)+
"/\">"+$.time->date_format("%%mon%%")+"<
/a>-";
#
print "<a
href=\""+$.journal->base_url()+"/calenda
r/$.time.year/\">"+$.time->date_format("
%%yyyy%%")+"</a>
";
#
print """</dt><dd
class="entryMetadata-content">""";$.time-
>time_format();
print
$.time->time_format($*text_format_entry_
date_and_time);"""</dt><br
/>""";
if (($.metadata{"mood"}!="" or $.metadata{"music"}!="" or ((size
$.tags>0)and($*layout_position_entrytags=
="metadata"))) and
($.itemid!=int($*layout_guestbook_entryi
d))) {
if ((size $.tags>0)and($*layout_position_entrytags=
="metadata")) {
"""<dt class="entryMetadata-label">$*text_meta_
tags:</dt>
<dd class="entryMetadata-content"><a
href="$.tags[0].url">$.tags[0].name</a>"
"";
foreach var int i (1 .. (size $.tags - 1)) {
""", <a href="$.tags[$i].url">$.tags[$i].name</a>
""";
}
"""</dd><br />""";
}
if
($.metadata{"mood"}!="") { """<dt
class="entryMetadata-label">$*text_meta_
mood:</dt><dd
class="entryMetadata-content">"""; print
$.metadata{"mood"}+$.mood_icon; """</dd><br />"""; }
if
($.metadata{"music"}!="") { """<dt
class="entryMetadata-label">$*text_meta_
music:</dt><dd
class="entryMetadata-content">"""; print $.metadata{"music"};
"""</dd><br />""";
}
}
"""</dl></div>""";
}
function Entry::lay_print_subjectline() {
var Page p = get_page();
if ($.itemid!=int($*layout_guestbook_entryi
d)) {
"""<div
class="entryHeader"><h3 class="entryHeaderSubject">""";
if ($p.view=="entry") {
print (defined $.security_icon?" - $.security_icon":"");
}else{
print (defined $.security_icon or $.subject!=""?" ":"")+(defined
$.security_icon?"$.security_icon ":"")+($.subject==""?"":"$.subject");
}
"""</h3>""";
if ((size $.tags>0)and($*layout_position_entrytags=
="subject")) {
"""<span class="entryHeaderTags"> [<a
href="$.tags[0].url">$.tags[0].name</a>"
"";
foreach var int i (1 .. (size $.tags - 1)) {
""", <a href="$.tags[$i].url">$.tags[$i].name</a>
""";
}
"""]</span>""";
}
"""</div>""";
}else{
"""<div class="entryHeader">""";
print (defined $.security_icon?""+$.security_icon:"&nbs
p;");
"""</div>""";
}
}
function Page::print_entry(Entry e) {
if ( $e.itemid==int($*layout_guestbook_entryi
d) and ($.view=="recent" or $.view=="day" )) { return; }
if ( $.args{"noshow"}==$e.journal.username ) { return; }
""" <a name="$e.journal.username$e.itemid"></a>
<div class="entryHolder">
""";
$e->lay_print_subjectline();
$e->print_metadata();
"""<div class="entryText">"""; print $e.text; """</div>""";
$e->print_linkbar();
""" </div> <!-- entryHolder -->
""";
}
function Page::lay_print_header() {
var string title = $.global_title;
var string subtitle = $.global_subtitle;
"""
<div class="pageheaderblock"><h1
class="header-title">$title</h1><h1
class="header-title1">$title</h1>
<h2 class="header-subtitle">$subtitle</h2><h
2
class="header-subtitle2">$subtitle</h2><h
2
class="header-icon">$this.journal.defaul
t_pic</h2>
</div>
""";
$this->lay_print_header_links();
"""
<!--pageheaderblock-->
""";
}
function Page::lay_print_bodytitlebox(string title, string titletype) {
"""
<div class="bodyheaderblock">
<h1 class="body-$titletype">$title </h1>
</div>
""";
}
function Page::lay_print_body() {
$this->lay_print_bodytop();
"""<div class="bodyblock">""";
if ($*layout_sidebar_position=="left") {
"""<div id="sbarbox">""";
$this->lay_print_sidebar();
"""</div>""";
}
"""<div class="entrybox">""";
$this->lay_print_bodybottom();
"""</div>""";
if ($*layout_sidebar_position=="right") {
"""<div id="sbarbox">""";
$this->lay_print_sidebar();
"""</div>""";
}
"""</div> <!--bodyblock-->""";
}
function Page::lay_print_sidebox_top(string title) {
"""
<div class="sidebox">
""";
if ($title!="") {
"""
<h3 class="sideboxTitle">$title</h3>
""";
}
}
###### Summary######
function Entry::lay_print_summaryline(Page p) {
"""<li class="summaryList">""";
if ($p.view=="friends") {
"""$.poster""";
if
($.journal.username!=$.poster.username) { print
$*text_sidebox_summary_username_seperato
r; """$.journal"""; }
""" - """;
}elseif ($p.view=="day") {
print $.time->time_format(); """ - """;
}else{
#nothing
}
if (defined $.security_icon) { """$.security_icon """; }
"""<a href="#$.journal.username$.itemid">""";
if ($.subject!="") { print
$this->plain_subject(); } else {
"""<i>$*text_nosubject</i>"""; }
"""</a>""";
if ($.comments.count>0 or
$.comments.screened) { """ <a
href="$.comments.read_url">[+$.comments.c
ount]</a>"""; }
"""</li>
""";
}
function Comment::lay_print_summaryline(Page p) {
"""<li class="summaryList">""";
print (defined $.poster?""+$.poster:"<i>$*text_poster_a
nonymous</i>");
""" - <a href="#$.anchor">""";
if ($.subject!="") { """$.subject"""; } else { """<i>$*text_nosubject</i>"""; }
"""</a>""";
var int count = $this->lay_count_replies();
if ($count>0) { """ [+$count]"""; }
"""</li>""";
}
function Page::lay_print_sidebar_summary() {}
function RecentPage::lay_print_sidebar_summary() {
$this->lay_print_sidebox_top($*text_side
box_summary_title);
"""<div class="sideboxContent"><ul id="summary">""";
var int i = size $.entries - 1;
if ($i<0) { """</div> <!--sidebox-summary -->"""; return; }
foreach var int pos (0..$i) {
var Entry e = $.entries[$pos];
if ($e.itemid!=int($*layout_guestbook_entry
id)) {$e->lay_print_summaryline($this);}
}
"""</ul></div> <!--sidebox-summary -->""";
$this->lay_print_sidebox_bottom();
}
function FriendsPage::lay_print_sidebar_summary()
{
$this->lay_print_sidebox_top($*text_side
box_summary_title);
"""<div class="sideboxContent"><ul id="summary">""";
var int i = size $.entries - 1;
if ($i<0) { """</div> <!--sidebox-summary -->"""; return; }
foreach var int pos (0..$i) {
var Entry e = $.entries[($*layout_friends_sortorder=="n
ewest"?$pos:$i-$pos)];
$e->lay_print_summaryline($this);
}
"""</ul></div> <!--sidebox-summary -->""";
$this->lay_print_sidebox_bottom();
}
function DayPage::lay_print_sidebar_summary() {
$this->lay_print_sidebox_top($*text_side
box_summary_title);
"""<div class="sideboxContent"><ul id="summary">""";
var int i = size $.entries - 1;
if ($i<0) { """</div> <!--sidebox-summary -->"""; return; }
foreach var int pos (0..$i) {
var Entry e = $.entries[($*layout_day_sortorder=="newe
st"?$i-$pos:$pos)];
if ($e.itemid!=int($*layout_guestbook_entry
id)) {$e->lay_print_summaryline($this);}
}
"""</ul></div> <!--sidebox-summary -->""";
$this->lay_print_sidebox_bottom();
}
function EntryPage::lay_print_sidebar_summary() {
$this->lay_print_sidebox_top($*text_side
box_summary_title);
"""<div class="sideboxContent"><ul id="summary">""";
$.entry->lay_print_summaryline($this);
foreach var Comment c ($.comments) {
$c->lay_print_summaryline($this);
}
"""</ul></div> <!--sidebox-summary -->""";
$this->lay_print_sidebox_bottom();
}
function Page::print() {
var string title = $this->title();
"""<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xh
tml1-transitional.dtd">
<html>
<head>
<title>$title</title>
""";
if ($*layout_stylesheet=="") {
""" <link title="Romachino" rel="stylesheet" href="$.stylesheet_url" type="text/css" />""";
}else{
""" <link title="External" rel="stylesheet" href="$*layout_stylesheet" type="text/css" />""";
}
$this->print_head();
"""
</head>
<body>
<a name="top"></a>
"""; $this->print_body(); """
<div class="counter">
<a href="http://counter.hackers.lv/"><img
src="http://cc5461.counter.hackers.lv/co
unter.php?uid=5461"
alt="hackers counter system" />
</a>
</div>
</body>
</html>
""";
}
tik traki pamainīts jau nav gan, lielākā daļa ir tīra kosmētika
bet viena (varbūt vienīgā) būtiskā lieta, izskatās, sabojāja visu tavu pasaulīti - ir pamainītas lomas f-jām Page::print_body un ap to esošajām
izmaiņas idejiski pareizā virzienā, bet no tā jau nesāp mazāk