<?php

// -----------------------------------------------------------------------
// This file is part of aroundme
//
// Copyright (C) 2003, 2005 Barnraiser
// http://www.barnraiser.org/
// info@barnraiser.org
//
// This program is free software; you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the
// Free Software Foundation; either version 2, or (at your option) any
// later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with program; see the file COPYING. If not, write to the Free
// Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
// -----------------------------------------------------------------------

?>


<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td width="180" valign="top">
			<?php
			$show_item = 1;
			$hide_form = 1;
			include $templatePath . "tag.inc.tpl.php";
			?>
		</td>

		<td width="20">
			<img src="<?php echo $templatePath;?>img/pixel.png" width="20" height="1" alt="" /><br />
		</td>
		
		<td width="560" valign="top">
			<?php
			if (isset($blog)) {
			?>
			<div class="box_top">
				<?php echo $blog['blog_create_datetime'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td>
						<span class="txt_item_title">
						<?php echo $blog['blog_title'];?><br />
						</span>
						<?php echo $blog['blog_body_display'];?><br />
					</td>
				</tr>
				<tr>
					<td class="txt_footer">
						<?php echo $lang['txt_author'];?>: <a href="sn_profile.php?user_id=<?php echo $author['user_id'];?>" class="txt_footer_link"><?php echo $author['profile_nic'];?></a>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_joined'];?>: <?php echo $author['display_profile_create_datetime'];?>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_hometown'];?>: <?php echo $author['profile_hometown'];?>
						<?php
						if (isset($group)) {
						?>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_group'];?>: <a href="g_group.php?group_id=<?php echo $group['group_id'];?>" class="txt_footer_link"><?php echo $group['group_title'];?></a>
						<?php }?>
						<br />
					</td>
				</tr>
			</table>
			</div>
			<?php }?>

			<?php
			if (isset($subject)) {
			?>
			<div class="box_top">
				<?php echo $subject['subject_create_datetime'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td valign="top">
						<?php
						if (isset($subject['image'])) {
						?>
						<img src="get_file.php?file=<?php echo $subject['image']['file'];?>" border="0" align="left" class="picture_left" title="<?php echo $subject['image']['file_title'];?>">
						<?php  }?>
						<span class="txt_item_title">
						<?php echo $subject['subject_title'];?><br />
						</span>
						<?php echo $subject['display_subject_body'];?><br />
					</td>
			    </tr>
				<tr>
					<td class="txt_footer">
						<?php echo $lang['txt_last_edit'];?>: <a href="sn_profile.php?user_id=<?php echo $author['user_id'];?>&amp;user_id=<?php echo $author['user_id'];?>" class="txt_footer_link"><?php echo $author['profile_nic'];?></a>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_joined'];?>: <?php echo $author['display_profile_create_datetime'];?>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_hometown'];?>: <?php echo $author['profile_hometown'];?>
						<?php
						if (isset($group)) {
						?>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_group'];?>: <a href="g_group.php?group_id=<?php echo $group['group_id'];?>" class="txt_footer_link"><?php echo $group['group_title'];?></a>
						<?php }?>
						<br />
					</td>
			    </tr>
			</table>
			</div>
			<?php }?>


			<?php
			if (isset($poll)) {
 			?>
			<div class="box_top">
				<?php echo $poll['poll_start_datetime'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
 			<table border="0" cellspacing="4" cellpadding="0" width="100%">
 				<tr>
					<td valign="top">
						<?php
						include $templatePath . "poll_detail.inc.tpl.php";
						?>
					</td>
				</tr>
				<?php
				if (isset($poll_history)) {
				?>
				<tr>
					<td class="vote_results_box" valign="top">
						<b><?php echo $lang['hdr_my_vote_history'];?></b><br />
						<?php
						$separator = ", ";
						foreach($poll_history as $key => $r):
							if ($key == (count($poll_history)-1)) {
							    $separator=".";
							}
							echo $r['option_body'] . " (" . $r['answer_create_datetime'] . ")" . $separator;
						endforeach;
						?>
					</td>
				</tr>
				<?php }?>
				<?php
				if (isset($group)) {
				?>
				<tr>
					<td class="txt_footer">
						<?php echo $lang['txt_group'];?>: <a href="g_group.php?group_id=<?php echo $group['group_id'];?>" class="txt_footer_link"><?php echo $group['group_title'];?></a><br />
					</td>
				</tr>
				<?php }?>
 			</table>
			</div>
			<?php }?>

			<?php
			if (isset($library)) {
			?>
			<div class="box_top">
				<?php echo $library['display_library_create_datetime'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td>
						<span class="txt_item_title">
						<?php echo $library['library_title'];?><br />
						</span>
						<?php echo $library['library_body_display'];?><br />
					</td>
				</tr>
				<tr>
					<td class="txt_footer">
						<?php echo $lang['txt_last_edit'];?>: <a href="sn_profile.php?user_id=<?php echo $author['user_id'];?>" class="txt_footer_link"><?php echo $author['profile_nic'];?></a>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_joined'];?>: <?php echo $author['display_profile_create_datetime'];?>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_hometown'];?>: <?php echo $author['profile_hometown'];?>
						<?php
						if (isset($group)) {
						?>
						&nbsp;&#47;&nbsp;
						<?php echo $lang['txt_group'];?>: <a href="g_group.php?group_id=<?php echo $group['group_id'];?>" class="txt_footer_link"><?php echo $group['group_title'];?></a>
						<?php }?>
						<br />
					</td>
				</tr>
			</table>
			</div>
			<?php }?>
			
			<div id="box_bottom">
				<table cellpadding="0" cellspacing="0" border="0" width="100%">
					<tr>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/box_bottom_left.png" width="5" height="18" alt="" border="0" /><br />
						</td>
						<td align="left">
							<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="9" alt="" border="0" /><br />
						</td>
						<td align="right">
							<img src="<?php echo $templatePath;?>img/box_bottom_right.png" width="5" height="18" alt="" border="0" /><br />
						</td>
					</tr>
				</table>
			</div>
			

			<?php
			if (isset($allow_add_comment)) {
				$unlocked = 1;
			}

			if (isset($blog)) {
				$hidden_form = array(
					"comment_item_id" => $blog['blog_id'],
					"blog_id" => $blog['blog_id'],
					"group_id" => $blog['group_id']
				);
			}
			elseif (isset($subject)) {
				$hidden_form = array(
					"comment_item_id" => $subject['subject_id'],
					"subject_id" => $subject['subject_id']
				);
			}
			elseif (isset($library)) {
				$hidden_form = array(
					"comment_item_id" => $library['library_id'],
					"library_id" => $library['library_id'],
					"group_id" => $library['group_id']
				);
			}
			elseif (isset($poll)) {
				$hidden_form = array(
					"comment_item_id" => $poll['poll_id'],
					"poll_id" => $poll['poll_id'],
					"group_id" => $poll['group_id']
				);
			}

			$requested_comment_language_id = null;
			unset($group);
			include $templatePath . "comment.inc.tpl.php";
			?>
			
		</td>
	</tr>
</table>
