Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Diego Andrés on July 12, 2009, 06:33:24 AM

Title: Hide Images From Guests
Post by: Diego Andrés on July 12, 2009, 06:33:24 AM
Link to the mod (https://custom.simplemachines.org/index.php?mod=1942)

(https://smftricks.com/logos/logo.png) (https://smftricks.com/)

(https://img.shields.io/badge/License-MPL%202.0-248049) (https://img.shields.io/badge/Hooks%20Only-Yes-6041a3) (https://img.shields.io/badge/SMF-2.1-3f73a0)

Hide Images From Guests
Developed by Diego Andrés (https://smftricks.com/index.php?action=profile;u=1)
Original Developer: islam2hamy (https://www.simplemachines.org/community/index.php?action=profile;u=126024)




Introduction
This mod allows you to hide post images from guests.

Localization
(https://www.simplemachines.org/site_images/lang/english.gif) English
(https://www.simplemachines.org/site_images/lang/arabic.gif) Arabic by islam2hamy (https://www.simplemachines.org/community/index.php?action=profile;u=126024)
(https://www.simplemachines.org/site_images/lang/spanish_es.gif) Spanish
(https://www.simplemachines.org/site_images/lang/german.gif) German (FORMAL and INFORMAL) by Matthias (https://www.simplemachines.org/community/index.php?action=profile;u=389)

Compatibility with other MODs


GitHub (https://github.com/SMFTricks/Hide-Images-From-Guests)
Title: Re: Hide Images From Guests
Post by: gourav on July 12, 2009, 07:09:40 AM
Hey Great mod :)
Can you please update it for Beta 2 Rc1-1 ?
Thanks
Title: Re: Hide Images From Guests
Post by: Sevgiformu.com on July 12, 2009, 07:32:09 AM
thank you very nice mod

turkish translate.

//HideImagesFromGuests
$txt['prevent_view_pic'] = 'Ziyaretci\'Resimleri Göremez,Lütfen <a href="' . $scripturl . '?action=register">Kayıt Olun</a> or <a href="' . $scripturl . '?action=login">Üye İseniz Giriş Yapın</a>';
//HideImagesFromGuests
Title: Re: Hide Images From Guests
Post by: DilSe on July 12, 2009, 12:43:50 PM
hello good mod..

after install this mod .. when i open any section or any topic i get it this error

Fatal error: Call to undefined function: str_ireplace() in /snt/w0700/d23/s19/b02fc5b45/www/domin.com/SMF/Sources/Subs.php on line 4432
Title: Re: Hide Images From Guests
Post by: MF30 on July 12, 2009, 01:19:38 PM
Good mod.

Thanks.
Title: Re: Hide Images From Guests
Post by: Realinfo on July 13, 2009, 09:15:10 PM
Thanks for MOD but will it Hide images from Google Bot too......... I mean I need that Google Bot can see my Images while Guests not.................
Title: Re: Hide Images From Guests
Post by: JeremyB. on July 14, 2009, 03:39:41 AM
It will hide it from ALL types of guests
Title: Re: Hide Images From Guests
Post by: cold77 on July 14, 2009, 04:25:27 AM
thanks for the mods!
Title: Re: Hide Images From Guests
Post by: SAFAD on July 21, 2009, 05:07:26 AM
O sorry I Didn't see this topic (Blind and first time make a mod for SMF)
@gourav now it is compatible with 1.1.X and 2.X
@Php Coder Turkish Thanx for the translation i will put it now
@Hanzalah you have an error on your forum try it on another or make a new fresh files
@Realinfo this is possible but i won't make it! why ? cuz this is black hat seo i mean when google enter a page and see :
"hello you're the best !!"
and a visitor see
"get out !!"
google will think this is kind of trick to trick him and win PR
so Black Hat Seo

anyone else i didn't say his name :
THANK YOU FOR SUPPORTING ME !
Best Regards
Title: Re: Hide Images From Guests
Post by: SAFAD on July 21, 2009, 05:11:50 AM
@Php Coder Turkish can you please give me the file names :D
Thanx
Title: Re: Hide Images From Guests
Post by: Cal O'Shaw on July 23, 2009, 02:13:19 AM
Hello,

When you say it hides images, does that mean just images displayed with the [img][/img] tags, or does it include the avatars and gifs?  And does it go get the image and decide not to display it or does it skip the call to get the image entirely?  I'm trying to reduce our CPU load and wondering if this will help.

Grazie,

Cal
Title: Re: Hide Images From Guests
Post by: SAFAD on July 23, 2009, 10:15:48 AM
only bbcode one
[img] thing
this won't do a Server load
if it is
so all SMF
do aserver load
and it is really wrong idea
Title: Re: Hide Images From Guests
Post by: philcross on July 27, 2009, 02:03:09 PM

great mod - thanks
Title: Re: Hide Images From Guests
Post by: SAFAD on July 28, 2009, 04:56:40 AM
no problem bro
Title: Re: Hide Images From Guests
Post by: hmalik007 on July 29, 2009, 08:27:59 PM
bro, is it possible to change the default text with some custom text and style. if yes please tell me how ? thanks in advance.
Title: Re: Hide Images From Guests
Post by: SAFAD on August 01, 2009, 10:34:57 AM
Thx For The Idea
I Will Make New Version That Lets You Choose Your Text And How Does It Look
Yes You Can
Open
mod1.1.xml
else
mod2.xml if you use smf2

Search For

$txt['prevent_view_pic'] = 'visitors can't see pics , please <a href="' . $scripturl . '?action=register">register</a> or <a href="' . $scripturl . '?action=login">login</a>';

change what you can
PS: Use Html Better Than BBcode
Best Regards
Title: Re: Hide Images From Guests
Post by: Les Paul on August 24, 2009, 11:13:24 AM
Screenshot please. :)
Title: Re: Hide Images From Guests
Post by: philcross on August 28, 2009, 02:09:13 PM

Any chance of a new Mod which will hide links the same as images?

Title: Re: Hide Images From Guests
Post by: SAFAD on September 04, 2009, 09:10:51 AM
no need
for the screen nothing special
@philcross
didn't understand but ithink you are looking for registred links mod
Title: Re: Hide Images From Guests
Post by: LuminaRS on October 14, 2009, 08:20:18 AM
How is this mod "set"?

Am I able to specify certain threads that the pics cannot be seen or does it disallow guests from viewing pics across the whole forum?

I'd like to be able to disallow on specific posts instead of the whole entire forum
Title: Re: Hide Images From Guests
Post by: SAFAD on October 14, 2009, 01:34:25 PM
Sepcific post or sepcific board ?
Title: Re: Hide Images From Guests
Post by: LuminaRS on October 14, 2009, 01:46:15 PM
Specific posts would be optimal, but if need be I could do a whole board
Title: Re: Hide Images From Guests
Post by: sombra on November 07, 2009, 10:04:43 PM
it woud be nice if it was only for certaing sections any ideas?
Title: Re: Hide Images From Guests
Post by: SAFAD on November 24, 2009, 10:53:50 AM
maybe in next version ?
i must learn more about adding admin things in admin panel :)
Title: Re: Hide Images From Guests
Post by: Yahmez on December 18, 2009, 12:09:17 PM
This mod stops any uploaded avatars (like in the postbit) from showing to guests...
Title: Re: Hide Images From Guests
Post by: SAFAD on December 19, 2009, 01:39:34 AM
No It Doesn't
It Just Hides The Pics In [ img] Tags Only
Title: Re: Hide Images From Guests
Post by: Yahmez on December 19, 2009, 11:55:35 AM
LOL my bad!
I thought I was posting in the board for this mod: http://custom.simplemachines.org/mods/index.php?mod=2295
Which does affect avatars... Sorry SAFAD  :-[
Title: Re: Hide Images From Guests
Post by: SAFAD on December 28, 2009, 05:33:10 AM
No Problem
;)
Title: Re: Hide Images From Guests
Post by: tbk22 on February 13, 2010, 08:00:12 AM
Can you post a screen of the mod when working?
Title: Re: Hide Images From Guests
Post by: Eclipse16V on March 15, 2010, 02:22:09 AM
Nice Mod

Please update it for SMF 2.0RC3  ;)

Thanks
Title: Re: Hide Images From Guests
Post by: SAFAD on March 20, 2010, 11:42:43 AM
Updated !!
Title: Re: Hide Images From Guests
Post by: twentetoo on April 17, 2010, 01:23:23 PM
Hello,

This is exactly what I have been looking for! I am using version 1.1.11 and have installed this mod but it not working for some reason. I am not very good with this kind of stuff and am used to just being able to installing the package and things working... Is there another version of this mod I should be using for the 1.1.11 or something? Any help would be greatly appreciated!

Thanks
Title: Re: Hide Images From Guests
Post by: twentetoo on April 20, 2010, 08:54:23 PM
Here is the error I receive every time I try to install;

Execute Modification     ./Sources/Subs.php     Test failed

Title: Re: Hide Images From Guests
Post by: flapjack on April 20, 2010, 08:55:24 PM
then you need look into this: Manual Installation of Mods (http://docs.simplemachines.org/index.php?topic=402.0)
Title: Re: Hide Images From Guests
Post by: caoyiqian on April 21, 2010, 02:39:23 AM
Again, a nice mod here. You know why I love simplemachine? Because you can get everything great free here.
Title: Re: Hide Images From Guests
Post by: Arantor on April 21, 2010, 06:40:45 AM
Quote from: twentetoo on April 20, 2010, 08:54:23 PM
Here is the error I receive every time I try to install;

Execute Modification     ./Sources/Subs.php     Test failed



Let me guess. SMF 1.1.11? Mod needs to be rewritten to make it work on 1.1.11.
Title: Re: Hide Images From Guests
Post by: SAFAD on June 25, 2010, 05:29:55 AM
damn,
again ?
another fail ?
too bad
i'll work it out later
Title: Re: Hide Images From Guests
Post by: forfun on June 30, 2010, 07:39:38 AM
Quote from: SAFAD on June 25, 2010, 05:29:55 AM
damn,
again ?
another fail ?
too bad
i'll work it out later

I have the same problem with SMF 2.0 RC3.  test failed with /sources/Sub.php
Title: Re: Hide Images From Guests
Post by: SAFAD on July 03, 2010, 07:13:27 AM
what the ?
there must be something wrong
cuz they work PERFECTLY in my forums
and even in test forums
ok ok
i'll find some time
and re-write it
Title: Re: Hide Images From Guests
Post by: Apllicmz on November 06, 2010, 01:21:01 AM
Portuguese

<file name="$languagedir/Modifications.portuguese_pt.php" error="skip">
    <operation>
        <search position="after"><![CDATA[
?>]]></search>
        <add><![CDATA[
//HideImagesFromGuests translate candidosa2  for smfpt
$txt['prevent_view_pic'] = 'Visitantes n&atilde;o podem ver as fotos, por favor <a href="' . $scripturl . '?action=register">registar-se</a> ou <a href="' . $scripturl . '?action=login">Entrar</a>';
//HideImagesFromGuests       
]]></add>
    </operation>
</file>

<file name="$languagedir/Modifications.portuguese_pt-utf8.php" error="skip">
    <operation>
        <search position="after"><![CDATA[
?>]]></search>
        <add><![CDATA[
//HideImagesFromGuests translate candidosa2  for smfpt
$txt['prevent_view_pic'] = 'Visitantes n&atilde;o podem ver as fotos, por favor <a href="' . $scripturl . '?action=register">registar-se</a> ou <a href="' . $scripturl . '?action=login">Entrar</a>';
//HideImagesFromGuests       
]]></add>
    </operation>
</file>
Title: Re: Hide Images From Guests
Post by: SinnerSaint on December 04, 2010, 03:23:19 PM
Quote from: forfun on June 30, 2010, 07:39:38 AM
Quote from: SAFAD on June 25, 2010, 05:29:55 AM
damn,
again ?
another fail ?
too bad
i'll work it out later

I have the same problem with SMF 2.0 RC3.  test failed with /sources/Sub.php

Is there any fix for this installation error? I tried installing this mod to a freshly installed SMF 2.0 RC3 WITHOUT ANY OTHER MODS INSTALLED but still got the same error:

./Sources/Subs.php    Test failed
Title: Re: Hide Images From Guests
Post by: Blipsqueak on December 08, 2010, 04:18:39 PM
I'm also getting the error on a fresh install.

I'll be able to manually install it, but I assume it's something you'd want to fix.
Title: Re: Hide Images From Guests
Post by: jaisi on December 20, 2010, 02:02:52 PM
Nice Mod

Please update it for SMF RC 
Title: Re: Hide Images From Guests
Post by: Tokzu on January 23, 2011, 12:52:30 AM
Hi~ Nice mod.

I want that the guests cannot see the images of certain boards, how could I modify it?
Title: Re: Hide Images From Guests
Post by: aquascape on May 04, 2011, 05:22:30 PM
I installed this mod to my RC5 and found that when view page index as guest, some boards in my forum s disappeared and only be seen when registered. The board does not contained pics or some even no post at all.??

one other thing I found is the "log in or log in" is replacing the image so I go to parse and edit the
/public_html/board/Themes/default/languages/Modifications.english.php  the last word "log in" changed to "register".

$txt['prevent_view_pic'] = 'Guests can\'t see images. Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>';
Title: Re: Hide Images From Guests
Post by: gigashiga on June 06, 2011, 08:27:49 AM
I downloaded your version for 1.1.13 since my forum is same version

I got this error


!!
Error in Package Installation
At least one error was encountered during a test installation of this package. It is strongly recommended that you do not continue with installation unless you know what you are doing, and have made a backup very recently. This error may be caused by a conflict between the package you're trying to install and another package you have already installed, an error in the package, a package which requires another package that you don't have installed yet, or a package designed for another version of SMF.


??
Title: Re: Hide Images From Guests
Post by: .Vapor on September 28, 2011, 09:08:41 AM
Working for 2.0.1 ?
Title: Re: Hide Images From Guests
Post by: iverSUN on December 08, 2011, 07:35:34 PM
Quote from: V@por on September 28, 2011, 09:08:41 AM
Working for 2.0.1 ?

Also interested in this question...
Title: Re: Hide Images From Guests
Post by: Adrek on December 09, 2011, 01:15:23 AM
Quote from: V@por on September 28, 2011, 09:08:41 AM
Working for 2.0.1 ?
Yes.
Title: Re: Hide Images From Guests
Post by: islam2hamy on January 01, 2012, 12:17:47 AM
Updated :)
Title: Re: Hide Images From Guests
Post by: Venera on January 10, 2012, 10:41:06 AM
Nice mod. But I have problem. When I install "hide images", its block  nCode image risazer to resize images.

Help!  :)
Title: Re: Hide Images From Guests
Post by: villasg on June 09, 2015, 12:48:09 PM
Working for 2.0.10 ?
Title: Re: Hide Images From Guests
Post by: willymmx on August 03, 2016, 10:42:45 AM
Quote from: villasg on June 09, 2015, 12:48:09 PM
Working for 2.0.10 ?

yes!

But I have a problem..... mod is working and it shows the visitors message, but the text is still a link to the image.... so.... if a visitors clicks on the link he will see the picture....

(https://postimg.org/image/ncn987czr/)

Any idea?

board www.hondacgclub.com.ar

Thanks!
Title: Re: Hide Images From Guests
Post by: Diego Andrés on November 04, 2020, 11:17:51 PM
Updated to SMF 2.1
Title: Re: Hide Images From Guests
Post by: woolly bugger on November 05, 2020, 10:44:01 AM
Quote from: Diego Andrés on November 04, 2020, 11:17:51 PM
Updated to SMF 2.1

installed, get "You cannot see attachments on this board." but no link to log in or sign up...

also only blocks attached images, not [img]linked image[/img]

smf 2.1 rc3

mods

2   Simple Audio Video Embedder   5.1.4   November 02, 2020, 12:59:37 PM   UNINSTALL LIST FILES DELETE
6   Forum Width Setting   1.2   November 02, 2020, 13:01:16 PM   UNINSTALL LIST FILES DELETE
18   Ad Managment   3.5d   November 02, 2020, 13:02:18 PM   UNINSTALL LIST FILES DELETE
14   Report BBC   1.0.0   November 02, 2020, 13:03:13 PM   UNINSTALL EMULATING: 2.1RC1 LIST FILES DELETE
4   SMF Gallery Lite   6.0d   November 02, 2020, 13:03:34 PM   UNINSTALL LIST FILES DELETE
10   Google Analytics Code   1.5.1   November 02, 2020, 13:04:06 PM   UNINSTALL EMULATING: 2.0 LIST FILES DELETE
5   EzPortal   4.5.10   November 02, 2020, 13:04:40 PM   UNINSTALL LIST FILES DELETE
16   FancyBox 4 SMF   0.7.2   November 02, 2020, 13:05:35 PM   UNINSTALL LIST FILES DELETE
12   Tapatalk SMF 2.1 Plugin   5.0.1   November 04, 2020, 19:30:34 PM   UNINSTALL LIST FILES DELETE
8   Hide Images From Guests
Title: Re: Hide Images From Guests
Post by: Diego Andrés on November 05, 2020, 12:40:56 PM
Quote from: woolly bugger on November 05, 2020, 10:44:01 AM
installed, get "You cannot see attachments on this board." but no link to log in or sign up...

The mod doesn't block attachments, that's a permission setting in smf, and doesn't generate this message either You cannot see attachments on this board.

Regarding the mod not working would have to test with other mods from your list.
Title: Re: Hide Images From Guests
Post by: Diego Andrés on November 05, 2020, 01:23:34 PM
To make it work with FancyBox 4 SMF (https://custom.simplemachines.org/mods/index.php?mod=3303):

Edit the file Class-FancyBox.php
Code (Find) Select

foreach ($codes as &$code) {
if ($code['tag'] == 'img') {

Code (Replace) Select
foreach ($codes as &$code) {
if ($user_info['is_guest'])
continue;
if ($code['tag'] == 'img') {
Title: Re: Hide Images From Guests
Post by: woolly bugger on November 06, 2020, 08:58:19 PM
Quote from: Diego Andrés on November 05, 2020, 01:23:34 PM
To make it work with fancy box edit Class-FancyBox.php

Code (Find) Select

foreach ($codes as &$code) {


if ($code['tag'] == 'img') {


Code (Replace) Select
foreach ($codes as &$code) {
if ($user_info['is_guest'])
continue;
if ($code['tag'] == 'img') {



Thanks!!!
Title: Re: Hide Images From Guests
Post by: Diego Andrés on April 27, 2022, 06:36:24 PM
- Added german translations provided by @Matthias
Title: Re: Hide Images From Guests
Post by: FredT on July 01, 2022, 08:55:53 AM
v2.1.2

Installed mod, all fine, mod is active. I can not see any settings in my admin menu.
I can also not see the mod is active
Title: Re: Hide Images From Guests
Post by: Arantor on July 01, 2022, 09:09:01 AM
What settings would you expect?

If the mod is installed, images in posts are not visible to guests. There's not really any settings you *could* have, except possibly an off switch - but then you could just as easily uninstall the mod.
Title: Re: Hide Images From Guests
Post by: Diego Andrés on July 01, 2022, 10:28:33 AM
There are no settings afaik, it will hide the images from guests if installed.
Title: Re: Hide Images From Guests
Post by: Arantor on July 01, 2022, 10:37:46 AM
Exactly what I was getting at ;)
Title: Re: Hide Images From Guests
Post by: Diego Andrés on July 01, 2022, 10:39:57 AM
Didn't see your post at all. Clicked the new button and only showed previous page :P
Title: Re: Hide Images From Guests
Post by: FredT on July 07, 2022, 04:31:39 AM
Quote from: Arantor on July 01, 2022, 09:09:01 AMWhat settings would you expect?

If the mod is installed, images in posts are not visible to guests. There's not really any settings you *could* have, except possibly an off switch - but then you could just as easily uninstall the mod.

Oh, ok. I thought guests get a message then, such as:

"You must be logged in or register to see forum content/images"

Title: Re: Hide Images From Guests
Post by: Arantor on July 07, 2022, 05:15:36 AM
They do, as per the screenshot - it's just not configurable.
Title: Re: Hide Images From Guests
Post by: FredT on July 07, 2022, 05:23:53 AM
Quote from: Arantor on July 07, 2022, 05:15:36 AMThey do, as per the screenshot - it's just not configurable.

Good...this message I do miss. So I am not sure the module works
Title: Re: Hide Images From Guests
Post by: Arantor on July 07, 2022, 05:39:56 AM
Assuming you have it installed, do you have a link to a post that a guest can see where an image in the post (not an attachment) should be?
Title: Re: Hide Images From Guests
Post by: forumsbuilder on March 22, 2025, 04:15:23 PM
installed this on a new forum,
indeed there appear to be an issue,

language file says : Guests are not allowed to view images in posts, please <a href="' . $scripturl . '?action=signup">Register</a> or <a href="' . $scripturl . '?action=login">Login</a>';

whereas the actual message is i think the standard message : You cannot view this attachment.
Title: Re: Hide Images From Guests
Post by: Diego Andrés on March 23, 2025, 09:29:15 PM
That would depend on the BBC used, attachments have their own tag.