ElkArte Community

Extending Elk => Addons => Addons ideas and questions => Topic started by: Antechinus on September 24, 2016, 11:11:11 pm

Title: Turn quoted images into lynx
Post by: Antechinus on September 24, 2016, 11:11:11 pm
This mod exists for SMF and I've always found it handy. So if you post an image you get the normal:

(http://ourbeautifulworldanduniverse.com/wp-content/uploads/2013/05/Lynx-in-winter-OWVg-r.jpg)

But if you then quote the post you get something like:

With the link acting as the toggle for a spoiler.

So the code for this is pretty basic. That's no drama. The catch is that if you modern kids with all yer new-fangled stuffz are wanting everyone to be hookers then how do you propose to deal with a mod like this, which AFAICT is always going to require a direct edit to the quote tags in Subs.php?

I have no problem editing the quote tags code directly via the install.xml, but I assume somebody is going to freak out about that. So, without making things insanely complex, is there a better way?
Title: Re: Turn quoted images into lynx
Post by: ahrasis on September 24, 2016, 11:33:44 pm
I have no problem editing core file, with or without install.xml. When it is your forum, you can do whatever you think is right to do.
Title: Re: Turn quoted images into lynx
Post by: Antechinus on September 24, 2016, 11:54:53 pm
Sure, but I'm thinking of packaging this up as a mod, so am wondering if anyone has a better idea.
Title: Re: Turn quoted images into lynx
Post by: ahrasis on September 25, 2016, 04:40:47 am
I think there is some bbc tag addons around for samples on how you can use hook to add some new tags. My guess will be, you can use the same hook to overwrite the quote tag code in Subs.php with whatever code you wish to replace it.

Well this kinda reminds me of my unfinished indent bbc addon as well, which I think I will never finish it as adding simple indent buttons is not so easy as the way it was back in SMF. It's kinda "crazy" and "stressful", so I already gave up on completing it. Besides, nobody will ever need it.
Title: Re: Turn quoted images into lynx
Post by: emanuele on September 25, 2016, 06:08:49 am
Quote from: Antechinus – So, without making things insanely complex, is there a better way?
/me is insane so emanuele is ruled out. :P

At the moment, the only way I know is the one I used in the nofollow addon: loop over the whole array of codes, identify the quote and do some magic. What sort of magic depends on what is needed.
Title: Re: Turn quoted images into lynx
Post by: Antechinus on September 25, 2016, 04:40:01 pm
Had a look at the code for that mod. Looks gruesome. :D

I think I'll just do it the old way for now.
Title: Re: Turn quoted images into lynx
Post by: badmonkey on September 25, 2016, 06:55:21 pm
Hhmmm....this are looking like nice mod!  Especially with everyone are using mobiles so much now.   :D
Title: Re: Turn quoted images into lynx
Post by: radu81 on September 25, 2016, 07:12:55 pm
Quote from: Antechinus – This mod exists for SMF and I've always found it handy. So if you post an image you get the normal:

(http://ourbeautifulworldanduniverse.com/wp-content/uploads/2013/05/Lynx-in-winter-OWVg-r.jpg)

Just a test
Title: Re: Turn quoted images into lynx
Post by: Antechinus on September 25, 2016, 07:46:06 pm
Umm, the mod isn't written yet. Not much point trying to test it here. ;)
Title: Re: Turn quoted images into lynx
Post by: radu81 on September 26, 2016, 03:06:08 am
I know, but I don't remember how the images quoted are displayed into elkarte. On my forum 90% or more of the images are inserted as attachments and I use ILA addon, and quoted images are not working with this addon
Title: Re: Turn quoted images into lynx
Post by: ahrasis on September 26, 2016, 08:56:56 am
I think it should be reported in that addon's thread so that its author can look into it.
Title: Re: Turn quoted images into lynx
Post by: radu81 on September 26, 2016, 09:13:30 am
ILA addon needs some improvements, and inline attachments are into the core of Elkarte 1.1, I don't want to stress the developers since it's not a relevant function for me, I prefer to wait the 1.1 stable
Sorry for the off-topic