Changeset 1158 in ExiteCMS for trunk/downloads.php


Ignore:
Timestamp:
12/03/07 21:40:54 (4 years ago)
Author:
hverton
Message:

added a locale type selection per module
fixed typo from 404handler.php
updated English language pack
fixed not being able to move a post to a thread in the same forum.post.move.tpl
getusergroups() now returns the array ordered by name
upgraded tiny_mce to version 2.1.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/downloads.php

    r1150 r1158  
    4444 
    4545// compose the query where clause based on the localisation method choosen 
    46 switch ($settings['localisation_method']) { 
     46switch ($settings['download_localisation']) { 
    4747    case "none": 
    4848        $where = ""; 
     
    9191} 
    9292 
     93if (isset($cat_id)) { 
     94    // get the selected category, and all sub-categories of the requested download category 
     95    $variables['subcats'] = true; 
     96    $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id'"); 
     97    if (dbrows($result) == 0) { 
     98        // not found. pretend none was given 
     99        unset($cat_id); 
     100    } else { 
     101        $variables['parent'] = dbarray($result); 
     102        $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_parent='$cat_id' AND ".groupaccess('download_cat_access')." ORDER BY ".$variables['parent']['download_cat_cat_sorting']); 
     103    } 
     104} 
     105 
    93106if (!isset($cat_id)) { 
    94107    // get all root categories 
     
    99112        $variables['parent'] = array('download_cat_access' => 0, 'download_cat_sorting' => 'download_id DESC');  
    100113        $cat_id = 0; 
     114    } else { 
     115        die('oops'); 
    101116    } 
    102 } else { 
    103     // get the selected category, and all sub-categories of the requested download category 
    104     $variables['subcats'] = true; 
    105     $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id='$cat_id'"); 
    106     if (dbrows($result) == 0) { 
    107         redirect("downloads.php"); 
    108         exit; 
    109     } 
    110     $variables['parent'] = dbarray($result); 
    111     $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_parent='$cat_id' AND ".groupaccess('download_cat_access')." ORDER BY ".$variables['parent']['download_cat_cat_sorting']); 
    112117} 
    113118// fill the download_cats array with the result 
    114119$variables['cats_count'] = dbrows($result); 
    115120$variables['download_cats'] = array(); 
    116 while ($result && $data = dbarray($result)) { 
    117     $data['download_count'] = countdownloads($data['download_cat_id']); 
    118     $variables['download_cats'][] = $data; 
     121if ($variables['cats_count'] != 0) { 
     122    while ($data = dbarray($result)) { 
     123        $data['download_count'] = countdownloads($data['download_cat_id']); 
     124        $variables['download_cats'][] = $data; 
     125    } 
    119126} 
    120127 
Note: See TracChangeset for help on using the changeset viewer.