<?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="370" valign="top">
			<div class="box_top">
				<?php echo $lang['section_publish_group'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td>
						<b><?php echo $lang['hdr_publish_library'];?></b><br />
					</td>
				</tr>
				<?php
				if (isset($publish_library)) {
				foreach($publish_library as $key => $i):
				?>
				 <tr>
					<td>
						<?php
						if (!empty($i['group_id'])) {
							$lnk = "lib_item.php?group_id=" . $i['group_id'] . "&amp;page_id=" . $i['library_id'];
						}
						else {
							$lnk = "lib_item.php?user_id=" . $i['user_id'] . "&amp;page_id=" . $i['library_id'];
						}
						?>
						<a href="<?php echo $lnk;?>"><img align="left" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture_left" title="<?php echo $i['image']['file_title'];?>"></a>
						<a href="<?php echo $lnk;?>"><?php echo $i['library_title'];?></a><br />
						<span class="txt_footer"><?php echo dots('120', $i['library_synopsis']);?></span><br />
					</td>
			    </tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td>
						<?php echo $lang['err_no_library'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			
			<hr />
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />

			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td colspan="2">
						<b><?php echo $lang['hdr_publish_forum'];?></b><br />
					</td>
				</tr>
				<?php
				if (isset($publish_forum)) {
				foreach($publish_forum as $key => $i):
				?>
				 <tr>
					<td>
						<?php
						if (!empty($i['group_id'])) {
							$lnk = "frm_item.php?group_id=" . $i['group_id'] . "&amp;subject_id=" . $i['subject_id'];
						}
						else {
							$lnk = "frm_item.php?user_id=" . $i['user_id'] . "&amp;subject_id=" . $i['subject_id'];
						}
						?>
						<a href="<?php echo $lnk;?>"><img align="left" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture_left" title="<?php echo $i['image']['file_title'];?>"></a>
						<a href="<?php echo $lnk;?>"><?php echo $i['subject_title'];?></a><br />
						<span class="txt_footer"><?php echo dots('120', $i['subject_body']);?></span><br />
					</td>
					<td align="right" valign="top">
						<span class="txt_footer"><?php echo $i['total_replies'];?></span><br />
					</td>
			    </tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_forum'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			
			<hr />
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />

			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td colspan="2">
						<b><?php echo $lang['hdr_publish_blog_item'];?></b><br />
					</td>
				</tr>
				<?php
				if (isset($blogs)) {
				foreach($blogs as $key => $i):
				?>
				 <tr>
					<td valign="top">
						<?php
						if (!empty($i['group_id'])) {
							$lnk = "blg_item.php?group_id=" . $i['group_id'] . "&amp;blog_id=" . $i['blog_id'];
						}
						else {
							$lnk = "blg_item.php?user_id=" . $i['user_id'] . "&amp;blog_id=" . $i['blog_id'];
						}
						?>
						<a href="<?php echo $lnk;?>"><img align="left" src="get_file.php?file=<?php echo $i['image']['file'];?>" border="0" class="picture_left" title="<?php echo $i['image']['file_title'];?>"></a>
						<a href="<?php echo $lnk;?>"><?php echo $i['blog_title'];?></a><br />
						<span class="txt_footer"><?php echo $i['blog_synopsis'];?></span><br />
					</td>
					<td align="right" valign="top" nowrap>
						<span class="txt_footer"><?php echo $i['blog_create_datetime'];?></span><br />
					</td>
			    </tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_blogs'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			</div>
			
			<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>


		</td>

		<td width="20">
			<img src="<?php echo $templatePath;?>img/pixel.png" width="20" height="1" alt="" /><br />
		</td>

		<td width="370" valign="top">
			<div class="box_top">
				<?php echo $lang['section_publish_community'];?><br />
			</div>
			
			<div class="box_mid" style="padding: 9px;">
			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td colspan="3">
						<b><?php echo $lang['hdr_poll_participation'];?></b><br />
					</td>
				</tr>
				<?php
				if (isset($poll_participation)) {
				foreach($poll_participation as $key => $i):
				?>
				 <tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td valign="top">
						<?php echo $i['poll_question'];?><br />
						<span class="txt_footer"><?php echo $i['option_body'];?></span><br />
					</td>
					<td align="right" valign="top">
						<span class="txt_footer"><?php echo $i['answer_create_datetime'];?></span><br />
					</td>
			    </tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_poll_participation'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			
			
			<?php
			if ($this->user_acs->checkPermission($resource_ids['shoutbox'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
			?>
			<hr />
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />

			<table width="100%" cellpadding="4" cellspacing="0" border="0">
				<tr>
					<td colspan="2">
						<b><?php echo $lang['hdr_publish_shouts'];?></b><br />
					</td>
				</tr>
				<?php
				if (isset($publish_shouts)) {
				foreach($publish_shouts as $key => $i):
				?>
			    <tr valign="top">
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td>
						<?php echo $i['shoutbox_create_datetime'];?>: <?php echo $i['shoutbox_body'];?><br />
					</td>
			    </tr>
				<?php
				endforeach;
				} else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_shouts'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			<?php }?>
			
			<hr />
			<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />

			<table border="0" width="100%" cellspacing="0" cellpadding="4">
				<tr>
					<td colspan="2">
						<b><?php echo $lang['section_comments'];?></b><br />
					</td>
				</tr>
				<?php
				if (isset($comments)) {
				foreach($comments as $key => $i):
				?>
				<tr>
					<td width="3" valign="top">
						<img src="<?php echo $templatePath;?>img/green_dot.png" width="3" height="9" alt="" /><br />
					</td>
					<td valign="top">
						<table width="100%" cellpadding="4" cellspacing="0" border="0">
							<tr>
								<td class="txt_footer" colspan="2">
									<?php echo $lang['txt_from'];?>: <a href="sn_profile.php?user_id=<?php echo $i['user_id'];?>" class="txt_footer_link"><?php echo $i['profile_nic'];?></a>&nbsp;(<?php echo $lang['txt_joined'];?>: <?php echo $i['profile_create_datetime'];?>, <?php echo $lang['txt_hometown'];?>: <?php echo $i['profile_hometown'];?>)<br />
									<?php echo $lang['txt_comment_datetime'];?>: <?php echo $i['comment_create_datetime'];?><br />
								</td>
							</tr>
							<tr>
								<td valign="top">
									<?php
									if ($rsp_item_type_ids['blog'] == $i['rsp_item_type_id']) {
									?>
									<a href="my_blog.php?blog_id=<?php echo $i['item_id'];?>"><?php echo $lang['rsp']['item_type'][$i['rsp_item_type_id']];?></a>:&nbsp;
									<?php
									}
									elseif ($rsp_item_type_ids['library'] == $i['rsp_item_type_id']) {
									?>
									<a href="my_library.php?library_id=<?php echo $i['item_id'];?>"><?php echo $lang['rsp']['item_type'][$i['rsp_item_type_id']];?></a>:&nbsp;
									<? }?>
									
									<?php echo $i['comment_body'];?><br />
								</td>
						    </tr>

						</table>
					</td>
				</tr>
				<?php
				endforeach;
				}
				else {
				?>
				<tr>
					<td colspan="2">
						<?php echo $lang['err_no_comments'];?><br />
					</td>
				</tr>
				<?php }?>
			</table>
			</div>
			
			<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>
		</td>
	</tr>
</table>
