I'd like to be able to include things like the latest news, users online, latest topics on my front page, login box. I don't want a portal I just want to be able to do a php include (or whatever) to insert the item i want into a page that isn't the forum. I have recently upgraded from YaBB and with that I just used SSI to get this info. Is there likely to be a hack for this written? I know about the javascript external data provider but can't get it to do all the things I want. I have looked at the vbAdvanced mod and that would be exactly what I need if it just inserted one of the boxes at a time using php include.
Hope I'm making sense!
just look at thow the portals do it and adapt it for your own uses
I suppose that would work, I just wanna make sure I don't put unecessary calls to the DB. It would just be nice if someone put something simple together that does exactly what we need.
I suppose that would work, I just wanna make sure I don't put unecessary calls to the DB. It would just be nice if someone put something simple together that does exactly what we need.
your going to use the php include tempalates? or somthing differnt?
$newsforumid="6"; // Forum ID to pull the news from
$items="5"; // How many news threads to pull
Connect to DB:
PHP Code:
$db_connection = mysql_connect("host","username","password") or die ("No DB Connection");
$db = mysql_select_db("dbname",$db_connection) or die ("Couldn't select DB");
Fetch the threads:
PHP Code:
$query="SELECT title,threadid,forumid,replycount,views,firstpostid,dateline
FROM thread
WHERE forumid='$newsforumid'
ORDER BY dateline DESC
LIMIT 0,$items";
$newsitems=mysql_query($query,$db_connection);
while ($news=mysql_fetch_array($newsitems)) {
$query="SELECT pagetext,postid
FROM post
WHERE postid='$news[firstpostid]'
";
$posts=mysql_query($query,$db_connection);
while ($post=mysql_fetch_array($posts)) {
Export your HTML with the info.. voila! (oh yea add in stuff like parse_bbcode, etc)