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
Previous Page | Next Page
Author Previous Topic Topic Next Topic
Page: of 6

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 10 November 2005 :  05:15:14  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
Hm.. could you post your original thruncstring? Mine is much longer than your new one =)
<

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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 10 November 2005 :  06:09:36  Show Profile  Visit MarcelG's Homepage  Reply with Quote
The two functions at the bottom of inc_func_common.asp:

<script language="javascript1.2" runat="server">
function truncString(sOutput, sOutput2,aLength, bLength) {
  if (sOutput2.length > (aLength+bLength+3)) {
    aString = sOutput2.substring(0, aLength);
    bString = sOutput2.substring(sOutput2.length-bLength, sOutput2.length);
    sOutput = "<a href=\""+sOutput+"\" target=\"_blank\">"+aString+"..."+bString+"</a>"
  }
  else
  {
    sOutput = "<a href=\""+sOutput+"\" target=\"_blank\">"+sOutput2+"</a>"
  }
  return sOutput;
}

function edit_hrefs(sURL, iType) {
	sOutput = new String(sURL);

	if (iType == 1) {
		sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			function($1) { return truncString($1, $1, 30, 8); });
	} else if (iType == 2) {
		sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			function($1) { return truncString($1, $1, 30, 8); });
	} else if (iType == 3) {
		sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			function($1) { return truncString("http://"+$1,$1, 30, 8); });
	} 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,
			function($1) { return truncString($1, $1, 30, 8); });
	} else if (iType == 6) {
		sOutput = sOutput.replace(/\b(file\:\/\/\/[\w+\:\/\\]+[\w+\/\w+\.\:\/\\\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
		  	function($1) { return truncString($1, $1, 30, 8); });
	}

	return sOutput;
}
</script>
<

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

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 10 November 2005 :  06:23:38  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
Okay!
now go get your collegue so he can solve this ;)
<

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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 10 November 2005 :  07:55:57  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Done some more investigation.
I think I know what's happening:

[url]http://www.lasttest.com[/url]
[url]http://www.thislinkisbig.com/bigeyornot.com/blablaww[/url]

creates this HTML code:
<a href="http://www.lasttest.com" target="_blank"><a href="http://www.lasttest.com" target="_blank">http://www.lasttest.com</a></a><br />
<a href="http://www.thislinkisbig.com/bigeyornot.com/blablaww" target="_blank"><a href="http://www.thislinkisbig.com/b...blablaww" target="_blank">http://www.thislinkisbig.com/b...blablaww</a></a>


In other words, the urls are parsed through the function twice....<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 10 November 2005 07:57:11
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 10 November 2005 :  08:25:01  Show Profile  Reply with Quote
Sorry for the absence, emergency at work.

Marcel, what it looks like is happening there is that the link gets passed through the ReplaceURLs function when using the [url] tag, constructing the anchor tag and truncating the display text, if need be. Then, for some reason, that outputted code is being picked up by the chkURLs function and tries to pass both ocurrences of the URI through edit_hrefs.

<

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

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 10 November 2005 :  08:26:11  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
hmm... now let's just find out here =)
<

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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 10 November 2005 :  09:14:27  Show Profile  Visit MarcelG's Homepage  Reply with Quote
quote:
Originally posted by Shaggy

Sorry for the absence, emergency at work.

Marcel, what it looks like is happening there is that the link gets passed through the ReplaceURLs function when using the [url] tag, constructing the anchor tag and truncating the display text, if need be. Then, for some reason, that outputted code is being picked up by the chkURLs function and tries to pass both ocurrences of the URI through edit_hrefs.



No apologies necessary ! I know what you mean

I have the same idea....still a bit boggled by the ReplaceURLs function....I think we need to do some modifaction there...<

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

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 10 November 2005 :  09:16:38  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
You guys have to look over your priorities... ;)
<

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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 10 November 2005 :  18:41:43  Show Profile  Visit MarcelG's Homepage  Reply with Quote
guys, the bug we're experiencing is not a side effect of this mod ; it's in the basecode for some time already, even here at Snitz.
Have a look at this topic: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=60139
Quote it to see which forumcode I used for which URL.
Then, have a look at the output HTML...

I've filed a bugreport in the dev section for this.<

portfolio - linkshrinker - oxle - twitter

Edited by - MarcelG on 10 November 2005 18:42:32
Go to Top of Page

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 11 November 2005 :  03:10:10  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
I hope HuwR's answer can help =) Wouldn't it be possible to redirect these urls so it's not parsed twice?
<

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

MarcelG
Retired Support Moderator

Netherlands
2625 Posts

Posted - 11 November 2005 :  05:05:57  Show Profile  Visit MarcelG's Homepage  Reply with Quote
I've proposed a fix that needs to be doublechecked.<

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

tribaliztic
Senior Member

Sweden
1532 Posts

Posted - 11 November 2005 :  06:03:33  Show Profile  Visit tribaliztic's Homepage  Send tribaliztic an ICQ Message  Reply with Quote
Wohoo!
Nice work (I hope.. ;))
<

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

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 November 2005 :  06:31:01  Show Profile  Reply with Quote
Good man, Marcel That was going to be my next suggestion; beat me to it.

<

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 - 11 November 2005 :  07:25:41  Show Profile  Visit MarcelG's Homepage  Reply with Quote
Well, I guess we just have to wait untill we hear about the final bugfix for Snitz, to assure that our nifty mod is compatible with basecode snitz.<

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

Podge
Support Moderator

Ireland
3775 Posts

Posted - 11 November 2005 :  07:33:35  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message  Reply with Quote
What was the suggested fix?<

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page
Page: of 6 Previous Topic Topic Next Topic  
Previous Page | 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.11 seconds. Powered By: Snitz Forums 2000 Version 3.4.07