Changeset 1014 for trunk/picture.php
- Timestamp:
- Jan 27, 2006, 2:11:43 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/picture.php
r1008 r1014 44 44 } 45 45 //---------------------------------------- incrementation of the number of hits 46 $query = ' 47 UPDATE '.IMAGES_TABLE.' 48 SET hit = hit+1 49 WHERE id = '.$_GET['image_id'].' 50 ;'; 51 @pwg_query( $query ); 46 if ( count(array_intersect( 47 array_keys($_GET), 48 array('add_fav', 'caddie', 'rate', 'representative', 'del') ) 49 )==0 ) 50 { 51 $query = ' 52 UPDATE '.IMAGES_TABLE.' 53 SET hit = hit+1 54 WHERE id = '.$_GET['image_id'].' 55 ;'; 56 @pwg_query( $query ); 57 } 52 58 //-------------------------------------------------------------- initialization 53 59 initialize_category( 'picture' ); … … 70 76 break; 71 77 } 78 if ($page['num']==0) 79 { 80 $url_first_last = PHPWG_ROOT_PATH.'picture.php'; 81 $url_first_last.= get_query_string_diff(array('image_id','add_fav', 82 'slideshow','rate')); 83 $url_first_last.= '&image_id='; 84 $template->assign_block_vars( 85 'first', 86 array( 87 'U_IMG' => $url_first_last . $row['id'], 88 )); 89 } 72 90 $page['num']++; 73 91 } 92 if ($page['cat_nb_images']>0 and $page['num'] < $page['cat_nb_images'] - 1) 93 { 94 mysql_data_seek($result, $page['cat_nb_images'] - 1); 95 $row = mysql_fetch_array($result); 96 $url_first_last = PHPWG_ROOT_PATH.'picture.php'; 97 $url_first_last.= get_query_string_diff(array('image_id','add_fav', 98 'slideshow','rate')); 99 $url_first_last.= '&image_id='; 100 $template->assign_block_vars( 101 'last', 102 array( 103 'U_IMG' => $url_first_last . $row['id'], 104 )); 105 } 106 74 107 // if this image_id doesn't correspond to this category, an error message is 75 108 // displayed, and execution is stopped … … 248 281 } 249 282 250 $url_up = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat'].'&'; 251 $url_up.= 'num='.$page['num']; 283 $url_up = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat']; 284 $url_up_start = floor( $page['num'] / $user['nb_image_page'] ); 285 $url_up_start *= $user['nb_image_page']; 286 if ($url_up_start>0) 287 { 288 $url_up .= '&start='.$url_up_start; 289 } 290 252 291 if ( $page['cat'] == 'search' ) 253 292 { … … 643 682 'TITLE_IMG' => $picture['prev']['name'], 644 683 'IMG' => $picture['prev']['thumbnail'], 645 'U_IMG' => $picture['prev']['url'] 684 'U_IMG' => $picture['prev']['url'], 685 'U_IMG_SRC' => $picture['prev']['src'] 646 686 )); 647 687 } … … 654 694 'TITLE_IMG' => $picture['next']['name'], 655 695 'IMG' => $picture['next']['thumbnail'], 656 'U_IMG' => $picture['next']['url'] 696 'U_IMG' => $picture['next']['url'], 697 'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload 657 698 )); 658 699 }
Note: See TracChangeset
for help on using the changeset viewer.