vBulletin 4 according to the thread prefix. You can try something like below assuming you don't use a table prefix and that you want the latest 15 posts. I also moved the forumid check to the query instead of the check in the PHP code.
This is untested by the way.
PHP Code:
<?php
$servername = 'localhost';
$dbusername = 'Removed by';
$dbpassword = 'Staff';
$dbname = 'mybb';
$con = new mysqli($servername, $dbusername, $dbpassword, $dbname);
if ($con->connect_error) {
die("Connection failed: " . $con->connect_error);
}
echo "<body style=\"background-color:#001500;\">";
$sqlquery = "SELECT thread.title, thread.forumid, thread.dateline, post.pagetext, thread.firstpostid FROM thread INNER JOIN post ON post.postid = thread.firstpostid WHERE thread.forumid in(2,5) ORDER BY thread.dateline DESC LIMIT 0,15";
$sqlresult = $con->query($sqlquery);
while ($row = $sqlresult->fetch_array()) {
echo "<a style=\"text-decoration:none;color:orange;\" href=\"http://swghuttcartel.com/forums/showthread.php?p=" . $row['firstpostid'] . "\">" . "<b>" . $row['title'] . "</b>" . "</a><br>";
$message = preg_replace("#\s*\[.+\]\s*#U", "", explode('!', explode('.', $row['pagetext'])[0])[0]);
echo "<a style=\"color:#fff;\">" . $message . ".</a><br>";
echo "<i><a style=\"color:gray;\">" . gmdate("m.d.Y", $row['dateline']) . "</a></i><br><hr><br>";
}
echo "</body>";
$con->close();
?>