Changeset 1509 in ExiteCMS for branches/PLi-Fusion/downloads.php
- Timestamp:
- 07/02/08 18:27:06 (4 years ago)
- File:
-
- 1 edited
-
branches/PLi-Fusion/downloads.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/PLi-Fusion/downloads.php
r1227 r1509 66 66 // if a download ID is given... 67 67 if (isset($download_id)) { 68 $res = 0;69 68 // and it exists ... 70 69 if ($data = dbarray(dbquery("SELECT download_url,download_cat FROM ".$db_prefix."downloads WHERE download_id='$download_id'"))) { … … 72 71 // and the user has access to it... 73 72 if (checkgroup($cdata['download_cat_access'])) { 74 $res = 1;75 73 // update the download counter (if we're using internal statistics) 76 if (!isset($settings[' remote_stats']) || !$settings['remote_stats']) $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'");74 if (!isset($settings['dlstats_remote']) || !$settings['dlstats_remote']) $result = dbquery("UPDATE ".$db_prefix."downloads SET download_count=download_count+1 WHERE download_id='$download_id'"); 77 75 // if a URL is given for the download, redirect to it, else fall back to the download category 78 76 if ($data['download_url']) { 77 // download statistics plugin installed but no remote stats used? Then update the IP counters 78 if (isset($settings['dlstats_remote']) && !$settings['dlstats_remote']) { 79 if (USER_IP != "0.0.0.0") { 80 $result = dbquery("INSERT INTO ".$db_prefix."dlstats_ips (dlsi_ip, dlsi_ccode, dlsi_counter) VALUES ('".USER_IP."', '".USER_CC."', '1') ON DUPLICATE KEY UPDATE dlsi_counter = dlsi_counter + 1"); 81 } 82 } 79 83 redirect($data['download_url']); 80 84 exit; … … 107 111 $variables['subcats'] = false; 108 112 $result = dbquery("SELECT * FROM ".$db_prefix."download_cats WHERE download_parent='0' AND ".groupaccess('download_cat_access').($where==""?"":(" AND ".$where))." ORDER BY download_datestamp DESC"); 109 if ( $result) {113 if (!$result) { 110 114 // any downloads in the 'root' are public, and ordered by download_id DESC, by default! 111 115 $variables['parent'] = array('download_cat_access' => 0, 'download_cat_sorting' => 'download_id DESC'); 112 116 $cat_id = 0; 113 } else {114 die('oops');115 117 } 116 118 } … … 139 141 } 140 142 143 // check if we have categories at all 144 $variables['have_cats'] = dbfunction("COUNT(*)", "download_cats"); 145 141 146 // define the body panel variables 142 147 $template_panels[] = array('type' => 'body', 'name' => 'downloads', 'template' => 'main.downloads.tpl', 'locale' => "main.downloads");
Note: See TracChangeset
for help on using the changeset viewer.
