%%sequence-view-editor-html%%
2002-11-27 13:00

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

if ($this->id=="") {
	header("HTTP/1.0 404 Not Found");
	}

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


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

// only show body if body is there!
if (trim($this->body)) {
	//$this->body= bparsebml($this->body);
	$this->bodyContent= "
<table border=0>
	<tr>
		<td width='1%'><img src='/bicons/spacer.gif' border=0 alt=sequence width=20 height=1></td>
		<td width='98%'>&nbsp;</td>
		<td width='1%'><img src='/bicons/spacer.gif' border=0 alt=sequence width=20 height=1></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td class='objBody'>$this->body</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td width='1%'>&nbsp;</td>
		<td width='98%'>&nbsp;</td>
		<td width='1%'>&nbsp;</td>
	</tr>
</table>
<table cellspacing=5 cellpadding=5>
	<tr>
		<td align='right' class='info'>
				<a href='sequence-$this->name.txt'><img src='/bicons/print.gif' border=0 alt='text version' title='text version' align=absmiddle></a>
				<a href='sequence-$this->name.txt'>text</a> |
				<a href='$session->refreshURL'><img src='/bicons/refresh.gif' border=0 alt='refresh page' title='refresh page' align=middle></a>
				<a href='$session->refreshURL'>refresh</a> |
				<a href='$folder->baseUrl?method=view$session->cgi'><img src='/bicons/folder-open.gif' border=0 alt='parent folder' title='parent folder' align=middle></a>
				<a href='$folder->baseUrl?method=view$session->cgi'>$folder->title</a> |
				<a href='$this->baseUrl?method=toggleRank$session->cgi'><img src='/bicons/bulbsgif/$this->glow.gif' alt='$this->publishStatus' title='sequence:$this->id is $this->publishStatus' align=absmiddle border=0></a> |
				<a href='$this->baseUrl?method=edit$session->cgi'><img src='/bicons/edit.gif' alt='edit' title='edit this object' align=absmiddle border=0></a> 
				<a href='$this->baseUrl?method=edit$session->cgi'>edit</a> |
				<a href='#top'>jump to top</a>&nbsp;
		</td>
	</tr>
</table>
<br>";
	}

// subscriptionTag
if ($sitemember->id>0 && $this->p_subscriptionList!="") {
    // if sitemember is on subscription list, say so and link to unsubscribe
    $subscriptionArray= explode(",",$this->p_subscriptionList);
    $found= 0;
    foreach ($subscriptionArray AS $key=>$value) {
	if ($value==$sitemember->id) {
	    $found= 1;
	    berror("sequence-view: found sitemember->id in subscriptionList array at $key.",1);
	    }
	}

    if ($found) {
	$this->subscribeTag= "<p>You will receive a copy of all new comments at $member->email.
		<a href='$this->baseUrl?method=toggleSubscribed$session->cgi'>Click to unsubscribe.</a>
		To find out who else is subscribed, <a href='$this->baseUrl?method=viewSubscriptionList'>click here</a>.</p>";
	}
    else {
	// else, link to subscribe
	$this->subscribeTag= "<p><a href='$this->baseUrl?method=toggleSubscribed$session->cgi'>Subscribe to this discussion</a> via email.
	To find out who is subscribed, <a href='$this->baseUrl?method=viewSubscriptionList'>click here</a>.</p>";
	}
    }
elseif ($sitemember->id>0) {
    // link to subscribe
    $this->subscribeTag= "<p><a href='$this->baseUrl?method=toggleSubscribed$session->cgi'>Subscribe to this discussion</a> via email.</p>";
    }

// 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];
	}
else $this->commentTotal= "0";


%%header%%

%%css%%

%%template%%
<table class='objTable' cellspacing=5 cellpadding=5>
	<tr>
		<td>
			<table class='objHeader'>
				<tr>
					<td width='1' valign='middle'>$this->iconTag</td>
					<td>
						<span class='objFlavor'>$this->flavor:<br></span>
						<span class='objTitle'><a href='$this->baseUrl'>$this->headline</a></span>
						<span class='objByline'> <br> 
							By $this->authorTag (#$this->sitememberid) on $this->dateTag.</span>
					</td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td><span class='info'>
						sequence:$this->id is <b>$this->publishStatus</b> as of $this->updated.
						<img src='/bicons/event.gif' alt='updated $this->updated' title='created $this->created - updated $this->updated' align=absmiddle border=0>
						</span>
					</td>
				</tr>
			</table>
			<blockquote class='objDescription'>$this->description<br>&nbsp;</blockquote>
			<p align='right' class='info'>$this->moreTag 
				<a href='#comments'><img src='/bicons/comment.gif' alt='' title='view/add comments' align=absmiddle border=0></a> 
				<a href='#comments'>$this->commentTotal comments</a> | 
				<a href='sequence-$this->name.txt'><img src='/bicons/print.gif' border=0 alt='text version' title='text version' align=absmiddle></a>
				<a href='sequence-$this->name.txt'>text</a> |
				<a href='$this->baseUrl?method=toggleRank$session->cgi'><img src='/bicons/bulbsgif/$this->glow.gif' alt='$this->publishStatus' title='sequence:$this->id is $this->publishStatus' align=absmiddle border=0></a> |
				<a href='$this->baseUrl?method=edit$session->cgi'><img src='/bicons/edit.gif' alt='edit' title='edit this object' align=absmiddle border=0></a> 
				<a href='$this->baseUrl?method=edit$session->cgi'>edit</a> |
				<a href='$this->baseUrl?method=pickup$session->cgi'><img src='/bicons/pickup.gif' alt='pick up' title='pick up this object' align=absmiddle border=0></a>
				<a href='$this->baseUrl?method=pickup$session->cgi'>pick up</a>&nbsp;
			</p>
		</td>
	</tr>
</table>
$this->bodyContent
<table class="commentTable">
	<tr>
		<td valign=top><a name='comments'>&nbsp;</a></td>
		<td><span class='objTitle'>Discussion of <i>$this->title</i>:</span>
			$this->subscribeTag
			{list:SELECT obj.* FROM comment AS obj WHERE obj.siteid='$site->id' AND obj.parentobjtype='sequence' AND obj.parentid='$this->id' $session->statuswhere $session->publicwhere ORDER BY obj.created ASC;list}</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td width='1%'><img src='/bicons/spacer.gif' border=0 alt=sequence width=10 height=1></td>
		<td width='98%'>&nbsp;</td>
		<td width='1%'><img src='/bicons/spacer.gif' border=0 alt=sequence width=10 height=1></td>
	</tr>
</table>

%%listrow%%

%%nullobject%%
<p><img src='/bicons/warning.png' alt='Warning' align=left><br>
	<b>The sequence you requested was not found.</b></p>
<p><a href='$session->scriptname$folder->name/sequence-.html?method=listall$session->cgi'>Here is a list</a> of all the sequences in this folder.</p> 

%%footer%%

%%postprocess%%

%%end of context%%
