diff options
Diffstat (limited to 'picture.php')
-rw-r--r-- | picture.php | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/picture.php b/picture.php index 092b2aed2..98c9593fe 100644 --- a/picture.php +++ b/picture.php @@ -2,7 +2,7 @@ // +-----------------------------------------------------------------------+ // | Piwigo - a PHP based photo gallery | // +-----------------------------------------------------------------------+ -// | Copyright(C) 2008-2013 Piwigo Team http://piwigo.org | +// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | // +-----------------------------------------------------------------------+ @@ -102,8 +102,8 @@ SELECT id { if ('best_rated'==$page['section']) { - $page['rank_of'][$page['image_id']] = count($page['items']); - array_push($page['items'], $page['image_id'] ); + $page['rank_of'][ $page['image_id'] ] = count($page['items']); + $page['items'][] = $page['image_id']; } else { @@ -150,7 +150,7 @@ trigger_action('loc_begin_picture'); function default_picture_content($content, $element_info) { global $conf; - + if ( !empty($content) ) {// someone hooked us - so we skip; return $content; @@ -309,13 +309,8 @@ UPDATE '.CATEGORIES_TABLE.' ;'; pwg_query($query); - $query = ' -UPDATE '.USER_CACHE_CATEGORIES_TABLE.' - SET user_representative_picture_id = NULL - WHERE user_id = '.$user['id'].' - AND cat_id = '.$page['category']['id'].' -;'; - pwg_query($query); + include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); + invalidate_user_cache(); } redirect($url_self); @@ -377,7 +372,7 @@ UPDATE '.USER_CACHE_CATEGORIES_TABLE.' } unset($_POST['content']); } - + $edit_comment = $_GET['comment_to_edit']; } break; @@ -473,13 +468,13 @@ $picture = array(); $ids = array($page['image_id']); if (isset($page['previous_item'])) { - array_push($ids, $page['previous_item']); - array_push($ids, $page['first_item']); + $ids[] = $page['previous_item']; + $ids[] = $page['first_item']; } if (isset($page['next_item'])) { - array_push($ids, $page['next_item']); - array_push($ids, $page['last_item']); + $ids[] = $page['next_item']; + $ids[] = $page['last_item']; } $query = ' @@ -546,6 +541,7 @@ while ($row = pwg_db_fetch_assoc($result)) $picture[$i] = $row; $picture[$i]['TITLE'] = render_element_name($row); + $picture[$i]['TITLE_ESC'] = str_replace('"', '"', $picture[$i]['TITLE']); if ('previous'==$i and $page['previous_item']==$page['first_item']) { @@ -773,7 +769,6 @@ if (is_admin()) array('action'=>'add_to_caddie') ), 'U_PHOTO_ADMIN' => $url_admin, - 'U_ADMIN' => $url_admin, // TEMP 2.5 for backward compatibility ) ); @@ -813,7 +808,9 @@ if (isset($picture['current']['comment']) $template->assign( 'COMMENT_IMG', trigger_event('render_element_description', - $picture['current']['comment']) + $picture['current']['comment'], + 'picture_page_element_description' + ) ); } @@ -864,8 +861,7 @@ if ($picture['current']['src_image']->is_original() and isset($picture['current' // filesize if (!empty($picture['current']['filesize'])) { - $infos['INFO_FILESIZE'] = - sprintf(l10n('%d Kb'), $picture['current']['filesize']); + $infos['INFO_FILESIZE'] = l10n('%d Kb', $picture['current']['filesize']); } // number of visits @@ -949,6 +945,7 @@ $template->assign( 'ELEMENT_CONTENT', $element_content ); if (isset($picture['next']) and $picture['next']['src_image']->is_original() + and $template->get_template_vars('U_PREFETCH') == null and strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome/') === false) { $template->assign( @@ -986,7 +983,6 @@ if ($conf['picture_menu'] AND (!isset($themeconf['hide_menu_on']) OR !in_array(' { if (!isset($page['start'])) $page['start'] = 0; include( PHPWG_ROOT_PATH.'include/menubar.inc.php'); - if (is_admin()) $template->assign('U_ADMIN', $url_admin); // overwrited by the menu TEMP 2.5 for backward compatibility } include(PHPWG_ROOT_PATH.'include/page_header.php'); |