View Single Post
  #36  
Old 04-20-2006, 09:25 AM
EvilHawk EvilHawk is offline
 
Join Date: Feb 2005
Location: Greece
Posts: 107
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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=\"&laquo; " . $vbphrase['first_page'] . "\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page=1'\">";
			$prevpage = "<input type=\"button\" class=\"button\" value=\"&lt; " . $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'] . " &gt;\" tabindex=\"1\" onclick=\"window.location='downloadadmin.php?do=downloads&page=$nxt'\">";
			$lastpage = "<input type=\"button\" class=\"button\" value=\"" . $vbphrase['last_page'] . " &raquo;\" 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 &nbsp; $nextpage $lastpage");	
	print_cp_footer();
}
and your downloads log will look like this :

Attachment 46101
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01207 seconds
  • Memory Usage 1,785KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete