Help to show the latest thread for sub forum
dikers Offline
Junior Member
**
Posts: 5
Joined: Sep 2011
Post: #1
Exclamation Help to show the latest thread for sub forum
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
09-02-2011 07:28 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: Help to show the latest thread for sub forum
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.


My Blog
09-02-2011 07:33 AM
Find all posts by this user Quote this message in a reply
dikers Offline
Junior Member
**
Posts: 5
Joined: Sep 2011
Post: #3
RE: Help to show the latest thread for sub forum
(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

09-02-2011 07:44 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #4
RE: Help to show the latest thread for sub forum
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.


My Blog
09-02-2011 08:15 AM
Find all posts by this user Quote this message in a reply
dikers Offline
Junior Member
**
Posts: 5
Joined: Sep 2011
Post: #5
RE: Help to show the latest thread for sub forum
oh i see..
but its not shown the prefix...... do you know to do?
09-02-2011 08:28 AM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #6
RE: Help to show the latest thread for sub forum
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.

My Blog
09-02-2011 11:10 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: