Add this code to any block to allow it to display one random topic from the board. Reply posts are comments.
This allows blocks that display things like quotes or tips of the day.
Just change the name of $ff_boardname to the same as the forum you want to have it display from, and $ff_maxlength limits the length of the post.
$ff_boardname = 'Tips and Tricks';
$ff_maxlength = 1024;
$ff_boards = ssi_topBoards( 100, 'return' );
foreach ($ff_boards as $ff_board)
{
if ($ff_board['name'] == $ff_boardname)
{
$ff_numtopics = $ff_board['num_topics'];
$ff_boardID = $ff_board['id'];
}
}
$ff_randomtopic = rand( 0, $ff_numtopics - 1 );
ssi_boardNews($ff_boardID, 1, $ff_randomtopic, $ff_maxlength, 'echo');
Nice script Foolish Frost :up:
Sorry for posting in this old thread. If anyone is considering better I open a new post, I'll do it.
My question is about a little modification on this block code to show one random post from any random forum.
I'm wondering how to do it, but I'm not a code expert... Maybe with a forum array?
Thanks in advance.
Sorry. I've found the solution here:
http://www.tinyportal.net/index.php?topic=23006.msg187161#msg187161
Please admins, delete these two posts if you consider it neccessary
In the future, if you have any question about where you should post, you should read the posting guidelines. Thanks.
Sure, I'll do it.
My mistake was that I've made a search about "random post" and the solution appeared when I searched about "random topic"
My mistake. Please accept my apologies.
Not a huge deal 3nd3r. Apologies accepted. :)
Mine posts the same quote on every refresh.
It's the most recent post on the board I set to display a random quote from.