![]() |
See latest attached files on sidebar block ?
Hello,
We have some video game mod developers on our forums and they asked me if that was possible to see the X latest attached files posted on the forum, in a sidebar block. All I found is the PHP script that shows them in the admin panel : Code:
http://www.example.fr/forum/admin/attachment.php?do=search&search[orderby]=dateline&search[ordering]=DESC Maybe it isn't difficult to find how but I know nothing about PHP... Thank you in advance ! |
1 Attachment(s)
This is how I set up the forum block in the "Forum Blocks Manager":
https://vborg.vbsupport.ru/attachmen...1&d=1450766041 This is the PHP code: PHP Code:
https://vborg.vbsupport.ru/attachmen...1&d=1450766041 The usernames are shown in their usergroup HTML markup, and link to their profiles. The attachment filename has a tooltip that shows when it was uploaded, the number of views and the size of the file (in KB). Below the filename is a link to the post containing the attachment. You can edit the PHP code, the second line, to change the number of most recent attachments to display...replace the "5" with whatever positive integer you want. Please let me know of any changes you would like. :) |
Hello Mark,
And thank you for your quick answer :) I made a try and got a database error. This comes up because we put a prefix to all our vBulletin tables (we have several other databases so we chose to prefix their tables). I tried to add the prefix to the query but it still doesn't work ; I don't know where to add it. As you can see, the prefix is vb_ ; where should I add it ? Again, thank you ! Code:
Database error in vBulletin 4.2.2: |
Try this:
PHP Code:
|
Hello Mark, and thank you :)
I tried this but it still didn't work. Here's the error message : Code:
Database error in vBulletin 4.2.2: Many many thanks to you, Mark, for your patience and receptiveness :) edit : here's the final code : Code:
global $vbulletin, $db; |
Okay, I understand what you did and why it works. I am thinking that a version that would work for any prefix would be:
PHP Code:
|
It tried this version and that works perfectly :)
Maybe this trick could be proposed as a small mod or else ? I guess I'm not the only one in the universe to seek this kind of widget... Thank you once more, Mark ! |
Quote:
If I do, I will list you as the co-author, because it was your idea. :) |
I would be honored :o though it's not only my idea, it was also members of my forum's !
|
All times are GMT. The time now is 12:38 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|