View file modules/comments/views/default/list_comments.tpl

File size: 2.66Kb
<?php $this->display('header.tpl', array('sub_title' => 'Комментарии')) ?>

<div class="title"><img src="<?php echo URL ?>views/<?php echo THEME ?>/img/titl.gif" class="ico" alt="" /><b>Комментарии</b></div>

<form action="<?php echo a_url('comments', 'module='. $_GET['module'] .'&amp;item_id='. $_GET['item_id'] .'&amp;module_name='. $_GET['module_name']) ?>" method="post">
<div class="menu">
Оставить комментарий:<br />
<textarea cols="15" rows="4" name="comment"></textarea><br />
<input type="submit" name="submit" value="Отправить" /><br />
</div>
</form>

<?php if($comments): ?>
	<?php foreach($comments AS $comment): ?>
	<div class="menu">
	<table cellpadding="0" cellspacing="0">
		<tr>
			<td><?php if($comment['avatar_exists']) echo '<img src="'. URL .'files/avatars/'. $comment['user_id'] .'_32.jpg" alt="" />'; else echo '<img src="'. URL .'files/avatars/empty_32.png" alt="" />'; ?>&#160;</td>
			<td>
				<b><a href="<?php echo a_url('user/profile/view', 'user_id='. $comment['user_id']) ?>"><?php echo $comment['username'] ?></a></b> [<?php echo a_is_online($comment['last_visit']) ?>] <?php if(a_check_rights($comment['user_id'], $comment['user_status'])): ?>[<a href="<?php echo a_url('comments/comment_delete', 'comment_id='. $comment['comment_id'] . '&amp;module='. $_GET['module'] .'&amp;item_id='. $_GET['item_id'] .'&amp;module_name='. $_GET['module_name']) ?>">x</a>]<?php endif; ?><br />
				<span style="color: grey; font-size: 11px;">[<?php echo date('d.m.Y в H:i', $comment['time']) ?>]</span>
			</td>
		</tr>
	</table>

	<?php echo $comment['text'] ?>
	</div>
	<?php endforeach; ?>
<?php else: ?>
	<div class="block">
	Комментариев пока нет, оставьте свой и он будет первым =)
	</div>
<?php endif; ?>

<?php if($pagination): ?>
<div class="block">
<?php echo $pagination ?>
</div>
<?php endif; ?>

<div class="block">
<a href="<?php echo a_url('smiles', 'return_name='. urlencode('К комментариям') .'&amp;return_url='. urlencode(a_url('comments', 'module='. @$_GET['module'] .'&item_id='. @$_GET['item_id'] .'&module_name='. @$_GET['module_name'], TRUE))) ?>">Смайлы</a><br />
<a href="<?php echo a_url('main/bbcode', 'return_name='. urlencode('К комментариям') .'&amp;return_url='. urlencode(a_url('comments', 'module='. @$_GET['module'] .'&item_id='. @$_GET['item_id'] .'&module_name='. @$_GET['module_name'], TRUE))) ?>">Теги</a><br />
<a href="<?php echo urldecode(@$_GET['return']) ?>">Вернуться</a><br />
<a href="<?php echo URL ?>">На главную</a>
</div>

<?php $this->display('footer') ?>