Quote:
Originally Posted by DementedMindz
um maybe a feature... would you be able to include something to clear out who downloaded? like if your in admincp and you click on the downloads it shows you everyone who downloaded... im up to page 45 lol and its not lookin to nice it goes all the way across the bottom...
heres a example
[1][2][3][4][5][6][7][8][9][10]
|
I have fixed this problem, i also send the code to Ron1n but he refused to change it !
Open your downloadadmin.php (at your admincp dir) find this
Code:
// ########################################################
// ###################### Downloads #######################
// ########################################################
if ($_GET['do'] == 'downloads')
{
if ($_GET['page'] == '')
$_GET['page'] = 1;
$start = (25)*($_GET['page']-1);
$result = $db->query_first("SELECT COUNT(`id`) AS downloads FROM " . TABLE_PREFIX . "dl_downloads");
$results = $result['downloads'];
if ($results > 25)
for ($i = 0; $i < $results; $i+=25)
{
if ($i > $start && $i < $start+25)
$navigation .= '[<a href="downloadadmin.php?do=downloads&page='.($i/25+1).'"><font color="#FF0000">'.($i/25+1).'</font></a>]';
else
$navigation .= '[<a href="downloadadmin.php?do=downloads&page='.($i/25+1).'">'.($i/25+1).'</a>]';
}
print_cp_header('Downloads');
print_table_start('downloadadmin');
print_table_header('Downloads', 4);
$class = fetch_row_bgclass();
echo '<tr><td class="'.$class.'"><b>User</b></td><td class="'.$class.'"><b>File</b></td><td class="'.$class.'"><b>Time</b></td><td class="'.$class.'"><b>Filesize</b></td></tr>';
$result = $db->query("SELECT * FROM " . TABLE_PREFIX . "dl_downloads ORDER BY `id` DESC LIMIT ".$start.",".(25));
while ($download = $db->fetch_array($result))
{
$class = fetch_row_bgclass();
echo '<tr><td class="'.$class.'"><a href="../member.php?u='.$download['userid'].'">'.$download['user'].'</a></td><td class="'.$class.'"><a href="../downloads.php?do=file&id='.$download['fileid'].'">'.$download['file'].'</a></td><td class="'.$class.'">'.vbdate($vbulletin->options['dateformat'],$download['time'],true).'</td><td class="'.$class.'">'.$download['filesize'].'</td></tr>';
}
$class = fetch_row_bgclass();
echo '<tr><td class="'.$class.'" colspan="4" align="center">'.$navigation.'</td></tr>';
print_table_footer(4);
print_cp_footer();
}
and replace the code with this
Code:
// ########################################################
// ###################### Downloads #######################
// ########################################################
if ($_GET['do'] == 'downloads')
{
$vbulletin->input->clean_array_gpc('r', array(
'perpage' => TYPE_UINT,
'pagenumber' => TYPE_UINT,
));
$vbulletin->GPC['perpage'] = 25;
$result = $db->query_first("SELECT COUNT(`id`) AS downloads FROM " . TABLE_PREFIX . "dl_downloads");
$logs = $result['downloads'];
$totalpages = ceil($result['downloads'] / $vbulletin->GPC['perpage']);
if ($vbulletin->GPC['pagenumber'] < 1)
{
$vbulletin->GPC['pagenumber'] = 1;
}
$startat = ($vbulletin->GPC['pagenumber'] - 1) * $vbulletin->GPC['perpage'];
$result = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "dl_downloads ORDER BY `id` DESC LIMIT $startat, " . $vbulletin->GPC['perpage'] . " ");
if ($db->num_rows($result))
{
if ($vbulletin->GPC['pagenumber'] != 1)
{
$prv = $vbulletin->GPC['pagenumber'] - 1;
$firstpage = "<input type=\"button\" class=\"button\" value=\"« " . $vbphrase['first_page'] . "\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page=1'\">";
$prevpage = "<input type=\"button\" class=\"button\" value=\"< " . $vbphrase['prev_page'] . "\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page=$prv'\">";
}
if ($vbulletin->GPC['pagenumber'] != $totalpages)
{
$nxt = $vbulletin->GPC['pagenumber'] + 1;
$nextpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['next_page'] . " >\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page=$nxt'\">";
$lastpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['last_page'] . " »\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page=$totalpages'\">";
}
}
$page = $vbulletin->GPC['pagenumber'];
print_cp_header('Downloads');
print_table_start('downloadadmin');
print_table_header("Downloads - Total log entries: $logs - Page: $page of $totalpages", 4);
$class = fetch_row_bgclass();
echo '<tr><td class="'.$class.'"><b>User</b></td><td class="'.$class.'"><b>File</b></td><td class="'.$class.'"><b>Time</b></td><td class="'.$class.'"><b>Filesize</b></td></tr>';
while ($download = $db->fetch_array($result))
{
$class = fetch_row_bgclass();
echo '<tr><td class="'.$class.'"><a href="../member.php?u='.$download['userid'].'">'.$download['user'].'</a></td><td class="'.$class.'"><a href="../downloads.php?do=file&id='.$download['fileid'].'">'.$download['file'].'</a></td><td class="'.$class.'">'.vbdate($vbulletin->options['dateformat'],$download['time'],true).'</td><td class="'.$class.'">'.$download['filesize'].'</td></tr>';
}
print_table_footer(4, "$firstpage $prevpage $nextpage $lastpage");
print_cp_footer();
}
and your downloads log will look like this :
Attachment 46101