%%document-index-anonymous-html%%
roots.encielo.org : / (context:10)
2002-08-11 16:03:36

%%preprocess%%
// format the object for display
$this->beryliumToHtml(); 
$this->timeFormat("F j, Y");
$this->getBaseUrl();

// convert generic flavor to objtype:
if ($this->flavor=="Generic") $this->flavor= "Document";

// show sitemember if no author defined, show sitename if no sitemember found...
if (trim($this->author)== "") $this->author= bparsebml("[sitemember:$this->sitememberid]");
if (trim($this->author)== "") $this->author= $site->title;

// determine dateTag
if ($this->p_originaldate) {
	$origdate= mysql_timestamp($this->p_originaldate);
	$this->originaldate= date("D, M j, Y", $origdate);
	$this->dateTag= $this->originaldate;
	}
else $this->dateTag= $this->created;
	
// compile publishStatus ( like: public-posted-100 ) and glow
switch (true) {
	case ($this->rank < 100) : 
		$lightrank= 50;
		break;	
	case ($this->rank < 500) :
		$lightrank= 100;
		break;
	case ($this->rank < 1000) :
		$lightrank= 500;
		break;
	case ($this->rank >= 1000) :
		$lightrank= 1000;
		break;
	}
if ($this->public) {
	$this->publishStatus= "public-$this->status-$this->rank";
	$this->glow= "public-$this->status-$lightrank";
	}
else {
	$this->publishStatus= "private-$this->status-$this->rank";
	$this->glow= "private-$this->status-$lightrank";
	$this->iconpvt= "-pvt";
	}
if ($this->status=="deleted") $this->glow= "deleted";

// show default icon or alt icon from imageid
if ($this->imageid!="0") {
	$this->iconTag= bparsebml("[icon:$this->imageid;document:$this->id]");
	}
else $this->iconTag= "<img src='/bicons/document$this->iconpvt.png' border=0 alt='document:$this->id' title='document:$this->id'><br>&nbsp;";

// headline fix if only title
if ($this->title=="" && $this->headline=="") $this->title= "Untitled ($this->name)";
elseif ($this->title=="") $this->title= $this->headline;

// more tag if body exists
if ($this->body!="") $this->moreTag="<a href='$this->baseUrl'>full document</a> &raquo; |";

// alternating rows
$session=$GLOBALS[session];
if ($session->row=="" || $session->row==1) {
	$this->rowclass="oddrow";
	$GLOBALS[session]->row=2;
	}
else {
	$this->rowclass="evenrow";
	$GLOBALS[session]->row=1;
	}
	
// show folder link?
if ($folder->id != $this->folderid) $this->folderTag= bparsebml(", in [folder:$this->folderid]");
	
// show archive link?
if ($folder->rank<=500) {
	$this->archiveTag="
		<table class=documentTable cellspacing=5 cellpadding=5>
			<tr class='$this->rowclass'>
				<td align='center'>
					<a href='$folder->baseUrl$this->objtype-.html?method=listall&listranksign=<$session->cgi'>$folder->title $this->objtype archive</a>
				</td>
			</tr>
		</table>";
	}
	
// how many comments?
$query= "SELECT COUNT(obj.id) FROM comment AS obj WHERE obj.parentobjtype='$this->objtype' AND obj.parentid='$this->id' $session->statuswhere $session->publicwhere";
if ($result=@mysql_query($query)) {
	$commentTotal= mysql_fetch_row($result);
	$this->commentTotal= $commentTotal[0]." ";
	if ($this->commentTotal==0) $this->commentTotal="";
	}

%%header%%


%%css%%


%%template%%
<tt><br>
<a href="$this->uri"><b>$this->title</b></a>
<br>
$this->description
<br>
&nbsp;<b>$this->created</b> by $this->author
<br>
<br></tt>

%%listrow%%
 

%%nullobject%%
 

%%footer%%


%%postprocess%%


%%end of context%%

 
