convert urls to "click here"

Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/60076?pagenum=1
05 November 2025, 10:54

Topic


tribaliztic
convert urls to "click here"
04 November 2005, 07:11


I would like to convert all url's posted in the forums to "click here" or something. Url's tend to be too long and screw up the posts... Any hints? <

 

Replies ...


Shaggy
04 November 2005, 07:39


Do you want to this only with URIs posted without the [url] tags? Going to be difficult to do it with them as you'll need to determine what is a URI and what isn't.
This topic may be of use, it details a slightly different solution to your problem.
<
tribaliztic
04 November 2005, 08:33


Thanks =)
<
Shaggy
04 November 2005, 08:53


You're welcome smile Will that do the trick for you?
<
tribaliztic
04 November 2005, 10:00


nah, take a look in the other thread =)
<
Shaggy
04 November 2005, 10:07


Just spotted it. Been back to that line a couple of times since and haven't been able to figure out what the problem is. dead
<
MarcelG
04 November 2005, 10:18


bigsmile more coffee ? wink hehe<
Shaggy
04 November 2005, 10:22


More? I'd settle for some being the recovering cafeeinaholic that I am, nary a drop has passed my lips in over 20 months!
<
tribaliztic
04 November 2005, 10:33


now I'm dissapointed in you Shaggy.. you've been a bad boy! Fix that code tonight!
;)
<
MarcelG
05 November 2005, 07:35


no coffee for 20 months ??? You scare me Shaggy......<
Bassman
06 November 2005, 08:05


I made a small wizard, when pressing the wizard button one field will ask for name of the link, the next you can put your link in. See screenshots for example.
NAME

LINK

RESULT CODE INCL. POST PREVIEW SCREEN


Also it will add a diferend color to the link.<
tribaliztic
06 November 2005, 14:18


Nice, but my users are too lazy to do something like that when they could just paste the link instead =)
<
imweazel
07 November 2005, 08:29


Originally posted by tribaliztic
I would like to convert all url's posted in the forums to "click here" or something. Url's tend to be too long and screw up the posts... Any hints?

How about an update query to convert the URL's to the format you're looking for?<
Shaggy
07 November 2005, 08:33


Bassman, how does your mod differ from the default "Prompt" format mode?
<
golfmann
07 November 2005, 08:49


Originally posted by Shaggy
Bassman, how does your mod differ from the default "Prompt" format mode?

It seems a variation to me. I've seen others that use that language in their post link button. That's why I did the button java change noted here:
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=57507#329930

It's actually pretty easy with tabbed browsers and all (one step copy & paste), but it would sure be nice to have it automatic as mentioned in my post above. blush<
tribaliztic
07 November 2005, 09:20


Originally posted by tribaliztic
I would like to convert all url's posted in the forums to "click here" or something. Url's tend to be too long and screw up the posts... Any hints?

How about an update query to convert the URL's to the format you're looking for?
How would I know what to convert? <
imweazel
07 November 2005, 09:50


Instring's and mid's for the URL tag.<
tribaliztic
07 November 2005, 10:10


yeah, but most of my users don't use the URL-tag, that's the problem =/
<
AnonJr
07 November 2005, 13:45


Originally posted by tribaliztic
yeah, but most of my users don't use the URL-tag, that's the problem =/

Maybe replace the link with the text "stinkin long url - use the tag". Bet they'll only do it once! tongue
Seriously though - instead of trying to put some elipses in the middle, why not pear the display down to the domain and keep the rest intact?
i.e.: http://www.reallylongulr.com/dir/subdir/insanethirddir/thatpage.asp?arg=onetoomany&another=istomuch

becomes: http://www.reallylongurl.com on display, but the link points to the appropriate location?<
imweazel
07 November 2005, 15:13


Did some messing around with SQL. Since you stated your users paste the link I converted this:

stuff before http://forum.snitz.com/forum/topic.asp?TOPIC_ID=60076 stuff after

to this:

stuff before click here stuff after

Using a update query, based on "http://" appearing in the reply.
The query gets formatted in the posting so it doesn't appear exactly as shown.
UPDATE FORUM_REPLY SET FORUM_REPLY.R_MESSAGE = Left([r_message],InStr([r_message],"http://")-1) & ',InStr([r_message],"http://"),InStr(InStr([r_message],"http://"),[r_message]," ")-InStr([r_message],"http://")) & '"]click here' & Mid([r_message],InStr(InStr([r_message],"http://"),[r_message]," "),Len([r_message])-InStr(InStr([r_message],"http://"),[r_message]," ")+1)
WHERE (((FORUM_REPLY.R_MESSAGE) Like "*http://*"));

Granted, this is not an elegant solution. <
Bassman
07 November 2005, 15:18


Originally posted by Shaggy
Bassman, how does your mod differ from the default "Prompt" format mode?

Noting, like golfmann posted its just a small change.<
Shaggy
08 November 2005, 08:16


tribaliztic
09 November 2005, 04:27


Thanks alot!! Worked like a charm! I don't know which look better, this solution or the other one (http://forum.snitz.com/forum/topic.asp?TOPIC_ID=57507) though.. <
Shaggy
10 November 2005, 08:25


You're welcome, Tribal' smile
<
tribaliztic
10 November 2005, 08:38


Maybe release this as a mod with an admin interface where you can choose if you want this or just "clipped urls" =)
<
Shaggy
10 November 2005, 09:08


Ay, if someone wants to do that once we get the clipped version working, fire away; I just don't have the time these days to write up and support mods. sad
<
tribaliztic
10 November 2005, 09:13


Neither have I but I don't think it would be that hard. I'll give it a try when it's all working =)
<
© 2000-2021 Snitz™ Communications