(#1)
gtaclub Offline
 
Posts: 2
Join Date: Mar 2011
WCDDL Live Total Downloads Stats (v2) - 03-08-2011, 07:43 PM



Create a new php file named wcddl_stats.php in /modules/

Paste this following code in it and then save it.

PHP Code:
<?php
if(!defined("WCDDL_GUTS"))
   exit;
$statshtml .= '<li><a href="index.php">Home</a></li>';
$statshtml .= '<li><strong><a href="submit.php">Submit</a></strong></li>'
foreach(
$core->allowed_types as $ty) {
$county mysql_query("SELECT COUNT(id) as countid from wcddl_downloads WHERE type = '".$ty."'");
while(
$row mysql_fetch_assoc($county)) { $total += $row['countid'];
$statshtml .= '<li><a href="/index.php?type='.$ty.'">'.ucfirst($ty).'</a>: '.$row['countid'].'</li>';
}
}
$contqueue mysql_query("SELECT COUNT(id)from wcddl_queue");
$cqueue mysql_result($contqueue0);
$statshtml .= '<hr><strong>Total:</strong> '.$total.'';
$statshtml .= '<br /><strong>Queue:</strong> '.$cqueue.'';
$core->setTemplateVar("stats",$statshtml);
?>
Replace you navigation code to:

PHP Code:
<?=$core->templateVar("stats")?>
For each new type downloads you add on wcfg.php and it will be automatically added on the list.

Note: If you have any question about this mod, please send a P.M to me.
(#2)
jomasaco Offline
 
Posts: 21
Join Date: May 2010
03-09-2011, 02:26 AM

This is one of heavy mods, very nice and usefull, but execute that query's for each page turns the site an little slow.

you can add there some output to an file and read from file untill X time like an cache.

if(fileatime($file) >= ($time() - 3600))
{
EXECUTE THE CODE
OUTPUT TO AN FILE
OUTPUT TO BROWSER
EXIT
}
else
{
readfile($file)
}

something near this

Bookmarks

Tags
downloads, live, stats, total, wcddl

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




Powered by vBulletin


Content Relevant URLs by vBSEO