Changeset 236 for branches/fuze/modules/mod_bestcontent/module.php
- Timestamp:
- 07/28/10 10:35:12 (22 months ago)
- File:
-
- 1 edited
-
branches/fuze/modules/mod_bestcontent/module.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/fuze/modules/mod_bestcontent/module.php
r181 r236 23 23 return; 24 24 } 25 if (!isset($cfg['subs'])) { $cfg['subs'] = 1; } 25 26 $today = date("Y-m-d H:i:s"); 27 if ($cfg['cat_id'] != '-1') { 28 if (!$cfg['subs']){ 29 //âûáèðàåì èç êàòåãîðèè 30 $catsql = ' AND c.category_id = '.$cfg['cat_id']; 31 } else { 32 //âûáèðàåì èç êàòåãîðèè è ïîäêàòåãîðèé 33 $rootcat = $inDB->get_fields('cms_category', 'id='.$cfg['cat_id'], 'NSLeft, NSRight'); 34 $catsql = "AND (c.category_id = cat.id AND cat.NSLeft >= {$rootcat['NSLeft']} AND cat.NSRight <= {$rootcat['NSRight']})"; 35 } 36 } else { $catsql = 'AND c.category_id = cat.id'; } 37 26 38 27 39 $sql = "SELECT c.*, c.pubdate as fpubdate, 28 40 IFNULL(r.total_rating, 0) as points, 29 41 u.nickname as author, u.login as author_login 30 FROM cms_ users u, cms_content c42 FROM cms_category cat, cms_users u, cms_content c 31 43 LEFT JOIN cms_ratings_total r ON r.item_id=c.id AND r.target='content' 32 44 WHERE c.published = 1 AND c.user_id = u.id AND c.canrate = 1 33 45 AND (c.is_end=0 OR (c.is_end=1 AND c.enddate >= '$today' AND c.pubdate <= '$today')) 46 ".$catsql." 34 47 GROUP BY r.item_id 35 48 ORDER BY points DESC"; … … 37 50 $sql .= "\n" . "LIMIT ".$cfg['shownum']; 38 51 39 $result = $inDB->query($sql) or die('<pre>'.$sql.'</pre>'.mysql_error());52 $result = $inDB->query($sql); 40 53 41 54 if ($inDB->num_rows($result)){
Note: See TracChangeset
for help on using the changeset viewer.
