Changeset 2512


Ignore:
Timestamp:
Sep 9, 2008, 3:16:32 AM (16 years ago)
Author:
rvelices
Message:
  • fix issue when picture_url_style = file (sql query like)
  • sql call SET NAMES "xxx" (if required) in upgrade.php, upgrade_feed.php and after 65-database.php
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/install/db/65-database.php

    r2299 r2512  
    299299  define('DB_COLLATE',  '');
    300300
     301  if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') and DB_CHARSET!='' )
     302  {
     303    pwg_query('SET NAMES "'.DB_CHARSET.'"');
     304  }
     305
    301306  echo $upgrade_log;
    302307  $fp = @fopen( PHPWG_ROOT_PATH.'upgrade65.log', 'w' );
  • trunk/picture.php

    r2446 r2512  
    5353  {// url given by file name
    5454    assert( !empty($page['image_file']) );
    55     $query .= 'file LIKE "' . $page['image_file'] . '.%" ESCAPE "|" LIMIT 1';
     55    $query .= 'file LIKE "' .
     56      str_replace(array('_','%'), array('/_','/%'), $page['image_file'] ).
     57      '.%" ESCAPE "/" LIMIT 1';
    5658  }
    5759  if ( ! ( $row = mysql_fetch_array(pwg_query($query)) ) )
  • trunk/template/yoga/picture.tpl

    r2481 r2512  
    210210                        {/if}
    211211                        {/foreach}
    212                         <script type="text/javascript" src="{$ROOT_URL}{$themeconf.template_dir}/rating.js"></script>
     212                        <script type="text/javascript" src="{$ROOT_URL}template/{$themeconf.template}/rating.js"></script>
    213213                        <script type="text/javascript">
    214214                        makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
  • trunk/upgrade.php

    r2299 r2512  
    4141
    4242// Database connection
    43 mysql_connect( $cfgHote, $cfgUser, $cfgPassword )
    44 or die ( "Could not connect to database server" );
    45 mysql_select_db( $cfgBase )
    46 or die ( "Could not connect to database" );
     43mysql_connect( $cfgHote, $cfgUser, $cfgPassword ) or die ( "Could not connect to database server" );
     44mysql_select_db( $cfgBase ) or die ( "Could not connect to database" );
     45if ( version_compare(mysql_get_server_info(), '4.1.0', '>=')
     46    and defined('DB_CHARSET') and DB_CHARSET!='' )
     47{
     48  pwg_query('SET NAMES "'.DB_CHARSET.'"');
     49}
     50
    4751// +-----------------------------------------------------------------------+
    4852// |                            tricky output                              |
  • trunk/upgrade_feed.php

    r2323 r2512  
    4343// +-----------------------------------------------------------------------+
    4444
    45 mysql_connect($cfgHote, $cfgUser, $cfgPassword)
    46 or die("Could not connect to database server");
    47 mysql_select_db($cfgBase)
    48 or die("Could not connect to database");
     45mysql_connect($cfgHote, $cfgUser, $cfgPassword) or die("Could not connect to database server");
     46mysql_select_db($cfgBase) or die("Could not connect to database");
     47if ( version_compare(mysql_get_server_info(), '4.1.0', '>=')
     48    and defined('DB_CHARSET') and DB_CHARSET!='' )
     49{
     50  pwg_query('SET NAMES "'.DB_CHARSET.'"');
     51}
     52
    4953
    5054// +-----------------------------------------------------------------------+
Note: See TracChangeset for help on using the changeset viewer.