MyBB Community Forums

Full Version: thread display on page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi everyone...per many tutorials I've found how to integrate myBB log in into my PHP pages on my website...but what i would now like to do is have the PHP code to include the five latest posts in a particular board on my home page. How would I do this?

Thank you.
Thanks, but I'm still a bit confused...I'm basic PHP but not as good as MyBB developers so I can't quite understand everything.

The script you showed me...I'm not sure if it displays the way I want it formatted. I looked at the link in the post you linked me too, and he says one thing, and repliers say change it to $db->query or something.

What script should I use to make something like this?

<font size="4"><b>Post Title</b></font>
Posted <i>Date</i> <i>Time</i> by <a href='author's profile'>Author</a>

<p>
Post Text
</p>


And repeat over and over again to only show the latest 5 posts from my Announcements forum (which is forum id 4).

Thank you
the one in my post prints this out :: http://www.thingiej.be/test.php
I'd like to have the full post appear. Is this possible?

thank you
flamingamer Wrote:I'd like to have the full post appear. Is this possible?

thank you

Just delete this ::
if(my_strlen($message) > 50)
{
    $message = substr($message, 0, 40)."...";
}
and to do this i do NOT need to open a new mysql connection? it just uses the one that was already started by requiring global.php at the beginning?
also was it okay if when i required global.php, instead of doing:
chdir("forums");
require "./global.php";

i just did...

require "forums/global.php";

? Thank you.
flamingamer Wrote:and to do this i do NOT need to open a new mysql connection? it just uses the one that was already started by requiring global.php at the beginning?
also was it okay if when i required global.php, instead of doing:
chdir("forums");
require "./global.php";

i just did...

require "forums/global.php";

? Thank you.

If that works for you, you can use it that way ... i need chdir()
for getting it to work overhere.
Well the reason I didn't want to use chdir was because I have other PHP include() commands in my script that are in the same directory.
So I didn't know if CHDIR was only in effect for the first require statement, or for the whole script..I've never used it before.

Thank you.

EDIT: I tried to implement your code and got this error

Fatal error: Call to a member function query() on a non-object in C:\www\programs\iVIP\announcements.php on line 17

Line 17 is:
$query = $db->query("SELECT * FROM ".$prefix."posts WHERE fid=$fid ORDER BY dateline DESC LIMIT 0,$max");
Attach "annoucements.php"
Pages: 1 2