Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: serval on January 10, 2019, 06:51:06 AM

Title: Option to drag and drop URL / hyperlink?
Post by: serval on January 10, 2019, 06:51:06 AM
My apologies if this is in the wrong board.




When creating a post, if you click on the button to "Insert Hyperlink" :

(https://static.simplemachinesweb.com/smf/default/images/bbc/url.gif)

you get the following :

[url][/url]


I use this function massively. My thoughts:


1] Would it be an easy matter to change this to:

[url=] [/url]

?

Then I could more quickly cut and paste an URL into it and format it correctly, for example:

[url=fictional-news.com]Fictional News[/url]





2] Better still, I was a member of a film forum (now defunct) where, when you copied and pasted an URL name, such as:

fictional-news.com

the link would automatically be formatted and inserted, with the given site name, e.g.

Fictional News 

I suggested this change to the chief techie of our coin forum, but he didn't know how to do it. Does SMF have an app to allow this?

Title: Re: Option to drag and drop URL / hyperlink?
Post by: serval on January 10, 2019, 01:07:36 PM
In my fictional example, I forgot to add the starting code, of course:

[url=https://fictional-news.com]Fictional News[/url]
Title: Re: Option to drag and drop URL / hyperlink?
Post by: serval on January 10, 2019, 02:31:53 PM
Now that I'm in the right board and have read your notes, I'll add that the coin forum of which I am a member uses SMF 2.0.15.
Title: Re: Option to drag and drop URL / hyperlink?
Post by: Kindred on January 11, 2019, 03:40:34 AM
https://github.com/Spuds/SMF-Descriptive-Links
Title: Re: Option to drag and drop URL / hyperlink?
Post by: serval on January 12, 2019, 07:42:04 PM
Thank you very much, Kindred. I will show this to our chief techie on the coin forum.
Title: Re: Option to drag and drop URL / hyperlink?
Post by: izotz on January 13, 2019, 11:17:24 AM
Quote from: Kindred on January 11, 2019, 03:40:34 AM
https://github.com/Spuds/SMF-Descriptive-Links

I was having a look at this, as I'd like to have it in our forum. I could only a page describing an older version of the mod :
http://www.simplemachines.org/community/index.php?topic=470471.0
That links to a mod that doesn't exist. So I wonder where I can download the packaged version in order to install it. Would it be as simple as downloading the files in Github and zip them?

On the other hand, that code has not been updated for 5 years, so I can't tell if it works with the latest versions of SMF software. Does anybody know if this would work with 2.0.15?
Title: Re: Option to drag and drop URL / hyperlink?
Post by: Kindred on January 13, 2019, 12:36:31 PM
Download from git...

And yes, we use it on fx-sabers
Title: Re: Option to drag and drop URL / hyperlink?
Post by: izotz on January 13, 2019, 01:36:55 PM
I got to download it, zip it, and install it. It looks like it is working. We'll give it a try.
Thanks for the info.
Title: Re: Option to drag and drop URL / hyperlink?
Post by: serval on January 13, 2019, 02:28:48 PM
Well, we just tried it. A lot of the time it worked fine, but not always. Izotz, the techie, noted this:

There was something in its configuration preventing to act on any URL containing the following :
home,index,page title,default,login,logon,welcome,ebay

I tried it with our home page, but just got this:

http://www.worldofcoins.eu/forum/index.php

I noted:

The code needs tweaking.  It dislikes certain unusual URL endings.

The code simply needs to take the title from the open tab - when you have the tab open and copy the url.

I suppose that with a few judicious "IF" clauses, or whatever this language uses, it could be made to work in all cases - but that's not something I know how to do.  :(

Title: Re: Option to drag and drop URL / hyperlink?
Post by: Kindred on January 13, 2019, 02:33:17 PM
No...  that might be whatbyour "techie" thinks, but that is not what this mod (nor any of the others) do, and is not at all how they work.

Title: Re: Option to drag and drop URL / hyperlink?
Post by: Shambles on January 13, 2019, 02:40:49 PM
Quote from: serval

There was something in its configuration preventing to act on any URL containing the following :
home,index,page title,default,login,logon,welcome,ebay


That list is in the mod's configuration.
Title: Re: Option to drag and drop URL / hyperlink?
Post by: serval on January 13, 2019, 02:47:29 PM
Thank you for all your help. Unfortunately our forum administrator has had to call time on it, as there is more pressing work elsewhere on the forum for our "techie". With a little more time we could probably have worked it out and tweaked the configuration, as you say, but it was not to be.