MyBB Community Forums

Full Version: Way to show "News" from a forum on a site?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anyone happen to know if there is a way to show posts in a forum as "news" posts on a page on a website (with the link to the thread in a Comments link or something)?

I know some forum software has a hack/plugin/etc. --- I couldn't find anything on the forum about this, hence this post.

Any help is appriciated. Smile
the news.php plugin MAYBE.

might just be news plugin.
Hi Soshite,
You can try this script. Smile
<?php
/** Config **/
$dbhost = "localhost";
$dbuser = "";
$dbpassword = "";
$dbdatabase = "";
$prefix = "mybb_"; //Databaseprefix

$url = "http://"; // URL to the board
$viewable_forums = ""; //viewable forums - seperate with coma , (for examble "2,11")
$limit = "5"; // How many topics we want to see?
$length = "15"; // length of the subject (0 ist full length)
/** End of config **/

// We connect to the database
$db = mysql_connect($dbhost,$dbuser,$dbpassword) or die ("Verbindung fehlgeschlagen");
mysql_select_db($dbdatabase,$db);
$viewable_forums = str_replace(","," OR fid=",$viewable_forums);

echo "<ul>";
// username= author // replies = answers
$query = mysql_query ("SELECT subject,tid,replies,fid FROM ".$prefix."threads WHERE visible='1' AND fid=".$viewable_forums." ORDER BY tid DESC LIMIT 0,".$limit."");
while ($newest_threads = mysql_fetch_array($query))
{
	if ($length != 0)
	{
		if (strlen($newest_threads['subject']) > $length)
		{
			$newest_threads['subject'] = substr($newest_threads['subject'],0,$length) . "...";
		}
	} 
	echo "<li>".$newest_threads['subject']." (".$newest_threads['replies']." ".($newest_threads['replies']!="1"?"Replies":"Reply")." 
<a href=\"".$url."/forum/showthread.php?tid=".$newest_threads['tid']."\" target=\"_blank\">Go to Topic</a>)</li>";
}
echo "</ul>";
?>
Have fun. Smile
Thanks. Once the beta forum I have MyBB under is finished, I'll be sure to try out that script. Smile

Many thanks for replying so fast. ^.^
Hi, is there any way to show the auctual post by the way Garlant showed?
msgworld.net Wrote:Hi, is there any way to show the auctual post by the way Garlant showed?

Hi msgworld.net,
please explain how its should work. More information from your imagination would be nice.

Greez Garlant
Ok, right now it shows the "Subject" of a post, but I want it to show the full content of the post... The subject and the real post.