FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Random Post on phpBB





Zuwiki
Hello, I would like a script, or information on how I might go about creating my own script, that would show the user a random post on the forums.

Preferebly, it would be compatible with MKPortal, as in it could be made to show up on one of the sidebars, like where the Random Image section is on the demo site.

I want it to show name of poster, title of thread, date posted, and the forum it is in. I am not very good with PHP or MySQL (I assume it would take some SQL queries at least), but I think I could figure it out if I try hard enough. Smile

Thanks.
PatTheGreat42
I'm not sure of the exact workings, but phpBB uses a database to store all of the posts and user information. Doing what you want would require access to this database (which I'm not so sure you would have) and a lot of not so fun programming I would think. However, if you just wanted a link to a random post, that might be a little simpler.

In 30 seconds of research done by pressing a few random buttons, it seems that different topics in phpBB all follow this format:

http://www.frihost.com/forums/vt-integer.html

So concievably, the following code would link to a random topic. I've never tested it, and it probably sucks, and is nothing like what you wanted, but hey, what's life if you can't make people use possible non-working code every once in a while?

Code:

<?php
while($i != 1)
{
        $file = "http://www.frihost.com/forums/vt-".rand(24000,27000).".html";
        if(file_exists($file))
        {echo "<a href=".$file.">Random Topic!</a>";
        $i = 1;}
}
?>
n0obie4life
It's mod-rewrite.

Using this will still work.

http://www.frihost.com/forums/viewtopic.php?t=25158
Related topics
suggestion on posting pic
What does your name mean??
Censorship @ Frihost???
Display
post phpbb installation
Hello. I'm a generic Frihost Bot.
Viewing forum as a guest
Moogleboi says Hello
Give me Recipies
What determines the amount of posts there are in a thread?
Ideas to Improve Frihost and the Quality of its Posts
Looking for some system ($500, if done right)
Environmental Protection: My Ideal Solution
Porn Post Attack - mOrpheuS to the rescue?
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.