<?php

// -----------------------------------------------------------------------
// This file is part of Igloo
// 
// Copyright (C) 2003, 2006 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., 51 Franklin St, Fifth Floor, Boston, MA
// 02110-1301, USA.
// -----------------------------------------------------------------------
?>

<div class="col_left1">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_publish_community'];?><br />
		</div>
		
		<div class="box_mid">
			<div class="content">
			
				<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
							$lnk = "lib_view.php?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 />
							<?php echo $i['library_synopsis'];?><br />
						</td>
					</tr>
					<?php
					endforeach;
					} else {
					?>
					<tr>
						<td>
							<?php echo $lang['err_no_library'];?><br />
						</td>
					</tr>
					<?php }?>
					<tr>
						<td align="right" colspan="2">
							<a href="lib_edit.php"><?php echo $lang['sub_add'];?></a><br />
						</td>
					</tr>
				</table>
				
				<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />
				<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
							$lnk = "frm_view.php?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 />
							<?php echo $i['subject_synopsis'];?><br />
						</td>
						<td align="right" valign="top">
							<?php echo $i['total_replies'];?><br />
						</td>
					</tr>
					<?php
					endforeach;
					} else {
					?>
					<tr>
						<td colspan="2">
							<?php echo $lang['err_no_forum'];?><br />
						</td>
					</tr>
					<?php }?>
					<tr>
						<td align="right" colspan="2">
							<a href="frm_edit.php"><?php echo $lang['sub_add'];?></a><br />
						</td>
					</tr>
				</table>
				
				<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />
				<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
							$lnk = "blg_view.php?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 />
							<?php echo $i['blog_synopsis'];?><br />
						</td>
						<td align="right" valign="top" nowrap>
							<?php echo $this->date->formatDate($i['blog_create_datetime']);?><br />
						</td>
					</tr>
					<?php
					endforeach;
					} else {
					?>
					<tr>
						<td colspan="2">
							<?php echo $lang['err_no_blogs'];?><br />
						</td>
					</tr>
					<?php }?>
					<tr>
						<td align="right" colspan="2">
							<a href="blg_edit.php"><?php echo $lang['sub_add'];?></a><br />
						</td>
					</tr>
				</table>
			</div>
		</div>
	</div>
	
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>

<div class="col_right1">
	<div class="box">
		<div class="box_top">
			<?php echo $lang['hdr_publish_community'];?><br />
		</div>
			
		<div class="box_mid">
			<div class="content">
				<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/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td valign="top">
							<?php echo $i['poll_question'];?><br />
							<?php echo $i['option_body'];?><br />
						</td>
						<td align="right" valign="top">
							<?php echo $this->date->formatDate($i['answer_create_datetime']);?><br />
						</td>
					</tr>
					<?php
					endforeach;
					} else {
					?>
					<tr>
						<td colspan="3">
							<?php echo $lang['err_no_poll_participation'];?><br />
						</td>
					</tr>
					<?php }?>
					<tr>
						<td align="right" colspan="3">
							<a href="pol_edit.php"><?php echo $lang['sub_add'];?></a><br />
						</td>
					</tr>
				</table>
				
				
				<?php
				if ($this->user_acs->checkPermission($resource_ids['shoutbox'], $privilege_ids['allow_access'])) { //resourece_id, Priv_id
				?>
				<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />
				<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/dot.png" width="3" height="9" alt="" /><br />
						</td>
						<td>
							<?php echo $this->date->formatDate($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 }?>
					<tr>
						<td align="right" colspan="2">
							<a href="sho_view.php"><?php echo $lang['sub_add'];?></a><br />
						</td>
					</tr>
				</table>
				<?php }?>
				
				<img src="<?php echo $templatePath;?>img/pixel.png" width="1" height="3" alt="" /><br />
				<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['hdr_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/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 $this->date->formatDate($i['profile_create_datetime']);?>, <?php echo $lang['txt_hometown'];?>: <?php echo $i['profile_hometown'];?>)<br />
										<?php echo $lang['txt_comment_datetime'];?>: <?php echo $this->date->formatDate($i['comment_create_datetime'], 1);?><br />
									</td>
								</tr>
								<tr>
									<td valign="top">
										<?php
										if ($rsp_item_type_ids['blog'] == $i['rsp_item_type_id']) {
										?>
										<a href="blg_view.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="lib_view.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>
	</div>
	
	<div class="box_bottom">
		<span class="box_bottom_right"></span>
		<span class="box_bottom_left"></span>
	</div>
</div>
