Changeset 1145


Ignore:
Timestamp:
Apr 11, 2006, 5:55:51 AM (18 years ago)
Author:
rvelices
Message:

merge r1144 from branch-1_6 into trunk

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/category_recent_cats.inc.php

    r1132 r1145  
    4747       , tn_ext
    4848       , nb_images
     49       , c.name AS cat_name
    4950  FROM '.CATEGORIES_TABLE.' AS c
    5051    INNER JOIN '.IMAGES_TABLE.' AS i ON i.id = c.representative_picture_id
     
    6869      )
    6970    );
    70  
     71
    7172  // template thumbnail initialization
    7273  if (mysql_num_rows($result) > 0)
    7374  {
    7475    $template->assign_block_vars('categories', array());
     76  }
     77
     78  $comment = null;
     79  if (isset($row['comment']))
     80  {
     81    $comment = strip_tags($row['comment'], '<a><br><p><b><i><small><strong>');
    7582  }
    7683
     
    8592        'ALT'   => $row['file'],
    8693        'TITLE' => $lang['hint_category'],
    87        
     94
    8895        'URL'  => make_index_url(
    8996          array(
    9097            'category' => $row['category_id'],
     98            'cat_name' => $row['cat_name'],
    9199            )
    92100          ),
    93101        'NAME' => get_cat_display_name_cache($row['uppercats'], null, false),
    94102        'NB_IMAGES' => $row['nb_images'],
    95         'DESCRIPTION' => @$row['comment'],
     103        'DESCRIPTION' => $comment,
    96104        )
    97105      );
     
    111119    $row_number = 0;
    112120  }
    113  
     121
    114122  $old_level_separator = $conf['level_separator'];
    115123  $conf['level_separator'] = '<br />';
     
    124132        'IMAGE_ALT'   => $row['file'],
    125133        'IMAGE_TITLE' => $lang['hint_category'],
    126        
     134
    127135        'U_IMG_LINK'  => make_index_url(
    128136          array(
    129137            'category' => $row['category_id'],
     138            'cat_name' => $row['cat_name'],
    130139            )
    131140          ),
  • trunk/include/category_subcats.inc.php

    r1135 r1145  
    9595  if (isset($row['comment']))
    9696  {
    97     $comment = strip_tags($row['comment']);
     97    $comment = strip_tags($row['comment'], '<a><br><p><b><i><small><strong>');
    9898  }
    9999
  • trunk/index.php

    r1123 r1145  
    4545  session_unset();
    4646  session_destroy();
    47   setcookie(session_name(),'',0, ini_get('session.cookie_path') );
     47  setcookie(session_name(),'',0,
     48      ini_get('session.cookie_path'), ini_get('session.cookie_domain') );
    4849  redirect( make_index_url() );
    4950}
  • trunk/tools/create_listing_file.php

    r1046 r1145  
    8383{
    8484  $result = array();
    85  
     85
    8686  // Read IPTC data
    8787  $iptc = array();
    88  
     88
    8989  $imginfo = array();
    9090  getimagesize($filename, $imginfo);
    91  
     91
    9292  if (isset($imginfo['APP13']))
    9393  {
     
    136136  // remove binary nulls
    137137  $value = str_replace(chr(0x00), ' ', $value);
    138  
     138
    139139  return htmlentities($value);
    140140}
     
    146146  $map = $conf['use_iptc_mapping'];
    147147  $datefields = array('date_creation', 'date_available');
    148  
     148
    149149  $iptc = get_iptc_data($file, $map);
    150150
     
    162162  if (isset($iptc['keywords']))
    163163  {
    164     // keywords separator is the comma, nothing else. Allowed characters in
    165     // keywords : [A-Za-z0-9], "-" and "_". All other characters will be
    166     // considered as separators
    167     $iptc['keywords'] = preg_replace('/[^\w-]+/', ',', $iptc['keywords']);
     164    // official keywords separator is the comma
     165    $iptc['keywords'] = preg_replace('/[.;]/', ',', $iptc['keywords']);
    168166    $iptc['keywords'] = preg_replace('/^,+|,+$/', '', $iptc['keywords']);
    169167  }
     
    243241
    244242  $prefix_length = strlen($conf['prefix_thumbnail']);
    245  
     243
    246244  $thumbnails = array();
    247245  if ($opendir = @opendir($dir.'/thumbnail'))
     
    350348    $dirs.= "\n".$indent.'</dir'.$level.'>';
    351349  }
    352   return $dirs;   
     350  return $dirs;
    353351}
    354352
     
    370368{
    371369  global $conf, $page;
    372  
     370
    373371  // fs means FileSystem : $fs_files contains files in the filesystem found
    374372  // in $dir that can be managed by PhpWebGallery (see get_pwg_files
     
    384382  $print_dir = preg_replace('/^\.\//', '', $dir);
    385383  $print_dir = preg_replace('/\/*$/', '/', $print_dir);
    386  
     384
    387385  foreach ($fs_files as $fs_file)
    388386  {
     
    391389    $element['path'] = $page['url'].$print_dir.$fs_file;
    392390    $element['filesize'] = floor(filesize($dir.'/'.$fs_file) / 1024);
    393    
     391
    394392    $file_wo_ext = get_filename_wo_extension($fs_file);
    395393
     
    409407
    410408    // 2 cases : the element is a picture or not. Indeed, for a picture
    411     // thumbnail is mandatory, high is optional and for non picture element, 
     409    // thumbnail is mandatory, high is optional and for non picture element,
    412410    // thumbnail and representative is optionnal
    413411    if (in_array(get_extension($fs_file), $conf['picture_ext']))
     
    421419          $element['height'] = $image_size[1];
    422420        }
    423        
     421
    424422        if ( in_array($fs_file, $fs_highs) )
    425423        {
     
    465463          }
    466464        }
    467        
     465
    468466        array_push($elements, $element);
    469467      }
     
    493491        }
    494492      }
    495      
     493
    496494      array_push($elements, $element);
    497495    }
     
    538536  {
    539537    $start = get_moment();
    540    
     538
    541539    $listing = '<informations';
    542540    $listing.= ' generation_date="'.date('Y-m-d').'"';
    543541    $listing.= ' phpwg_version="'.htmlentities($conf{'version'}).'"';
    544    
     542
    545543    $attrs=array();
    546544    if ($conf['use_iptc'])
     
    553551    }
    554552    $listing.= ' metadata="'.implode(',',array_unique($attrs)).'"';
    555    
     553
    556554    $end = strrpos($_SERVER['PHP_SELF'], '/') + 1;
    557555    $local_folder = substr($_SERVER['PHP_SELF'], 0, $end);
    558556    $page['url'] = 'http://'.$_SERVER['HTTP_HOST'].$local_folder;
    559    
     557
    560558    $listing.= ' url="'.$page['url'].'"';
    561559    $listing.= '/>'."\n";
    562    
     560
    563561    $listing.= get_dirs('.', '', 0);
    564    
     562
    565563    if ($fp = @fopen("./listing.xml","w"))
    566564    {
Note: See TracChangeset for help on using the changeset viewer.