Index: /trunk/category.php =================================================================== --- /trunk/category.php (revision 1013) +++ /trunk/category.php (revision 1014) @@ -65,16 +65,4 @@ } -// Sometimes, a "num" is provided in the URL. It is the number -// of the picture to show. This picture must be in the thumbnails page. -// We have to find the right $page['start'] that show the num picture -// in this category -if ( isset( $_GET['num'] ) - and is_numeric( $_GET['num'] ) - and $_GET['num'] >= 0 ) -{ - $page['start'] = floor( $_GET['num'] / $user['nb_image_page'] ); - $page['start']*= $user['nb_image_page']; -} - initialize_category(); Index: /trunk/include/category_default.inc.php =================================================================== --- /trunk/include/category_default.inc.php (revision 1013) +++ /trunk/include/category_default.inc.php (revision 1014) @@ -40,5 +40,5 @@ $query = ' SELECT DISTINCT(id),path,file,date_available - ,tn_ext,name,filesize,storage_category_id,average_rate + ,tn_ext,name,filesize,storage_category_id,average_rate,hit FROM '.IMAGES_TABLE.' AS i INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=ic.image_id @@ -109,4 +109,9 @@ $name = '('.$row['average_rate'].') '.$name; } + else + if ($page['cat'] == 'most_visited') + { + $name = '('.$row['hit'].') '.$name; + } if ($page['cat'] == 'search') Index: /trunk/include/functions_html.inc.php =================================================================== --- /trunk/include/functions_html.inc.php (revision 1013) +++ /trunk/include/functions_html.inc.php (revision 1014) @@ -83,5 +83,5 @@ $navbar.= ''.$lang['first_page']; + $navbar.= '" class="'.$link_class.'" rel="start">'.$lang['first_page']; $navbar.= ''; } @@ -97,5 +97,5 @@ $navbar.= ''.$lang['previous_page']; + $navbar.= '" class="'.$link_class.'" rel="prev">'.$lang['previous_page']; $navbar.= ''; } @@ -131,5 +131,14 @@ $navbar.= ' '.$i.''; + $navbar.= '" class="'.$link_class.'"'; + if ($i == $cur_page - 1) + { + $navbar.= ' rel="prev"'; + } + if ($i == $cur_page + 1) + { + $navbar.= ' rel="next"'; + } + $navbar.='>'.$i.''; } else @@ -160,5 +169,5 @@ $navbar.= ''.$lang['next_page'].''; + $navbar.= '" class="'.$link_class.'" rel="next">'.$lang['next_page'].''; } else Index: /trunk/picture.php =================================================================== --- /trunk/picture.php (revision 1013) +++ /trunk/picture.php (revision 1014) @@ -44,10 +44,16 @@ } //---------------------------------------- incrementation of the number of hits -$query = ' -UPDATE '.IMAGES_TABLE.' - SET hit = hit+1 - WHERE id = '.$_GET['image_id'].' -;'; -@pwg_query( $query ); +if ( count(array_intersect( + array_keys($_GET), + array('add_fav', 'caddie', 'rate', 'representative', 'del') ) + )==0 ) +{ + $query = ' + UPDATE '.IMAGES_TABLE.' + SET hit = hit+1 + WHERE id = '.$_GET['image_id'].' + ;'; + @pwg_query( $query ); +} //-------------------------------------------------------------- initialization initialize_category( 'picture' ); @@ -70,6 +76,33 @@ break; } + if ($page['num']==0) + { + $url_first_last = PHPWG_ROOT_PATH.'picture.php'; + $url_first_last.= get_query_string_diff(array('image_id','add_fav', + 'slideshow','rate')); + $url_first_last.= '&image_id='; + $template->assign_block_vars( + 'first', + array( + 'U_IMG' => $url_first_last . $row['id'], + )); + } $page['num']++; } +if ($page['cat_nb_images']>0 and $page['num'] < $page['cat_nb_images'] - 1) +{ + mysql_data_seek($result, $page['cat_nb_images'] - 1); + $row = mysql_fetch_array($result); + $url_first_last = PHPWG_ROOT_PATH.'picture.php'; + $url_first_last.= get_query_string_diff(array('image_id','add_fav', + 'slideshow','rate')); + $url_first_last.= '&image_id='; + $template->assign_block_vars( + 'last', + array( + 'U_IMG' => $url_first_last . $row['id'], + )); +} + // if this image_id doesn't correspond to this category, an error message is // displayed, and execution is stopped @@ -248,6 +281,12 @@ } -$url_up = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat'].'&'; -$url_up.= 'num='.$page['num']; +$url_up = PHPWG_ROOT_PATH.'category.php?cat='.$page['cat']; +$url_up_start = floor( $page['num'] / $user['nb_image_page'] ); +$url_up_start *= $user['nb_image_page']; +if ($url_up_start>0) +{ + $url_up .= '&start='.$url_up_start; +} + if ( $page['cat'] == 'search' ) { @@ -643,5 +682,6 @@ 'TITLE_IMG' => $picture['prev']['name'], 'IMG' => $picture['prev']['thumbnail'], - 'U_IMG' => $picture['prev']['url'] + 'U_IMG' => $picture['prev']['url'], + 'U_IMG_SRC' => $picture['prev']['src'] )); } @@ -654,5 +694,6 @@ 'TITLE_IMG' => $picture['next']['name'], 'IMG' => $picture['next']['thumbnail'], - 'U_IMG' => $picture['next']['url'] + 'U_IMG' => $picture['next']['url'], + 'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload )); } Index: /trunk/template/yoga/picture.tpl =================================================================== --- /trunk/template/yoga/picture.tpl (revision 1013) +++ /trunk/template/yoga/picture.tpl (revision 1014) @@ -15,5 +15,5 @@