PDA

View Full Version : Simple forumdisplay hack.. show only threads with attachments


cruelio
03-31-2005, 03:17 PM
Hi guys, I'm not quite a rookie but I think this hack would just need a modified query to fetch only attachment threads, ...

practically, if the request is /forumdisplay.php?f=46 , then it should show the normal forum display. however, if something like /forumdisplay.php?f=46&attachonly=1 then it should show only the threads with attachments.

I looked in forumdisplay.php and the place where the change needs to be made is around line 465 of an unhacked 3.0.7, which reads
// display threads

I noticed it builds the query piece by piece. So practically, it would be just a line of code adding another "AND something" to the query if the attachonly variable is defined through the query string..

If anyone can help i would be really grateful :)

okay here is what i have so far..
it's a template mod and does the job ok, but it could be better if forumdisplay.php would be modified.

in the phpinclude_start template add to the bottom:

$attachonly = $_GET['attachonly'];


in the threadbit template add to the top:

<if condition="($attachonly and $show['paperclip']) xor (!$attachonly)">


in the threadbit template add to the bottom:

</if>



this is a quick fix and might be helpful to those that don't like modding their templates but i would still like to hear from anyone that knows how to do it by modding forumdisplay.

thanks
cruelio