2007-06-19, 07:23 PM
2007-06-19, 07:36 PM
See http://community.mybboard.net/showthread.php?tid=13430
There's a section in the first post that shows you how to put the recent posts on your homepage.
There's a section in the first post that shows you how to put the recent posts on your homepage.
2007-06-19, 08:09 PM
DennisTT Wrote:See http://community.mybboard.net/showthread.php?tid=13430
There's a section in the first post that shows you how to put the recent posts on your homepage.
I'm having issues with it.
http://appleaday.cn/index.php
I put the script in the right column, all it says it "by"
What's wrong??
2007-06-20, 03:47 PM
Maybe this helps ::
<?php
// Root Of Forum
$root = "mybb129";
// Posts To Show
$max = 5;
// Table Prefix
$prefix = "mybb_";
// Forum ID
$fid = 2;
define('IN_MYBB', 1);
chdir($root);
require "./global.php";
// Get Posts
$query = $db->query("SELECT * FROM ".$prefix."posts WHERE fid=$fid ORDER BY dateline DESC LIMIT 0,$max");
while($posts = $db->fetch_array($query))
{
//PostInfo
$tid = $posts['tid'];
$pid = $posts['pid'];
$subject = $posts['subject'];
$subject = str_replace("RE:","",$subject);
$date = date("H:i / d-m", $posts['dateline']);
$message = $posts['message'];
if(my_strlen($message) > 50)
{
$message = substr($message, 0, 40)."...";
}
//UserInfo
$username = $posts['username'];
$uid = $posts['uid'];
require_once "inc/functions_user.php";
$link = build_profile_link($username, $uid);
//Posts
$post .= ":: <strong>Thread: </strong> <a href=\"{$root}showthread.php?tid={$tid}&pid={$pid}#pid={$pid}\">{$subject}</a> By ".$link." On ".$date." :: <br /><br /><strong>Message: </strong>{$message}<br /><br />";
}
echo $post;
?>
2007-06-20, 09:02 PM
Thanks lex
2007-07-29, 10:32 PM
Would it be easier to create some form of javascript code from the RSS? There is a great mod for phpbb that does that and it works well as the code can be placed ANYWHERE without the need to edit php or access the database. Safer imho.