Show Top 10 Downloads by Views [module]
Author Message
c0rrupt
Administrator


Posts: 261
Joined: Mar 2010
Post: #1
Show Top 10 Downloads by Views [module]
by jomasaco on Sat Jan 23, 2010








Since i include one easy way to disable the module ($enablemod = true the entire table structure must be inside of module.

<?php
    /*BEGIN_INFO
    Show the top downloads by views.

    By jomasaco [url]www.stugas-ddl.org[/url].
    END_INFO*/
    if(!defined("WCDDL_GUTS")) exit;


    $enablemod = true; //change to false if you don't want to show
    if($enablemod) {
    $outa = '<table border="0" cellpadding="6" cellspacing="1" width="100%">
    <thead>
    <tr>
    <th colspan="5">[b]Top 10 Downloads[/b]</span></th>
    </tr>
    </thead>
    <tbody>
    <tr><td>[b]Type[/b]</td><td>[b]Title[/b]</td><td>[b]Provider[/b]</td><td>[b]Views[/b]</td><td>[b]Rating[/b]</td></tr>';

    $getit = mysql_query("SELECT id,sid,type,title,views,rating FROM wcddl_downloads WHERE views>0 ORDER BY views DESC LIMIT 0,10"); //change 10 to many you want
    while ($got = mysql_fetch_array($getit)) {
             $site = mysql_query("SELECT name as sname, url as surl from wcddl_sites WHERE id = '".$got['sid']."'");
             $site = mysql_fetch_assoc($site);
             $row = array_merge($site,$got);  

    $outa .= '<tr><td>'.$row['type'].'</td><td>[url=download.php?id='.$row['id'].']'.$row['title'].'[/url]</td><td>[url=http://'.$row['surl'].']'.$row['sname'].'[/url]</td><td>'.$row['views'].'</td><td>'.$row['rating'].'</td></tr>';
    }
    $outa .= '</tbody></table>';

    $core->setTemplateVar("top10",$outa);
    }
    ?>
display
<?=$core->templateVar("top10")?>
11-07-2010 02:19 PM
 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Show the downloads for a specific site (WCDDL v2) c0rrupt 0 59 07-26-2012 04:35 PM
Last Post: c0rrupt
  Button and Link [Module] c0rrupt 2 199 07-04-2012 09:55 PM
Last Post: c0rrupt
  Report Download [module] jomasaco 1 168 12-25-2011 10:24 PM
Last Post: WJManiaC
  Show site Downloads/Rank [module] c0rrupt 9 554 12-25-2011 01:41 AM
Last Post: WJManiaC
  Clean blank downloads (Automatically) immu 2 182 02-05-2011 06:20 PM
Last Post: c0rrupt
  Amount of Downloads in Graph c0rrupt 9 332 11-15-2010 01:34 PM
Last Post: nYXem
  Top Searches - Module c0rrupt 0 136 11-07-2010 02:21 PM
Last Post: c0rrupt
  Full Speed Downloads c0rrupt 0 110 11-07-2010 02:12 PM
Last Post: c0rrupt
  Strip all the slashes from downloads c0rrupt 0 79 11-07-2010 06:26 AM
Last Post: c0rrupt
  Show Date [Module] c0rrupt 0 109 11-07-2010 06:23 AM
Last Post: c0rrupt



User(s) browsing this thread: 1 Guest(s)