Post by Peter on Oct 31, 2004 13:45:33 GMT
Code by Awesome AnDrEw
I don't remember which Nuke program it is (it's either PostNuke, or PHPNuke), which allows so that when certain words are posted on a page the program will automatically pick them up, and convert them into noticeable links that lead to another site, an ad, or some sort of an affiliate. I was bored so I figured I'd do something similar to it.
1.) Modify the link words in "LinkWord". If you'd like you may add more by following the same structure it's already in. These will be the words to be picked up in posts, and converted.
2.) Edit the link URLs that are currently in "LinkURL". If you added more link words, than you must add the same amount of link URLs. These will be the target destination for the words, which are converted.
3.) Edit the link descriptions that are in "LinkDescription". You need to have the same amount descriptions as those in the "LinkWord". When users highlight the link, it'll tell them what the link leads to.
4.) If you'd like you may edit the "LinkLook" variable. All it does is allow the link to be a bit more noticeable in posts. Do not include a font tag in it though, as the script will then malfunction.
5.) Place the modified script into the forum footers of those forums, which you'd like to have the script change words for.
6.) If you do not put the correct number of items in the LinkWord, LinkURL, and LinkDescription variable you do not need to worry about any errors appearing as I have made it so that the script won't execute. You'll just have to make sure you put the right amount of items in those variables.
I don't remember which Nuke program it is (it's either PostNuke, or PHPNuke), which allows so that when certain words are posted on a page the program will automatically pick them up, and convert them into noticeable links that lead to another site, an ad, or some sort of an affiliate. I was bored so I figured I'd do something similar to it.
<script language="VBScript">
'Brought to you by
'Awesome AnDrEw & Web Wonders
'http://beam.to/w2
Dim Looper, Looper2, LinkWord, LinkURL, LinkDescription, LinkLook
LinkWord = Array("Word1", "Word2", "Word3")
LinkURL = Array("http://site1.com", "http://site2.com", "http://site3.com")
LinkDescription = Array("Click here to visit Word1's site", "Click here to visit Word2's site", "Click here to visit Word3's site")
LinkLook = Array("<b><u>", "</u></b>")
If Ubound(LinkWord) = Ubound(LinkURL) And Ubound(LinkURL) = Ubound(LinkDescription) Then
If instr(location.href, "&action=display") Then
For Looper = 0 to (document.getElementsByTagName("FONT").length - 1)
For Looper2 = 0 to Ubound(LinkWord)
If instr(ucase(document.getElementsByTagName("FONT")(Looper).innerHTML), ucase(LinkWord(Looper2))) Then
document.getElementsByTagName("FONT")(Looper).innerHTML = replace(ucase(document.getElementsByTagName("FONT")(Looper).innerHTML), ucase(LinkWord(Looper2)), ucase("<a href='" & LinkURL(Looper2) & "' title='" & LinkDescription(Looper2) & "'>" & LinkLook(0) & LinkWord(Looper2) & LinkLook(1) & "</a>"))
End If
Next
Next
End If
End If
</script>
1.) Modify the link words in "LinkWord". If you'd like you may add more by following the same structure it's already in. These will be the words to be picked up in posts, and converted.
2.) Edit the link URLs that are currently in "LinkURL". If you added more link words, than you must add the same amount of link URLs. These will be the target destination for the words, which are converted.
3.) Edit the link descriptions that are in "LinkDescription". You need to have the same amount descriptions as those in the "LinkWord". When users highlight the link, it'll tell them what the link leads to.
4.) If you'd like you may edit the "LinkLook" variable. All it does is allow the link to be a bit more noticeable in posts. Do not include a font tag in it though, as the script will then malfunction.
5.) Place the modified script into the forum footers of those forums, which you'd like to have the script change words for.
6.) If you do not put the correct number of items in the LinkWord, LinkURL, and LinkDescription variable you do not need to worry about any errors appearing as I have made it so that the script won't execute. You'll just have to make sure you put the right amount of items in those variables.