MyBB Community Forums

Full Version: Need help making custom xthreads
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Greetings.

I would like to make a custom xthreads forum section.

I would like it to look just like the normal forum sections looks, but it have to include a custom text field.

Where users have to enter a numeric ID.

Then I would like the following content to be placed in top of the thread. (NUMMERIC-ID should be the ID which was entered from the custom field.)
<?php
function streamStatus($live_id = NUMMERIC-ID) {
$ownedTv = new SimpleXMLElement('http://api.own3d.tv/liveCheck.php?live_id='.intval($live_id), NULL, TRUE);
$liveEvent = $ownedTv->liveEvent[0];
$live = strval($liveEvent->isLive);
$viewers = strval($liveEvent->liveViewers);
return array('online' =>  ($live == 'true') ? 'Online': 'Offline', 'viewers' => intval($viewers) . ' viewers ');
}
$id = isset($_GET['stream_id']) ? $_GET['stream_id'] : 1;
extract(streamStatus($id));

echo "Live stream is currently ";
if($live = "true") {
echo "online<br>Viewers: ". $viewers . "";
}else{
echo "offline";
}

?>

Would this be possible somehow?