php or Javascript question
19 posts
• Page 1 of 2 • 1, 2
php or Javascript question
Is there a way to display the most recent posts from a blog and a forum on the main page of a website using php or javascript??? Preferably PHP but anything that works would be a help.
Thanks.
Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
What forum application are you running on your server? The easiest way to do it is to basically use the forum connection and style programming in order to set it up the way you want it. Let me know and I can have some code up pretty quick.
Jason
Jason
- jbullard
- VP - Software
- Posts: 3653
- Joined: Sun Jun 06, 2004 10:17 pm
- Location: Utah
- Real Name: Jason Bullard
Sorry man. Been busy with VBP lately.
Alright. To display the forums most recent posts on Wordpress sidebar you can use <a href="http://love-unlimited.net/test/downloads/wp-phpbb/wp-phpbb-files.zip" target="_blank">this</a>.
If that is not what you needed you first need to create a connection to the SQL database (hopefully mysql) by using <a href="http://www.pro-networks.org/forum/viewtopic.php?t=68406&highlight=" target="_blank">this</a> tutorial or you could include the phpbb db files and use it's connection.
Then you need to do something like this.
I will have to get some code for wordpress and if the above doesn't work let me know.
HTH,
Jason
Alright. To display the forums most recent posts on Wordpress sidebar you can use <a href="http://love-unlimited.net/test/downloads/wp-phpbb/wp-phpbb-files.zip" target="_blank">this</a>.
If that is not what you needed you first need to create a connection to the SQL database (hopefully mysql) by using <a href="http://www.pro-networks.org/forum/viewtopic.php?t=68406&highlight=" target="_blank">this</a> tutorial or you could include the phpbb db files and use it's connection.
Then you need to do something like this.
- Code: Select all
<?
require("dbconfig.php");
require("db/connection.php");
/* PHPBB Topics Table */
$PHPBB_TOPICS_TB = "phpbb_topics";
/* Return Limit */
$POST_LIMIT = 10;
$rPosts = $db->dbQuery("SELECT * FROM ". $PHPBB_TOPICS ." ORDER BY topic_last_post_id DESC LIMIT ". $POST_LIMIT .";");
While ($row = $db->dbFetchRowArray($rPosts)) {
$recent_post = '<a href="viewtopic.php?t='. $rPosts["topic_id"] .'">'. $rPosts["topic_title"] .'</a>';
echo $recent_post;
}
?>
I will have to get some code for wordpress and if the above doesn't work let me know.
HTH,
Jason
- jbullard
- VP - Software
- Posts: 3653
- Joined: Sun Jun 06, 2004 10:17 pm
- Location: Utah
- Real Name: Jason Bullard
i finally got around to actually doing this (mostly because I finished by site design today) and it appears from your guide there is no db/connection.php or dbconfig.php.
I thought maybe dbconfig was the the same as db.php (where we told the path to the database we want to access) so I changed that. Code still didn't work so I changed db/connection.php to mysql.php - just because I thought that might work.
Still nothing though...
I thought maybe dbconfig was the the same as db.php (where we told the path to the database we want to access) so I changed that. Code still didn't work so I changed db/connection.php to mysql.php - just because I thought that might work.
Still nothing though...
Mac OS 10.6.7 - Personal
Ubuntu Server 11.04 - Server
19 posts
• Page 1 of 2 • 1, 2
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 9 guests