1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-25 02:51:35 +02:00

Merge most changes from 3.0.x branch since the 25th december.

(Captcha changes for refreshing captcha image not included)

git-svn-id: file:///svn/phpbb/trunk@9404 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2009-03-22 16:34:26 +00:00
parent fac9c024ff
commit 4cbf6bc703
80 changed files with 2491 additions and 916 deletions

View File

@@ -79,6 +79,35 @@ function set_config($config_name, $config_value, $is_dynamic = false)
}
}
/**
* Set dynamic config value with arithmetic operation.
*/
function set_config_count($config_name, $increment, $is_dynamic = false)
{
switch (phpbb::$db->sql_layer)
{
case 'firebird':
$sql_update = 'CAST(CAST(config_value as integer) + ' . (int) $increment . ' as CHAR)';
break;
case 'postgres':
$sql_update = 'int4(config_value) + ' . (int) $increment;
break;
// MySQL, SQlite, mssql, mssql_odbc, oracle
default:
$sql_update = 'config_value + ' . (int) $increment;
break;
}
phpbb::$db->sql_query('UPDATE ' . CONFIG_TABLE . ' SET config_value = ' . $sql_update . " WHERE config_name = '" . phpbb::$db->sql_escape($config_name) . "'");
if (!$is_dynamic)
{
phpbb::$acm->destroy('#config');
}
}
/**
* Return formatted string for filesizes
* @todo move those functions to a helper class?
@@ -314,7 +343,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$sql_update = array();
while ($row = phpbb::$db->sql_fetchrow($result))
{
$sql_update[] = $row['forum_id'];
$sql_update[] = (int) $row['forum_id'];
}
phpbb::$db->sql_freeresult($result);