Changeset 808 for trunk/include/functions_category.inc.php
- Timestamp:
- Aug 8, 2005, 10:52:19 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/functions_category.inc.php
r773 r808 41 41 * @return void 42 42 */ 43 function check_restrictions( $category_id)44 { 45 global $user, $lang;46 47 if ( in_array( $category_id, $user['restrictions'] ))43 function check_restrictions($category_id) 44 { 45 global $user, $lang; 46 47 if (in_array($category_id, explode(',', $user['forbidden_categories']))) 48 48 { 49 49 echo '<div style="text-align:center;">'.$lang['access_forbiden'].'<br />'; … … 168 168 $query = ' 169 169 SELECT COUNT(DISTINCT(image_id)) as total 170 FROM '.IMAGE_CATEGORY_TABLE; 171 if (count($user['restrictions']) > 0) 172 { 173 $query.= ' 174 WHERE category_id NOT IN ('.$user['forbidden_categories'].')'; 175 } 176 $query.= ' 177 ;'; 178 179 $row = mysql_fetch_array(pwg_query($query)); 180 181 return isset($row['total']) ? $row['total'] : 0; 170 FROM '.IMAGE_CATEGORY_TABLE.' 171 WHERE category_id NOT IN ('.$user['forbidden_categories'].') 172 ;'; 173 list($total) = mysql_fetch_array(pwg_query($query)); 174 175 return $total; 182 176 } 183 177
Note: See TracChangeset
for help on using the changeset viewer.