MyBB Community Forums

Full Version: Help me!! How to show new threads in new homepage??
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have set up our homepage(http://www.mybbchina.cn)? But how could I show new threads in our homepage?? I did not find any function in Admin-Cp. Anyone can give me a detail steps?? Thank you,I need to do this urgently
there is latest thread function in the portal.php
check it out and use that code and that should do
If by homepage you mean the portal page of MyBB, then as said above, there should be a latest-threads integrated template in it. Check it on the portal configuration in ACP.
I have check the function of portal.I am so sorry that I still do not know how to show latest threads in my homepage(not for portal homepage,but another html homepage).

could any one give me a detail steps? My home page is http://www.mybbchina.cn
Thank all of you!
This plugin might interest you.
Not show it in community homepage.However need to show it in my website homepage which made by html
Yea, sorry. Read it wrong, but try this.

<?php

//What is the name of the directory of your forums?
$forums = ""; //ex: forum.

//How many posts do you want to show?
$posts = 5;

//No more editing needed.

define('IN_MYBB', 1);
chdir($forums);
require "./global.php";

$query = $db->query("SELECT * FROM ".TABLE_PREFIX."posts ORDER BY dateline DESC LIMIT 0,$posts");
while($b = $db->fetch_array($query))
{

	$tid = $b['tid'];
	$pid = $b['pid'];
	$subject = $b['subject'];
	$date = date("g:iA (M-j)", $b['dateline']);
	

	$username = $b['username'];
	$uid = $b['uid'];

	require_once "inc/functions.php";
	$link = build_profile_link($username, $uid);
	//Posts
	$post = '<a href="showthread.php?tid='.$tid.'&pid='.$pid.'#pid='.$pid.'">'.$subject.'</a> By '.$link.' at '.$date.'<br /><br />';
	echo $post;
}
chdir("./");
?>
Thanks DCR! I changed to save it in UTF-8,and all done!
Some visitors get following errors:

Quote:Warning: Cannot modify header information - headers already sent by (output started at /home/iblue/domains/mybbchina.cn/public_html/index.php:7) in /home/iblue/domains/mybbchina.cn/public_html/community/inc/functions.php on line 1216

How could solve it?