|
Displaying News on your homepage
|
|
08-14-2007, 06:08 PM
(This post was last modified: 10-08-2009 10:53 PM by MrD..)
Post: #1
|
|||
|
|||
|
Displaying News on your homepage
I'm sure there was a tutorial on this before but it seems to have vanished... oh well.
This tutorial will enable you to show posts from a specific forum in your MyBB forum on your website's homepage. This code should be placed at the top of your page (before any output): PHP Code: <?phpThis code should then be placed where you would like the news to be shown: PHP Code: <?phpThen you need to replace: - The 2 in "$fid = 2" with the fid of the forum you want to show the posts from - The 5 in "$limit = 5" with whatever you want your limit to be. - The 'forum/' in chdir('forum/') to your forum path relative to the page this is being called from. - The '../' in chdir('../') to the path back from your forum to the page this is being called from. You will also need to change the code in the echo() statements to reflect how you want the news to be displayed on your site. UPDATE - PLEASE READ The little boat gently drifted across the pond exactly the way a bowling ball wouldn't. |
|||
|
08-15-2007, 04:35 AM
(This post was last modified: 08-15-2007 06:13 PM by MrD..)
Post: #2
|
|||
|
|||
|
RE: Displaying News on your homepage
I tried. It didn't work. See here for the error:
<Removed to protect others from Trojans (site was hacked)> |
|||
|
08-15-2007, 06:00 AM
Post: #3
|
|||
|
|||
|
RE: Displaying News on your homepage
Remove the '.'
require('.http://stcd.createmybb.com/global.php'); See the dot before the http? Yea, remove it. Cross Industries, LLC - Affordable Technology Services █ Cross into dreams... █ Quality free & paid cPanel hosting at Glacier Host |
|||
|
08-15-2007, 06:16 PM
Post: #4
|
|||
|
|||
|
RE: Displaying News on your homepage
Your forum is a CreateMyBB one? This will only work if the forum is on the same server as the website.
I suppose if you wanted to do this with a CreateMyBB forum, you could create a RSS feed for the forum you wanted content from and then integrate an RSS parser and a post parser into your website to parse the information from the RSS feed. If you just wanted the titles of the threads with a link to the post, that would be a lot easier because then you wouldn't need to make your own post parser. The little boat gently drifted across the pond exactly the way a bowling ball wouldn't. |
|||
|
08-16-2007, 12:04 PM
Post: #5
|
|||
|
|||
|
RE: Displaying News on your homepage
Hmm MrDoom, this is a useful one, but will it show (number of) comments as well?
If it does, im going to integrate it with my website design. MapleHub Recreation! http://maplehub.ahplace.com |
|||
|
08-16-2007, 02:59 PM
Post: #6
|
|||
|
|||
|
RE: Displaying News on your homepage
Yeah:
PHP Code: echo("Replies (<a href=\"{$forumpath}showthread.php?tid={$row['tid']}\">{$row['replies']}</a>)<br /><hr />"); The little boat gently drifted across the pond exactly the way a bowling ball wouldn't. |
|||
|
08-18-2007, 02:58 AM
Post: #7
|
|||
|
|||
|
RE: Displaying News on your homepage
Hmm thanks alot. But then, does it automatically make another post page?
Like when the first 5 announcement its been in the main site, then when i add another post, will it automatically make a new page? It might be a good idea to make that if possible. MapleHub Recreation! http://maplehub.ahplace.com |
|||
|
08-19-2007, 03:11 AM
(This post was last modified: 08-19-2007 03:13 AM by MrD..)
Post: #8
|
|||
|
|||
|
RE: Displaying News on your homepage
It will always show the latest (by default) 5 threads from a forum. If you make a new post, it will appear at the top and the previous 5th thread will vanish.
If you want to change it to show all the threads in a forum and add pagination to it, feel free. It is however outside the scope of this tutorial. The little boat gently drifted across the pond exactly the way a bowling ball wouldn't. |
|||
|
08-19-2007, 03:22 AM
Post: #9
|
|||
|
|||
|
RE: Displaying News on your homepage
I see. thanks for the info!
MapleHub Recreation! http://maplehub.ahplace.com |
|||
|
08-19-2007, 08:36 AM
(This post was last modified: 08-21-2007 07:10 PM by MrD..)
Post: #10
|
|||
|
|||
|
RE: Displaying News on your homepage
If you want "Multipage".
PHP Code: <?phpChange the VARS to your needs and save. MyPluginsFor1.4 |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help




