Changeset 761
- Timestamp:
- Mar 31, 2005, 11:53:24 PM (19 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/ChangeLog
r760 r761 1 2005-03-31 Pierrick LE GALL <pierrick at phpwebgallery dot net> 2 3 * apply category name and element name separation in calendar 4 special category 5 6 * change method of counting total number of viewable pictures : 7 pictures linked to more than one category are not counted twice. 8 1 9 2005-03-26 Pierrick LE GALL <pierrick at phpwebgallery dot net> 2 10 -
trunk/include/category_calendar.inc.php
r744 r761 246 246 'IMAGE_ALT'=>$row['file'], 247 247 'IMAGE_TITLE'=>$thumbnail_title, 248 'IMAGE_NAME'=>$name,249 248 250 249 'U_IMG_LINK'=>add_session_id($url_link) 251 250 ) 252 251 ); 252 253 $template->assign_block_vars( 254 'thumbnails.line.thumbnail.category_name', 255 array( 256 'NAME' => $name 257 ) 258 ); 253 259 254 260 // create a new line ? … … 300 306 'IMAGE_ALT'=>$row['file'], 301 307 'IMAGE_TITLE'=>$thumbnail_title, 302 'IMAGE_NAME'=>$name,303 308 304 309 'U_IMG_LINK'=>add_session_id($url_link) 305 310 ) 306 311 ); 312 313 $template->assign_block_vars( 314 'thumbnails.line.thumbnail.category_name', 315 array( 316 'NAME' => $name 317 ) 318 ); 307 319 308 320 // create a new line ? … … 348 360 'IMAGE_ALT'=>$row['file'], 349 361 'IMAGE_TITLE'=>$thumbnail_title, 350 'IMAGE_NAME'=>$name,351 362 352 363 'U_IMG_LINK'=>add_session_id($url_link) … … 354 365 ); 355 366 367 $template->assign_block_vars( 368 'thumbnails.line.thumbnail.category_name', 369 array( 370 'NAME' => $name 371 ) 372 ); 373 356 374 // create a new line ? 357 375 if (++$row_number == $user['nb_image_line']) … … 416 434 'IMAGE_ALT'=>$row['file'], 417 435 'IMAGE_TITLE'=>$thumbnail_title, 418 'IMAGE_NAME'=>$name,419 436 420 437 'U_IMG_LINK'=>add_session_id($url_link) 421 438 ) 422 439 ); 423 $template->assign_block_vars('thumbnails.line.thumbnail.bullet',array()); 440 441 $template->assign_block_vars( 442 'thumbnails.line.thumbnail.category_name', 443 array( 444 'NAME' => $name 445 ) 446 ); 424 447 425 448 // create a new line ? -
trunk/include/functions_category.inc.php
r715 r761 156 156 } 157 157 158 /** 159 * returns the total number of elements viewable in the gallery by the 160 * connected user 161 * 162 * @return int 163 */ 158 164 function count_user_total_images() 159 165 { 160 166 global $user; 161 167 162 $query = 'SELECT SUM(nb_images) AS total'; 163 $query.= ' FROM '.CATEGORIES_TABLE; 164 if ( count( $user['restrictions'] ) > 0 ) 165 $query.= ' WHERE id NOT IN ('.$user['forbidden_categories'].')'; 166 $query.= ';'; 168 $query = ' 169 SELECT COUNT(DISTINCT(image_id)) as total 170 FROM '.IMAGE_CATEGORY_TABLE; 171 if (count($user['restrictions']) > 0) 172 { 173 $query.= ' 174 WHERE category_id NOT IN ('.$user['forbidden_categories'].')'; 175 } 176 $query.= ' 177 ;'; 167 178 168 $row = mysql_fetch_array( pwg_query( $query ) ); 169 170 if ( !isset( $row['total'] ) ) $row['total'] = 0; 171 return $row['total']; 179 $row = mysql_fetch_array(pwg_query($query)); 180 181 return isset($row['total']) ? $row['total'] : 0; 172 182 } 173 183
Note: See TracChangeset
for help on using the changeset viewer.