Gazelle/sections/comments/post.php

53 lines
1.7 KiB
PHP
Raw Normal View History

2012-10-27 08:00:09 +00:00
<?php
/**
* Prints a table that contains a comment on something
*
* @param $UserID UserID of the guy/gal who posted the comment
* @param $PostID The post number
2013-02-22 08:00:24 +00:00
* @param $postheader the header used in the post.
2012-10-27 08:00:09 +00:00
* @param $permalink the link to the post elsewhere on the site (torrents.php)
* @param $Body the post body
* @param $EditorID the guy who last edited the post
* @param $EditedTime time last edited
* @returns void, prints output
*/
function comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime) {
2013-04-19 08:00:55 +00:00
global $Text,$HeavyInfo;
$UserInfo = Users::user_info($UserID);
$postheader = 'by <strong>' . Users::format_username($UserID, true, true, true, true, false) . '</strong> '
2012-10-27 08:00:09 +00:00
. time_diff($AddedTime) . $postheader;
?>
2013-04-19 08:00:55 +00:00
<table class="forum_post box vertical_margin<?=$noavatar ? ' noavatar' : '' ?>" id="post<?=$PostID?>">
2012-10-29 08:00:20 +00:00
<colgroup>
2013-05-01 08:00:16 +00:00
<? if (Users::has_avatars_enabled()) { ?>
2012-10-29 08:00:20 +00:00
<col class="col_avatar" />
<? } ?>
<col class="col_post_body" />
</colgroup>
2013-04-19 08:00:55 +00:00
<tr class="colhead_dark">
2013-05-01 08:00:16 +00:00
<td colspan="<?=Users::has_avatars_enabled() ? 2 : 1 ?>">
2013-04-19 08:00:55 +00:00
<span style="float: left;"><a href="<?=$permalink ?>">#<?=$PostID?></a>
<?=$postheader ?>
2012-10-27 08:00:09 +00:00
</span>
</td>
</tr>
<tr>
2013-05-01 08:00:16 +00:00
<? if (Users::has_avatars_enabled()) { ?>
2013-04-19 08:00:55 +00:00
<td class="avatar" valign="top">
2013-05-01 08:00:16 +00:00
<?=Users::show_avatar($UserInfo['Avatar'], $UserInfo['Username'], $HeavyInfo['DisableAvatars'])?>
2012-10-27 08:00:09 +00:00
</td>
2013-04-19 08:00:55 +00:00
<? } ?>
<td class="body" valign="top">
2013-02-22 08:00:24 +00:00
<?=$Text->full_format($Body) ?>
2013-04-19 08:00:55 +00:00
<? if ($EditorID) { ?>
<br /><br />
Last edited by
<?=Users::format_username($EditorID, false, false, false) ?> <?=time_diff($EditedTime)?>
<? } ?>
2012-10-27 08:00:09 +00:00
</td>
</tr>
</table>
2013-02-22 08:00:24 +00:00
<? }