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)
 Controlling how Web Links open
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 March 2007 :  10:57:49  Show Profile  Visit leatherlips's Homepage  Reply with Quote
On the default.asp page, I wanted any web links that pointed to any page within my own domain to open in the same window. If found this code in the forums to do that:

In default.asp I removed: & """ target=""_blank" from below

if ForumFType = 0 then
Response.Write "forum.asp?FORUM_ID=" & ForumID
else
Response.Write ForumURL & """ target=""_blank"
end if


What this did was now make every web link on the default.asp page open in the same window. I would like to control it so if the link points to a site outside of my domain it will open in a new window (as is the original Snitz procedure) but still retain the links within my domain to continue to open in the same window.

Can this be done?
<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD

Edited by - leatherlips on 15 March 2007 10:58:36

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2007 :  11:08:49  Show Profile  Reply with Quote
Are you using relative or absolute URLs to point to page within your own domain? If the former, use [brown]instr[/brwon] to check if the ForumURL variable contains http:// and write the target attribute if it does. If the llatter, use instr to check if the ForumURL contains your domain and write the target attribute if it doesn't.

<

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

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 March 2007 :  11:20:07  Show Profile  Visit leatherlips's Homepage  Reply with Quote
I understand what you mean with relative and absolute URLs but the rest...I'm lost.

When I enter a Web Link I by clicking I enter the absolute URL regardless if it points to my site or not.

Can you explain more about the instr?<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2007 :  11:38:57  Show Profile  Reply with Quote
Here's what you need, so, where domain.tld is your domain:
if ForumFType = 0 then
	Response.Write	"forum.asp?FORUM_ID=" & ForumID
else 
	Response.Write	ForumURL
	if instr(ForumURL,"http://www.domain.tld/")=0 then response.write """ target=""_blank"
end if
<

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

leatherlips
Senior Member

USA
1838 Posts

Posted - 15 March 2007 :  11:45:55  Show Profile  Visit leatherlips's Homepage  Reply with Quote
Thanks Shaggy! Perfect!<

Mangione Magic Forum - The Music of Chuck Mangione

My Mods: Googiespell MOD | Link To Reply MOD | Petition MOD | Contact Page MOD | Share This Topic MOD | MP3 MOD | PageEar MOD | Google Viewer MOD
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 15 March 2007 :  11:48:20  Show Profile  Reply with Quote
You're welcome

<

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

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 29 March 2007 :  10:06:40  Show Profile  Reply with Quote
Is it possible to incorporate this 'sweet trick' to the topic.asp page, where most of the information is posted etc., and possible links.
regards
andy<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 29 March 2007 :  10:53:38  Show Profile  Reply with Quote
Yes, but it's a lot more complex.

[Linkage]

<

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

Andy Humm
Average Member

United Kingdom
908 Posts

Posted - 29 March 2007 :  18:30:40  Show Profile  Reply with Quote
Absolutely spot on!
Thank you
andy<
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 30 March 2007 :  04:59:05  Show Profile  Reply with Quote
You're welcome.

<

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
  Previous Topic Topic Next Topic  
 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.2 seconds. Powered By: Snitz Forums 2000 Version 3.4.07