I wanted a pal that showed the latest files added to a specific forum. I'm using one board as a file archive, and I wanted to be able to list the latest files added to that archive.
This pal is quite versatile, you can use it as either one of the customboxpals by just setting the number in the variable at the top of the script. There are also a lot of other variables to edit: select which forums to grab files from, what info to show and in what order, what to sort by (date, downloads, rating etc) and whether to only grab files from main posts or from any posts. Each variable is described in full in the script.
Install instructions: Save this file over the first empty customboxXpal.php file and set the number you chose in the variable $custombox inside the script. After that you can go to the IIP configuration and select where this box should be shown. If you want you can also customize what info to show inside the script.
The pal is written for IIP 5.3 but works for 5.1 as well.
Updated Updated to 1.1 which contains some small bugfixes when having several forums.
I tested this here. We had this big empty space on the front page... .thought it might be cool to show latest or most recent downloads.
It's pretty cool.
One problem.... I tried to restrict it to our mods forums, integration and the template and css forums.... but when I listed the keywords with commas, I get an error on the query.
I tried to see what might be wrong, but couldn't figure it out easily. You might be able to tell off the top of your head.
Here's the error: SQL ERROR: Wed, Mar 12 2003 14:02:02 -0800 Unable to do_query: SELECT B_Number,B_Posted,B_Subject,B_Replies,B_Board,B_File,B_FileCounter,B_Rating,B_Rates,B_Counter,Bo_Title,U_Username,B_PosterId FROM w3t_Posts AS t1, w3t_Boards AS t2, w3t_Users AS t3 WHERE t1.B_Board = t2.Bo_Keyword AND t1.B_PosterId = t3.U_Number AND B_Approved = 'yes' AND B_File != '' AND B_Main = B_Number AND () ORDER BY B_Posted DESC LIMIT 20 You have an error in your SQL syntax near ') ORDER BY B_Posted DESC LIMIT 20 ' at line 11 Warning: Supplied argument is not a valid MySQL result resource in /home/virtual/site2/fst/var/www/html/threads/php/mysql.inc.php on line 157
Well... I think I know why it happens. The IIP is set to force public, so the pal removes all forums from the list that aren't accessible by all, which leaves no boards left to search in.
Should probably add a check that there are any forums left before doing the query so that it won't just break.
But I don't think it would be a good idea to ignore the force public option...
I checked when I logged out.... it still showed files for forums that they couldn't see. But then when you clicked... it told them they had to login (the access denied message - which I'd tweaked a bit). So I didn't figure that was bad. Let them see what they are missing to encourage registrations. Especially if the file sounds cool.
Yeah, it seems I've done a logical error in the code, as well as a nasty little bug.
I'll update the first post of this thread with v1.1 which hopefully fixes the bug you encountered and some other small things. I'm still not convinced that I'm using the force_public right but I think it works like you want it to, so I'll leave it at that for now. =]
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.