query(" SELECT p.ID, p.TopicID, ( SELECT COUNT(ID) FROM forums_posts WHERE forums_posts.TopicID = p.TopicID AND forums_posts.ID <= p.ID ) AS PostNum FROM forums_posts AS p WHERE ID = $ID"); list($PostID, $TopicID, $PostNum) = $DB->next_record(); $Link = "forums.php?action=viewthread&threadid=$TopicID&post=$PostNum#post$PostID"; break; case 'comment': $Link = "comments.php?action=jump&postid=$ID"; break; } $DB->query(' INSERT INTO reports (UserID, ThingID, Type, ReportedTime, Reason) VALUES ('.db_string($LoggedUser['ID']).", $ID , '$Short', '".sqltime()."', '".db_string($Reason)."')"); $ReportID = $DB->inserted_id(); $Channels = array(); if ($Short == 'request_update') { $Channels[] = '#requestedits'; $Cache->increment('num_update_reports'); } if (in_array($Short, array('comment', 'post', 'thread'))) { $Channels[] = '#forumreports'; } foreach ($Channels as $Channel) { send_irc("PRIVMSG $Channel :$ReportID - ".$LoggedUser['Username']." just reported a $Short: https://".SSL_SITE_URL."/$Link : ".strtr($Reason, "\n", ' ')); } $Cache->delete_value('num_other_reports'); header("Location: $Link"); ?>