News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Attachment Browser

Started by shawnb61, May 09, 2022, 02:32:15 PM

Previous topic - Next topic

shawnb61

Link to the mod

Description:
The Attachment Browser lets you browse, filter & sort attachments, while honoring user access.

A simple tagging system is provided.  Categories of tags are supported.  Each tag belongs to a single category, and each tag may have one or more aliases.  

A form is also provided to allow users to add or remove tags from their attachments.  Admins may also update tags.  To update the tags on an attachment, click on the tags value when browsing.

Auto Tagging:
When an attachment is added to a post, the message subject and body are scanned for tags & their aliases.  The board and category names & descriptions are also scanned.  If found, the tags are associated with the attachment.

There is also a bulk Auto Tag admin feature, where all existing attachments can be auto-tagged.  You may choose to run this after you configure your tags so historical attachments are included.  The Auto Tag process can be re-run - tags found are added to the existing list.

For example, if you have different boards set up for different products in your forum, with tags that correspond to the products, you can easily filter by product.

Tag Filters:
When using the tags to filter the list of attachments, the search utilizes ANDs across tag categories, and ORs within tag categories.

A "Search Again" button is provided to allow the user to refine the filter.

Limitations:
 - Only 255 characters of tag info per attachment are supported.  You need to find the right level of categorization.
 - The focus is attachments - avatars & thumbnails are excluded.
 - Performance is a concern given the flexibility provided.  This mod may not be appropriate for extremely large forums.  In testing, for forums with less than 20K attachments, performance is sub-second.  For a forum with 500K attachments, performance is ~2-6 seconds per page. YMMV. The more filters used to narrow the result set, the better!

Releases:
 - v2.2 Addresses null error when admins modify posts
 - v2.1 Enhancements to grid view
 - v2.0 Added grid view; improved handling of guest attachments
 - v1.11 Added date range filtering and French translations
 - v1.10 Added German translations
 - v1.9 Addresses array offset on null error
 - v1.8 Addresses undefined error
 - v1.7 Added Spanish translations
 - v1.6 Initial public release

Acknowledgements:
 - Thanks to Bugo for the Russian translation!
 - Thanks to @rjen for the Dutch translation!
 - Thanks to -Rock Lee- for the Spanish translations!
 - Thanks to AllMassive for the German translations!
 - Thanks to brunog14 for the French translations!
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

Probably the hardest thing about using this mod is figuring out what your tags and tag categories should be.

If your forum has categories & boards established in a hierarchical fashion, where categories & boards are dedicated to something specific & distinct from the other categories & boards, such as products, tv shows, characters, movies, toys, technologies, etc., then start there.

If your forum is more general purpose, it is possible this mod won't really help your users.

However, if folks are drawn to your forum in part for attachments (patches, songs, plans, diagrams, drawings, reviews, etc.), then this mod may be of benefit.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Antechinus

I can see this being very useful for some sites.

shawnb61

Quote from: Antechinus on May 09, 2022, 04:38:35 PMI can see this being very useful for some sites.

Yeah. Despite heroic efforts to structure our site, folks post patches all over the place.

It's nice to be able to find which ambient SY-1000 patches are most popular, in one list, no matter where they were posted:
You cannot view this attachment.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

-Rock Lee-

I make my quick way over here to drop off the translation into Spanish es and latam ::).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Gryzor

Works great as a list, it'd be nice to have a gallery mode too!

One question: how are download counts calculated? I run a pretty niche forum (for the Amstrad CPC range of 8-bit computers) and the top-downloaded attachment has over 14K downloads?! I doubt there are that many users of the CPC worldwide, so I don't know what to make of it :)

shawnb61

The mod is displaying SMF's download count, which increases every time someone clicks on a download link.

If the same user downloads a doc multiple times over the years, those are all counted. 

I see high download counts for reference materials - folks use the site as storage, & redownload docs every time they need them...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Gryzor

Yeah, I guess that's a SMF issue then - no way my top download has 15K+ legit downloads, we're talking about a version of a ROM file for an obscure OS someone designed in their spare time, whereas much more popular files like games have much lower counts...

shawnb61

v1.9 - New version uploaded that corrects a couple minor errors.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

As an example of categories & tags, this is what we are using on our forum. 

Our forum (https://vguitarforums.com) is for users of guitar synthesizers and modelers.  These are effects boxes that make your guitar rig sound like other guitars/amps/instruments. 

The categories we have setup are:

Effect - Delay, distortion, reverb, etc.
Instrument - What are you trying to emulate?  A sax?  A Gibson 335?  A 12-string acoustic guitar?  The early GR-300 guitar synth?  A piano?
Model - What gear are you using?  Variax?  Boss SY-1000?  Roland VG-99?
Qualities - This is a bit more squishy, and generally refers to a list of artists (Adrian Belew, Pat Metheny), amps (1959, tweed), and styles (blues, prog, acid, worship).

You cannot view this attachment.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

dodos26


shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

AllMassive

seems i'm too dumb to find the way to attach a file to this post - heres the german translation.

$txt['attbr_list'] = 'Liste der Anhänge';
$txt['attbr_browse'] = 'Dateien durchsuchen';
$txt['attbr_filter'] = 'Filtern nach';
$txt['attbr_search'] = 'Suche nach Anhängen';
$txt['attbr_editattachtags'] = 'Tags der Anhänge bearbeiten';
$txt['attbr_desc'] = 'Wartung der im Attachment Browser verwendeten Tags durchführen';

$txt['attbr_tags'] = 'Tags des Anhangs';
$txt['attbr_tagmaint'] = 'Wartung der Tags';

$txt['attbr_add_tag'] = 'Tag hinzufügen/ändern';
$txt['attbr_category'] = 'K';
$txt['attbr_category_desc'] = 'Gruppe von Tags (max. 25 Zeichen)';
$txt['attbr_tag'] = 'Tag';
$txt['attbr_tag_desc'] = 'Tags sind alphanumerisch und dürfen keine für URLs reservierten Zeichen enthalten (max. 25 Zeichen)';
$txt['attbr_aliases'] = 'Aliasnamen';
$txt['attbr_aliases_desc'] = 'Kommaseparierte Liste von Tag-Aliasen (max. 50 Zeichen)';

$txt['attbr_delete_tag'] = 'Tag löschen';

$txt['attbr_bad_tag'] = 'Ungültiger Wert für den Tag';
$txt['attbr_bad_aliases'] = 'Ungültige Alias-Liste';
$txt['attbr_bad_cat'] = 'Ungültiger Wert für Kategorie';
$txt['attbr_too_many'] = 'Zu viele Tags ausgewählt';
$txt['attbr_too_long'] = 'Zu viele Tags für Anhang %1$s';

$txt['attbr_autotag'] = 'Auto-Tag';
$txt['attbr_autotag_desc'] = 'Mit dieser Funktion werden alle Anhänge automatisch getaggt';
$txt['attbr_start'] = 'Start';
$txt['attbr_resume'] = 'Fortsetzen'; 
$txt['attbr_complete'] = 'Fertig';
$txt['attbr_continue'] = 'Weiter';

$txt['viewing_attachs'] = 'Anzeigen der Anhänge von %1$s bis %2$s';
$txt['of_total_attachs'] = 'von insgesamt %1$s Anhängen';

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

@AllMassive - did you have translations for the first set of entries, or were you using the English translations for those?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

AllMassive

@shawnb61 : sorry - missed some lines :/

$txt['filename'] = 'Dateiname';
$txt['poster_name'] = 'Beitrag von';
$txt['fileext'] = 'Erweiterung';
$txt['fileext_long'] = 'Dateierweiterung';
$txt['filesize'] = 'Dateigrösse';
$txt['tags'] = 'Tags';
$txt['submit'] = 'Senden';
$txt['return'] = 'Zurück';

$txt['attbr_list'] = 'Liste der Anhänge';
$txt['attbr_browse'] = 'Dateien durchsuchen';
$txt['attbr_filter'] = 'Filtern nach';
$txt['attbr_search'] = 'Suche nach Anhängen';
$txt['attbr_editattachtags'] = 'Tags der Anhänge bearbeiten';
$txt['attbr_desc'] = 'Wartung der im Attachment Browser verwendeten Tags durchführen';

$txt['attbr_tags'] = 'Tags des Anhangs';
$txt['attbr_tagmaint'] = 'Wartung der Tags';

$txt['attbr_add_tag'] = 'Tag hinzufügen/ändern';
$txt['attbr_category'] = 'Kategorie';
$txt['attbr_category_desc'] = 'Gruppe von Tags (max. 25 Zeichen)';
$txt['attbr_tag'] = 'Tag';
$txt['attbr_tag_desc'] = 'Tags sind alphanumerisch und dürfen keine für URLs reservierten Zeichen enthalten (max. 25 Zeichen)';
$txt['attbr_aliases'] = 'Aliasnamen';
$txt['attbr_aliases_desc'] = 'Kommaseparierte Liste von Tag-Aliasen (max. 50 Zeichen)';

$txt['attbr_delete_tag'] = 'Tag löschen';

$txt['attbr_bad_tag'] = 'Ungültiger Wert für den Tag';
$txt['attbr_bad_aliases'] = 'Ungültige Alias-Liste';
$txt['attbr_bad_cat'] = 'Ungültiger Wert für Kategorie';
$txt['attbr_too_many'] = 'Zu viele Tags ausgewählt';
$txt['attbr_too_long'] = 'Zu viele Tags für Anhang %1$s';

$txt['attbr_autotag'] = 'Auto-Tag';
$txt['attbr_autotag_desc'] = 'Mit dieser Funktion werden alle Anhänge automatisch getaggt';
$txt['attbr_start'] = 'Start';
$txt['attbr_resume'] = 'Fortsetzen';
$txt['attbr_complete'] = 'Fertig';
$txt['attbr_continue'] = 'Weiter';

$txt['viewing_attachs'] = 'Anzeigen der Anhänge von %1$s bis %2$s';
$txt['of_total_attachs'] = 'von insgesamt %1$s Anhängen';

shawnb61

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

v1.10 - New version uploaded that adds the German translations.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

brunog14

Good morning,
Great Mod!! THANKS...

I took the liberty of doing a French translation.

Excellent day.

keyboard

#20
Is it possible to filter by "Most Recent" regardless of extension name. I would make a substantial donation for something like this !

Слaва
Украинi

keyboard

Is it possible to filter by "Most Recent" regardless of extension name ?

Слaва
Украинi

shawnb61

Not at this time, but an excellent idea for the next version!
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

keyboard

Quote from: shawnb61 on May 26, 2023, 10:38:10 PMNot at this time, but an excellent idea for the next version!

I have been using SMF since 2007 and my ONE AND ONLY complaint is that we are missing that feature.

My Site thrives on attachments and whenever I add an attachment to an existing message, it does not show in "Recent Posts".  If I create a new message and attach a file, it will show. So I have no way to inform my users that I Have uploaded new material.  I would say that 60% of all my uploads are to existing messages

This is where your mod would solve the problem.    Filter by "Recent Attachments" would be awesome

Please give it some thought.... You have my permission to PM me if needed

Ron
Слaва
Украинi

keyboard

#24
Hi

I log in as "admin", upload a pdf, and tag it........ Then when I go to "Attachments" and click on an attachment, I get changed to a guest.

"You cannot view this attachment."

I am running a fresh install of 2.1.4 using the default theme. The only other mod that I have installed is "Recent Forum Topics on Board Index"

I am missing something fundamental

Please advise
Слaва
Украинi

shawnb61

Hmmm... I cannot reproduce that.  Sounds like you got logged out somehow.

Does this happen consistently?

Is it possible your session just expired?
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

keyboard

The strange thing is, if I click on the "Attachment List/Subject", I get changed to a Guest.......
But if I click on "Attachment List/Filename", I am able to download with no problems (Administrator)

Please advise
Слaва
Украинi

keyboard

I restored a backup to an earlier date and I don't have that problem anymore

Слaва
Украинi

keyboard

Still had problems so I did a complete reinstall and have no problems now !!!!!
Слaва
Украинi

shawnb61

When you say you get changed to a guest... Does that mean you were logged out & had to log back in?

And this happens when you changed the sort order to sort by Subject?  But not other sort orders?

Can guests view attachments?

Do you have similar issues browsing the member list?

It might help if you could share the URL you see when hovering over Subject, to see if something funky is happening to that URL.

This mod utilizes fairly straightforward SMF list functions, including sorting and paging.  Identical to the SMF member list function.

If one of the sorting links brings you somewhere strange, my best guess is that your browser had that cached somehow.  My first suggestions would be to try clearing your browser history, & also trying a hard browser refresh (usually Ctl-F5) to ensure the page is rebuilt clean.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

keyboard

In fairness, I fault everything to the initial installation of SMF (errors made by me) to be the cause of all the problems I have been having

Since then, I have reinstalled SMF and have not have any problems with "Attachment Browser"

The only problem that I have run into, is a file name must only contain text. Other characters such as "&" give me an error.

Other than that, I am quite happy with the "Attachment Browser"  The "Filter" is an awesome feature. Perfect for my needs.

Слaва
Украинi

keyboard

So "Mike & the Mechanics' has to be "Mike and the Mechanics"
Слaва
Украинi

shawnb61

#32
Quote from: keyboard on July 06, 2023, 08:50:08 PMSo "Mike & the Mechanics' has to be "Mike and the Mechanics"

What kind of error are you seeing?  I can upload, display, list, & even download the file.  See attachment on this post.

Attachment Browser properly tags the file & displays its name.  No errors logged by Attachment Browser or SMF.


(However... I do see that upon download it is named funky...  I logged an issue for that:
https://github.com/SimpleMachines/SMF/issues/7785 )
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

keyboard

When I want to add this

You cannot view this attachment.

I get this message

You cannot view this attachment.
Слaва
Украинi

shawnb61

Ah, yes - tags.  That is a limitation of Attachment Browser.  Special characters are not allowed within tags.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

darkmoon2010

Hi,
i like your mod, it works fine.

Is it possible to give only admin users access to the mod in the menu tab to hide it for "normal" users ?
At the moment everybody has permission to see the mod in the menu tab ?

Best regards

Thomas

shawnb61

Anyone with permission to view attachments will have access to this mod and see it in their menu.

Note that admins can already browse attachments in the ACP.  The primary goal of this mod was to provide similar access to non-admins.

So, to restrict access, one option is to restrict the ability to view attachments.

Or, if you just want to hide the menu entry from non-admins, you would need to tweak the integrate menu hook.  Note non-admins could still access it if they knew the proper url.


Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

keyboard

#37
I select "Mamboleo - Loona

You cannot view this attachment.

even though I have logged in as admin, I see this

You cannot view this attachment.

and when I try to log in again , I see this

You cannot view this attachment.

I have tried Chrome, Firefox, Safari, Edge, Opera and the only way to log in, is get out of the application and restart.

I have not registered the Domain Name and the forum is in another Domain. I do not know if this is relevant or not !   I do not have this problem when I uninstall the Mod so I am guessing that it is Mod related.


I really like this Mod and would love to use this. 

Please advise
Слaва
Украинi

Diego Andrés

Make sure the URL  of your forum is consistent and the same as the one you want to visit.
For example, I see in your profile here, you have linked your forum as http://www. And your forum URL is actually https://www..

SMF Tricks - Free & Premium Responsive Themes for SMF.

keyboard

My URL looks good .....

You cannot view this attachment.
Слaва
Украинi

m4z

Please use repair_settings.php to verify there isn't an error in your SMF (URL) config. Like Diego said, your forum is accessible both via http and https, and only one of those can be configured in SMF.

Maybe the mod constructs absolute URLs, which use the configured forum URL, which "logs out" users on the wrong domain?
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

keyboard

Ran "repair_settings.php" with no errors found. 

Please advise
Слaва
Украинi

keyboard

I am in the process of purchasing a domain name and giving the Forum a proper home..... Hoping for the best.... This mod is perfect for my needs.
Слaва
Украинi

keyboard

Everything works as intended now that I have a permanent home for it.

there still is a problem with errors

You cannot view this attachment.

I clear the errors only to have them reappear . and there a lot of the same error.

So close but so far away.

Please advise
Слaва
Украинi

keyboard

Everything is well !!!!!!!!
Слaва
Украинi

keyboard

You cannot view this attachment.



Please tell me how I can add "Bogdan" to this list
Слaва
Украинi

keyboard

Quote from: shawnb61 on May 20, 2022, 01:01:29 AMYou cannot view this attachment.

How do I add an extention ?  I would like to add "Bogdan" to the list

Слaва
Украинi

shawnb61

The list of extensions is built dynamically.

So, add a file with that extension.

Note that the extension list is cached, so there may be a brief lag.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

keyboard

#48
So if I want to add "Bogdan" to the Extension's, I need to create a file like "Bogdan.Bogdan" and upload to a Directory named "Bogdan" and this will add Bogdan to the list ?

You cannot view this attachment.
Слaва
Украинi

shawnb61

Quote from: keyboard on September 03, 2023, 12:09:14 PMSo if I want to add "Bogdan" to the Extension's, I need to create a file like "Bogdan.Bogdan" and upload to a Directory named "Bogdan" and this will add Bogdan to the list ?

No, just upload an attachment with that extension.  Like any other attachment.

You may need to add the extension to the list of valid extensions under Admin | Forum | Attachments & Avatars | Attachment Settings to allow the upload.

You may need to wait a few minutes (or clear the cache) for it to appear, since the current set of extensions is cached.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

keyboard

You cannot view this attachment.

So if I check the "PDF" then "Search".... I should only be able to see all the PDF's


But this is what I am seeing

You cannot view this attachment.



Please advise
Ron from Canada
Слaва
Украинi

keyboard

Solved.   My error
Слaва
Украинi

shawnb61

v1.11 Added date range filtering and French translations
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

v2.0 uploaded.

Added grid view; & improved handling of guest attachments.

You cannot view this attachment.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

Some notes when using the Attachment Browser:
 - All the column headings are clickable, and when you click on them, it will sort by that column.  Clicking a 2nd time will sort in descending order.  Handy for seeing items uploaded recently, or items frequently downloaded, etc.
 - Many of the fields within the list & grid are clickable - e.g., clicking on the filename will download the file.  Clicking on the message subject (list view) or the post date (grid view) will bring you directly to the post that has the attachment.
 - Clicking on the "Filter By" button allows you to filter by poster, date range, file extension, and various tags.
 - When viewing a filtered list, clicking on the "Search Again" button at the bottom of the list will bring you back to the "Filter By" screen to allow you to tweak the filter.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

shawnb61

v2.1 is available, with enhancements to the grid view.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: