Changeset 861 in ExiteCMS for trunk/administration/downloads.php
- Timestamp:
- 10/02/07 22:23:07 (5 years ago)
- File:
-
- 1 edited
-
trunk/administration/downloads.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/administration/downloads.php
r838 r861 87 87 88 88 // initialise some variables we need later 89 if (!isset($download_cat_id)) $download_cat_id = " ";89 if (!isset($download_cat_id)) $download_cat_id = "-1"; 90 90 if (!isset($step)) $step = ""; 91 91 $barmsg = ""; … … 168 168 } 169 169 170 // get the first download category 170 // build the download tree 171 $variables['tree'] = array(); 172 $variables['tree'][] = array('node' => 'P', 'nestlevel' => -1, 'name' => $locale['455'], 'id' => 0); 173 // Download root first 174 $result = dbquery("SELECT * FROM ".$db_prefix."downloads WHERE download_cat = '0' ORDER BY download_id DESC"); 175 if ($rows = dbrows($result)) { 176 $row = 1; 177 while ($data = dbarray($result)) { 178 $variables['tree'][] = array('node' => 'D', 'first' => ($row == 1), 'last' => ($row == $rows), 'cat_id' => 0, 'url' => $data['download_url'], 'name' => $data['download_title'], 'id' => $data['download_id']); 179 } 180 } else { 181 // no downloads in this category 182 $variables['tree'][] = array('node' => 'E', 'name' => $locale['505'], 'id' => 0); 183 } 184 // Then recurse through the download categories 171 185 $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_cat_id > 0 AND download_parent = 0 ORDER BY download_cat_id DESC LIMIT 1"); 172 $variables['tree'] = array();173 186 if (dbrows($result) != 0) { 174 187 $data = dbarray($result); … … 189 202 // get all downloads from the database 190 203 $variables['barfiles'] = array(); 191 $result = dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_id ");204 $result = dbquery("SELECT * FROM ".$db_prefix."downloads ORDER BY download_id DESC"); 192 205 while($data = dbarray($result)) { 193 $data['download_cat_name'] = $variables['download_cats'][$data['download_cat']]; 206 if ($data['download_cat']) { 207 $data['download_cat_name'] = $variables['download_cats'][$data['download_cat']]; 208 } else { 209 $data['download_cat_name'] = $locale['455']; 210 } 194 211 $variables['barfiles'][] = $data; 195 212 }
Note: See TracChangeset
for help on using the changeset viewer.
