• Welcome to Simple Machines Community Forum. Please login or sign up.
November 28, 2021, 03:34:49 PM

News:

SMF 2.1 RC4 has been released! Try it out and help us test! :) Read more.


Image Attachment Thumbnail View

Started by GL700Wing, January 10, 2021, 08:59:39 PM

Previous topic - Next topic

GL700Wing

Link to the mod

Image Attachment Thumbnail View - v 1.5

Thumbnail-sized view of images in Administration Center, Member Profiles and Moderation Center.

By default only download links are provided for image attachments accessed via Administration Center >> Attachments and Avatars >> Browse Files and Profile of Member >> Show Posts >> Attachments and only file names are shown for unapproved attachments accessed via Moderation Center >> Unapproved Attachments.

In addition, unapproved attachments listed in the Administration Center are not identified by either the use of a different coloured row background or the addition of the text  '(Awaiting Approval)'  below the filename. (In Member Profiles unapproved attachments have both these attributes).

This mod provides the option to display a thumbnail-sized (ie, max 150px x 150px) view of all image attachments in the Administration Center, Member Profiles and Moderation Center.

In addition, this mod adds download links unapproved attachments in the Moderation Center, uses a different coloured row background for unapproved attachments listed in the Administration Center, and displays the text  '(Awaiting Approval)'  after the filename of unapproved attachments in both the Administration Center and Member Profiles.

Administration Center:
This mod provides the option to display a thumbnail-sized (ie, max 150px x 150px) view of all image attachments (ie, attachments, avatars and thumbnails) above the download link.

The option is enabled/disabled via the 'Display thumbnail-sized view of image attachments in Admin Center' setting in Administration Center >> Attachments and Avatars >> Attachment Settings.


Member Profiles:
This mod provides the option for Admins, Moderators and/or members to see a thumbnail-sized (ie, max 150px x 150px) view of image attachments above the download link.

These options are enabled/disabled via the 'Allow Admins to see a thumbnail-sized view of image attachments in all member profiles', 'Allow Moderators to see a thumbnail-sized view of image attachments in all member profiles' and 'Allow members to see a thumbnail-sized view of image attachments in member profiles' settings in Administration Center >> Attachments and Avatars >> Attachment Settings.


Moderation Center:
In addition to also providing the same option for unapproved attachments for moderators this mod also adds download links for ALL types of unapproved attachments.
(Note: Download links will be displayed even if the thumbnail view is disabled).

The option to display a thumbnail-sized (ie, max 150px x 150px) view of unapproved image attachments is enabled/disabled via the 'Display thumbnail-sized view of unapproved image attachments in Moderation Center' setting in Administration Center >> Attachments and Avatars >> Attachment Settings.


Release History:
1.0 - 26-Dec-20
o Initial Release with support only for SMF 2.0.17

1.1 - 21-Jan-21
o Added support for SMF 2.0.10-2.0.17 and SMF 2.1 RC3

1.2 - 06-Feb-21
o Added support for SMF 2.0.18

1.3 - 07-Feb-21
o SMF 2.0.xx - Fixed two bugs in GenericList.template.php

1.4 - 25-Jul-21
o Added support from SMF 2.1 RC4
o SMF 2.1 RC3 - Fixed bug in GenericList.template.php and added support for multiple releases of SMF 2.1 RC3.
o Added Russian language support (thanks to wylekk).
o Added support for LazyLoad mod.
o Other minor enhancements.

1.5 - 01-Nov-21
o Fix for issue of broken image link showing for non-image files in Admin Center - reported by @rjen.
o Added Dutch language support (thanks to @rjen).


License
Copyright (c) 2021 Kathy Leslie
All rights reserved

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer; and

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Life doesn't have to be perfect to be wonderful ...

GigaWatt

Oh, this is really nice :). Good work :) ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Steve

Won't install on versions prior to 2.0.17?
Please do not PM me for support.

GL700Wing

Quote from: Steve on January 13, 2021, 07:22:33 AM
Won't install on versions prior to 2.0.17?
I haven't tested it on earlier versions so I don't know if/how it will install/work with them - I'll test it with some previous versions within the next few days and let you know.
Life doesn't have to be perfect to be wonderful ...

Steve

Please do not PM me for support.

wylekk

Hi. For the SMF 2.1 RC3 forum will the mod be adapted?

GL700Wing

Quote from: wylekk on January 14, 2021, 01:39:48 AM
Hi. For the SMF 2.1 RC3 forum will the mod be adapted?
I don't know but I will find out and let you know.
Life doesn't have to be perfect to be wonderful ...

GL700Wing

Uploaded v1.1 - 20 January 2021
o  Added installation support for SMF 2.0.10 through SMF 2.0.17 (installed and verified with all these versions)
o  Added Support for SMF 2.1 RC3 (installed and verified with all the officially released version and GitHub release as at 16 January 2021)
o  Added different background colour for unapproved attachments in Administration Center
o  Added option to enable thumbnail view separately for Admins and Moderators (these were combined in the previous release)
o  Moved the setting for viewing thumbnails in the Moderation Center to 'Administration Center » Attachments and Avatars » Attachment Settings' (this change was needed to ensure this feature works when a forum is upgraded to SMF 2.1 RC3)



Note: If you previously used v1.0 of this mod to view thumbnail-sized images in the Moderation Center you must enable and save the 'Display thumbnail view of unapproved image attachments in Moderation Center' setting in 'Administration Center » Attachments and Avatars » Attachment Settings' to enable this feature in v1.1.
Life doesn't have to be perfect to be wonderful ...

Steve

Please do not PM me for support.

wylekk

Thank you very much, everything works! :)
If necessary, here's the Russian language

$languagedir/index.russian.php

$txt['att_awaiting_approval'] = '<br /><em style="color: red;">(В ожидании подтверждения)</em>';


$languagedir/Admin.russian.php

$txt['moderation_center_view_thumbs'] = 'Показывать миниатюры неутвержденных прикрепленных изображений в Центре модерации';
$txt['attachment_manager_view_thumbs'] = 'Показывать миниатюры вложенных изображений в админке<div class="smalltext">Этот параметр применяется к вложениям, аватарам и миниатюрам в разделе «Просмотр файлов».</div>';
$txt['member_profile_view_thumbs_admin'] = 'Разрешить администраторам просматривать миниатюры вложенных изображений в профилях участников';
$txt['member_profile_view_thumbs_moderator'] = 'Разрешить модераторам просматривать миниатюры вложенных изображений в профилях участников';
$txt['member_profile_view_thumbs_other'] = 'Разрешить участникам просматривать миниатюры вложенных изображений в профилях участников';


Dave J

All the Quiz info is here

stoneageman

Very nice mod. Works a treat.Thanks GL  ;D

Dave J

Hi GL,

This has been causing an error on 2 different sites I manage

Both using 2.0.18
PHP 7

The error is seen in the attachments below and this is the line from the template

==>126: $aaa_pos = substr($row['name']['value'], -$aaa_length ) === $txt['att_awaiting_approval'];

I have now uninstalled the mod and the error doesn't happen anymore.

The error is apparent when you go to 'Users Online' and click on a staff members IP address.

I should add that at no time other than in that instance does the error happen.

All the Quiz info is here

GL700Wing

Hi Dave,

Quote from: Dave J on February 14, 2021, 07:10:47 AM
The error is seen in the attachments below and this is the line from the template

==>126: $aaa_pos = substr($row['name']['value'], -$aaa_length ) === $txt['att_awaiting_approval'];
I actually came across this issue myself just over a week ago and it has been fixed in the latest release (ie, v1.3).
Life doesn't have to be perfect to be wonderful ...

Dave J

All the Quiz info is here

Dave J

Hi

Again just to let you know that 1.3 is now working fine on both sites.

Thank you
All the Quiz info is here

GL700Wing

Quote from: Dave J on February 15, 2021, 04:32:18 AM
Hi

Again just to let you know that 1.3 is now working fine on both sites.

Thank you
You're welcome - and thanks for letting me know!
Life doesn't have to be perfect to be wonderful ...

GL700Wing

Uploaded 1.4 - 25-Jul-21
o Added support from SMF 2.1 RC4
o SMF 2.1 RC3 - Fixed bug in GenericList.template.php and added support for multiple releases of SMF 2.1 RC3.
o Added Russian language support (thanks to wylekk).
o Added support for LazyLoad mod.
o Other minor enhancements.
Life doesn't have to be perfect to be wonderful ...

@rjen

Just updated to version 1.4 and I am seeing that in the admin center it is trying to show thumbnails for attachements that are not images.

No I had some issues uninstalling version 1.0 of the MOD, so not sure it that has something to do with it...

Running SMF 2.0 with Tinyportal 2.1.0 at www.fjr-club.nl
Testing SMF 2.1 with Tinyportal 2.1.0 at test2.fjr-club.nl

GL700Wing

Uploaded 1.5 - 01-Nov-21
1.5 - 01-Nov-21
Fix for issue of broken image link showing for non-image files in Admin Center - reported by @rjen.


Many thanks to @@rjen for reporting this bug.
Life doesn't have to be perfect to be wonderful ...

Advertisement: