Changeset 1158 in ExiteCMS for trunk/downloads.php
- Timestamp:
- 12/03/07 21:40:54 (4 years ago)
- File:
-
- 1 edited
-
trunk/downloads.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/downloads.php
r1150 r1158 44 44 45 45 // compose the query where clause based on the localisation method choosen 46 switch ($settings[' localisation_method']) {46 switch ($settings['download_localisation']) { 47 47 case "none": 48 48 $where = ""; … … 91 91 } 92 92 93 if (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 93 106 if (!isset($cat_id)) { 94 107 // get all root categories … … 99 112 $variables['parent'] = array('download_cat_access' => 0, 'download_cat_sorting' => 'download_id DESC'); 100 113 $cat_id = 0; 114 } else { 115 die('oops'); 101 116 } 102 } else {103 // get the selected category, and all sub-categories of the requested download category104 $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']);112 117 } 113 118 // fill the download_cats array with the result 114 119 $variables['cats_count'] = dbrows($result); 115 120 $variables['download_cats'] = array(); 116 while ($result && $data = dbarray($result)) { 117 $data['download_count'] = countdownloads($data['download_cat_id']); 118 $variables['download_cats'][] = $data; 121 if ($variables['cats_count'] != 0) { 122 while ($data = dbarray($result)) { 123 $data['download_count'] = countdownloads($data['download_cat_id']); 124 $variables['download_cats'][] = $data; 125 } 119 126 } 120 127
Note: See TracChangeset
for help on using the changeset viewer.
