Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Robbo_ on August 29, 2009, 06:07:09 PM

Title: User Toggle Images
Post by: Robbo_ on August 29, 2009, 06:07:09 PM
User Toggle Images





Written by: Arantor (http://www.simplemachines.org/community/index.php?action=profile;u=53626) (my other mods (http://custom.simplemachines.org/mods/index.php?action=profile;u=53626))   Current version: 1.3
Updates: Arantor's Developments (http://ara.ixos.org/)
Suitable for: 1.1.10, 1.1.11, 2.0 RC1.2, 2.0 RC2Supported languages: (http://www.simplemachines.org/site_images/lang/english.gif) (http://www.simplemachines.org/site_images/lang/english_british.gif)

Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2099) | Mod support topic (http://www.simplemachines.org/community/index.php?topic=333601.0) | Mod bugtracker (http://ara.ixos.org/index.php?project=15) | Donate (https://www.paypal.com/cgi-bin/webscr&cmd=_s-xclick&hosted_button_id=7164850)





Summary

This mod allows the user to selectively disable pictures in profiles - for users with slow connections, this enables them to not see all the pictures embedded into the page, but have a link to them instead.

Additionally it allows them to turn off attachment thumbnails.

Both options are visible in Look and Layout Preferences, available from the user profile area.

Installation

Package Manager should work in most cases. If you need to make any edits, the full list can be obtained from the Parse function on the right.

Useful links
Manual Installation Of Mods (http://docs.simplemachines.org/index.php?topic=402)
How Do I Modify Files? (http://www.simplemachines.org/community/index.php?topic=24110.0)

Support

Questions should be address to the mod support topic (http://www.simplemachines.org/community/index.php?topic=333601.0). Anything that is a bug or feature request can additionally be reported to the mod bugtracker (http://ara.ixos.org/index.php?project=15).

Updating

Please remove earlier versions before installing the current version.

Changelog

1.3 - 29 December 2009
Added support for 1.1.11.
Also fixed stupid bug in English/English-British where it was applying edits twice.

1.2 - 1 November 2009
Added support for 2.0 RC2.

1.1 - 2 September 2009
Added support for hiding attachment pictures too.

1.0 - 23 August 2009
First release

Files modified by User Toggle Images

Sources/Subs.php
Sources/Display.php
Themes/yourtheme/Settings.template.php
Themes/yourtheme/Profile.template.php
Title: Re: User Toggle Images
Post by: Blinker on August 29, 2009, 09:43:47 PM
Hi Arantor, nice mod, good idea.

Installed perfectly but it doesn't seem to work for attached pics.

I've flagged the option in my profile and saved but every topic I check that has attached pics still displays them but if they're hosted elsewhere then a link displays.

Am I missing something? Is it supposed to only work for offsite images inside [img] code? 1.1.10 btw.
Title: Re: User Toggle Images
Post by: Arantor on August 29, 2009, 09:46:15 PM
Are they attached or are they embedded with [img] tags?

Also, is it the default theme?
Title: Re: User Toggle Images
Post by: Blinker on August 29, 2009, 10:03:11 PM
The attached images still display but externally embedded ones with [img] tags don't.

I use a custom theme (Mesh).

Title: Re: User Toggle Images
Post by: Arantor on August 29, 2009, 10:05:54 PM
Then it's working precisely as designed. It turns off embedded images with img tags. Since attachments are not embedded with img tags, it won't turn them off.
Title: Re: User Toggle Images
Post by: Blinker on August 29, 2009, 10:11:27 PM
OK thanks Arantor. I wasn't 100% clear on that, I thought it would disable all images.
Title: Re: User Toggle Images
Post by: Arantor on August 29, 2009, 10:13:32 PM
My mod description wasn't very clear, true enough.

I've logged it into the bug tracker to add it as an enhancement to also allow users to hide attachment images too.
Title: Re: User Toggle Images
Post by: Blinker on August 29, 2009, 10:15:51 PM
Quote from: Arantor on August 29, 2009, 10:13:32 PMallow users to hide attachment images too.

That would be awesome dude. It would make the mod a more "complete" bandwidth saver for those still on dialup (poor bastards).
Title: Re: User Toggle Images
Post by: alex30 on August 30, 2009, 12:42:16 AM
Good addition to users' profiles. Thanks.
Title: Re: User Toggle Images
Post by: Rohan_ on August 30, 2009, 01:47:48 AM
Thanks You Arantor Bro
Title: Re: User Toggle Images
Post by: Sabre™ on August 31, 2009, 05:19:51 PM
Very nice :)
Thank You
Title: Re: User Toggle Images
Post by: bbmtalk on August 31, 2009, 10:35:05 PM
Yes thank you for this!!
Title: Re: User Toggle Images
Post by: Arantor on September 02, 2009, 09:10:42 AM
I have updated this today to include the ability to optionally hide attachments too.
Title: Re: User Toggle Images
Post by: bullbreedluverz on September 02, 2009, 05:06:05 PM
nice 1, i'll add this to the list of mods for my new forum now attatchments have been added
Title: Re: User Toggle Images
Post by: Arantor on September 02, 2009, 06:07:37 PM
Excellent to hear, thanks :)

As ever, if any new features are requested, please either post here or on the bugtracker as linked in the first post and I'll see what I can do about it.
Title: Re: User Toggle Images
Post by: Antechinus on October 23, 2009, 09:12:50 PM
Just spotted this and I can see it being handy for some people. Question: does this just hide the images or does it actually disable loading them? I mean is it merely aesthetic or does it actually eliminate download/caching time for linked images?
Title: Re: User Toggle Images
Post by: Arantor on October 23, 2009, 09:15:38 PM
Merely aesthetic.

What SMF does normally: the resolution of 'loading time' is actually done on post saving; it figures out on save whether it should resize the image but it doesn't actually resize it. It simply encapsulates the original image in an [img width=xyz height=xyz]img url[/img] tag. Meaning that it will load the full picture but the browser will resize it on display.

Without ripping apart the code that SMF uses for this (and effectively forcing it to download and store as an attachment, rather than download just to gather sizes) you can't really get around it much.
Title: Re: User Toggle Images
Post by: Antechinus on October 23, 2009, 09:26:07 PM
Ok, so it wont really benefit anyone on a slower connection then. To really speed up the rendering of pages it would need to stop the image being downloaded and cached to start with.
Title: Re: User Toggle Images
Post by: Arantor on October 23, 2009, 09:26:59 PM
Yup. That is actually an option in the admin panel, to disable the resizing in the first place.
Title: Re: User Toggle Images
Post by: Antechinus on October 23, 2009, 10:10:02 PM
I'm not talking about resizing. I'm talking about completely blocking images from being downloaded and cached by the user's browser.
Title: Re: User Toggle Images
Post by: Antechinus on October 23, 2009, 10:12:29 PM
This is a problem not just for people on slow connections but also for people who may be accessing sites from work and have to worry about being hit for downloading NSFW images. Even if the image does not display on their screen it is still downloaded by their browser and they could well be subject to disciplinary action if anyone checked up on this.
Title: Re: User Toggle Images
Post by: Arantor on October 23, 2009, 10:19:54 PM
Oh, then this mod is what you want. It physically prevents the <img> being generated.
Title: Re: User Toggle Images
Post by: Touti on December 01, 2009, 09:52:47 PM
Arantor,

This mod is not compatible with 1.1.11 because of the changes it makes in Subs.php.  I was unable to install 1.1.11 until I removed it and now I can't re-install it because it no longer find the strings to modify in Subs.php

Title: Re: User Toggle Images
Post by: Arantor on December 01, 2009, 09:55:07 PM
That's because I haven't had time to update it for 1.1.11 yet. Considering that it's only been out a couple of hours, and I have 20-odd mods to review and retest, I think I've done rather well in updating most of them. I'll fix this one shortly.
Title: Re: User Toggle Images
Post by: Touti on December 01, 2009, 09:58:21 PM
I apologize if my post sounded like I was complaining, I assure you it wasn't the case.  I posted because it took me a while to figure out which mod was stopping me from installing 1.1.11 and I thought it could help others who have this mod installed.
Title: Re: User Toggle Images
Post by: Arantor on December 01, 2009, 09:59:20 PM
Ah, yeah - I'm sorry, it's late here and we had a few problems with the initial package.

Unfortunately many many mods are going to be in the same way and I expect to see lots of similar issues as people upgrade (as 1.1.11 is a huge patch)
Title: Re: User Toggle Images
Post by: Shannar on December 08, 2009, 09:42:46 AM
Quote from: Arantor on December 01, 2009, 09:55:07 PM
I'll fix this one shortly.

Sorry, but how quickly it can be?
Title: Re: User Toggle Images
Post by: Arantor on December 08, 2009, 09:48:55 AM
Sorry, I have had more important things going on than fixing a mod I'm still trying to give away.

Will be fixed 'soon', sorry can't give a better timeframe than that.
Title: Re: User Toggle Images
Post by: Arantor on December 29, 2009, 07:20:31 AM
I finally fixed this one for 1.1.11, will upload shortly.
Title: Re: User Toggle Images
Post by: Eclipse16V on January 11, 2010, 03:52:10 AM
Nice Mod

Here the German Lang
// User Toggle Images MOD
$txt['hide_img_contents'] = 'Keine Bilder in Beiträgen anzeigen, dafür Links.';
$txt['hide_img_attachments'] = 'Keine Vorschaubilder für Dateianhänge in Beiträgen anzeigen, dafür Links.';
Title: Re: User Toggle Images
Post by: Eclipse16V on March 15, 2010, 01:34:34 AM
Nice Mod

Please update it for SMF 2.0RC3  ;)

Thanks
Title: Re: User Toggle Images
Post by: c23_Mike on April 05, 2010, 04:37:58 PM
Hi there !

Yes indeed, RC3 support is also what i wish!