query('SELECT poster_ip FROM '.$db->prefix.'posts WHERE id='.$get_host) or error('Unable to fetch post IP address', __FILE__, __LINE__, $db->error());
$ip = $db->result($result, 0);
message('The IP address is: '.$ip.'
The host name is: '.gethostbyaddr($ip).'
Show more users for this IP');
}
// All other functions require forum-based moderator access
$fid = intval($_GET['fid']);
if (empty($fid))
message($lang_common['Bad request']);
if (!is_admmod($fid, $foo, $foo))
message($lang_common['No permission']);
if (isset($_GET['move']))
{
if (isset($_POST['move_to']))
{
confirm_referer('moderate.php');
$move = intval($_GET['move']);
$move_to_forum = intval($_POST['move_to_forum']);
if (empty($move) || empty($move_to_forum))
message($lang_common['Bad request']);
// Delete a redirect topic if there is one (only if we moved/copied the topic back to where it where it was once moved from) (start transaction)
$db->query('DELETE FROM '.$db->prefix.'topics WHERE forum_id='.$move_to_forum.' AND moved_to='.$move, PUN_TRANS_START) or error('Unable to delete redirect topic', __FILE__, __LINE__, $db->error());
// Move the topic
$db->query('UPDATE '.$db->prefix.'topics SET forum_id='.$move_to_forum.' WHERE id='.$move) or error('Unable to move topic', __FILE__, __LINE__, $db->error());
if ($_POST['with_redirect'] == '1')
{
// Fetch info for the redirect topic
$result = $db->query('SELECT poster, subject, posted, last_post FROM '.$db->prefix.'topics WHERE id='.$move) or error('Unable to fetch topic info', __FILE__, __LINE__, $db->error());
$moved_to = $db->fetch_assoc($result);
// Create the redirect topic
$db->query('INSERT INTO '.$db->prefix.'topics (poster, subject, posted, last_post, moved_to, forum_id) VALUES(\''.$moved_to['poster'].'\', \''.$moved_to['subject'].'\', '.$moved_to['posted'].', '.$moved_to['last_post'].', '.$move.', '.$fid.')') or error('Unable to create moved_to topic', __FILE__, __LINE__, $db->error());
}
update_forum($fid); // Update last_post in the forum FROM which the topic was moved/copied
update_forum($move_to_forum, PUN_TRANS_END); // Update last_post in the forum TO which the topic was moved/copied (end transaction)
redirect('viewforum.php?id='.$move_to_forum, 'Topic moved/copied. Redirecting ...');
}
else
{
$move = intval($_GET['move']);
if (empty($move))
message($lang_common['Bad request']);
$page_title = htmlspecialchars($options['board_title']).' / Moderate';
require 'header.php';
?>