MyBB Hacks

Full Version: Help to show the latest thread for sub forum
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi mybber,,

i was created PHP class for show latest thread mybb by FID like this tutorial:
http://community.mybb.com/thread-35598.html

its worked and shown the latest thread by FID, but its just show the latest by FID and not following the sub forum..

how to show tha latest thread  by FID and its also the latest sub forum in FID...

hope your help
thx very much.. Yipi
A hack, but you can set the $fid variable to contain the list of subforums:

PHP Code:
$blurg->threads(10, false, '2 OR fid IN (3,4,5)');


Replace "3,4,5" with a comma separated list of ALL subforums.

(09-02-2011 07:33 AM)ZiNgA BuRgA Wrote: [ -> ]A hack, but you can set the $fid variable to contain the list of subforums:

PHP Code:
$blurg->threads(10, false, '2 OR fid IN (3,4,5)');


Replace "3,4,5" with a comma separated list of ALL subforums.


thx I'll try it,, but my question whats the meaning

Code:
2 OR fid IN

could you tell me Biggrin

The first number is the main forum, the others in the brackets are the subforums.

So if the main forum ID is 10, and it has two children, 15 and 28, the string should be

Code:
10 OR fid IN (15,28)


The code is just an SQL injection to get it to work the way you want it to.

oh i see..
but its not shown the prefix...... do you know to do?
You're going to have to do a bit of code modification to get the prefix.  Easiest is to probably modify the query to join with the prefixes table and pull the fields you need.
Reference URL's