View Full Version : php include(?) - items from the forum
accyroy
01-08-2004, 05:45 AM
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!
rkettner
01-26-2004, 04:49 AM
I am looking for this too. Is there any solution for news grabbing that doesn't require a full "portal" system?
Zachery
01-26-2004, 04:59 AM
I am looking for this too. Is there any solution for news grabbing that doesn't require a full "portal" system?
just look at thow the portals do it and adapt it for your own uses
rkettner
01-26-2004, 06:10 PM
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.
Zachery
01-26-2004, 06:12 PM
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?
vbmechanic
01-26-2004, 06:24 PM
Set variables:
$newsforumid="6"; // Forum ID to pull the news from
$items="5"; // How many news threads to pull
Connect to DB:
$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:
$query="SELECT title,threadid,forumid,replycount,views,firstposti d,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)
rkettner
01-26-2004, 10:09 PM
(oh yea add in stuff like parse_bbcode, etc)
How would I do that? I'm sorry, I'm no PHP expert :P
JacobiKenobi
03-23-2004, 12:37 AM
Yeah, can you help finish it?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.