Skip to content
WJunction - Webmaster Forum

WCDDL WcDDL v2 mix downloads

Status
Not open for further replies.
hi,

is it possible to mix downloads in wcddl v2, say

6x apps, 6x games, 6x music, 6x movies, 6x tv etc?

if so any help plz?
 

11 comments

Ok, i've been messing with this all day and managed:

Code:
$core->sqlOrder = "views DESC"; //order the downloads list by views.

it orders de list by views, need it by type and 6 of each.
 
This is a feature loads of DDL sites had back in the day, some still do.

Easiest way to do it is select 6 of each, separately but this will only work for the homepage, pagination will not work since there's 6 sets of downloads.

Consider downloading the beta of v3, then you can do something like this:
PHP:
<?php
$downloads = new Downloads;
$downloads->perPage = 6;
foreach(array('app', 'game', 'music', 'movie') as $t):
     $downloads->type = $t;
     foreach($downloads->get() as $d):
?>
HTML and stuff here
like <tr><td><?php echo $d->title; ?></td></tr>
<?php
     endforeach;
endforeach;
 
I wanna stick with v2 atm due tothe mods, so this work for v2?

and wheredoes this go, funcs.php where?
 
Last edited:
It would be better if u validate or approve ur downloads in the fashion u need them to be displayed. Showing up 4 diff catgories submission on index would take 4 queries to retrieve 6 downloads from each category & that would even disturb submission displayed on different pages. In all its possible but can turn complex
 
add this line in fetchdownloads function present in funcs.php
Code:
if ($sqlwhere=="")
 $sqlWhere = " where type not in ('Xxx')";
else
 $sqlWhere.= " and type not in ('Xxx')";

below this line

Code:
$sqlWhere = $this->processDataHook("fetchDownloadsSQLWhere",$sqlWhere);

Just keep in mind that it can overide some mod's work which uses processDataHook


Ps.... still its not at all a proper work around. I would have to change it someway so that it doesnt override anything else
 
Last edited:
yo, this doesnt work m8. it completely hides xxx from the site btw i kinda figured tht frm the start as somehow u need to say dont show on index...

any1 can help?
 
PHP:
$excludeIndexTypes = array(
              "xxx"
    );
function siteDownloads($where) {
    global $core,$excludeIndexTypes;     
        $sid = mysql_query("SELECT id FROM wcddl_sites WHERE url = '".$core->siteSQL."'");
        if(!mysql_num_rows($sid)) {
        unset($core->siteSURL);
        if(empty($excludeIndexTypes) || !empty($where)) {
        return $where;
    }
    else
    {
        $notIn = array();
        foreach($excludeIndexTypes as $eITK)
                        $notIn[] = "'".$eITK."'";
              $notIn = implode(",",$notIn);
              $where = " WHERE type NOT IN (".$notIn.")";
              return $where;
    }
        } else {
        $sid = mysql_result($sid,0);
        if(empty($where))
            $where = " WHERE sid = ".$sid;
        else
            $where = " AND sid = ".$sid;
    return $where;
}
}
$core->attachDataHook("fetchDownloadsSQLWhere","siteDownloads");
See if you understand, can't help more

Abut that group of 6 type's.
in an normal index Type1x6 type2x6... no matter the site?
or an index where show the types whit 6 titles?
if are the secound i did an mod long time back to show must visited tytles by type, just use in index.php
 
Last edited:
Status
Not open for further replies.

About the author

C
Banned · Joined
901
Messages
17
Reactions
18
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom