Show the downloads for a specific site (WCDDL v2) - Printable Version

+- WCDDL Skins and Mods (http://wcddl.org)
+-- Forum: WCDDL Skins and Mods (/Forum-WCDDL-Skins-and-Mods)
+--- Forum: WCDDL Modules (/Forum-WCDDL-Modules)
+---- Forum: WCDDLv2 Modules (/Forum-WCDDLv2-Modules)
+---- Thread: Show the downloads for a specific site (WCDDL v2) (/Thread-Show-the-downloads-for-a-specific-site-WCDDL-v2)



Show the downloads for a specific site (WCDDL v2) - c0rrupt - 07-26-2012 04:35 PM

Show the downloads for a specific site (WcDDL V2)

create file: wcddl_site.php
paste inside
PHP Code:
<?php
/*BEGIN_INFO
Show the downloads for an specific site.
Stugas-ddl.org
END_INFO*/
if(!defined("WCDDL_GUTS"))
    exit;
        
$modEnabled true//Change to false if don't use
    
if($modEnabled) {    
             if(isset(
$_GET['site'])) {
            
$core->site $_GET['site'];
            
$core->siteSQL mysql_real_escape_string($core->site);
          
$core->siteSURL $core->processURL($core->site);
          
$core->sqlOrder "dat DESC"//order the downloads list by views, comment if want to show by date
        
}
function 
siteDownloads($where) {
    global 
$core $sitenumRows;     
        
$sid mysql_query("SELECT id FROM wcddl_sites WHERE url = '".mysql_real_escape_string($core->site)."'");
        
$core->sitenumRows mysql_num_rows($sid);
        if(!
mysql_num_rows($sid))
            return 
$where;
        
$sid mysql_result($sid,0);
        if(empty(
$where))
            
$where " WHERE sid = ".$sid;
        else
            
$where " AND sid = ".$sid;
    
    return 
$where;
}
$core->attachDataHook("fetchDownloadsSQLWhere","siteDownloads");
}
?>
save and upload to modules folder

open: index.php

find:
PHP Code:
<?php
include "funcs.php";
$downloads $core->fetchDownloads();
?>

replace with:
PHP Code:
<?php
include "funcs.php";
$downloads $core->fetchDownloads(true,false);
?>

find:
PHP Code:
<td>Rating</td></tr

replace with:
PHP Code:
<td>Provided by</td><td>Rating</td></tr

find:
PHP Code:
<td><?=$dl['rating']?></td></tr> 

replace with:
PHP Code:
<td><a href="index.php?site=<?=$dl['surl']?>"  target="_blank"><?=$dl['sname']?></a></td><td><?=$dl['rating']?></td></tr> 


Screen Shot:








mod by jomasaco.


This forum uses Lukasz Tkacz MyBB addons.