Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3313)
Descriptive Links v1.0
By Spuds (http://custom.simplemachines.org/mods/index.php?action=search;author=11359)
Licenseo This Modifications Source Code is subject to the terms of the Mozilla Public License version 2.0 (the "License"). You can obtain a copy of the License at http://mozilla.org/MPL/2.0/.
Introductiono Adds capability to automatically update links in posts to display the links page title instead of the default url.
o Converts internal links to show the topic subject or board name as appropriate, external links to website title
o Optional length and generic name protection to avoid changing links to things like Login, welcome, etc
o Optionaly convert links contained inside of BBC URL codes
o Permissions to allow users to disable link conversion on a per post basis (under post additional options)
o Only converts links when the post is saved or modified, ensuring no performance impact during normal message viewing.
Original modsBased on the concept from :
- "Titled Links" (by SlammedDime - http://custom.simplemachines.org/mods/index.php?mod=835 (http://custom.simplemachines.org/mods/index.php?mod=835))
There are admin settings available with this mod, go to configuration -> modification settings -> dlinks
Here you can disable/enable various features of the modificaiton.
InstallationSimply install the package to install this modification on the SMF Default Curve theme.
This mod is compatible with SMF 2.0x
SupportPlease use the Descriptive Link modification thread for support with this modification.
Changelog1.0 - 15 January 2012o + Initial release
Nice work!
Thanks
Thanks for this Mod
Nice work
Really nice!!! Just installed it, runs very well!
EDIT Oops, I found a small issue: when I post a plain url in a tag, like [code] http://www.blahblah.com the mod should not touch it, yet it replaces it with the full tagged url, namely [url=http://www.blahblah.com]BlahBlah[/url]. Can it be fixed?
Thats the way it works, it finds all links in a message irrespective of other tags it might be nested it. You have the option to turn off the feature on a per message basis however (under advanced) for those times when you don't want it to mess around in a message.
Yes, I know this is how it's supposed to work. I'm just saying that the CODE tag is supposed to be absolute - nothing should be parsed inside it otherwise it loses its meaning.
That said, I know it's not a big problem, it's not often you put a url in a CODE tag after all :)
Ok, here's a strange one. Why won't the following URL work?
http://www.zxsoftware.co.uk/8bitgamer/?cat=36
At least in my forum it returns an empty line...
Also, I had a report from a user of mine that when linking to a zip file directly, apparently the script tries to download the entire file before deciding what to do with it. Shouldn't it
a.ignore such files, or maybe just display their filenames directly and
b.just parse the first few bytes where the title is located (in the case of a page)?
Very nice mod, been looking for something like this for a moment already :)
Though I must agree with Gryzor, the [nobbc] and [code] tags should not be included in the parsing process of this mod.
Quote from: Yoshi2889 on March 28, 2012, 11:25:26 AM
Though I must agree with Gryzor, the [nobbc] and [code] tags should not be included in the parsing process of this mod.
Well I did release it as open source ... feel free to make those changes ;) The issue as I see it is that in order to do that you need to tie in to parse_bbc, which implys the link lookup happens then and on every page load, which would be bad for page load performance or could be under some conditions. Thats why the mod does its check outside of that function, and only does the title lookup during the saving of the post, not during the rendering of the post (which happens on every page load). So not saying you could not find a way to do that smartly, just thats not the direction I chose at that time.
Quote from: Gryzor on March 28, 2012, 03:25:46 AM
Ok, here's a strange one. Why won't the following URL work?
http://www.zxsoftware.co.uk/8bitgamer/?cat=36
At least in my forum it returns an empty line...
Don't know, I'll have to take a look and see why its doing that
Quote
Also, I had a report from a user of mine that when linking to a zip file directly, apparently the script tries to download the entire file before deciding what to do with it. Shouldn't it
a.ignore such files, or maybe just display their filenames directly and
b.just parse the first few bytes where the title is located (in the case of a page)?
It should probably skip over those type of links ... no convenient (e.g. built in to smf) way to just grab the first x bits of a page to see if you got what you want or if you asked for enough really.
I can live it with parsing all links, it doesn't cause any major problems for my site (though I can see it screwing up things in others.
If you could take a look at that specific link it could help, though!
As for my other request, if there's no easy way, then at least have an extension blacklist (like all the archive files) that it won't parse...?
Thanks again for a great mod!
Please, DO take a backup before you do that :P
Thanks, will try it this evening when I get home.
I wonder what in my server's config could cause that blank... it's weird, isn't it?
Thanks for your help!!
@Spuds: Very nice mod. I been using this mod from many days, but had to remove it recently following a bug.
Some Urls didnt parse properly. I mean, it displays a blank post.
When investigated, I found out the reason:
Some links dont have a title assigned and hence descriptive mod parse it this way:
[url=http://your_domain.com][/url]
Hence, this above link displays a blank post.
While, a proper descriptive link should be like this:
[url=http://your_domain.com]Your_Domain_Title[/url]
This bug happens with only some of the links.... Please have a look into this.
I guess it's similar to what I described above? Indeed, it does give some blanks, though I had no problem because it's rather rare. I hope it gets fixed though...
If the problem is, indeed, lack of a title, then I guess the script should keep the url as the name of the link. Or maybe keep the domain name, such as www.testsite.com/testdir/filename.html is rendered as www.testsite.com.
Quote from: Gryzor on April 24, 2012, 08:53:26 AM
I guess it's similar to what I described above? Indeed, it does give some blanks, though I had no problem because it's rather rare. I hope it gets fixed though...
If the problem is, indeed, lack of a title, then I guess the script should keep the url as the name of the link. Or maybe keep the domain name, such as www.testsite.com/testdir/filename.html is rendered as www.testsite.com.
Exactly....something should be done.... I am running a forum where links are exchanged on regular basis. So this bug occurs often. Something needs to be done. Hope Spuds will help us here :)
This works great. But I only find the disable for individual posts when I log in as administrator! :)
bdtcomp
Have you checked the permissions?
I have they are all enabled.
Quote from: bdtcomp on May 01, 2012, 09:49:43 PM
I have they are all enabled.
want me to have a quick peep?
I can't promise anything though.
Thanks Old Fossil, I think I will just leave it. I will just have people edit the URLs to say what they want, as I believe most will be happy with the way it works, magically putting a more meaningful name to the links.
Hi I Need help,
When i tried to center the link, it don't retrive the title, this can fix ?
Thanks
EDIT:
If you put the url for example:
[center]www.mysite.com[/center]
[center][url]www.mysite.com[/url][/center]
The mod don't work!
But if you put it of this way:
[center]
Title post
image
etc...
[url]www.mysite.com[/url]
or
www.mysite.com
More information in the post
[/center]
It Work Now...
:P
I tried this and you are right.
Put a space between the brackets and it works! I don't know if that is a hassle to do each time, I guess it is if you are doing a lot of them. I will remember this myself, and I don't know where the code for this mod is, but seems like it could be fixed fairly easy!
Well .. that mod don't works correct ..
After edit, the link description is changed.
See attached images:
test-1 : create message (links with and witout SEF)
test-1-1 : message after save
test-2 : edit message (link description is changed)
test-2-1 : save without edit
Well .. that mod don't works correct ..
After edit, the link description is changed.
See attached images:
test-1 : create message (links with and witout SEF)
test-1-1 : message after save
test-2 : edit message (link description is changed)
test-2-1 : save without edit
Ummmm .. yeah thats what the mod is supposed to do, it updates the links with the page title ::)
Great job Spuds! This is the first and only mod like this that works on my site. Others seem to blame it on my server which it isn't rather then investigate their code. I am glad this one works with my site.
I haven't been using it long so I haven't seen the issues others have seen. But maybe one suggestion from what I have been reading about sites with no titles. If possible if the mod doesn't parse a title from the URL have the mod set a default title to say something like "Link" so its not just posting nothing. I know other mods like this for other forums platforms do that. Just a suggestion if you're looking for a work around.
Quote from: Spuds on May 26, 2012, 11:14:28 PM
Ummmm .. yeah thats what the mod is supposed to do, it updates the links with the page title ::)
@Spuds, bro please look into the bug which sometimes gives no title to a link and hence the link gets hidden.
Try any link with no title like this:
[url=http://google.com][/url]Such link gets hidden......this mod sometimes doesnt give a title to certain web links (just some particular domain link) and hence the whole link gets hidden.
Apart from this issue, the mod is super awesome...hats off to you for this wonderful work :)
Quote from: die2mrw007 on May 27, 2012, 02:12:41 AM
Try any link with no title like this:
[url=http://google.com][/url]
Such link gets hidden......this mod sometimes doesnt give a title to certain web links (just some particular domain link) and hence the whole link gets hidden.
I believe the problem with linking URL's the way you showed is because those are meant for user submitted titles verses just posting the URL and letting the mod parse a title as the mod is developed to do. If you just post a URL or embed it between URL bbc tags it will parse the title. See attachment for example.
Quote from: Texan78 on May 27, 2012, 03:11:03 AM
Quote from: die2mrw007 on May 27, 2012, 02:12:41 AM
Try any link with no title like this:
[url=http://google.com][/url]
Such link gets hidden......this mod sometimes doesnt give a title to certain web links (just some particular domain link) and hence the whole link gets hidden.
I believe the problem with linking URL's the way you showed is because those are meant for user submitted titles verses just posting the URL and letting the mod parse a title as the mod is developed to do. If you just post a URL or embed it between URL bbc tags it will parse the title. See attachment for example.
I know this. Actually some members sent a link to me via PM (it isnt the root path of the domain...some particular post link from that domain) which the Descriptive mod didnt given a title and hence it got hidden to me....when I quoted the PM which he sent me, I was able to see the link which was not provided with a title on its own.
What is the link of question that is not showing a title? I can test it on my board and see if I get the same results. Did you by chance check to see if the page being linked even had a title set in the source or did a title show in the browser?
I know there are some links that won't have titles for the exact reason it may not have one. I think the best way around that is what I described earlier for the mod to check if the link has a title and if not set a default title with some text that simply says "Link" so it's not just blank.
Quote from: Texan78 on May 27, 2012, 03:30:02 AM
What is the link of question that is not showing a title? I can test it on my board and see if I get the same results. Did you by chance check to see if the page being linked even had a title set in the source or did a title show in the browser?
I know there are some links that won't have titles for the exact reason it may not have one. I think the best way around that is what I described earlier for the mod to check if the link has a title and if not set a default title with some text that simply says "Link" so it's not just blank.
Yes, you got it now exactly. The members there at my forum will not be knowing about this thing and they will simply copy paste the link and send. The receiver will get a blank PM (though not blank actually). I received many complaints from users stating that the links they send doesnt get delivered to receiver and hence I disabled this mod for time being until I find a solution for this.
Is there any way to modify the mod such that the links having no title should be set into exception and thus it will not parse via this descriptive mod purpose.
Or make those No-Title link with default Title as "Link" or something.
The reason for this here is that, people will not be bothered to verify the link which they post whether it is having a title or not and thus the receiver of such links will always get a blank message giving the forum a bad impression of a BUG for them!
I have included a small problem with links to a comma.
Such is for example from the link:
http://www.yourdomain.com/index.php?t=test,domain
Later, he sees but then like this:
Your Domain (http://www.yourdomain.com/index.php?t=test),domain
one of my staff has encountered an off glitch with this mod.
It works perfectly for me...
When he moves a post, however, the auto-generated post with link to the new location uses the correct title but points to a completely different thread
Quote from: Eclipse16V on May 27, 2012, 06:51:40 AM
I have included a small problem with links to a comma.
Such is for example from the link:
http://www.yourdomain.com/index.php?t=test,domain
Later, he sees but then like this:
Your Domain (http://www.yourdomain.com/index.php?t=test),domain
Yes I know people hate to hear this but thats "how it works" .... it stops at a ',' since it does not know if its part of the link, or part of the text around the link. So it plays it safe in that regard (since you can't always depend on folks to put a space after the comma) .... you can adjust the regex in the program if you don't want the default behavior but I'm not going to change that for the mod since it might gab normal text as a link.
Quote from: die2mrw007 on May 27, 2012, 02:12:41 AM
[url=http://google.com][/url]
Such link gets hidden.....
I think plain old SMF would show a blank link for a BBC URL set up like that ... I think the mod would try to find a title and insert one for you, but if it could not it would leave it as is, a blank link. I guess I could repair them, e.g. turn them in to
[url=http://google.com]http://google.com[/url]
Quote from: Texan78 on May 27, 2012, 03:30:02 AM
What is the link of question that is not showing a title? I can test it on my board and see if I get the same results. Did you by chance check to see if the page being linked even had a title set in the source or did a title show in the browser?
I know there are some links that won't have titles for the exact reason it may not have one. I think the best way around that is what I described earlier for the mod to check if the link has a title and if not set a default title with some text that simply says "Link" so it's not just blank.
The mod does check for blank titles, or no titles found, in which case it leaves the link as it was entered. Obviously there have been reports of blank titles, or probably some non displayable junk in the title, so it would "disapear" However to fix that I need specific links to see what it might be doing before I can do that.
Quote from: Kindred on May 27, 2012, 09:35:35 AM
one of my staff has encountered an off glitch with this mod.
It works perfectly for me...
When he moves a post, however, the auto-generated post with link to the new location uses the correct title but points to a completely different thread
Hummm ... interesting. I don't think I ever ran that usage case in testing, will have to take a look !
Quote from: Kindred on May 27, 2012, 09:35:35 AM
one of my staff has encountered an off glitch with this mod.
It works perfectly for me...
When he moves a post, however, the auto-generated post with link to the new location uses the correct title but points to a completely different thread
Yes, yes, this same thing happened with me too... Though I was not knowing why it was showing wrong description....Now after your report, I got it clear that its due to "thread location move"
Quote from: Spuds on May 27, 2012, 09:59:14 AM
Quote from: die2mrw007 on May 27, 2012, 02:12:41 AM
[url=http://google.com][/url]
Such link gets hidden.....
I think plain old SMF would show a blank link for a BBC URL set up like that ... I think the mod would try to find a title and insert one for you, but if it could not it would leave it as is, a blank link. I guess I could repair them, e.g. turn them in to
[url=http://google.com]http://google.com[/url]
can something be done to such links? such no title link gets hidden in post
now, check this one (just an example)
Google (http://google.com)
Now the "No title version here:
(http://google.com)
See here, the link is hidden....just Quote my post to see the exact content or if moderation capability, do click on modify on my post and see the content. The link is actually there but hidden
Quote from: die2mrw007 on May 27, 2012, 03:52:00 PM
Now the "No title version here:
[url=http://google.com][/url]
Because as I explained this morning that is the code for the user inputted titles. The mod won't parse a title because it's expecting user input. Look carefully at what you posted... If you don't assign it a title then it will be blank, the mod will not parse a title that it's expecting a user to input.
It should be this....
[url=http://google.com]Google[/url]
That has nothing to do with the mod.... That is inherent in the way SMF bbc for URL works,
. Basically, if you try to "break" it, by using bad code, you an.
Quote from: Texan78 on May 27, 2012, 05:53:59 PM
Quote from: die2mrw007 on May 27, 2012, 03:52:00 PM
Now the "No title version here:
[url=http://google.com][/url]
Because as I explained this morning that is the code for the user inputted titles. The mod won't parse a title because it's expecting user input. Look carefully at what you posted... If you don't assign it a title then it will be blank, the mod will not parse a title that it's expecting a user to input.
It should be this....
[url=http://google.com]Google[/url]
Guess you are not getting my point... I do know that if we dont apply a title to a url, it is going to be hidden.
The mod sometimes doesnt provide a title automatically to certain links...this is what I am trying to explain. I guess I am failing here to explain it properly.
Quote from: Kindred on May 27, 2012, 07:46:31 PM
That has nothing to do with the mod.... That is inherent in the way SMF bbc for URL works,
. Basically, if you try to "break" it, by using bad code, you an.
You could drop the smugness, Kindred, you're actually in the wrong here.
Sometimes, the code won't get a title for a given page. But it still ends up putting an empty title into the URL tag. If no title is returned, it should not rewrite the link - at worst it should put the full URL back into the url tag where *the mod* removes it.
Poof ... its gone, now everyone can move on to clutter up some other support thread.
Quote from: Arantor on May 28, 2012, 03:12:07 PM
You could drop the smugness, Kindred, you're actually in the wrong here.
Sometimes, the code won't get a title for a given page. But it still ends up putting an empty title into the URL tag. If no title is returned, it should not rewrite the link - at worst it should put the full URL back into the url tag where *the mod* removes it.
Hello Arantor, nice to see you here at this topic :)
Yes, if the mod performs exactly the same as you described, it would be a great and perfect mod for SMF!
I appreciate Spuds for making this creative mod. He deserves a BIG HUG from me :D
Quote from: Spuds on May 28, 2012, 03:50:14 PM
Poof ... its gone, now everyone can move on to clutter up some other support thread.
Why? it was a wonderful mod :'(
Arantor... What smugness? Huh?
Where you keep repeating, as if it were truth, that there's nothing wrong because that's how it's supposed to work.
It isn't supposed to be the case that the mod ends up *removing the title* because one could not be supplied. But since it's been removed now, I guess it's kind of moot.
(In hindsight, smugness may have been the wrong word, but it wasn't quite up to your usual arrogance about how SMF is right and everyone else has it wrong.)
Spuds why did you remove it? It was a great mod and worked perfectly on my board. It's to be expected some may run into issues with it.
die2mrw007, I hear what you are saying but I don't think you understand what I am trying to say. It you add a link this way....
[url=http://google.com]INSERT USER TITLE HERE[/url]
The MOD will NOT add a title because it is expecting a user inputted title. That is the function of SMF for that bbc tag.
Now if you linked it like this....
[url]http://google.com[/url]
Or just pasted the link without it, the MOD WILL parse a title for it because it's NOT expecting a user title.
The only way this MOD will NOT parse a title is if the page does NOT have a title to parse, therefor leaving it blank or embedding the link in a manner where the user has to input a title.
Look at the two examples really close and you will see the difference. I know what you are trying to say and understand but but look very closely in the example you're posted of how you're linking the URL, but the mod doesn't work the way you are explaining and it's not suppose to parse a title for user input titles because it would defeat the purpose of the tag.
Hope that clears up some confusion.
QuoteThe only way this MOD will NOT parse a title is if the page does NOT have a title to parse, therefor leaving it blank or embedding the link in a manner where the user has to input a title.
Yes, yes, we know, we got that point several posts back.
The point that die is trying to make and no-one seems to be listening is that there are times the mod doesn't get a title for whatever reason and in that case it empties out the link text rather than substituting the original URL back in.
There wasn't really any confusion, except from people that didn't take the time to read what die was saying properly.
Is this mod gone?
only for SMF staff, Old Fossil... the mod WAS removed.
Ah er in that case I'll remove the link.
This is sad, really...
I'm confused. Why was it removed?
My guess is, because of all the comments and the slight trolling?
This mod was removed from the mod site, therefore I have to lock it.
EDIT: Neverrmind, need to learn the way of things going around here ;D
Now its really gone
Sad, I dont know whats going wrong with SMF developers :/
Quote from: Gryzor on June 01, 2012, 02:33:54 AM
My guess is, because of all the comments and the slight trolling?
Exactly and that is despite bthe mod working as it should.