Changeset 3683 for extensions/AMenuManager
- Timestamp:
- Jul 26, 2009, 5:56:37 PM (15 years ago)
- Location:
- extensions/AMenuManager
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/AMenuManager/amm_pip.class.inc.php
r3681 r3683 75 75 Add a new random picture section 76 76 */ 77 if ( ( $block = $menu->get_block( 'mbAMM_randompict' ) ) != null)77 if ( ( ($block = $menu->get_block( 'mbAMM_randompict' ) ) != null ) && ($user['nb_total_images'] > 0) ) 78 78 { 79 79 $block->set_title( base64_decode($this->my_config['amm_randompicture_title'][$user['language']]) ); … … 176 176 private function ajax_amm_get_random_picture() 177 177 { 178 global $user; 179 178 180 $local_tpl = new Template(AMM_PATH."menu_templates/", ""); 179 181 $local_tpl->set_filename('body_page', … … 181 183 182 184 $sql="SELECT i.id as image_id, i.file as image_file, i.comment, i.path, i.tn_ext, c.id as catid, c.name, c.permalink, RAND() as rndvalue, i.name as imgname 183 FROM ".CATEGORIES_TABLE." c, ".IMAGES_TABLE." i, ".IMAGE_CATEGORY_TABLE." ic 184 WHERE c.status='public' 185 AND c.id = ic.category_id 186 AND ic.image_id = i.id 187 ORDER BY rndvalue 188 LIMIT 0,1 189 "; 190 185 FROM ".CATEGORIES_TABLE." c, ".IMAGES_TABLE." i, ".IMAGE_CATEGORY_TABLE." ic 186 WHERE c.id = ic.category_id 187 AND ic.image_id = i.id 188 AND i.level <= ".$user['level']." "; 189 if($user['forbidden_categories']!="") 190 { 191 $sql.=" AND c.id NOT IN (".$user['forbidden_categories'].") "; 192 } 193 194 $sql.=" ORDER BY rndvalue 195 LIMIT 0,1"; 191 196 192 197 -
extensions/AMenuManager/main.inc.php
r3682 r3683 24 24 | 2.0.0b | 2008/07/27 | * initial release with own blocks classes 25 25 | 2.0.0 | 2008/10/23 | * first release for piwigo's blocks classes 26 | 2.1.0 | 2009/07/26 | * add ofa functionality : random image can be changed26 | 2.1.0 | 2009/07/26 | * add a functionality : random image can be changed 27 27 | | | every x seconds (from 0.5 to 60) 28 | | | 28 | | | * bug resolved : random image block is displayed only 29 | | | if user have accessibility to more than 0 images 30 | | | random images are choosen in the accessible images for 31 | | | a user (permission + level) 32 | | | (cf. post:107877 on french forum) 33 | | | (cf. topic:14374 on french forum) 29 34 | | | 30 35 | | |
Note: See TracChangeset
for help on using the changeset viewer.