Gazelle/sections/comments/artistcomments.php

63 lines
1.5 KiB
PHP
Raw Normal View History

2012-10-27 08:00:09 +00:00
<?php
$OtherLink = '';
2013-04-19 08:00:55 +00:00
$Title = 'Artist comments made by '.($Self ? 'you' : $Username);
$Header = 'Artist comments left by '.($Self ? 'you' : Users::format_username($UserID, false, false, false)).'';
$Comments = $DB->query("
SELECT
SQL_CALC_FOUND_ROWS
ac.AuthorID,
a.ArtistID,
a.Name,
ac.ID,
ac.Body,
ac.AddedTime,
ac.EditedTime,
ac.EditedUserID as EditorID
FROM artists_group as a
JOIN artist_comments as ac ON ac.ArtistID = a.ArtistID
WHERE ac.AuthorId = $UserID
GROUP BY ac.ID
ORDER BY ac.AddedTime DESC
LIMIT $Limit;
2012-10-27 08:00:09 +00:00
");
$DB->query("SELECT FOUND_ROWS()");
list($Results) = $DB->next_record();
2013-05-15 08:00:54 +00:00
$Pages = Format::get_pages($Page, $Results, $PerPage, 11);
2012-10-27 08:00:09 +00:00
$DB->set_query_id($Comments);
$GroupIDs = $DB->collect('GroupID');
2012-10-29 08:00:20 +00:00
View::show_header($Title,'bbcode');
2012-10-27 08:00:09 +00:00
$DB->set_query_id($Comments);
?><div class="thin">
<div class="header">
<h2><?=$Header?></h2>
<? if ($OtherLink !== '') { ?>
<div class="linkbox">
<?=$OtherLink?>
</div>
<? } ?>
2013-02-22 08:00:24 +00:00
</div>
2012-10-27 08:00:09 +00:00
<div class="linkbox">
<?=$Pages?>
</div>
<?
2013-04-19 08:00:55 +00:00
while (list($UserID, $ArtistID, $ArtistName, $PostID, $Body, $AddedTime, $EditedTime, $EditorID) = $DB->next_record()) {
$permalink = "artist.php?id=$ArtistID&amp;postid=$PostID#post$PostID";
$postheader = ' on ' . "<a href=\"artist.php?id=$ArtistID\">$ArtistName</a>";
2012-10-27 08:00:09 +00:00
2013-04-19 08:00:55 +00:00
comment_body($UserID, $PostID, $postheader, $permalink, $Body, $EditorID, $AddedTime, $EditedTime);
2012-10-27 08:00:09 +00:00
} /* end while loop*/ ?>
2013-05-16 16:15:57 +00:00
<div class="linkbox"><?=($Pages)?></div>
2012-10-27 08:00:09 +00:00
</div>
2013-02-22 08:00:24 +00:00
<?
2013-04-19 08:00:55 +00:00
View::show_footer();