Changeset 1020 for trunk/picture.php


Ignore:
Timestamp:
Feb 1, 2006, 3:46:26 AM (19 years ago)
Author:
rvelices
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/picture.php

    r1014 r1020  
    248248    // if we are working on the "current" element, we search if there is a
    249249    // high quality picture
    250     // FIXME : with remote pictures, this "remote fopen" takes long...
    251250    if ($i == 'current')
    252251    {
    253       if (@fopen($cat_directory.'/pwg_high/'.$row['file'], 'r'))
     252      $url_high=$cat_directory.'/pwg_high/'.$row['file'];
     253      if (url_is_remote($cat_directory))
    254254      {
    255         $picture[$i]['high'] = $cat_directory.'/pwg_high/'.$row['file'];
     255        if ($row['has_high'])
     256        {
     257          $picture[$i]['high'] = $url_high;
     258        }
     259      }
     260      else
     261      {
     262        if (@fopen($url_high, 'r'))
     263        {
     264          $picture[$i]['high'] = $url_high;
     265        }
    256266      }
    257267    }
     
    527537
    528538$page['body_id'] = 'thePicturePage';
     539//-------------------------------------------------------- navigation management
     540if ($has_prev)
     541{
     542  $template->assign_block_vars(
     543    'previous',
     544    array(
     545      'TITLE_IMG' => $picture['prev']['name'],
     546      'IMG' => $picture['prev']['thumbnail'],
     547      'U_IMG' => $picture['prev']['url'],
     548      'U_IMG_SRC' => $picture['prev']['src']
     549      ));
     550}
     551
     552if ($has_next)
     553{
     554  $template->assign_block_vars(
     555    'next',
     556    array(
     557      'TITLE_IMG' => $picture['next']['name'],
     558      'IMG' => $picture['next']['thumbnail'],
     559      'U_IMG' => $picture['next']['url'],
     560      'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload
     561      ));
     562}
     563
    529564include(PHPWG_ROOT_PATH.'include/page_header.php');
    530565$template->set_filenames(array('picture'=>'picture.tpl'));
     
    586621if (isset($picture['current']['high']))
    587622{
    588   $full_size = @getimagesize($picture['current']['high']);
    589   $full_width = $full_size[0];
    590   $full_height = $full_size[1];
    591623  $uuid = uniqid(rand());
    592624  $template->assign_block_vars('high', array(
    593625    'U_HIGH' => $picture['current']['high'],
    594         'UUID'=>$uuid,
    595         'WIDTH_IMG'=>($full_width + 40),
    596         'HEIGHT_IMG'=>($full_height + 40)
     626        'UUID'=>$uuid
    597627        ));
    598628  $template->assign_block_vars(
     
    672702{
    673703  $template->assign_block_vars('admin', array());
    674 }
    675 
    676 //-------------------------------------------------------- navigation management
    677 if ($has_prev)
    678 {
    679   $template->assign_block_vars(
    680     'previous',
    681     array(
    682       'TITLE_IMG' => $picture['prev']['name'],
    683       'IMG' => $picture['prev']['thumbnail'],
    684       'U_IMG' => $picture['prev']['url'],
    685       'U_IMG_SRC' => $picture['prev']['src']
    686       ));
    687 }
    688 
    689 if ($has_next)
    690 {
    691   $template->assign_block_vars(
    692     'next',
    693     array(
    694       'TITLE_IMG' => $picture['next']['name'],
    695       'IMG' => $picture['next']['thumbnail'],
    696       'U_IMG' => $picture['next']['url'],
    697       'U_IMG_SRC' => $picture['next']['src'] // allow navigator to preload
    698       ));
    699704}
    700705
Note: See TracChangeset for help on using the changeset viewer.