Author |
Topic |
leatherlips
Senior Member
USA
1838 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 25 April 2008 : 11:19:33
|
I have some code for that which I seem to recall posting here; let me have a search around ...
< |
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.” |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 25 April 2008 : 11:27:50
|
Here's the original topic and here's the file that I was linking to.
Actually unearthed that in this topic where I helped you do something similar on default.asp!
< |
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 25 April 2008 11:28:19 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 28 April 2008 : 04:48:53
|
My domain is hardcoded into that function so you'll need to change all occurrences of WOO.IE to MANGIONEMAGIC.COM
Also note that I use my own JS function in that file to spawn new windows so you'll also need to change all occurrences of onclick=""return tL(this,'e');"" to the appropriate target attribute.
< |
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 28 April 2008 04:51:35 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 28 April 2008 : 09:21:21
|
Drop the onclick event completely and just use the target attribute. That function has been pretty heavily edited, mainly to make it more compact; other than what I've already mentioned, I don't think I've made any other changes that would effect its compatibility with a base Snitz install but it's a few years since I customised it so keep a copy of the original function to hand just in case things start going askew.
< |
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.” |
|
|
leatherlips
Senior Member
USA
1838 Posts |
Posted - 28 April 2008 : 09:35:59
|
I can't get it to work.
Here are the two spots with the onclick. What do I do to them?
oTag="" oTag2="[url]" c2Tag="" roTag="<a href=""" rc1Tag=""" onclick=""_BLANK;"">" rc2Tag="</a>" rc3Tag=""">" oTagPos=instr(1,strToFormat,oTag,1) c1TagPos=instr(1,strToFormat,c1Tag,1) if oTagpos>0 and c1TagPos>0 then strArray=split(strToFormat,oTag,-1,1) for Counter=0 to ubound(strArray) if instr(1,strArray(Counter),c1Tag,1)>0 then strArray2=split(strArray(Counter),c1Tag,-1,1) strArray2(0)=replace(strArray2(0),Chr(34)," ")
ReplaceURLs=ReplaceURLs&"<a href="""&strArray2(0)&""" onclick=""_BLANK;"">"&strFirstPart&"</a>"&strSecondPart elseif ucase(left(strArray2(0),7))="http://" then ReplaceURLs=ReplaceURLs&roTag&strArray2(0)&rc1Tag&strFirstPart&rc2Tag&strSecondPart elseif ucase(left(strArray2(0),8))="https://" then ReplaceURLs=ReplaceURLs&roTag&strArray2(0)&rc1Tag&strFirstPart&rc2Tag&strSecondPart elseif ucase(left(strArray2(0),4))="WWW." then< |
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 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 28 April 2008 : 10:10:28
|
oTag="[url=""" c1Tag="""]" oTag2="[url]" c2Tag="[/url]" roTag="<a href=""" rc1Tag=""" target=""_blank"">" rc2Tag="</a>" rc3Tag=""">" oTagPos=instr(1,strToFormat,oTag,1) c1TagPos=instr(1,strToFormat,c1Tag,1) if oTagpos>0 and c1TagPos>0 then strArray=split(strToFormat,oTag,-1,1) for Counter=0 to ubound(strArray) if instr(1,strArray(Counter),c1Tag,1)>0 then strArray2=split(strArray(Counter),c1Tag,-1,1) strArray2(0)=replace(strArray2(0),Chr(34)," ")
ReplaceURLs=ReplaceURLs&"<a href="""&strArray2(0)&""" target=""_blank"">"&strFirstPart&"</a>"&strSecondPart elseif ucase(left(strArray2(0),7))="http://" then ReplaceURLs=ReplaceURLs&roTag&strArray2(0)&rc1Tag&strFirstPart&rc2Tag&strSecondPart elseif ucase(left(strArray2(0),8))="https://" then ReplaceURLs=ReplaceURLs&roTag&strArray2(0)&rc1Tag&strFirstPart&rc2Tag&strSecondPart elseif ucase(left(strArray2(0),4))="WWW." then
< |
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 28 April 2008 10:12:11 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 28 April 2008 : 10:44:48
|
You're welcome, mate
< |
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.” |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 28 April 2008 : 14:07:46
|
As always, Shaggy comes up trumps, and it is greatly appreciated! Correct me if I am wrong, but when entering an URL www.domain.com in the forum, when posted I thought the hyperlink was automatically generated to show in the topic. Or do we have to, when, entering the url, use the insert URL option and manually amend the [url] tag to include the url ie [ url = "www.domain.com" ] Note: spaces added to show example. If I am wrong, could this function be altered to do such.. 'Icing on the cake' so to speak! Thanks so far..< |
Edited by - Andy Humm on 28 April 2008 18:13:14 |
|
|
leatherlips
Senior Member
USA
1838 Posts |
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 28 April 2008 : 18:04:22
|
Since adding the suggested code, I have also noticed all the previously entered urls have lost their hyperlinks...
I have looked at another forum and added a new url www.bbc.co.uk previewed the url prior to posting and the url has a hyperlink automatically generated. When posted the url hyperlink works. (opened in new window) Strange, doing the same with my forum the hyperlink is not generated, with new code as provided on this thread.. Leatherlips, kindly forwarded the complete 'url function' which is located at http://drop.io/snitzforum I have replaced this entire function in my inc_func_common.asp and the auto-hyperlink does not work. I have reverted back to the original url function Can anyone help.. Thank you.. < |
Edited by - Andy Humm on 29 April 2008 04:11:07 |
|
|
Shaggy
Support Moderator
Ireland
6780 Posts |
Posted - 29 April 2008 : 04:07:51
|
Hmm ... obviously made more changes to that function than I remembered (although, one of the first things I do on any new forum is to remove the edit_hrefs function, so I really should have!). Best thing to do for now is to revert back to the original function and I'll try making the changes again with a base inc_func_common.asp.
< |
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.” |
|
|
Andy Humm
Average Member
United Kingdom
908 Posts |
Posted - 29 April 2008 : 04:13:17
|
Looking through the inc_func_common.asp I notice there is a chkUrl function and replaceURL function. Can I email you a txt version of my inc_func_common to see what the problem is.. < |
|
|
Topic |
|