Changeset 1014
- Timestamp:
- Jan 27, 2006, 2:11:43 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/category.php
r1004 r1014 65 65 } 66 66 67 // Sometimes, a "num" is provided in the URL. It is the number68 // of the picture to show. This picture must be in the thumbnails page.69 // We have to find the right $page['start'] that show the num picture70 // in this category71 if ( isset( $_GET['num'] )72 and is_numeric( $_GET['num'] )73 and $_GET['num'] >= 0 )74 {75 $page['start'] = floor( $_GET['num'] / $user['nb_image_page'] );76 $page['start']*= $user['nb_image_page'];77 }78 79 67 initialize_category(); 80 68 -
trunk/include/category_default.inc.php
r1004 r1014 40 40 $query = ' 41 41 SELECT DISTINCT(id),path,file,date_available 42 ,tn_ext,name,filesize,storage_category_id,average_rate 42 ,tn_ext,name,filesize,storage_category_id,average_rate,hit 43 43 FROM '.IMAGES_TABLE.' AS i 44 44 INNER JOIN '.IMAGE_CATEGORY_TABLE.' AS ic ON id=ic.image_id … … 109 109 $name = '('.$row['average_rate'].') '.$name; 110 110 } 111 else 112 if ($page['cat'] == 'most_visited') 113 { 114 $name = '('.$row['hit'].') '.$name; 115 } 111 116 112 117 if ($page['cat'] == 'search') -
trunk/include/functions_html.inc.php
r1004 r1014 83 83 $navbar.= '<a href="'; 84 84 $navbar.= $url.'&start=0'; 85 $navbar.= '" class="'.$link_class.'" >'.$lang['first_page'];85 $navbar.= '" class="'.$link_class.'" rel="start">'.$lang['first_page']; 86 86 $navbar.= '</a>'; 87 87 } … … 97 97 $navbar.= '<a href="'; 98 98 $navbar.= $url.'&start='.$previous; 99 $navbar.= '" class="'.$link_class.'" >'.$lang['previous_page'];99 $navbar.= '" class="'.$link_class.'" rel="prev">'.$lang['previous_page']; 100 100 $navbar.= '</a>'; 101 101 } … … 131 131 $navbar.= ' <a href="'; 132 132 $navbar.= $url.'&start='.$temp_start; 133 $navbar.= '" class="'.$link_class.'">'.$i.'</a>'; 133 $navbar.= '" class="'.$link_class.'"'; 134 if ($i == $cur_page - 1) 135 { 136 $navbar.= ' rel="prev"'; 137 } 138 if ($i == $cur_page + 1) 139 { 140 $navbar.= ' rel="next"'; 141 } 142 $navbar.='>'.$i.'</a>'; 134 143 } 135 144 else … … 160 169 $navbar.= '<a href="'; 161 170 $navbar.= $url.'&start='.$next; 162 $navbar.= '" class="'.$link_class.'" >'.$lang['next_page'].'</a>';171 $navbar.= '" class="'.$link_class.'" rel="next">'.$lang['next_page'].'</a>'; 163 172 } 164 173 else -
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 } -
trunk/template/yoga/picture.tpl
r985 r1014 15 15 16 16 <div class="randomButtons"> 17 <a href="{U_SLIDESHOW}" title="{L_SLIDESHOW}" ><img src="{themeconf:icon_dir}/slideshow.png" class="button" alt="{L_SLIDESHOW}"></a>17 <a href="{U_SLIDESHOW}" title="{L_SLIDESHOW}" rel="nofollow"><img src="{themeconf:icon_dir}/slideshow.png" class="button" alt="{L_SLIDESHOW}"></a> 18 18 <a href="{U_METADATA}" title="{L_PICTURE_METADATA}"><img src="{themeconf:icon_dir}/metadata.png" class="button" alt="{L_PICTURE_METADATA}"></a> 19 19 <!-- BEGIN representative --> … … 35 35 36 36 <div class="navButtons"> 37 <!-- BEGIN last --> 38 <a class="navButton prev" href="{last.U_IMG}"><img src="{themeconf:icon_dir}/last.png" class="button" alt="{lang:last_page}"></a> 39 <!-- END last --> 37 40 <!-- BEGIN next --> 38 <a class="navButton next" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}"><img src="{themeconf:icon_dir}/right.png" class="button" alt="next"></a> 41 <a class="navButton next" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}" rel="next"><img src="{themeconf:icon_dir}/right.png" class="button" alt="next"></a> 42 <link rel="prefetch" href="{next.U_IMG_SRC}"><link rel="prefetch" href="{next.U_IMG}"> 39 43 <!-- END next --> 40 44 <a class="navButton up" href="{U_UP}" title="{L_UP_HINT}"><img src="{themeconf:icon_dir}/up.png" class="button" alt="{L_UP_ALT}"></a> 41 45 <!-- BEGIN previous --> 42 <a class="navButton prev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}" ><img src="{themeconf:icon_dir}/left.png" class="button" alt="previous"></a>46 <a class="navButton prev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}" rel="prev"><img src="{themeconf:icon_dir}/left.png" class="button" alt="previous"></a> 43 47 <!-- END previous --> 48 <!-- BEGIN first --> 49 <a class="navButton prev" href="{first.U_IMG}" rel="start"><img src="{themeconf:icon_dir}/first.png" class="button" alt="{lang:first_page}"></a> 50 <!-- END first --> 44 51 </div> 45 52 … … 66 73 67 74 <!-- BEGIN previous --> 68 <a class="navThumb" id="thumbPrev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}" >75 <a class="navThumb" id="thumbPrev" href="{previous.U_IMG}" title="{L_PREV_IMG}{previous.TITLE_IMG}" rel="prev"> 69 76 <img src="{previous.IMG}" class="thumbLink" id="linkPrev" alt="{previous.TITLE_IMG}"> 70 77 </a> 71 78 <!-- END previous --> 72 79 <!-- BEGIN next --> 73 <a class="navThumb" id="thumbNext" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}" >80 <a class="navThumb" id="thumbNext" href="{next.U_IMG}" title="{L_NEXT_IMG}{next.TITLE_IMG}" rel="next"> 74 81 <img src="{next.IMG}" class="thumbLink" id="linkNext" alt="{next.TITLE_IMG}"> 75 82 </a> … … 147 154 {rate.SENTENCE} : 148 155 <!-- BEGIN rate_option --> 149 {rate.rate_option.SEPARATOR} <a href="{rate.rate_option.URL}" >{rate.rate_option.OPTION}</a>156 {rate.rate_option.SEPARATOR} <a href="{rate.rate_option.URL}" rel="nofollow">{rate.rate_option.OPTION}</a> 150 157 <!-- END rate_option --> 151 158 </p>
Note: See TracChangeset
for help on using the changeset viewer.