- 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

git-svn-id: http://piwigo.org/svn/trunk@2512 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices 2008-09-09 01:16:32 +00:00
commit 26474d349f
5 changed files with 25 additions and 10 deletions

View file

@ -298,6 +298,11 @@ define(\'DB_COLLATE\', \'\');
define('DB_CHARSET', $db_charset);
define('DB_COLLATE', '');
if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') and DB_CHARSET!='' )
{
pwg_query('SET NAMES "'.DB_CHARSET.'"');
}
echo $upgrade_log;
$fp = @fopen( PHPWG_ROOT_PATH.'upgrade65.log', 'w' );
if ($fp)

View file

@ -52,7 +52,9 @@ SELECT id, file, level
else
{// url given by file name
assert( !empty($page['image_file']) );
$query .= 'file LIKE "' . $page['image_file'] . '.%" ESCAPE "|" LIMIT 1';
$query .= 'file LIKE "' .
str_replace(array('_','%'), array('/_','/%'), $page['image_file'] ).
'.%" ESCAPE "/" LIMIT 1';
}
if ( ! ( $row = mysql_fetch_array(pwg_query($query)) ) )
{// element does not exist

View file

@ -209,7 +209,7 @@ y.callService(
<input type="submit" name="rate" value="{$mark}" class="rateButton" />
{/if}
{/foreach}
<script type="text/javascript" src="{$ROOT_URL}{$themeconf.template_dir}/rating.js"></script>
<script type="text/javascript" src="{$ROOT_URL}template/{$themeconf.template}/rating.js"></script>
<script type="text/javascript">
makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
updateRateText: "{'update_rate'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),

View file

@ -40,10 +40,14 @@ include_once(PHPWG_ROOT_PATH.'include/constants.php');
define('PREFIX_TABLE', $prefixeTable);
// Database connection
mysql_connect( $cfgHote, $cfgUser, $cfgPassword )
or die ( "Could not connect to database server" );
mysql_select_db( $cfgBase )
or die ( "Could not connect to database" );
mysql_connect( $cfgHote, $cfgUser, $cfgPassword ) or die ( "Could not connect to database server" );
mysql_select_db( $cfgBase ) or die ( "Could not connect to database" );
if ( version_compare(mysql_get_server_info(), '4.1.0', '>=')
and defined('DB_CHARSET') and DB_CHARSET!='' )
{
pwg_query('SET NAMES "'.DB_CHARSET.'"');
}
// +-----------------------------------------------------------------------+
// | tricky output |
// +-----------------------------------------------------------------------+

View file

@ -42,10 +42,14 @@ define('UPGRADES_PATH', PHPWG_ROOT_PATH.'install/db');
// | Database connection |
// +-----------------------------------------------------------------------+
mysql_connect($cfgHote, $cfgUser, $cfgPassword)
or die("Could not connect to database server");
mysql_select_db($cfgBase)
or die("Could not connect to database");
mysql_connect($cfgHote, $cfgUser, $cfgPassword) or die("Could not connect to database server");
mysql_select_db($cfgBase) or die("Could not connect to database");
if ( version_compare(mysql_get_server_info(), '4.1.0', '>=')
and defined('DB_CHARSET') and DB_CHARSET!='' )
{
pwg_query('SET NAMES "'.DB_CHARSET.'"');
}
// +-----------------------------------------------------------------------+
// | Upgrades |