Location: PHPKode > projects > Kwalbum > kwalbum/pages/ItemPage.html.php
<?php
/**
 * @version 2.2
 * @package kwalbum
 * @since 2.0 created on Aug 19, 2008
 */
if (!$IPI)
{
	echo '<p class="error">Item does not exist.</p>';
	return;
}
?>
<big><b><a href='<?=$extendedURL.'n='.$IPI->pageNumber?>'><?=$IPI->title?></a> <?=($IPI->description ? substr($IPI->description, 0, 10) : 'Item')?><?=($IPI->canEdit ? ' =Edit Mode=' : null)?></b></big>
<br/>
<table border='0'>
<tr valign='top'>
<td width='<?=THUMB_X?>'><br/>Item <?=$IPI->itemNumber?> of <?=$IPI->totalItems?>
<?=(USER_ID ? '<br/><br/>'.$favSpan : null)?>
<br/><br/>
<small>viewed <?=$IPI->count?> times</small>
</td>
<td rowspan='2' width='<?=RESIZE_X?>'>
<table border='0'>
	<tr valign='bottom'>
	<td align='left'>
	<? if ($IPI->canEdit) {?>
		<div id='time'><?=$IPI->time?></div>
		<div id='date'><?=$IPI->date?></div>
		by <?=$IPI->owner?>
		</td><td align='right'>
		<span id='loc' ><?=$IPI->location?></span>
		<span id='locHint' class='autocomplete'"></span>
	<?} else {?>
		<?=$IPI->datetime?>
		<small>by</small> <?=$IPI->owner?>
		</td><td align='right'>
		<a href="<?=PAGE_URL.'loc='.$IPI->location?>"><?=$IPI->location?></a>
	<?}?>

	</td></tr>
	<tr><td colspan='2'>
	<?=$IPI->resizedItem?>
	</td></tr>
</table>
</td>

<td>
	<? if ($IPI->canEdit) {
		if (DESCRIPTION_ONLY != $IPI->type) {?>
			<b>Description:</b>
			<span id='desc'><?=$IPI->description;?></span>
			<?=(!$IPI->description ? '<input type="button" id="emptyDesc" value="Edit Description"/>':'')?>
			<br/>
		<? } ?>
		<b>Tags:</b>
		<span id='tags'><?=$IPI->tags?></span>
		<?=(!$IPI->tags ? '<input type="button" id="emptyTags" value="Edit Tags"/>':'')?>
		<span id='tagHint' class='autocomplete'"></span>
		<br/>
		<b>People in picture:</b>
		<span id='people'><?=$IPI->people?></span>
		<?=(!$IPI->people ? '<input type="button" id="emptyPeople" value="Edit People"/>':'')?>
		<span id='peopleHint' class='autocomplete'"></span>
		<script type='text/javascript'>
	 		new Ajax.InPlaceEditor('time', 'ajax/editTime.php', {
	 			cols: 6,
	 			highlightcolor: '#aaddff',
	 			highlightendcolor: '#99aaff',
	 			callback: function(form, value) { return 'time=' + escape(value) + '&id=<?=$id?>'; }
	 		});
	 		new Ajax.InPlaceEditor('date', 'ajax/editDate.php', {
	 			cols: 8,
	 			highlightcolor: '#aaddff',
	 			highlightendcolor: '#99aaff',
	 			callback: function(form, value) { return 'date=' + escape(value) + '&id=<?=$id?>'; }
	 		});
	 		new Ajax.InPlaceEditor('loc', 'ajax/editLocation.php', {
	 			cols: 20,
	 			paramName: 'loc',
	 			inputId:'loc',
	 			highlightcolor: '#aaddff',
	 			highlightendcolor: '#99aaff',
	 			onEnterEditMode: function(form, value) {
	 				setTimeout(function() {
	 					new Ajax.Autocompleter('loc', 'locHint', "ajax/getLocations.php", {frequency: 0.1})
	 				}, 110);
	 			},
	 			callback: function(form, value) { return 'loc=' + escape(value) + '&id=<?=$id?>'; }
	 		});
	 		new Ajax.InPlaceEditor('desc', 'ajax/editDescription.php', {
	 			cols: 80,
	 			rows: 20,
	 			highlightcolor: '#aaddff',
	 			highlightendcolor: '#99aaff',
	 			externalControl: 'emptyDesc',
	 			callback: function(form, value) { return 'desc=' + escape(value) + '&id=<?=$id?>'; }
	 		});
	 		new Ajax.InPlaceEditor('tags', 'ajax/editTags.php', {
	 			cols: 20,
	 			paramName: 'tags',
	 			inputId:'tags',
	 			highlightcolor: '#aaddff',
	 			highlightendcolor: '#99aaff',
	 			externalControl: 'emptyTags',
	 			onEnterEditMode: function(form, value) {
	 				setTimeout(function() {
	 					new Ajax.Autocompleter('tags', 'tagHint', "ajax/getTags.php", {frequency: 0.1})
	 				}, 110);
	 			},
	 			callback: function(form, value) { return 'tags=' + escape(value) + '&id=<?=$id?>'; }
	 		});
	 		new Ajax.InPlaceEditor('people', 'ajax/editPeople.php', {
	 			cols: 20,
	 			paramName: 'people',
	 			inputId:'people',
	 			highlightcolor: '#aaddff',
	 			highlightendcolor: '#99aaff',
	 			externalControl: 'emptyPeople',
	 			onEnterEditMode: function(form, value) {
	 				setTimeout(function() {
	 					new Ajax.Autocompleter('people', 'peopleHint', "ajax/getPeople.php", {frequency: 0.1})
	 				}, 110);
	 			},
	 			callback: function(form, value) { return 'people=' + escape(value) + '&id=<?=$id?>'; }
	 		});
		</script>
	<?} else {?>
		<br/>
		<?=(DESCRIPTION_ONLY != $IPI->type ? $IPI->description.'<br/><br/>' : null)?>
		<?=($IPI->tagLinks ? 'Tags: '.$IPI->tagLinks.'<br/>' : null)?>
		<?=((USER_CAN_VIEW and $IPI->peopleLinks) ? 'People: '.$IPI->peopleLinks : null)?>
	<?}?>
</td>
</tr>

<tr valign='bottom'>
<td>
<? if ($IPI->prev) {?>
<a href='<?=$IPI->prev['resizedURL']?>'>Previous Item<br/><?=$IPI->prev['thumbnail']?></a>
<?} else echo 'No<br/>Previous&nbsp;Item'?>
</td>
<td>
<? if ($IPI->next) {?>
<a href='<?=$IPI->next['resizedURL']?>'>Next Item<br/><?=$IPI->next['thumbnail']?></a>
<?} else echo 'No<br/>Next&nbsp;Item'?>
</td>
</tr>
<tr><td></td><td><a href='<?=$IPI->fullURL?>'>view file</a> - <a href='<?=$IPI->downloadURL?>'>download</a></td><td></td></tr>
</table>

<table>
<tr valign='top'>
<td width='50%' align='left'>
Comments<br/>
<?
if (0 < $IPI->numComments)
{
	echo '<table>';
	foreach($IPI->comments as $row)
	{
?>
		<tr><td class='kwalbumCommentCell'>
		&nbsp;&nbsp;&nbsp;<small><?=substr($row['CommentDt'], 0, 16)?> <b><?=$row['CommentName']?></b>
		<?=($IPI->canEdit ? " $row[CommentIp] " .
				"<form method='post' action='{$currentURL}i=$id'><input type='hidden' name='delcsmment' value='$row[CommentId]'><input type='submit' value='Delete Comment'/></form>" : null)?></small>
		<br/>
		<?=$row['CommentText']?>
		</td></tr>
<?
	}
	echo '</table>';
}
?>
</td>
<td>
<?php
if (PUBLIC_COMMENTS or USER_ID)
{
?>
<form method='post' action='<?=$currentURL?>i=<?=$id?>' id='form' onsubmit='return check();'>
Share a comment.
<input type='hidden' name='i' value='1'/>
<table border='0'>
<tr><td align='left'>Name:</td><td align='left'><input type='text' name='nsme' /></td></tr>
<tr><td valign='top'>Comment:</td><td><textarea name='csmment' cols='40' rows='8' wrap='on'></textarea></td></tr>
<tr><td colspan='2' align='center'><input type='submit' value='Add Comment' /></td></tr>
</table>
</form>

<script type='text/javascript'>
<!--
function check () {
  if (document.getElementById('form').nsme.value == '') {
	alert( 'Please enter a name.' );
	document.getElementById('form').nsme.focus();
	return false;
  }
  if (document.getElementById('form').csmment.value == '') {
	alert( 'Please enter a comment.' );
	document.getElementById('form').csmment.focus();
	return false;
  }
  return true ;
}
//-->
</script>
<?php
} else
	echo '<br/>Log in to add comments.';
?>
</td></tr>
</table>
<hr/>
<span id='exifData'><a href='' onClick='return GetJpegExifData(<?=$id?>);'?>View EXIF &amp; Meta Data</a></span>
Return current item: Kwalbum