Changeset 12153 for extensions/stripped/themeconf.inc.php
- Timestamp:
- Sep 13, 2011, 10:15:31 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/stripped/themeconf.inc.php
r10930 r12153 12 12 // Need upgrade? 13 13 14 global $conf ;14 global $conf, $user; 15 15 16 16 if (!isset($conf['stripped'])) … … 56 56 } 57 57 58 $config = unserialize( $conf['stripped'] ); 59 60 if (isset($config['imagePreload']) && ($user['theme'] == 'stripped')) { 61 add_event_handler('loc_end_picture', 'assign_next_images_url'); 62 63 function assign_next_images_url() 64 { 65 global $page, $template, $conf; 66 67 $config = unserialize( $conf['stripped'] ); 68 69 $nb_image =$config['imagePreloadNb']; 70 $nb_max = $page['last_rank'] - $page['current_rank']; 71 $nb_image = min ($nb_image, $nb_max); 72 73 if ($nb_image < 1) return; 74 75 for ($n = 1; $n <= $nb_image; $n++) { 76 $pagenext[$n] = $page['items'][ $page['current_rank'] + $n ]; 77 } 78 79 $picturenext = array(); 80 $idnext = array(); 81 82 for ($n = 1; $n <= $nb_image; $n++) { 83 array_push($idnext, $pagenext[$n]); 84 } 85 86 $query = ' 87 SELECT * 88 FROM '.IMAGES_TABLE.' 89 WHERE id IN ('.implode(',', $idnext).') 90 ;'; 91 92 $result = pwg_query($query); 93 94 while ($rownext = pwg_db_fetch_assoc($result)) 95 { 96 for ($n = 1; $n <= $nb_image; $n++) { 97 if (isset($pagenext[$n]) and $rownext['id'] == $pagenext[$n]) {$in = $n;} 98 } 99 100 $picturenext[$in] = $rownext; 101 $picturenext[$in]['is_picture'] = false; 102 103 if (in_array(get_extension($rownext['file']), $conf['picture_ext'])) 104 { 105 $picturenext[$in]['is_picture'] = true; 106 } 107 108 $picturenext[$in]['image_url'] = get_image_url( $picturenext[$in] ); 109 } 110 111 for ($n = 1; $n <= $nb_image; $n++) { 112 if (isset($picturenext[$n]['image_url'])) { $image_next[$n] = $picturenext[$n]['image_url']; } 113 } 114 115 $template->assign('U_IMGNEXT', $image_next ); 116 117 } 118 119 } 120 58 121 ?>
Note: See TracChangeset
for help on using the changeset viewer.