%%image-poseList-anonymous-html%%
2002-12-28 21:08

%%preprocess%%
$this->beryliumToHtml();
$this->getRuntimeVars();
$this->proportion(150,100);
$this->getFileSize();

	
// nasty old code to put images into rows of three. Must... be... better... way...
if (($GLOBALS['session']->imageIndex=="" || $GLOBALS['session']->imageIndex==0) && $this->listsize>0) {
	// imageIndex tracks which actual image is being served (+2 is because it will be debited twice before the first image is served)
	$GLOBALS['session']->imageIndex= $this->listsize + 2;
	
	// imageCounter is the ideal number of images for this table (a multiple of 3)
	$addImageCells= 0;
	$imageCounter= $this->listsize;
	while (($imageCounter % 3)!=0) {
		$imageCounter++;
		$addImageCells++;
		}
	$GLOBALS['session']->imageCounter= $imageCounter + 2; // (+2 is because it will be debited twice before the first image is served)

	// imageListSize is the local list size
	$GLOBALS['session']->imageListSize= $this->listsize;
	
	// addImageCells is how many cells to add
	$GLOBALS['session']->addImageCells= $addImageCells;
	
	$session= $GLOBALS[session];
	berror("[color:#889900;Image Index:] there are $this->listsize images here. Setting imageIndex ($session->imageIndex) and imageCounter ($session->imageCounter) and imageListSize ($session->imageListSize) and addImageCells ($session->addImageCells). Whew!",1);
	}
$GLOBALS['session']->imageCounter= $GLOBALS['session']->imageCounter - 1;
berror("[color:#668800;Image Index:] just reduced imageCounter by one, is now ".$GLOBALS['session']->imageCounter.".",1);
$GLOBALS['session']->imageIndex= $GLOBALS['session']->imageIndex - 1;
berror("[color:#668800;Image Index:] just reduced imageIndex by one, is now ".$GLOBALS['session']->imageIndex.".",1);

if (($GLOBALS['session']->imageCounter % 3)==1 ) {
	berror("[color:#889900;Image Index:] imageCounter % 3 is 1, inserting rowbreak.",1);
	$this->betweenCells= "</tr><tr>";
	}
else {
	$this->betweenCells= "";
	}
	
if ($GLOBALS['session']->imageIndex==1) {
	berror("[color:#668800;Image Index:] imageIndex is one, inserting $session->addImageCells empty cells.",1);
	$localindex= $session->addImageCells;
	while ($localindex>0) {
		$this->imagePadCells.= " <td>&nbsp;</td> ";
		$localindex= $localindex-1;
		}
	}
$this->imageCounter= $GLOBALS['session']->imageCounter;
$this->imageIndex= $GLOBALS['session']->imageIndex;
$this->mod3= $this->imageCounter % 3;

if ($session->canSave['image']==1 || $session->canSave['all']==1) {
	$this->poseForm= "
		<br />
	      <form  enctype='multipart/form-data' method='post' action='$folder->baseUrl/image-.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'>
			<input type=hidden name='rank' value='100'>
			<input type=hidden name='status' value='posted'>
			<input type=hidden name='public' value='1'>
			<table border='0' align='center' class='editTable'>
				<tr>
					<td colspan='2' class='objTitle'>Add a new Pose to this Character:</td>
				</tr>
				<tr>
					<td align='right' valign='top'>upload a new image:</td>
					<td valign='top'><input name='imagefile' type='file' size='32'></td>
				</tr>
				<tr>
				<td align='right' valign='top'><b>OR</b> import new image:</td>
				<td valign='top'><input type='text' name='imageurl' size='42' maxlength='255' value='$this->imageurl'><br>
						&nbsp;Public internet URL of image.</td>
				</tr>
				<tr>
					<td align='right' valign='top'>Pose Title:</td>
					<td><input type='text' name='title' size='42' maxlength='255'></td>
				</tr>
				<tr>
					<td>&nbsp;</td>
					<td><input type='submit' name='submit' value='post' class='buttonstyle'></td>
				</tr>
			</table>
	      </form>";
	      }


%%header%%
<table border=0>
	<tr>


%%css%%
.imageindex { font-size: 10px; color: #999999; }


%%template%%
		<td align=center valign=middle width='33%' class='imageindex'><a name='pose:$this->id'> </a>
			<a href='$this->baseURL'><img src='$this->uri' height='$this->height' width='$this->width' alt='image:$this->id' title='image:$this->id' border='1' vspace=5 hspace=5></a>
			<br>$this->title - $this->filesize<br />
			( $this->format: $this->origWidth x $this->origHeight )
		</td>
		$this->imagePadCells

		
%%listrow%%
$this->betweenCells


%%nullobject%%
 

%%footer%%
	</tr>
</table>
$this->poseForm

%%postprocess%%


%%end of context%%
