Alice
07-25-2017, 11:43 PM
Hello,
I am looking for a little assistance with converting this code from mybb to vbulletin.
<?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 subject, message, fid, tid, dateline FROM mybb_posts WHERE replyto = '0' ORDER BY dateline DESC";
$sqlresult = $con->query($sqlquery);
while ($row = $sqlresult->fetch_array()) {
if ($row['fid'] == 2 || $row['fid'] == 5) {
echo "<a style=\"text-decoration:none;color:orange;\" href=\"http://swghuttcartel.com/forums/showthread.php?tid=" . $row['tid'] . "\">" . "<b>" . $row['subject'] . "</b>" . "</a><br>";
$message = preg_replace("#\s*\[.+\]\s*#U", "", explode('!', explode('.', $row['message'])[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();
?>
Basically, this is for the launcher of a computer game, its to allow the launcher to fetch threads from an announcement forum and display them on the launcher.
Thank you,
I am looking for a little assistance with converting this code from mybb to vbulletin.
<?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 subject, message, fid, tid, dateline FROM mybb_posts WHERE replyto = '0' ORDER BY dateline DESC";
$sqlresult = $con->query($sqlquery);
while ($row = $sqlresult->fetch_array()) {
if ($row['fid'] == 2 || $row['fid'] == 5) {
echo "<a style=\"text-decoration:none;color:orange;\" href=\"http://swghuttcartel.com/forums/showthread.php?tid=" . $row['tid'] . "\">" . "<b>" . $row['subject'] . "</b>" . "</a><br>";
$message = preg_replace("#\s*\[.+\]\s*#U", "", explode('!', explode('.', $row['message'])[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();
?>
Basically, this is for the launcher of a computer game, its to allow the launcher to fetch threads from an announcement forum and display them on the launcher.
Thank you,