Witam!
Co tutaj może być nie tak? Klamerki sprawdzałem i wszystko jest ok.
Parse error: syntax error, unexpected T_ELSE
if ( ! $sql = mysql_query("SELECT * FROM " . POSTS_TABLE
. " WHERE topic_id = $moved_topics_ids_imp AND post_reason_mod = 0 AND poster_id = $idbota limit 1") ) {
if ( $num )
{
if ( !$db->sql_query("INSERT INTO ".POSTS_TABLE." (`post_id`, `topic_id`, `forum_id`, `poster_id`, `post_time`, `poster_ip`, `post_username`, `enable_bbcode`, `enable_html`, `enable_smilies`, `enable_sig`, `post_edit_time`, `post_edit_count`, `post_attachment`, `user_agent`, `post_icon`, `post_expire`, `reporter_id`, `post_marked`, `post_approve`, `poster_delete`, `post_edit_by`, `post_parent`, `post_order`, `post_reason_mod`) VALUES (".$db->sql_nextid().", '".$moved_topics_ids_imp."', '".$new_forum_id."', '".$idbota."', '".CR_TIME."', '0', '', '1', '0', '1', '1', '0', '0', '0', '', '0', '0', '0', '0', '1', '0', '0', '0', '".$post_order."', '2')") )
{
message_die(CRITICAL_ERROR, 'Error1');
}
if ( !$db->sql_query("INSERT INTO ".POSTS_TEXT_TABLE
." (`post_id`, `bbcode_uid`, `post_subject`, `post_text`) VALUES (".$db->sql_nextid().", '0', '', '".str_replace("\'", "''", sprintf($lang['bot_message_change'], $forum_name_old, $forum_name_new))."')") )
{
message_die(CRITICAL_ERROR, 'Error2');
}
$sql = "SELECT forum_posts
FROM " . FORUMS_TABLE . "
WHERE forum_id = $new_forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
}
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$forum_posts = $row['forum_posts'];
}
$forum_postss = $forum_posts + 1;
$sql = "SELECT topic_replies
FROM " . TOPICS_TABLE . "
WHERE topic_id =$moved_topics_ids_imp";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
}
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$topic_replies = $row['topic_replies'];
}
$topic_repliess = $topic_replies + 1;
$sql = "SELECT post_id
FROM " . POSTS_TABLE . "
WHERE forum_id = $new_forum_id
AND topic_id = $moved_topics_ids_imp
AND poster_id = $idbota";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
}
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$post_id = $row['post_id'];
}
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_last_post_id = $post_id
WHERE topic_id = $moved_topics_ids_imp";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'jakis errorek', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_last_post_id = $post_id
WHERE forum_id = $new_forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'jakis errorek', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_replies = $topic_repliess
WHERE topic_id = $moved_topics_ids_imp";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . FORUMS_TABLE . "
SET forum_posts = $forum_postss
WHERE forum_id = $new_forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
}
$sql = "SELECT user_posts
FROM " . USERS_TABLE . "
WHERE user_id = $idbota";
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$posts_bot = $row['user_posts'];
}
$postss_bot = $posts_bot + 1;
$sql = "UPDATE " . USERS_TABLE . "
SET user_posts = $postss_bot
WHERE user_id = $idbota";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'jakis errorek', '', __LINE__, __FILE__, $sql);
}
$sql = "SELECT topic_last_post_id
FROM " . TOPICS_TABLE . "
WHERE topic_id = $moved_topics_ids_imp";
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$lastt_post = $row['topic_last_post_id'];
}
}
}
else if ( ! $sql = mysql_query("SELECT post_id FROM " . POSTS_TABLE
. " WHERE topic_id = $moved_topics_ids_imp AND post_reason_mod = 2 AND poster_id = $idbota limit 1") ) {
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$postt_idd = $row['post_id'];
}
else if ( $numm )
{
$sql = "UPDATE " . POSTS_TEXT_TABLE . "
SET post_text = '".str_replace("\'", "''", sprintf($lang['bot_message_change'], $forum_name_old, $forum_name_new))."' WHERE post_id = $postt_idd";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'jakis errorek', '', __LINE__, __FILE__, $sql);
}
}
}
Ten post edytował Mody23 1.11.2011, 12:54:40