[BETA] Move topics when locked
Forumregels
Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
Sinds 1 januari 2009 wordt phpBB2 niet meer ondersteund.
Onderstaande informatie is verouderd en dient uitsluitend als archief.
Waarschijnlijk heb je in de MODCP.php iets verkeerd gedaan
en ik denk dit
en ik denk dit
Code: Selecteer alles
#-----[ OPEN ]------------------------------------------
#
modcp.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . TOPICS_TABLE . "
SET topic_status = " . TOPIC_LOCKED . "
WHERE topic_id IN ($topic_id_sql)
AND forum_id = $forum_id
AND topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not update topics table', '', __LINE__, __FILE__, $sql);
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
//
// START OF THE MOVE TOPICS WHEN LOCKED MODIFICATION
//
if($board_config['move_when_locked'])
{
//
// Let's check for special topics :)
//
$sql = "SELECT * FROM " . TOPICS_TABLE . "
WHERE topic_id IN ($topic_id_sql)
AND forum_id = $forum_id
AND topic_moved_id = 0";
if ( !($special_result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'This failure is caused by the Move Topics Mod.<br />Couldn\'t obtain special topics data.', '', __LINE__, __FILE__, $sql);
}
while($row = $db->sql_fetchrow($special_result))
{
if((($board_config['move_special_topic'] == 2) && ($row['topic_type'] != POST_GLOBAL_ANNOUNCE)) || (($board_config['move_special_topic'] == 1) && ($row['topic_type'] < POST_ANNOUNCE)) || (($board_config['move_special_topic'] == 0) && ($row['topic_type'] == POST_NORMAL)) || (($board_config['move_global_topic'] == 1) && ($row['topic_type'] == POST_GLOBAL_ANNOUNCE)))
{
//
// Start moving topic and posts
//
$sql = "UPDATE " . TOPICS_TABLE . "
SET forum_id = '". $board_config['move_when_locked_id'] ."'
WHERE topic_id = '". $row['topic_id'] ."'
AND forum_id = $forum_id
AND topic_moved_id = 0";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'This failure is caused by the Move Topics Mod.<br />Could not update topics table', '', __LINE__, __FILE__, $sql);
}
$sql = "UPDATE " . POSTS_TABLE . "
SET forum_id = '". $board_config['move_when_locked_id'] ."'
WHERE topic_id = '". $row['topic_id'] ."'
AND forum_id = $forum_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'This failure is caused by the Move Topics Mod.<br />Could not update posts table', '', __LINE__, __FILE__, $sql);
}
}
}
//
// Resync index :)
//
sync('forum', $forum_id);
sync('forum', $board_config['move_when_locked_id']);
}
//
// END OF THE MOVE TOPICS WHEN LOCKED MODIFICATION
//