Every one with ABBC3 MOD install will need to change the install. Like i did [replace all function add_bbcode($album_bbcode)]
Problem Solve
i have put with the order like the phpmyadmin and it works:
I have edit install.php
Code: Select all
function add_bbcode($album_bbcode)
{
global $db, $config;
$sql = 'SELECT * FROM ' . BBCODES_TABLE . " WHERE bbcode_tag = '$album_bbcode'";
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
$sql = 'SELECT MAX(bbcode_id) as max_bbcode_id
FROM ' . BBCODES_TABLE;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
if ($row)
{
$bbcode_id = $row['max_bbcode_id'] + 1;
// Make sure it is greater than the core bbcode ids...
if ($bbcode_id <= NUM_CORE_BBCODES)
{
$bbcode_id = NUM_CORE_BBCODES + 1;
}
}
else
{
$bbcode_id = NUM_CORE_BBCODES + 1;
}
$sql_ary['bbcode_id'] = (int) $bbcode_id;
if (!$row)
{
$sql_ary = array(
'bbcode_tag' => $album_bbcode,
'bbcode_helpline' => '',
'display_on_posting' => true,
'bbcode_match' => '[' . $album_bbcode . ']{NUMBER}[/' . $album_bbcode . ']',
'bbcode_tpl' => '<a href="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/image_page.php?image_id={NUMBER}"><img src="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/thumbnail.php?image_id={NUMBER}" alt="image_id: {NUMBER}" /></a>',
'first_pass_match' => '!\[' . $album_bbcode . '\]([0-9]+)\[/' . $album_bbcode . '\]!i',
'first_pass_replace' => '[' . $album_bbcode . ':$uid]${1}[/' . $album_bbcode . ':$uid]',
'second_pass_match' => '!\[' . $album_bbcode . ':$uid\]([0-9]+)\[/' . $album_bbcode . ':$uid\]!s',
'second_pass_replace' => '<a href="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/image_page.php?image_id=${1}"><img src="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/thumbnail.php?image_id=${1}" alt="image_id: ${1}" /></a>',
);
$db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary));
}
else
{
$sql_ary = array(
'bbcode_tpl' => '<a href="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/image_page.php?image_id={NUMBER}"><img src="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/thumbnail.php?image_id={NUMBER}" alt="image_id: {NUMBER}" /></a>',
'second_pass_replace' => '<a href="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/image_page.php?image_id=${1}"><img src="' . $config['server_protocol'] . $config['server_name'] . $config['script_path'] . '/gallery/thumbnail.php?image_id=${1}" alt="image_id: ${1}" /></a>',
);
$db->sql_query('UPDATE ' . BBCODES_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE bbcode_id = ' . (int) $row['bbcode_id']);
}
}
// What sql_layer should we use?
switch ($db->sql_layer)
{
case 'mysql':
$db_schema = 'mysql_40';
$delimiter = ';';
break;
case 'mysql4':
if (version_compare($db->mysql_version, '4.1.3', '>='))
{
$db_schema = 'mysql_41';
}
else
{
$db_schema = 'mysql_40';
}
$delimiter = ';';
break;
case 'mysqli':
$db_schema = 'mysql_41';
$delimiter = ';';
break;
case 'mssql':
case 'mssql_odbc':
$db_schema = 'mssql';
$delimiter = 'GO';
break;
case 'postgres':
$db_schema = 'postgres';
$delimiter = ';';
break;
case 'sqlite':
$db_schema = 'sqlite';
$delimiter = ';';
break;
case 'firebird':
$db_schema = 'firebird';
$delimiter = ';;';
break;
case 'oracle':
$db_schema = 'oracle';
$delimiter = '/';
break;
default:
trigger_error('Sorry, unsupportet Databases found.');
break;
}