Changeset 1677 for trunk/include/category_cats.inc.php
- Timestamp:
- Dec 21, 2006, 10:38:20 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/category_cats.inc.php
r1651 r1677 43 43 WHERE date_last > SUBDATE( 44 44 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY 45 );'; 45 ) 46 '.get_sql_condition_FandF 47 ( 48 array 49 ( 50 'visible_categories' => 'id', 51 ), 52 'AND' 53 ).' 54 ;'; 46 55 } 47 56 else … … 55 64 ON id = cat_id and user_id = '.$user['id'].' 56 65 WHERE id_uppercat '. 57 (!isset($page['category']) ? 'is NULL' : '= '.$page['category']); 58 if ($page['filter_local_mode']) 59 { 60 $query.= ' 61 AND max_date_last > SUBDATE( 62 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'; 63 } 64 $query.= ' 66 (!isset($page['category']) ? 'is NULL' : '= '.$page['category']).' 67 '.get_sql_condition_FandF 68 ( 69 array 70 ( 71 'visible_categories' => 'id', 72 ), 73 'AND' 74 ).' 65 75 ORDER BY rank 66 76 ;'; … … 86 96 FROM '.CATEGORIES_TABLE.' AS c INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic 87 97 ON ic.category_id = c.id'; 88 if ($page['filter_local_mode'] or $user['filter_global_mode'])89 {90 $query.= '91 INNER JOIN '.IMAGES_TABLE.' AS i on ic.image_id = i.id ';92 }93 98 $query.= ' 94 99 WHERE uppercats REGEXP \'(^|,)'.$row['id'].'(,|$)\' 95 AND c.id NOT IN ('.$user['forbidden_categories'].')'; 96 if ($page['filter_local_mode'] or $user['filter_global_mode']) 97 { 98 $query.= ' 99 AND i.date_available > SUBDATE( 100 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'; 101 } 102 $query.= ' 100 '.get_sql_condition_FandF 101 ( 102 array 103 ( 104 'forbidden_categories' => 'c.id', 105 'visible_categories' => 'c.id', 106 'visible_images' => 'image_id' 107 ), 108 'AND' 109 ).' 103 110 ORDER BY RAND() 104 111 LIMIT 0,1 … … 117 124 ON id = cat_id and user_id = '.$user['id'].' 118 125 WHERE uppercats REGEXP \'(^|,)'.$row['id'].'(,|$)\' 119 AND representative_picture_id IS NOT NULL'; 120 if ($page['filter_local_mode'] or $user['filter_global_mode']) 121 { 122 $query.= ' 123 AND max_date_last > SUBDATE( 124 CURRENT_DATE,INTERVAL '.$user['recent_period'].' DAY)'; 125 } 126 $query.= ' 126 AND representative_picture_id IS NOT NULL 127 '.get_sql_condition_FandF 128 ( 129 array 130 ( 131 'visible_categories' => 'id', 132 ), 133 'AND' 134 ).' 127 135 ORDER BY RAND() 128 136 LIMIT 0,1 … … 162 170 if (count($categories) > 0) 163 171 { 172 // Update filtered data 173 update_cats_with_filtered_data($categories); 174 164 175 if ($conf['subcatify']) 165 176 {
Note: See TracChangeset
for help on using the changeset viewer.