Changeset 606 for trunk/tools


Ignore:
Timestamp:
Nov 17, 2004, 12:38:34 AM (19 years ago)
Author:
plg
Message:
  • images.path column added to reduce database access
  • function mass_inserts moved from admin/remote_sites.php to admin/include/function.php
  • function mass_inserts used in admin/update.php
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/create_listing_file.php

    r593 r606  
    311311function get_pictures($dir, $indent)
    312312{
    313   global $conf;
     313  global $conf, $page;
    314314 
    315315  // fs means FileSystem : $fs_files contains files in the filesystem found
     
    322322
    323323  $elements = array();
     324
     325  $print_dir = preg_replace('/^\.\//', '', $dir);
     326  $print_dir = preg_replace('/\/*$/', '/', $print_dir);
    324327 
    325328  foreach ($fs_files as $fs_file)
     
    327330    $element = array();
    328331    $element['file'] = $fs_file;
     332    $element['path'] = $page['url'].$print_dir.$fs_file;
    329333    $element['filesize'] = floor(filesize($dir.'/'.$fs_file) / 1024);
    330334   
     
    421425  $attributes = array('file','tn_ext','representative_ext','filesize',
    422426                      'width','height','date_creation','author','keywords',
    423                       'name','comment');
     427                      'name','comment','path');
    424428  foreach ($elements as $element)
    425429  {
     
    464468    $end = strrpos($_SERVER['PHP_SELF'], '/') + 1;
    465469    $local_folder = substr($_SERVER['PHP_SELF'], 0, $end);
    466     $url = 'http://'.$_SERVER['HTTP_HOST'].$local_folder;
     470    $page['url'] = 'http://'.$_SERVER['HTTP_HOST'].$local_folder;
    467471   
    468     $listing.= ' url="'.$url.'"';
     472    $listing.= ' url="'.$page['url'].'"';
    469473    $listing.= '/>'."\n";
    470474   
Note: See TracChangeset for help on using the changeset viewer.