News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Remove images from Quotes

Started by Chas Large, March 30, 2010, 03:34:14 PM

Previous topic - Next topic

Chas Large

Link to Mod

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
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

RagingHippieHost

Quote from: Chas Large on March 30, 2010, 03:34:14 PM
Link to Mod

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!

Chas Large

You're welcome, glad you found it useful :)
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

aw06

Simple mods like these are what make a community better :P

About the install & test................
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor


aw06

This author only ported it over the rc3 ?
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

No, it is different code to the others. I'm just thinking that we now have three mods that do basically the same thing.

aw06

Quote from: 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.

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

Also this works on Rc3 :P
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

Did you try looking at the ones I linked...?

aw06

Quote from: Arantor on March 31, 2010, 12:16:44 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.
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Arantor

There are 2 mods I linked. Look at both of them.

aw06

Quote from: Arantor on March 31, 2010, 12:22:50 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 ...
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

Now that i look into it , a button would look better . by button i hope they mean thumbnail of quoted image ...
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

aw06

Quote from: Chas Large on March 30, 2010, 03:34:14 PMThis 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 ?
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Chas Large

#14
Quote from: aw06 on March 31, 2010, 12:45:08 PM
Quote from: Chas Large on March 30, 2010, 03:34:14 PMThis 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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

aw06

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
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Chas Large

Quote from: 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
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
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

aw06

:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bruno36

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
Bruno36 the French
SMF 2.0.9

aw06

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';
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Bruno36

I use the French language and I have edit the file Modifications.french-utf8.php
Bruno36 the French
SMF 2.0.9

aw06

Quote from: Bruno36 on April 02, 2010, 04:58:12 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..
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Chas Large

Quote from: 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
Can you upload a copy of your subs.php file so I can inspect the installation.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Bruno36

Bruno36 the French
SMF 2.0.9

Chas Large

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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

kaamaru

Didn't work on my forum. I'm using SMF RC3. The images did not change into a link on any themes.

Chas Large

Quote from: 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.
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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

ACAMS

This works fine in SMF Default theme, but only has (.) in the image link in my other themes



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?

Chas Large

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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

ACAMS

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

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

Reverse chronological order of list Today at 11:52:33 PM
Apply Filter: Only show the error messages of this session adde243825add74ab5e1e77e8a8ff2a5
Apply Filter: Only show the errors of this type Type of error: Undefined

here are the two errors I get.....2 different lines in Subs.php (attached)

Apply Filter: Only show the error messages of this URL http://gametechmods.com/forums/index.php?topic=2411.135
Apply Filter: Only show the errors with the same message 8: Undefined index: remove_image_from_post
Apply Filter: Only show the errors from this file File: /home/gametechmods/gametechmods.com/forums/Sources/Subs.php
Line: 1352       


Apply Filter: Only show the error messages of this URL http://gametechmods.com/forums/index.php?topic=2411.135
Apply Filter: Only show the errors with the same message 8: Undefined index: remove_image_from_post
Apply Filter: Only show the errors from this file File: /home/gametechmods/gametechmods.com/forums/Sources/Subs.php
Line: 1360



I need help correcting this as I am out of ideas.

ACAMS

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.


ACAMS

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.

Chas Large

Well done ACAMS, I guess the index.php file must have been accidentally deleted somehow ??? it's not changed as part of the mod.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

y-chan

This is a very useful mod, thanks!

Just a question ... This mod does not work with images mentioned in a spoiler tag.. something like:

[quote]
[spoiler][img]http://url-to-image[/img][/spoiler]
[/quote]


Is there a way to include the spoiler tag in the subs.php process?

Chas Large

Quote from: 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:

[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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

y-chan

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.

pikeman


Chas Large

Quote from: 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.
Apologies for not responding earlier, I have also received the following via PM, which is a similar issue to your question

Quote from: another memberHello, 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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Robert.


Wiejeben

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

Chas Large

Quote from: 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
Glad you found it useful but sadly there is no way to edit the posts prior to installing the mod other than manual editing.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

PopUpSteve

Interesting mod. I would love to install this but from your last statement:
Quoteno 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.
Steve
"Even a broken clock is right twice a day, unless it's digital."

Chas Large

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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Steve

Is this mod still being maintained? I seem to be having issues with it working since the upgrade to 2.0.7.
DO NOT pm me for support!

Chas Large

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?
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Steve

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
DO NOT pm me for support!

Chas Large

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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Steve

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.
DO NOT pm me for support!

Steve

I did discover something. I use the dQuoteSelection 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. :)
DO NOT pm me for support!

Chas Large

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.
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Steve

No worries my friend. It works as advertised and now that I know what's going on, I'm very happy with it. :D
DO NOT pm me for support!

TrackMustangsOnline


Antechinus

Hey Chas, would you mind if I nicked some of this code to port it to Elk?

Chas Large

Quote from: 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?
Sure, with the usual acknowledgements included, go ahead.

What is Elk (other than a big deer)? ;)
My Modifications :)  My Forum

Please DO NOT PM me with support requests. Post the problem in the appropriate Support Board so everyone can benefit from the advice given.

Antechinus

Thanks.

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

pikeman

Hello, is a modification for 2.1 planned?

gevv

Quote from: pikeman on February 13, 2022, 07:36:02 AMHello, is a modification for 2.1 planned?

Hi,

remove_image_from_quotes_modification.xml

search

'content' => '$1',
replace

'content' => '<div>$1</div>',
ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

pikeman


gevv

ElkArte is a modern, powerful community building forum software. https://www.elkarte.net/

Advertisement: