%%comment-list-anonymous-html%%
2002-07-18 17:31

%%preprocess%%
// format the object for display
$this->beryliumToHtml(); 
$this->getRuntimeVars();

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


// set up delete/undelete icon
if ($this->status=="deleted") $this->deleteTag= "<img src='/bicons/undelete.gif' alt='un-delete' title='set status to hidden' align=absmiddle border=0> un-delete";
else $this->deleteTag= "<img src='/bicons/delete.gif' alt='delete' title='set status to deleted' align=absmiddle border=0> 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" && $sitemember->role!="member") {
	$this->commentForm= "
		<hr>
	      <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=''>
			<input type=hidden name='flavor' value='Pose'>
			<table border='0' align='center'>
				<tr> 
					<td colspan='2' class=commentTitle><img src='/bicons/comment.gif' align=absmiddle>&nbsp;Add a Pose to this Character:</td>
				</tr>
				<tr>
					<td align='right' valign='top'>Image Url:</td>
					<td valign='top'><input type='text' name='title' size='42' maxlength='255'><br>
					&nbsp;Here's a <a href='$folder->baseUrl/image-.html?method=listall'>list of images</a> in this folder.</td>
				</tr>
				<tr>
					<td align='right' valign='top'>Pose Description:</td>
					<td><input type='text' name='description' size='42' maxlength='255'></td>
				</tr>
				<tr> 
					<td>&nbsp;</td>
					<td><input type='submit' name='submit' value='post' class='buttonstyle'></td>
				</tr>
			</table>
	      </form>";
	}
elseif (0) {
	$this->commentForm= "
		<hr>
	      <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='flavor' value='Pose'>
			<table border='0' align='center'>
				<tr> 
					<td colspan='2' class=commentTitle><img src='/bicons/comment.gif' align=absmiddle>&nbsp;Add a Pose to this Character:</td>
				</tr>
				<tr> 
					<td valign='top' colspan='2'>
                                            Please choose one:<br>
					    <img src='/bicons/spacer.gif' width=12 height=24><input type='radio' name='authType' value='anonymous' checked>Your name: <input type='text' name='author' size='32' maxlength='255' align='absmiddle'><br>
                                            <img src='/bicons/spacer.gif' width=12 height=20><input type='radio' name='authType' value='login'>Login on next screen (you must already be a member; <a href='$object->baseUrl?method=createmember'>register here</a>)
                                        </td>
				</tr>
				<tr>
					<td align='right' valign='top'>Image Url:</td>
					<td valign='top'><input type='text' name='title' size='42' maxlength='255'></td>
				</tr>
				<tr>
					<td align='right' valign='top'>Pose Name:</td>
					<td><input type='text' name='description' size='42' maxlength='255'></td>
				</tr>
				<tr> 
					<td>&nbsp;</td>
					<td><input type='submit' name='submit' value='post' class='buttonstyle'></td>
				</tr>
			</table>
	      </form>";
	}
	
if ($sitemember->role!="anonymous" && $sitemember->id==$this->sitememberid) {
	berror("comment-list-anonymous-html: comment is owned by this sitemember, showing controls...",1);
	$this->controlsTag= "
		<p align='right' class='commentControls'>
			<a href='$folder->baseUrl/comment-$this->id.html?method=edit$session->cgi'><img src='/bicons/edit.gif' alt='edit' title='edit this object' align=absmiddle border=0></a>
			<a href='$folder->baseUrl/comment-$this->id.html?method=edit$session->cgi'>edit</a> |
			<a href='$folder->baseUrl/comment-$this->id.html?method=delete$session->cgi'>$this->deleteTag</a>
			&nbsp;
		</p>";
	}
else berror("comment-list-anonymous-html: comment not owned by this sitemember (this->sitememberid=$this->sitememberid).",1);

%%header%%
<table width='96%'>
	<tr>

%%css%%
.comments { border: 1px; padding: 3px; border-style: none; border-color: #0099cc; }
.comments HR { height: 1px; background-color: #ff9900; border-style: none; }
.commentForm TD { padding: 5px; }
.commentTitle { color: #006699; font-weight: bold; }
.commentByline { color: #006699; }
.commentBody { color: #333344; font-size: 12px; line-height: 18px; }
.commentControls {font-size: 12px; line-height: 14px; font-weight: normal; }
.commentIcon { background-color: #cccccc; }

%%template%%
		<td class='comments'><hr>
			<table>
				<tr>
					<td align="center" valign="top"><a href='$this->title'><img src="$this->title" border='1'></a></td>
					<td valign='top'>
						<span class=objTitle><a name="comment:$this->id"></a>$this->description</span><span class=commentByline><br>
						by $this->authorTag on $this->created.</span>
						$this->controlsTag
					</td>
				</tr>
			</table>
		</td>

%%listrow%%
	</tr>
	<tr>

%%nullobject%%

%%footer%%
	</tr>
	<tr>
		<td class='comments'>
			$this->commentForm
		</td>
	</tr>
</table>

%%postprocess%%

%%end of context%%
