Gazelle/sections/tools/managers/recommend_list.php

61 lines
1.9 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
2013-05-02 08:00:23 +00:00
if (!check_perms('site_recommend_own') && !check_perms('site_manage_recommendations')) {
2011-03-28 14:21:28 +00:00
error(403);
}
2012-10-11 08:00:15 +00:00
View::show_header('Recommendations');
2011-03-28 14:21:28 +00:00
2013-05-02 08:00:23 +00:00
$DB->query("
SELECT
tr.GroupID,
tr.UserID,
tg.Name,
tg.ArtistID,
ag.Name
2011-03-28 14:21:28 +00:00
FROM torrents_recommended AS tr
2013-05-02 08:00:23 +00:00
JOIN torrents_group AS tg ON tg.ID=tr.GroupID
LEFT JOIN artists_group AS ag ON ag.ArtistID=tg.ArtistID
2011-03-28 14:21:28 +00:00
ORDER BY tr.Time DESC
LIMIT 10
");
?>
<div class="thin">
<div class="box" id="recommended">
<div class="head colhead_dark"><strong>Recommendations</strong></div>
2013-05-02 08:00:23 +00:00
<? if (!in_array($LoggedUser['ID'], $DB->collect('UserID'))) { ?>
2012-09-15 08:00:25 +00:00
<form class="add_form" name="recommendations" action="tools.php" method="post" class="pad">
2011-03-28 14:21:28 +00:00
<input type="hidden" name="action" value="recommend_add" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
2012-09-01 08:00:24 +00:00
<table cellpadding="6" cellspacing="1" border="0" class="layout border" width="100%">
2011-03-28 14:21:28 +00:00
<tr>
<td rowspan="2" class="label"><strong>Add Recommendation:</strong></td>
2013-02-09 08:01:01 +00:00
<td>Link to a torrent group on site. For example, <strong>https://<?=SSL_SITE_URL?>/torrents.php?id=12345</strong></td>
2011-03-28 14:21:28 +00:00
</tr>
<tr>
<td>
<input type="text" name="url" size="50" />
<input type="submit" value="Add recommendation" />
</td>
</tr>
</table>
</form>
<? } ?>
<ul class="nobullet">
<?
2013-05-02 08:00:23 +00:00
while (list($GroupID, $UserID, $GroupName, $ArtistID, $ArtistName) = $DB->next_record()) {
2011-03-28 14:21:28 +00:00
?>
<li>
2012-10-11 08:00:15 +00:00
<strong><?=Users::format_username($UserID, false, false, false)?></strong>
2013-05-02 08:00:23 +00:00
<? if ($ArtistID) { ?>
2011-03-28 14:21:28 +00:00
- <a href="artist.php?id=<?=$ArtistID?>"><?=$ArtistName?></a>
2013-02-22 08:00:24 +00:00
<? } ?>
2011-03-28 14:21:28 +00:00
- <a href="torrents.php?id=<?=$GroupID?>"><?=$GroupName?></a>
2013-05-02 08:00:23 +00:00
<? if (check_perms('site_manage_recommendations') || $UserID == $LoggedUser['ID']) { ?>
2013-02-09 08:01:01 +00:00
<a href="tools.php?action=recommend_alter&amp;groupid=<?=$GroupID?>" class="brackets">Delete</a>
2013-02-22 08:00:24 +00:00
<? } ?>
2011-03-28 14:21:28 +00:00
</li>
<? } ?>
</ul>
</div>
</div>
2013-02-09 08:01:01 +00:00
<? View::show_footer(); ?>