Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Chas Large on March 30, 2010, 03:34:14 PM

Title: Remove images from Quotes
Post by: Chas Large on March 30, 2010, 03:34:14 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2430)

Remove Images from quotes

This modification is based on the [TIP] by Heavyccasey on the support forum.

This mod removes images from quoted text and leaves a link to the image.
Clicking the link restores the removed image.

Version History:
1.4 Final installer bug fix.
1.3 Minor bug fix on installer.
1.2 Included Skip for Language support and corrected code for xHtml validation.
1.1 Included reference to text in modifications list and Skip on error for language english_british.
1.0 Mod tested and working on two forums.

Please use the support link if required.

Regards

Chas Large
March 2010
Title: Re: Remove images from Quotes
Post by: RagingHippieHost on March 30, 2010, 10:46:48 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=2430)

Remove Images from quotes

This modification is based on the [TIP] by Heavyccasey on the support forum.

This mod removes images from quoted text and leaves a link to the image.
Clicking the link restores the removed image.

Version History:
1.4 Final installer bug fix.
1.3 Minor bug fix on installer.
1.2 Included Skip for Language support and corrected code for xHtml validation.
1.1 Included reference to text in modifications list and Skip on error for language english_british.
1.0 Mod tested and working on two forums.

Please use the support link if required.

Regards

Chas Large
March 2010

awesome mod! thanks!
Title: Re: Remove images from Quotes
Post by: Chas Large on March 31, 2010, 04:58:16 AM
You're welcome, glad you found it useful :)
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 11:55:07 AM
Simple mods like these are what make a community better :P

About the install & test................
Title: Re: Remove images from Quotes
Post by: Arantor on March 31, 2010, 11:59:53 AM
You may want to have a chat with the other mod authors... http://custom.simplemachines.org/mods/index.php?mod=1041 and http://custom.simplemachines.org/mods/index.php?mod=1188
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 12:10:17 PM
This author only ported it over the rc3 ?
Title: Re: Remove images from Quotes
Post by: Arantor on March 31, 2010, 12:12:14 PM
No, it is different code to the others. I'm just thinking that we now have three mods that do basically the same thing.
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 12:13:31 PM
No, it is different code to the others. I'm just thinking that we now have three mods that do basically the same thing.

really, this one expands the image inline when clicked ... AFAIN the others only give the image url ....

Also this works on Rc3 :P
Title: Re: Remove images from Quotes
Post by: Arantor on March 31, 2010, 12:16:44 PM
Did you try looking at the ones I linked...?
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 12:22:18 PM
Did you try looking at the ones I linked...?

I have one installed on my 1.1.x ... it not even puts are url most of the time, it just says quoted image removed.
Title: Re: Remove images from Quotes
Post by: Arantor on March 31, 2010, 12:22:50 PM
There are 2 mods I linked. Look at both of them.
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 12:38:09 PM
There are 2 mods I linked. Look at both of them.

Yeah, one says it put's a button... but I'm on Rc3 hence whey i chose this mod ...
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 12:40:16 PM
Now that i look into it , a button would look better . by button i hope they mean thumbnail of quoted image ...
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 12:45:08 PM
This mod removes images from quoted text and leaves a link to the image.
Clicking the link restores the removed image.

Hey Chas, mod installed ok, no error in logs, however i don't see the little expand up icon you have in your screenshot,

http://custom.simplemachines.org/mods/index.php?action=download;mod=2430;id=133819;image

Also i don't see any image file for it in the package file, did you remove it ?
Title: Re: Remove images from Quotes
Post by: Chas Large on March 31, 2010, 02:47:49 PM
This mod removes images from quoted text and leaves a link to the image.
Clicking the link restores the removed image.

Hey Chas, mod installed ok, no error in logs, however i don't see the little expand up icon you have in your screenshot,

http://custom.simplemachines.org/mods/index.php?action=download;mod=2430;id=133819;image

Also i don't see any image file for it in the package file, did you remove it ?
No, sorry, should have been more careful with my screen shot, that comes from a FireFox add-on.

[Edit] Actually it's a Greasemonkey Script for FireFox, so if you're using both of those you can install and make use of it yourself, see attached.
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 03:18:32 PM
you mod was conflicting with post rating mod ... or it was conflicting with yours, either way i removed quoted images, take a look here
http://www.simplemachines.org/community/index.php?topic=344748.msg2563330#msg2563330
Title: Re: Remove images from Quotes
Post by: Chas Large on March 31, 2010, 03:22:35 PM
you mod was conflicting with post rating mod ... or it was conflicting with yours, either way i removed quoted images, take a look here
http://www.simplemachines.org/community/index.php?topic=344748.msg2563330#msg2563330
Sorry about that aw06. Sadly I can't possibly check compatibility with every other mod but it probably could be hard coded by hand and as Arantor has mentioned, there are other mods that do similar things to mine, perhaps one of them won't conflict.

Chas
Title: Re: Remove images from Quotes
Post by: aw06 on March 31, 2010, 04:48:51 PM
ok, will look into it ..
Title: Re: Remove images from Quotes
Post by: Bruno36 on April 02, 2010, 04:04:29 AM
Hello!

The mod does not work on my forum.
When I quote a message I still see the image
http://www.scooter-chinois-4t.com/poubelle/t3428/new/#new

login: invite
Passe: 123456
Title: Re: Remove images from Quotes
Post by: aw06 on April 02, 2010, 04:18:19 AM
Are you using English-utf8 ? if so ad the edits in /Themes/default/languages/Modifications.english-utf8.php

Code: (Find at the end of the file) [Select]
?>
Code: (Add Before:) [Select]
$txt['remove_image_from_post'] = 'Image removed from quote';
Title: Re: Remove images from Quotes
Post by: Bruno36 on April 02, 2010, 04:58:12 AM
I use the French language and I have edit the file Modifications.french-utf8.php
Title: Re: Remove images from Quotes
Post by: aw06 on April 02, 2010, 05:31:34 AM
I use the French language and I have edit the file Modifications.french-utf8.php

Ok ok, will have to wait for mod author to respond then..
Title: Re: Remove images from Quotes
Post by: Chas Large on April 02, 2010, 07:41:05 AM
Hello!

The mod does not work on my forum.
When I quote a message I still see the image
http://www.scooter-chinois-4t.com/poubelle/t3428/new/#new

login: invite
Passe: 123456
Can you upload a copy of your subs.php file so I can inspect the installation.
Title: Re: Remove images from Quotes
Post by: Bruno36 on April 02, 2010, 09:18:21 AM
Merci
Title: Re: Remove images from Quotes
Post by: Chas Large on April 02, 2010, 10:16:00 AM
Hello Bruno,

I have checked the file and the mod is installed correctly in the right place. However, I regret that I am unable to test it due to the other mods you have installed there. One is AEVA Gallery I believe.

As I mentioned earlier in this topic, it would be impossible for me to check and test compatibility with every other mod available.

There are really only two things you can do.
1. Remove other mods that are installed in the subs.php file to see which one is affecting this mod, it may be one of more are causing the conflict and I regret I am unable to troubleshoot conflicts with other mods. If you discover which one is stopping this mod from operating, let me know and I'll see if I can produce a workaround.
2. Remove my mod and try one of the others mentioned by Arantor above.
Title: Re: Remove images from Quotes
Post by: kaamaru on January 12, 2011, 10:55:56 AM
Didn't work on my forum. I'm using SMF RC3. The images did not change into a link on any themes.
Title: Re: Remove images from Quotes
Post by: Chas Large on January 12, 2011, 11:48:02 AM
Didn't work on my forum. I'm using SMF RC3. The images did not change into a link on any themes.
This mod has been tested on RC2/3 and 4 and works on many different forums so I can only conclude there was either an error when the mod was installed or it is clashing with another mod.

If you follow the manual instructions from the mod page, you can check if the items were installed correctly.
Title: Re: Remove images from Quotes
Post by: ACAMS on January 14, 2011, 09:30:37 PM
This works fine in SMF Default theme, but only has (.) in the image link in my other themes
 
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2FPics%2Fquotetest.jpg&hash=7466efaef5af4e14347ead8c8af5bab7)
 
The other themes don't have a Modifications.english.php in the Themes/Other Theme/languages folder.
 
Anybody have any idea what I need to do to fix this?
Title: Re: Remove images from Quotes
Post by: Chas Large on January 15, 2011, 04:51:03 AM
The mod picks up the text to be placed in the quote from the default theme's language Modifications.english.php file, there should be no need for it to be elsewhere. If you are not using the English language then you may need to insert the text into the Modifications.yourlanguage.php file in the default/language directory.
Title: Re: Remove images from Quotes
Post by: ACAMS on January 15, 2011, 03:15:35 PM
I have only english, and have double quadruple checked all the files and they are where they should be.
 
I made a topic in SMF 2.x Support http://www.simplemachines.org/community/index.php?action=post;msg=2914702;topic=417311.0 (http://www.simplemachines.org/community/index.php?action=post;msg=2914702;topic=417311.0)
 
About error codes I was getting...... had 15,873 this AM
 
 
 
I installed Remove Image From Quote mod only like 2-3 hours ago and have 3253 errors already.
 
 
Here is a link to the mod.....I had to install by hand  http://custom.simplemachines.org/mods/index.php?mod=2430 (http://custom.simplemachines.org/mods/index.php?mod=2430)
 
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Fsort_down.gif&hash=7b4e488d1d7280fe65dcb6ae255f3e9f) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog) Today at 11:52:33 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=session;value=adde243825add74ab5e1e77e8a8ff2a5) adde243825add74ab5e1e77e8a8ff2a5
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=error_type;value=undefined_vars) Type of error: Undefined
 
here are the two errors I get.....2 different lines in Subs.php (attached)
 
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=url;value=P3RvcGljPTI0MTEuMTM1) http://gametechmods.com/forums/index.php?topic=2411.135 (http://gametechmods.com/forums/index.php?topic=2411.135)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=message;value=ODogVW5kZWZpbmVkIGluZGV4OiAgcmVtb3ZlXF9pbWFnZVxfZnJvbVxfcG9zdA==) 8: Undefined index: remove_image_from_post
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=file;value=L2hvbWUvZ2FtZXRlY2htb2RzL2dhbWV0ZWNobW9kcy5jb20vZm9ydW1zL1NvdXJjZXMvU3Vicy5waHA=) File: /home/gametechmods/gametechmods.com/forums/Sources/Subs.php (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;file=L2hvbWUvZ2FtZXRlY2htb2RzL2dhbWV0ZWNobW9kcy5jb20vZm9ydW1zL1NvdXJjZXMvU3Vicy5waHA=;line=1352)
Line: 1352       
 
 
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=url;value=P3RvcGljPTI0MTEuMTM1) http://gametechmods.com/forums/index.php?topic=2411.135 (http://gametechmods.com/forums/index.php?topic=2411.135)
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=message;value=ODogVW5kZWZpbmVkIGluZGV4OiAgcmVtb3ZlXF9pbWFnZVxfZnJvbVxfcG9zdA==) 8: Undefined index: remove_image_from_post
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fgametechmods.com%2Fforums%2FThemes%2FHeadline%2Fimages%2Ffilter.gif&hash=614a8a2e67ec85edf2b4bdf0e8c1fbc8) (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;desc;filter=file;value=L2hvbWUvZ2FtZXRlY2htb2RzL2dhbWV0ZWNobW9kcy5jb20vZm9ydW1zL1NvdXJjZXMvU3Vicy5waHA=) File: /home/gametechmods/gametechmods.com/forums/Sources/Subs.php (http://gametechmods.com/forums/index.php?action=admin;area=logs;sa=errorlog;file=L2hvbWUvZ2FtZXRlY2htb2RzL2dhbWV0ZWNobW9kcy5jb20vZm9ydW1zL1NvdXJjZXMvU3Vicy5waHA=;line=1352)
Line: 1360
 
 
 
I need help correcting this as I am out of ideas.
Title: Re: Remove images from Quotes
Post by: ACAMS on January 15, 2011, 03:40:42 PM
Here is my Subs.php.....does everything look OK, as I had to copy to Word, then move to Notepad++ to get it to line up right, and then I still had to move the lines up.
 
 
Title: Re: Remove images from Quotes
Post by: ACAMS on January 15, 2011, 06:28:37 PM
I fixed it by adding an index.php to the Languages folder of the themes that were setting off the error.
 
 
THANKS for the help......problem solved and all is working properly now.....like this mod as I have idiots that will quote LONG pages of images.
Title: Re: Remove images from Quotes
Post by: Chas Large on January 16, 2011, 02:08:58 AM
Well done ACAMS, I guess the index.php file must have been accidentally deleted somehow ??? it's not changed as part of the mod.
Title: Re: Remove images from Quotes
Post by: y-chan on February 01, 2011, 01:33:35 AM
This is a very useful mod, thanks!

Just a question ... This mod does not work with images mentioned in a spoiler tag.. something like:
Code: [Select]
[quote]
[spoiler][img]http://url-to-image[/img][/spoiler]
[/quote]

Is there a way to include the spoiler tag in the subs.php process?
Title: Re: Remove images from Quotes
Post by: Chas Large on February 01, 2011, 03:48:05 AM
This is a very useful mod, thanks!

Just a question ... This mod does not work with images mentioned in a spoiler tag.. something like:
Code: [Select]
[quote]
[spoiler][img]http://url-to-image[/img][/spoiler]
[/quote]

Is there a way to include the spoiler tag in the subs.php process?
Sorry, don't quite understand the question. Do you want to install the spoiler mod or modify the remove quotes mod to make it work within a spoiler tag?
From my experience, the BBC parser has difficulty with some combinations of codes, even thngs like colour+bold+size don't always work. It could be difficult.
Title: Re: Remove images from Quotes
Post by: y-chan on February 01, 2011, 04:38:57 AM
Whoops! ... I'm sorry, I did not know how to explain.

I have installed the mod Spoiler and when the image is within the label, the mod does not work to remove images.
likewise, you have already cleared my doubt. I see that it would be difficult to change this mod to work with the mod Spoiler.

thank you very much, I keep looking.
Title: Re: Remove images from Quotes
Post by: pikeman on December 28, 2011, 08:57:13 AM
Great Mod, thank you very much!(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.vukovisadunava.com%2FSmileys%2Fmojismajliji%2Fhi.gif&hash=8a6e74dc67c9d83b41ffb37a0f1679e7)
Title: Re: Remove images from Quotes
Post by: Chas Large on May 01, 2012, 03:02:38 AM
Whoops! ... I'm sorry, I did not know how to explain.

I have installed the mod Spoiler and when the image is within the label, the mod does not work to remove images.
likewise, you have already cleared my doubt. I see that it would be difficult to change this mod to work with the mod Spoiler.

thank you very much, I keep looking.
Apologies for not responding earlier, I have also received the following via PM, which is a similar issue to your question

Quote from: another member
Hello, I make use of its modification referring to remove images of citations ... But I noticed that in an image using a tag like this:

Code: [Select]

[center] Image [/center]


the image is still visible in the quote ... what do I do?

grateful for the attention :)

Where two mods affect an image in a post, the one that surrounds the image wins. My mod cannot remove an image that is within the tags of another BBCode. Sorry.
Title: Re: Remove images from Quotes
Post by: Robert. on May 01, 2012, 03:56:20 AM
Nice mod :)
Title: Re: Remove images from Quotes
Post by: Wiejeben on November 28, 2012, 07:22:16 AM
Thank you very much :) This modification is really useful, it keeps everything a lot cleaner.
But is there a way to apply this to all excising posts? If not, well, nah don't mind it it's fine :P

Greetings,
Maarten
Title: Re: Remove images from Quotes
Post by: Chas Large on November 28, 2012, 07:26:09 AM
Thank you very much :) This modification is really useful, it keeps everything a lot cleaner.
But is there a way to apply this to all excising posts? If not, well, nah don't mind it it's fine :P

Greetings,
Maarten
Glad you found it useful but sadly there is no way to edit the posts prior to installing the mod other than manual editing.
Title: Re: Remove images from Quotes
Post by: PopUpSteve on December 27, 2012, 04:30:03 PM
Interesting mod. I would love to install this but from your last statement:
Quote
no way to edit the posts prior to installing the mod
it makes me think that you are modifying the text at the time of the post. Wouldn't be better to modify the text as it is being displayed, on the fly as it were and not changing the original? That way it would work with all existing posts, no matter when they were made and allow for changes to your mod in the future.
Title: Re: Remove images from Quotes
Post by: Chas Large on December 27, 2012, 05:45:28 PM
A good point and you're quite right, the mod removes the image from a quoted post on a post by post basis rather than by running a dB query to achieve the same effect.

If you care to come up with the dB query code to do it, I'm happy to modify the mod and give you credit for that work.

Personally I don't think it's necessary as it would involve running the query for every quote made to check for an image and remove it, this might push up the overhead on the server somewhat.
Title: Re: Remove images from Quotes
Post by: Steve on January 28, 2014, 08:31:26 PM
Is this mod still being maintained? I seem to be having issues with it working since the upgrade to 2.0.7.
Title: Re: Remove images from Quotes
Post by: Chas Large on January 30, 2014, 07:36:56 AM
Maintained? no, not unless changes in SMF 2.0.xx cause any issues, it works perfectly in 2.0.7. Could be clashing with other mods? What are the symptoms and what other mods do you have installed?
Title: Re: Remove images from Quotes
Post by: Steve on January 30, 2014, 09:53:37 AM
Thanks for responding. I actually fixed it this morning. I parsed the code where you download the mod from and in the modifications.english.php file, somehow the line that was supposed to be right above the end code wasn't there. I found it several lines back, moved it to where it was supposed to be, and voila! Works like a charm now.

Don't know why and I'm not sure I care as long as it works. lol :D
Title: Re: Remove images from Quotes
Post by: Chas Large on January 30, 2014, 10:08:07 AM
Glad you got it working. It's common for mods to add text code to the end of that file so my best guess is that another mod added text to the end and somehow corrupted the file.
Title: Re: Remove images from Quotes
Post by: Steve on January 30, 2014, 10:25:37 AM
Well, that was short-lived. It's now not working again. Good grief. I have a lot of mods installed so it could be cumbersome to try and figure out which mod is conflicting. I'll dig some more but if you still want a list I'll give it to you.
Title: Re: Remove images from Quotes
Post by: Steve on January 30, 2014, 11:12:27 AM
I did discover something. I use the dQuoteSelection (http://custom.simplemachines.org/mods/index.php?mod=2086) mod and if there are center tags around the image, it doesn't work. Remove the center tags in the quote and it works fine. :)
Title: Re: Remove images from Quotes
Post by: Chas Large on January 30, 2014, 03:19:56 PM
Yes, that would do it. My mod is very simple and to make it try and look for all possible combinations of BBCode around an image would make it difficult and slow. So it is what it is I'm afraid. Sometimes mods clash and there is little we can do about it given how many mods there are available. It's impossible to test a mod with all other mods.
Title: Re: Remove images from Quotes
Post by: Steve on January 30, 2014, 05:53:12 PM
No worries my friend. It works as advertised and now that I know what's going on, I'm very happy with it. :D
Title: Re: Remove images from Quotes
Post by: TrackMustangsOnline on September 24, 2014, 12:06:02 AM
Nice mod, thanks!
Title: Re: Remove images from Quotes
Post by: Antechinus on September 24, 2016, 06:43:09 PM
Hey Chas, would you mind if I nicked some of this code to port it to Elk?
Title: Re: Remove images from Quotes
Post by: Chas Large on September 25, 2016, 01:41:39 AM
Hey Chas, would you mind if I nicked some of this code to port it to Elk?
Sure, with the usual acknowledgements included, go ahead.

What is Elk (other than a big deer)? ;)
Title: Re: Remove images from Quotes
Post by: Antechinus on September 25, 2016, 02:19:42 AM
Thanks.

It's forum software. Forked from SMF 2.1 Alpha ages ago. ;)