Changeset 13736 for trunk/i.php


Ignore:
Timestamp:
Mar 26, 2012, 6:07:03 AM (12 years ago)
Author:
rvelices
Message:
  • small js fixes on index/picture
  • i.php does not use derivatives.dat file anymore (obsolete file)
  • better selection of derivatives in picture.php
  • larger sharpen real range in image.class.php
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/i.php

    r13651 r13736  
    2929defined('PWG_DERIVATIVE_DIR') or define('PWG_DERIVATIVE_DIR', $conf['data_location'].'i/');
    3030
     31@include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php');
     32
     33
    3134function trigger_action() {}
    3235function get_extension( $filename )
     
    373376}
    374377
     378include_once(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php');
    375379include_once( PHPWG_ROOT_PATH .'/include/derivative_params.inc.php');
    376380include_once( PHPWG_ROOT_PATH .'/include/derivative_std_params.inc.php');
    377381
    378 ImageStdParams::load_from_file();
     382try
     383{
     384  $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
     385                                $conf['db_password'], $conf['db_base']);
     386}
     387catch (Exception $e)
     388{
     389  ilog("db error", $e->getMessage());
     390}
     391list($conf['derivatives']) = pwg_db_fetch_row(pwg_query('SELECT value FROM '.$prefixeTable.'config WHERE param=\'derivatives\''));
     392ImageStdParams::load_from_db();
    379393
    380394
     
    429443    && strpos($page['src_location'], 'plugins/')===false)
    430444{
    431   @include(PHPWG_ROOT_PATH.PWG_LOCAL_DIR .'config/database.inc.php');
    432   include(PHPWG_ROOT_PATH .'include/dblayer/functions_'.$conf['dblayer'].'.inc.php');
    433445  try
    434446  {
    435     $pwg_db_link = pwg_db_connect($conf['db_host'], $conf['db_user'],
    436                                   $conf['db_password'], $conf['db_base']);
    437447    $query = 'SELECT coi, width, height FROM '.$prefixeTable.'images WHERE path=\''.$page['src_location'].'\'';
    438448    if ( ($row=pwg_db_fetch_assoc(pwg_query($query))) )
     
    444454      $page['coi'] = $row['coi'];
    445455    }
    446     mysql_close($pwg_db_link);
    447456    if (!$row)
    448457    {
     
    455464  }
    456465}
     466mysql_close($pwg_db_link);
    457467
    458468try_switch_source($params, $src_mtime);
Note: See TracChangeset for help on using the changeset viewer.