MyBB Community Forums

Full Version: Trying to display threads on my homepage.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am trying to use SQL and PHP to display threads from my news section to my homepage but I am not that good with SQL so I came here to ask if maybe you guys could help or tell me a really easy way to do it.
(05-01-2013, 02:21 PM).m. Wrote: [ -> ]see this for guidance http://community.mybb.com/thread-132997-...#pid963122

That would work but I am trying to get only threads from a certain section instead of all recent threads. Like what you can do on the portal.
Does anyone know how I can display threads like the portal does if so please tell me.
in the earlier suggested code $Query consisted of below code
WHERE 1=1 AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
     ORDER BY t.lastpost DESC

change it to below code
WHERE 1=1 AND t.visible='1' AND t.closed NOT LIKE 'moved|%'
     AND t.fid IN (A,B,C,D)
     ORDER BY t.lastpost DESC

A,B,C,D,... are forum IDs of your required sections (any number)
I followed it and I get this error

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /test.php(7) : eval()'d code on line 32
^ please give few lines around line 7 from your test.php file