Gazelle/sections/comments/post.php

57 lines
1.9 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) {
2012-10-29 08:00:20 +00:00
global $Text,$HeavyInfo;
2012-10-27 08:00:09 +00:00
$UserInfo = Users::user_info($UserID);
2013-02-22 08:00:24 +00:00
$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;
?>
<table class='forum_post box vertical_margin<?=$noavatar ? ' noavatar' : ''?>' id="post<?=$PostID?>">
2012-10-29 08:00:20 +00:00
<colgroup>
<? if(empty($UserInfo['DisableAvatars'])) { ?>
<col class="col_avatar" />
<? } ?>
<col class="col_post_body" />
</colgroup>
2012-10-27 08:00:09 +00:00
<tr class='colhead_dark'>
2012-10-29 08:00:20 +00:00
<td colspan="<?=empty($UserInfo['DisableAvatars']) ? 2 : 1?>">
2012-10-27 08:00:09 +00:00
<span style="float:left;"><a href='<?=$permalink ?>'>#<?=$PostID?></a>
<?=$postheader ?>
</span>
</td>
</tr>
<tr>
2012-10-29 08:00:20 +00:00
<? if(empty($HeavyInfo['DisableAvatars'])) { ?>
2012-10-27 08:00:09 +00:00
<td class='avatar' valign="top">
<? if($UserInfo['Avatar']){ ?>
<img src='<?=$UserInfo['Avatar']?>' width='150' alt="<?=$UserInfo['Username']?>'s avatar" />
<? } else { ?>
<img src="<?=STATIC_SERVER?>common/avatars/default.png" width="150" alt="Default avatar" />
<? } ?>
</td>
<? } ?>
<td class='body' valign="top">
2013-02-22 08:00:24 +00:00
<?=$Text->full_format($Body) ?>
2012-10-27 08:00:09 +00:00
<? if($EditorID){ ?>
<br /><br />
Last edited by
<?=Users::format_username($EditorID, false, false, false) ?> <?=time_diff($EditedTime)?>
<? } ?>
</td>
</tr>
</table>
2013-02-22 08:00:24 +00:00
<? }