%%comment-list-anonymous-html%%
roots.encielo.org : / (context:13)
2002-08-11 20:23:47

%%preprocess%%
// format the object for display
$this->beryliumToHtml(); 
$this->timeFormat("F j, Y \a\\t g:ia");
$this->getBaseUrl();

// show sitemember if no author defined
if ($this->author== "") $this->author= bparsebml("[sitemember:$this->sitememberid]");

// If untitled, just title it Comment
if ($this->title=="") $this->title= "Comment";

// 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;comment:$this->id]");
	}
else $this->iconTag= "<img src='/bicons/comment$this->iconpvt.png' border=0 alt='comment:$this->id' title='comment:$this->id'>";

// set up delete/undelete icon
if ($this->status=="deleted") $this->deleteTag= "un-delete";
else $this->deleteTag= "delete";

// 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;
	}

// form
if ($sitemember->role!="anonymous") {
	$this->commentForm= "
<form method='post' action='$folder->baseUrl/comment-.html?method=save$session->cgi' class=commentForm>
<input type=hidden name='parentobjtype' value='$object->objtype'>
<input type=hidden name='parentid' value='$object->id'>
<input type=hidden name='author' value=''>
<b>Add your comments:</b>
<blockquote>
Subject: (optional)
<br>
<input type='text' name='title' size='42' maxlength='255'>
<br>
<br>
Comment:
<br>
<textarea name='body' cols='46' wrap='VIRTUAL' rows='8'></textarea>
<br>
<br>
<input type='submit' name='submit' value='post' class='buttonstyle'>
</blockquote>
</form>
";
	}
else {
	$this->commentForm= "To submit a comment, please send it to <i>comments@$site->name</i>.";
	}

// editing controls
if ($sitemember->id==$this->sitememberid OR ($sitemember->role=="editor" OR $sitemember->role=="admin")) {
	berror("comment-list-anonymous-html: comment is owned by this sitemember, showing controls...",1);
	$this->controlsTag= "
		( <a href='$this->idUrl?method=edit$session->cgi'>edit</a> |
		<a href='$this->idUrl?method=delete$session->cgi'>$this->deleteTag</a> )";
	}
else berror("comment-list-anonymous-html: comment not owned by this sitemember (this->sitememberid=$this->sitememberid).",1);

%%header%%
<blockquote>

%%css%%


%%template%%
<a name="comment:$this->id"></a>$this->iconTag&nbsp;<b>$this->title</b> by $this->author on $this->created. 
$this->controlsTag
<blockquote>$this->body</blockquote>
<br>


%%listrow%%
 

%%nullobject%%
<tt>There are no comments.</tt>

%%footer%%
</blockquote>
$this->commentForm

%%postprocess%%


%%end of context%%

 
