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

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Replacing automatic links ?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

RichKav
Starting Member

United Kingdom
7 Posts

Posted - 03 March 2004 :  16:51:14  Show Profile  Visit RichKav's Homepage
Hi all.

When someone enters http://www.blah.com into a post, or even just www.blah.com, it automatically converts it to a "proper url".

Can I edit or change this auto-conversion ?

I'd like it to still replace with a normal link, but to add a bit in front, eg:

www.blah.com" target="_blank">http://www.blah.com

When clicked, would link to:

www.mysite.com/redirect.asp?url=" target="_blank">http://www.mysite.com/redirect.asp?url=http://www.blah.com

But it'd still need to display their original link, like:


<a href="http://www.mysite.com/redirect.asp?url=http://www.blah.com">www.blah.com</a>" target="_blank">http://www.blah.com</a>


Hope this makes sense :)


http://itvibe.com



OneWayMule
Dev. Team Member & Support Moderator

Austria
4969 Posts

Posted - 03 March 2004 :  17:14:43  Show Profile  Visit OneWayMule's Homepage  Send OneWayMule an ICQ Message
http://forum.snitz.com/forum/topic.asp?TOPIC_ID=42579

My MODs:
Birthdays - Custom Policy - F.A.Q. Administration - Forum Rules - Guestbook
Links Manager - MyOwnGoogle - Profile Views - Search Log - WebSearch

Useful stuff:
Forum and MOD Installation - MOD Installation Guide - Snitz v3.4.05 Readme - Free ASP Hosts - Support Snitz
Go to Top of Page

RichKav
Starting Member

United Kingdom
7 Posts

Posted - 03 March 2004 :  17:15:11  Show Profile  Visit RichKav's Homepage
S'ok, worked it out:


	if (iType == 1) {
		sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"http://www.mysite.com/redirect.asp?url=$1\" target=\"_blank\">$1<\/a>");
	} else if (iType == 2) {
		sOutput = sOutput.replace(/\b(https\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"$1\" target=\"_blank\">$1<\/a>");
	} else if (iType == 3) {
		sOutput = sOutput.replace(/\b(www\.[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
			"<a href=\"http://www.mysite.com/redirect.asp?url=http://$1\" target=\"_blank\">$1<\/a>");




http://itvibe.com



Go to Top of Page

RichKav
Starting Member

United Kingdom
7 Posts

Posted - 03 March 2004 :  17:16:11  Show Profile  Visit RichKav's Homepage
Ah, soz onewaymule, you replied as I was typing that in :)



http://itvibe.com



Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 3.62 seconds. Powered By: Snitz Forums 2000 Version 3.4.07