Author |
Topic  |
|
James
Average Member
  
USA
539 Posts |
Posted - 31 December 2003 : 15:11:51
|
I haven't messed with snitz much (other than mainting my site) for a while so maybe I forgot something. I'd like to know how to make links in a message open in the same browser window instead of opening a new browser page? Seems I remember there was a way to do this. |
*Interested in Radio Control* *The RC Web Board - http://www.rcwebboard.com/* |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 31 December 2003 : 15:34:29
|
This is on my "MODs to write" list, but I wanted only links from the current site to open in the current window, and external links in a new window.
Maybe I'll find the time in the next few days  |
 |
|
James
Average Member
  
USA
539 Posts |
Posted - 31 December 2003 : 16:23:25
|
That's what I'm trying to do, open pages from my site in the same window. I'm happy with pages to external sites opening a new window. |
*Interested in Radio Control* *The RC Web Board - http://www.rcwebboard.com/* |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 31 December 2003 : 17:11:03
|
OK, I've narrowed it down to the ReplaceURLs function in inc_func_common.asp, and I'm working my way thru that but I have some other things on the agenda this morning so I'll get back to it when I can. |
 |
|
Jeepaholic
Average Member
  
USA
697 Posts |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 18 February 2004 : 18:27:16
|
LOL !!! .. I haven't touch it since it's off the radar completely at the moment. |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 18 February 2004 : 19:57:28
|
Haven't tried it, but I guess, from a quick look at it, that it would be as easy as replacing all ocurrences of """ target=""_blank"">" by ">", in the replaceURLs function.
I also think you may need to remove the target=\"_blank\" parts from the edit_hrefs function, also in inc_func_common.asp. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
 |
|
laser
Advanced Member
    
Australia
3859 Posts |
Posted - 18 February 2004 : 20:12:09
|
You don't want to remove all though, only the ones where the link is the same domain you are on at the moment. |
 |
|
Jeepaholic
Average Member
  
USA
697 Posts |
Posted - 18 February 2004 : 20:35:44
|
quote: Originally posted by ruirib
Haven't tried it, but I guess, from a quick look at it, that it would be as easy as replacing all ocurrences of """ target=""_blank"">" by ">", in the replaceURLs function.
I also think you may need to remove the target=\"_blank\" parts from the edit_hrefs function, also in inc_func_common.asp.
Already tried that, Rui... Actually, I added duplicate functions (one to open new links, one to not) for each of those, but it doesn't seem to be working. This is so that my main page (the "What's New" section) doesn't open up a new window: http://www.jeepaholics.com/default.asp
The code is parsed using inc_func_common.asp, and the "GO" and "DISCUSS" buttons are directly in the post they came from. AL |
Al Bsharah Aholics.com
Jeepaholics Anonymous Broncoholics Anonymous Network Insight
|
Edited by - Jeepaholic on 18 February 2004 20:36:25 |
 |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
|
Jeepaholic
Average Member
  
USA
697 Posts |
|
ruirib
Snitz Forums Admin
    
Portugal
26364 Posts |
Posted - 19 February 2004 : 18:24:32
|
For URLs that start with "http://", you just need to remove the red part, at line# 1545, in edit_hrefs function, inc_func_common.asp:
if (iType == 1) {
sOutput = sOutput.replace(/\b(http\:\/\/[\w+\.]+[\w+\.\:\/\@\_\?\=\&\-\'\#\%\~\;\,\$\!\+\*]+)/gi,
"<a href=\"$1\" target=\"_blank\">$1<\/a>");
Just tested it and it worked as expected, that is, no new window when opening the URL. |
Snitz 3.4 Readme | Like the support? Support Snitz too |
Edited by - ruirib on 19 February 2004 18:27:12 |
 |
|
ajhvdb
Junior Member
 
Netherlands
392 Posts |
Posted - 19 February 2004 : 18:49:47
|
I've a changed ReplaceURLs function. If an url does NOT start with "http:" the new page starts in the same window. I can post it if you want but it's large. |
 |
|
Jeepaholic
Average Member
  
USA
697 Posts |
|
Jeepaholic
Average Member
  
USA
697 Posts |
Posted - 20 February 2004 : 02:20:59
|
Ok...so, it boils down to IMAGE LINKS. Regardless of the line we've been pointing to, if the link is an actual image (i.e. [ url = "blah.blah.blah" ] [ img ] blah.blah.blah [ /img ] [ /url ] ) it still pops open a new window.
So, thoughts on where to make this adjustment?
Realistically, I think what would be awesome is if links to the same site opened in the same window...whereas links to OTHER sites opened in new windows. But, beggars can't be choosers!  |
Al Bsharah Aholics.com
Jeepaholics Anonymous Broncoholics Anonymous Network Insight
|
Edited by - Jeepaholic on 20 February 2004 02:22:51 |
 |
|
|
Topic  |
|