Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Clipped URL's?
 New Topic  Reply to Topic
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 6

sr_erick
Senior Member

USA
1318 Posts

Posted - 14 March 2005 :  20:53:20  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message  Reply with Quote
I've done some searching and came up with nothing. Has anyone made any mods to clip the URL in the format string functions?

Like if there is a super long URL like this:

http://www.nohrsc.nws.gov/interactive/html/map.html?var=ssm_depth&dy=2005&dm=3&dd=9&dh=18&snap=1&o9=1&o12=1&o13=1&lbl=m&min_x=-77.650416666659&min_y=37.446667353307&max_x=-62.150416666659&max_y=52.946667353307&coord_x=-70.18&coord_y=44.54&metric=0&bgvar=dem&width=512&height=512&nw=512&nh=512&type=3&js=1&uc=0&mode=zoomin&submit1=0&ql=station&zf=4.0

It will turn it into this:

http://www.nohrsc.nws.gov/intera....tion&zf=4.0

And still link to the same place<




Erick
Snowmobile Fanatics

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 15 March 2005 :  04:09:33  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Good thought ; there are several sites out there using this principle.<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Classicmotorcycling
Development Team Leader

Australia
2084 Posts

Posted - 15 March 2005 :  06:32:59  Show Profile  Reply with Quote
About the best I have come up with is this:

<%
strLink ="http://www.nohrsc.nws.gov/interactive/html/map.html?var=ssm_depth&dy=2005&dm=3&dd=9&dh=18&snap=1&o9=1&o12=1&o13=1&lbl=m&min_x=-77.650416666659&min_y=37.446667353307&max_x=-62.150416666659&max_y=52.946667353307&coord_x=-70.18&coord_y=44.54&metric=0&bgvar=dem&width=512&height=512&nw=512&nh=512&type=3&js=1&uc=0&mode=zoomin&submit1=0&ql=station&zf=4.0"

if RTrim(Len(strLink)) > 60 then
strLinks = Left(strLink, 40) & "..."
end if
%>
<a href="<% =strLink %>"><% =strLinks %></a><

Cheers,

David Greening
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2005 :  07:05:53  Show Profile  Reply with Quote
Gimme a bit and I'll try and come up with something over lunch (GMT). Seem to remember someone doing this before but I can't find it now.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2005 :  08:27:34  Show Profile  Reply with Quote

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”

Edited by - Shaggy on 15 March 2005 10:39:29
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 15 March 2005 :  08:34:41  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Great!!! Time to experiment!<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2005 :  08:47:52  Show Profile  Reply with Quote
*sits patiently awaiting the bug reports! *

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 15 March 2005 :  09:38:56  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Well, I'm getting this error :
quote:
Microsoft JScript compilation error '800a03ea'

Syntax error

/forum/inc_func_common.asp, line 1836

iMLength = <%intMaxLinkLength%>;
-----------^


I've changed that line to this:
iMLength = intMaxLinkLength;

After posting this url:
http://ridiculoouslylongurl.com.netridiculoouslylongurl.com.netridiculoouslylongurl.com.netridiculoouslylongurl.com.netridiculoouslylongurl.com.net/
it displays it as this:
http://ridiculoously...longurl.com.netridiculoouslylongurl.com.netridiculoouslylongurl.com.netridiculoouslylongurl.com.netridiculo
So...it doesn't really works as designed.<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2005 :  10:41:16  Show Profile  Reply with Quote
Is that with or without the [url] tag? Figured the changes to edit_hrefs wouldn't work sraight off! Looks like the problem's being cused by this:

sLink.substring((iLLength-iHLength),iHLength)

Can't figure out why, though.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 15 March 2005 :  10:51:24  Show Profile  Visit MarcelG's Homepage  Reply with Quote
I didn't use the URL tag.
I just posted that URL, without any tags around it.<

portfolio - linkshrinker - oxle - twitter
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2005 :  11:03:06  Show Profile  Reply with Quote
Well, it's definitely that snippet above, then. Don't know why, even if it started trimming the right hand side from the wrong character (iLLength-iHLength), it should still only show iHLength characters from that point.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 15 September 2005 :  05:32:55  Show Profile  Visit MarcelG's Homepage  Reply with Quote
If I may be so bold, I'd like to bump this topic once again....
I've noticed that FireFox seems to have some problems with wrapping long urls.
In IE the url is wrapped at characters such as -, but in FireFox it's not...resulting in some odd looking layout.<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 15 September 2005 14:08:08
Go to Top of Page

Astralis
Senior Member

USA
1218 Posts

Posted - 24 September 2005 :  01:53:30  Show Profile  Send Astralis a Yahoo! Message  Reply with Quote
I think this would be excellent. Long URLs are a pain when they stretch the page.<
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 04 November 2005 :  09:12:01  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
Well.. I got the same error as MarcelG,

This link:
http://www.autoblog.com/entry/1234000873066126/
became:
http://www.a...utoblog.com/entry/1234000873066126/

it actually became LONGER after being processed =)
<

/Tribaliztic
- www.gotlandrace.se -
Go to Top of Page

golfmann
Junior Member

United States
450 Posts

Posted - 06 November 2005 :  07:52:46  Show Profile  Visit golfmann's Homepage  Reply with Quote
I converted a format button (actually the teletype add on one) to put THIS code when clicked:



You then paste the long url in at the left ", manually, and can change 'Link' to any word, color, etc..

COULD it be possible to COMBINE these and instead of trimming at x number of spaces, place the url string inside this between the url=" "'s?

So IF under the length it's normal, over is that above, putting the word link, click here or whatever in there with the actual link embedded behind it?

just a thought... <

Edited by - golfmann on 06 November 2005 08:08:24
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 07 November 2005 :  10:25:40  Show Profile  Reply with Quote
Been looking and looking and looking at this and still can't see where it's tripping up. All I can suggest is that ye try replacing my edited edit_hrefs function with the following:
function edit_hrefs(sURL, iType) {
	sOutput = new String(sURL);
	iMLength = intMaxLinkLength;
	iHLength = iMLength/2;
	iLLength = parseInt(sOutput.length);
	if(iLLength>=iMLength&&iType!=4)sLink=sOutput.substring(0,iHLength)+"..."+sOutput.substring((iLLength-iHLength),iHLength);
	else sLink = sOutput;

	if (iType == 1) {
		sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
	} else if (iType == 2) {
		sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
	} else if (iType == 3) {
		sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"http://$1\" target=\"_blank\">"+sLink+"<\/a>");
	} else if (iType == 4) {
		sOutput = sOutput.replace(/\b([\w+\-\'\#\%\.\_\,\$\!\+\*]+@[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+\.[\w+\.?\-\'\#\%\~\_\.\;\,\$\!\+\*]+)/gi,
			"<a href=\"mailto\:$1\">$1<\/a>");
	} else if (iType == 5) {
		sOutput = sOutput.replace(/\b(ftp\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
	} else if (iType == 6) {
		sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
		  	"<a href=\"$1\" target=\"_blank\">"+sLink+"<\/a>");
	}

	return sOutput;
}
If that doesn't work then maybe we should try looking at acheiving this with Gary's RegExp based edit_hrefs function.

<

Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Next Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.13 seconds. Powered By: Snitz Forums 2000 Version 3.4.07