|
Post by Majortopio on Dec 17, 2005 23:03:08 GMT
<script> var td = document.getElementsByTagName('td'); var img = new Array()
/*To add more image urls, copy the line, and make sure the number is one more than the previous.*/
img[0] = "URL of Image"; img[1] = "URL of Image"; img[2] = "URL of Image";
//Stop Edit
var border = "0"; if(location.href.match(/action=(post($|&)|createpoll|im(send|quote)|modify)/)){ for(t=0;t<td.length;t++){ if(td[t].width == "30%" && td[t].className == "windowbg2" && td[t].innerHTML.match(/Add Smilies:/i)){
//Edit
td[t+1].innerHTML+="<a href=javascript:add('[img]"+img[0]+"[/img]')><img src="+img[0]+" border=0></a>";
} } } </script> Yea, insructions? Coming right up Adding IMG URLs: img[ 0] = "URL of Image"; img[ 1] = "URL of Image"; img[ 2] = "URL of Image"; Here are where the img URLs are stored. If you want to have more, just add this line: img[ #] = "URL of Image"; And change the blue part to the next number, e.g 1 2 3 4Got it? Good. Adding the SmileysFind this part of the code: td[t+1].innerHTML+="<a href=javascript:add('[img]"+img[0]+"[/img]')><img src="+img[0]+" border=0></a>"; The only parts you have to edit are the blue. To make more smileys appear, copy that whole piece of code, and paste it after clicking on the ';' and pressing enter 2 times. Then you edit the blue part to the img URL id, if you can remember the IMG URLs we edited before. So, if you want three extra smileys to appear, copy: td[t+1].innerHTML+="<a href=javascript:add('img]"+img[ 0]+"[/img]')><img src="+img[ 0]+" border=0></a>";(Note, copy this when needed in the actual code) and paste it two times, each with an empty line between them. Then edit the blue part to '1', or '2', depending on which smiley you want to appear when pressing that. ---- Yea, sorry if that's not allowed in open source. Feel free to edit. My first useable code
|
|
|
Post by crazynarutard on Dec 18, 2005 3:02:25 GMT
for location check, you could use: if( document.postForm )
|
|
|
Post by Majortopio on Dec 18, 2005 7:44:09 GMT
Yea. I got that location check from an open source place some forum.... I must be the worst coder in the universe, I'm sure
|
|
|
Post by Me on Dec 29, 2005 4:07:50 GMT
Yea. I got that location check from an open source place some forum.... I must be the worst coder in the universe, I'm sure When I coded you wern't .
|
|
|
Post by Eric on Dec 29, 2005 4:26:40 GMT
Code: <script> var td = document.getElementsByTagName('td'); var img = new Array()
/*To add more image urls, copy the line, and make sure the number is one more than the previous.*/
img[0] = "URL of Image"; img[1] = "URL of Image"; img[2] = "URL of Image";
//Stop Edit
var border = "0"; if(document.postForm){ for(t=0;t<td.length;t++){ if(td[t].width == "30%" && td[t].className == "windowbg2" && td[t].innerHTML.match(/Add Smilies:/i)){
for(i = 0; i < img.length; i++){ td[t+1].innerHTML+="<a href=javascript:add('[img]"+img+"[/img]')>"+ "<img src="+img +" border=0></a>"; } } } } </script>
[/size] My version
|
|
|
Post by Xephra on Dec 29, 2005 4:41:55 GMT
<script> var td = document.getElementsByTagName('td'); var img = new Array()
/*To add more image urls, copy the line, and make sure the number is one more than the previous.*/
img[0] = "URL of Image"; img[1] = "URL of Image"; img[2] = "URL of Image";
//Stop Edit
if(document.postForm){ for(t=0;t<td.length;t++){ if(td[t].width == "30%" && td[t].className == "windowbg2" && td[t].innerHTML.match(/Add Smilies:/i)){
for(i = 0; i < img.length; i++){ var imgSmile = document.createElement('img'); var pbLink = "<a href=javascript:add('[img]"+img[i]+"[/img]')>"; imgSmile.src = img[i]; var imgDisplay = td[t+1].appendChild(pbLink + imgSmile + '</img></a>'; } } } } </script>
I dunno, whatever.
But what was the point in the border variable, Eric?
|
|
|
Post by Eric on Dec 29, 2005 5:02:20 GMT
I dunno, ask the Major Why do you have an </img>? Not to mention a mix between full DOM and regular HTML? Also, I don't think that you can append HTML.
|
|
|
Post by Xephra on Dec 29, 2005 5:05:04 GMT
Because I am the mix...no, I actually put </img> in there on accident...and I meant to make it all in one thing, but I got bored...XD
And you can append the TD if I'm not mistaken, or were you referring to the html inside of the append()?
|
|
|
Post by acoolie530 on Dec 29, 2005 5:06:06 GMT
I dunno, ask the Major Why do you have an </img>? Not to mention a mix between full DOM and regular HTML? Also, I don't think that you can append HTML. You have to turn your head to a 87 degree angle and then it will all make sense.
|
|
|
Post by Eric on Dec 29, 2005 16:30:39 GMT
Because I am the mix...no, I actually put </img> in there on accident...and I meant to make it all in one thing, but I got bored...XD And you can append the TD if I'm not mistaken, or were you referring to the html inside of the append()? The HTML inside of the append.
|
|
|
Post by Xephra on Dec 29, 2005 16:32:37 GMT
87 degrees... ... lmao
|
|
|
Post by Majortopio on Dec 31, 2005 11:06:30 GMT
But what was the point in the border variable, Eric? Yea, it was the meaning that I was going to let the user decide if he/she wanted a border. I know, kinda stupid, but it gives them one more thing to think about :P I guess I forgot about it :P
|
|