diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-02-01 02:46:26 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-02-01 02:46:26 +0000 |
commit | bb181b04cf3e4984cb1dfbe95e5521ad917fab76 (patch) | |
tree | 10199843cd8c12ff06ea1f2e0fb6977d6fa1c46f /picture.php | |
parent | ac5fd23412f64b5b8647574a431e3cc13518538e (diff) |
feature 280: Allow visitors/users to choose image ordering inside a category
improvement 82: Viewing pictures from remote galleries does not check anymore
for the high pictures (existence flag added to create_listing_file and db)
correction: link element in picture is in the head instead of body (w3c spec)
correction: in profile.php the current template was not selected by default
git-svn-id: http://piwigo.org/svn/trunk@1020 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'picture.php')
-rw-r--r-- | picture.php | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/picture.php b/picture.php index 11353de52..2b53b4868 100644 --- a/picture.php +++ b/picture.php @@ -247,12 +247,22 @@ foreach (array('prev', 'current', 'next') as $i) $picture[$i]['src'] = $row['path']; // if we are working on the "current" element, we search if there is a // high quality picture - // FIXME : with remote pictures, this "remote fopen" takes long... if ($i == 'current') { - if (@fopen($cat_directory.'/pwg_high/'.$row['file'], 'r')) + $url_high=$cat_directory.'/pwg_high/'.$row['file']; + if (url_is_remote($cat_directory)) { - $picture[$i]['high'] = $cat_directory.'/pwg_high/'.$row['file']; + if ($row['has_high']) + { + $picture[$i]['high'] = $url_high; + } + } + else + { + if (@fopen($url_high, 'r')) + { + $picture[$i]['high'] = $url_high; + } } } } @@ -526,6 +536,31 @@ if ($metadata_showable and !isset($_GET['show_metadata'])) } $page['body_id'] = 'thePicturePage'; +//-------------------------------------------------------- navigation management +if ($has_prev) +{ + $template->assign_block_vars( + 'previous', + array( + 'TITLE_IMG' => $picture['prev']['name'], + 'IMG' => $picture['prev']['thumbnail'], + 'U_IMG' => $picture['prev']['url'], + 'U_IMG_SRC' => $picture['prev']['src'] + )); +} + +if ($has_next) +{ + $template->assign_block_vars( + 'next', + array( + 'TITLE_IMG' => $picture['next']['name'], + 'IMG' => $picture['next']['thumbnail'], + 'U_IMG' => $picture['next']['url'], + 'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload + )); +} + include(PHPWG_ROOT_PATH.'include/page_header.php'); $template->set_filenames(array('picture'=>'picture.tpl')); @@ -585,15 +620,10 @@ if (!$picture['current']['is_picture']) // display a high quality link if present if (isset($picture['current']['high'])) { - $full_size = @getimagesize($picture['current']['high']); - $full_width = $full_size[0]; - $full_height = $full_size[1]; $uuid = uniqid(rand()); $template->assign_block_vars('high', array( 'U_HIGH' => $picture['current']['high'], - 'UUID'=>$uuid, - 'WIDTH_IMG'=>($full_width + 40), - 'HEIGHT_IMG'=>($full_height + 40) + 'UUID'=>$uuid )); $template->assign_block_vars( 'download', @@ -673,31 +703,6 @@ if ( $user['status'] == 'admin' ) $template->assign_block_vars('admin', array()); } -//-------------------------------------------------------- navigation management -if ($has_prev) -{ - $template->assign_block_vars( - 'previous', - array( - 'TITLE_IMG' => $picture['prev']['name'], - 'IMG' => $picture['prev']['thumbnail'], - 'U_IMG' => $picture['prev']['url'], - 'U_IMG_SRC' => $picture['prev']['src'] - )); -} - -if ($has_next) -{ - $template->assign_block_vars( - 'next', - array( - 'TITLE_IMG' => $picture['next']['name'], - 'IMG' => $picture['next']['thumbnail'], - 'U_IMG' => $picture['next']['url'], - 'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload - )); -} - //--------------------------------------------------------- picture information // legend if (isset($picture['current']['comment']) |