![]() |
Attachment Browser (v2.1 beta testing)
List/Search Attachment Files
List, filter/search, sort, etc. for attachments files. Respects forum permissions. Supports limiting search to a single forum or a list of forums. Also, a separate attachment summary page is available. Any problems raised in this thread have been fixed. For new features in version 2, see below under Version 2 for "New" entries. Standard page navigation is supported to go to last page, prev, next, etc. Sorts, ascending or descending, are supported for:
Changes pending for version 2.1
Version 2:
---------------------------- To search in a single forum: use the single click [Filter] next to any forum name on a page or enter the forumid on the "Display Options" form. To search only in a selected list of forums: Enter a comma-separated list of forumid's in "Display Options". You can AdminCP-install custom templates to override our defaults ones. You can AdminCP-install custom phrases to override the defaults -- all references in templates are to "$vbphrase[XXX]". If you do not want to change the default templates or phrases, then there are no other files to install -- just put this one in the main '/forum' directory. If you want to modify the default templates, copy them from this file and install them as usual. We will notice when there are installed templates to override our defaults. The same applies to phrases. We only list forums that the user has permissions to view and get attachments, for attachments that are visible and not from deleted posts. We do 2 queries: (1) get the total COUNT of accessible attachments matching the selection criteria and (2) retrieve enough rows to fill the requested page. If you follow a link on one of our pages to download an attachment, view a user profile, or view the original post, then the normal access checks will apply, as these links simply invoke standard vBulletin files. The templates referenced are: attbro_MAIN, attbro_FORM, attbro_ERROR, attbro_attachbit, attbro_SUMMARY and attbro_summary_categorybit. The default templates and phrases are defined in this file. Look for '$MyDefaultTemplates' and '$MyDefaultPhrases'. For example, if we had a template named 'attbro_example', it will appear in this file as: $MyDefaultTemplates['attbro_example'] = ' LINE 1 OF TEMPLATE LINE 2 OF TEMPLATE '; To install a custom version, just copy the LINES and install it under the template name attbro_example. ---------------------------- This extension is free, and will remain free. Cheers, CarCdr |
it seems to be breakin the width of the broswer.. see
http://www.exasko.info/forum/attachment_browser.php? |
nothing to edit??? This got to be the easy hack/mod :)
thnx I tried it looks nice but breaks the width a little and when I click on Download I get a 404 with this URL: h##p/www.mydomain.com/forums/attachment_browser?do=list&userid=1 |
Looks really nice and simple :)
But it doesn't use templates so I won't use it.... :( I would have to translate it and i don't want to crawl the php-page. |
this hack have to be in the Beta Releases section, because is not following the vBulletin3 protocol... no lang phrases, no templates, not using the templates at all,... maybe be useful but not in the full released!
|
everyone go to usercp , attachments i thibk you should find an attachment browser there
|
Yes but thats just for each user to see what they have uploaded. This is pretty cool in that it looks to offer a quick and easy page to call up for all attachments from everyone rather than going in through the AdminCP. I think a little more tweaking and it will be a good little add-on. :)
|
Quote:
The only caveat is that you have to replace \' with ' before saving them in AdminCP. For example, to replace the bit used for the listing rows, copy the template lines between: $MyDefaultTemplates['attbro_attachbit'] = ' TEMPLATE TEXT'; |
Quote:
Note that there was a style problem fixed in the just-uploaded v1.1, whereby I forgot a 'class="tcat"' on the first line of the table heading. That is why you see a slightly odd coloration on that first table header line in the attached GIF. That should be fixed now. If you could attach a shot of a broken display, that would be very helpful. Cheers, CarCdr. |
Quote:
The link in question worked on my web server as it defaults extensions (i.e., HTML, PHP). I forgot the '.php' suffix in the link to list a single user's attachments. Ooops... :o |
Quote:
* List attachments whose file names begin with 'TASKING_' and sort by date. * List attachments from user '*Admin' (i.e., ending with 'Admin') in the last month. |
Quote:
I see your point, definitely. Still, I would note that the entire mod is phrased (i.e., no english in the templates), although it uses a non-standard method for additionally required phrases. All phrasing is done either through $vbphrase references or references to $attbro_PHRASES. which is defined in the PHP file. It's actually easier to contain and control the mod within a single file like this, rather than having to go through the AdminCP (imho). It does use templates. It's just that the default versions are contained in the PHP file itself. If you install an updated template, the program will override the version contained in the PHP file. The rule is to first look for an installed template, then if none is found, to use the default. |
that's why i say it have togo to the Beta ... because you have the details, but not the vB3 way/protocol of things... this is a cool tool btw!
|
Quote:
vBulletin Standard $vbphrase[ascending] $vbphrase[days] $vbphrase[descending] $vbphrase[display_options] $vbphrase[downloads] $vbphrase[downloads]] $vbphrase[extension] $vbphrase[filename] $vbphrase[filesize] $vbphrase[months] $vbphrase[post] $vbphrase[username] $vbphrase[year] $vbphrase[years] New Phrases $attbro_PHRASES[attachment_browser] => Attachment Browser $attbro_PHRASES[attachments_selected] => attachments selected $attbro_PHRASES[Attached_date] => Attached date $attbro_PHRASES[Change] => Change $attbro_PHRASES[Display] => Display $attbro_PHRASES[expand_collapse] => Expand to change/Collapse $attbro_PHRASES[Filtering] => Filtering $attbro_PHRASES[First_by] => First by $attbro_PHRASES[ID] => ID $attbro_PHRASES[List] => List $attbro_PHRASES[no_matches] => No attachments match the selection criteria you have specified. $attbro_PHRASES[not_enough_pages] => Too few attachments retrieved to list the page you requested. $attbro_PHRASES[or_newer] => or newer $attbro_PHRASES[or_older] => or older $attbro_PHRASES[Profile] => Profile $attbro_PHRASES[Results_per_page] => Results per page $attbro_PHRASES[Select_Type] => Select Type $attbro_PHRASES[Show_attachment_ID] => Show attachment ID $attbro_PHRASES[Show_All] => Show All $attbro_PHRASES[Sorting] => Sorting $attbro_PHRASES[then_by] => then by $attbro_PHRASES[Version] => Version $attbro_PHRASES[D_7] => 7 $vbphrase[days] $attbro_PHRASES[D_30] => 30 $vbphrase[days] $attbro_PHRASES[M_3] => 3 $vbphrase[months] $attbro_PHRASES[M_6] => 6 $vbphrase[months] $attbro_PHRASES[Y_1] => 1 $vbphrase[year] $attbro_PHRASES[Y_2] => 2 $vbphrase[years] Some of the new phrases do exist somewhere in vBulletin, but loading an entire phrase group to get at the word 'List' for example, seemed like overkill. |
I use MyIE2 and it seems to break width at the bottom.. anyone else getting this problem
|
would it be possible to search in a certain forum only. we have a couple of specific forum and viewing the attachments from that forum only would be great!
|
Quote:
Quote:
|
Quote:
|
yes let me grab it
|
see the image
|
Version 1.2 uploaded:
Screenshot: https://vborg.vbsupport.ru/attachmen...chmentid=19525 |
Does this hack support permissions and does it show private attachments if you have the PM attachment hack installed?
|
Does this hack support permissions
Boofoo, permissions for accessing attachments and posts is handled. Perrmission handling for generating the listing will likely be in version 2. vBulletin does not offer any modularized way of handling permissions, so it's rather a pain in the a**. As you no doubt are aware, this would require checking each attachment against the associated forum table, via the thread table, then for each listing entry, a call has to be made to "fetch_permissions". Permissions in play are CANVIEW, CANGETATTACHMENT, and possibly can_moderate. If CANVIEW is off, then we would not list the post title. Finally, there would be processing for forum passwords. I do not know how that would work nicely, as you could be interrogated multiple times for a single page. The only tables we touch currently are attachment, user, and post. I discussed this in the initial post as I anticipated it would be a concern. Now, if one tries to download an attachment or look at a post, or view a user's profile (in other words, follow any of the links on a listing, then the normal vBulletin permissions apply since these are standard vBulletin URLs. does it show private attachments if you have the PM attachment hack installed? No. I am not familiar with this hack. Is it used widely? |
Quote:
|
Quote:
Boofo, the question is "How should it work?" Attachment_browser is meant to be a user utility, not an admin utility. I suppose it could display the private attachments for the logged-in user, but I *believe* the private attachment hack does that now via profile.php. For listing other user's private attachments, I note that the private attachment hack does not have admin support, via admincp\attachment.php. Perhaps that's what you are after. Cheers |
The problem is that the Private attachments are not private in the dbase - they are stored as regular attachments, and are linked not to a thread, but to a PM - this is what needs to be added to determine who can view what ...
There is (btw) already a hack that displays a listing of all attahcments - take a look for the "Files List" hack ... Nevertheless, good work! :) |
Quote:
Yes, I saw that FilesList was posted, but I thought I would post ours nevertheless as it has significantly more features. |
This is a very nice and easy hack. *install*
May I ask the possibility to show a thumbnail when the attachment is an image? Thanks! ;-) |
Quote:
Today I tested the mod's to search only in a specific form. I'll post it later this week. Implementation I took the easy way here. Each list entry now contains the form name. Next to the forum name is a [Filter] link. Clicking such a link will add the corresponding forum ID to the current selection criteria. |
re: thumbnails
highlander_RD , It's not that hard, but it would sure mess up the page display, making some entries occupy a lot of vertical space. I'm betting you don't care about that. :) Personally, I always want as much information on a page as possible -- i.e., lots of entries. |
Quote:
In my forum I have tons of pics attached, with nonsense names. So the only way to make fun should be to have a sort of preview even if very small. Sorry for my insisting, and all my best for this great work! ;-) |
Quote:
Easier still I think, from an implementation standpoint, would be a popup window. Let's see if anyone else is interested. Cheers |
Quote:
Re: permissions I checked now that attachments in supermoderators area (hidden) are listed as well as post titles to guest and registered users... It's true they can't get into because of permissions, but they're allowed to read the listed titles and attachments names. Any idea to allow only supermods and admins to view the listed attachments and tied infos placed in hidden forums? Wouldn't be easier to use the "Exclude Forums" as indicated in User profile Options? |
Re: permissions
As part of the code being tested now to allow selection on a single forum, I have also added persmission checking, so that only attachments from permitted forums are listed. The permissions checked are: CANVIEW AND CANGETATTACHMENT Both must be true. Perhaps someone can chime in here and let us know if these user-forum permissions would be set for moderators, super-moderaters, and administrators, or does one need to call 'can_moderate(forumid)'? |
I uploaded now the attachment_browser.php, renamed as ab1.php
here you can view the listed attachments with the secret attachment set in supermod area, actually as ID nr. 7 "reputation_balance.gif" http://forum.egcommunity.it/ab1.php |
Yes, permissions will be coming this week, along with the ability to list for a selected forum.
(BTW, and you probably know, if you rename the source file, you break the links on the page, as they are coded in the template to call 'attachment_browser.php'.) |
Quote:
Yep, I just changed the name for this checking purposes. Later on, when permissions are fixed, I'll replace the correct name. ;) |
Quote:
Code:
define(THIS_SCRIPT,'attachment_browser'); |
Quote:
Still, I suppose there is no reason one could not set $this_script to be referenced by templates. For that matter, one could set it by referencing the PHP global 'SCRIPT_FILENAME''. |
This is indeed a great hack and a good idea. :) Well done.
|
All times are GMT. The time now is 11:03 AM. |
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:
|