100%
|
Post by Aaron on May 22, 2005 6:34:00 GMT -8
Rating IconsFor Use on ProBoards version 4[ Cross-Browser ] Preview: HERE
Add the following coding to a specific Board Footer (like a rating board): <script type="text/javascript"> <!-- /* Rating Icons Created by Naruto hatakeforum.proboards30.com/ */
// Edit URL# to the URL of your rating icon
var imgUrl1 = "URL1"; var imgUrl2 = "URL2"; var imgUrl3 = "URL3"; var imgUrl4 = "URL4"; var imgUrl5 = "URL5";
// No Editting Necessary Below This Point
var rImg1 = "<img src=\"" + imgUrl1 + "\" border=\"0\" />"; var rImg2 = "<img src=\"" + imgUrl2 + "\" border=\"0\" />"; var rImg3 = "<img src=\"" + imgUrl3 + "\" border=\"0\" />"; var rImg4 = "<img src=\"" + imgUrl4 + "\" border=\"0\" />"; var rImg5 = "<img src=\"" + imgUrl5 + "\" border=\"0\" />";
var td = document.getElementsByTagName("td"); for(t=0;t<td.length;t++) { if(td[t].width=="30%" && td[t].className=="windowbg2" && td[t].innerHTML.match(/Message:/i)) { td[t].vAlign = "top"; td[t].innerHTML = "<font size=\"2\">Message:</font><br />" + "<hr size=\"1\" class=\"hr\" />" + "<font size=\"2\">Rating Icons:</font><br />" + "<br /><div align=\"center\">" + "<a href=\"javascript:add(' rate1 ')\">" + rImg1 + "</a><br />" + "<a href=\"javascript:add(' rate2 ')\">" + rImg2 + "</a><br />" + "<a href=\"javascript:add(' rate3 ')\">" + rImg3 + "</a><br />" + "<a href=\"javascript:add(' rate4 ')\">" + rImg4 + "</a><br />" + "<a href=\"javascript:add(' rate5 ')\">" + rImg5 + "</a></div>"; } if(td[t].width=="80%" && td[t-1].vAlign=="top" && td[t-1].width=="20%") { if(!location.href.match(/action=headersfooters/i)) { td[t].innerHTML = td[t].innerHTML.replace(/rate1/i,rImg1); td[t].innerHTML = td[t].innerHTML.replace(/rate2/i,rImg2); td[t].innerHTML = td[t].innerHTML.replace(/rate3/i,rImg3); td[t].innerHTML = td[t].innerHTML.replace(/rate4/i,rImg4); td[t].innerHTML = td[t].innerHTML.replace(/rate5/i,rImg5); } } } //--> </script>Edit these lines of coding: var imgUrl1 = "URL1";To your image url. For example: var imgUrl1 = "http://wontgetlost.com/codingtest_r1.gif";
Last Edit: May 22, 2005 6:35:27 GMT -8 by Aaron
|
|
|
Post by Nomi on May 22, 2005 7:30:15 GMT -8
Nice work Naruto looks great.
|
|
|
Post by SonicX on May 22, 2005 15:29:07 GMT -8
Kool code!!
|
|
|
Post by Jay on May 24, 2005 12:35:38 GMT -8
Woo, that's a big code! I like it mate. 'javascript:add' has a hard time working with Opera, and used to not work with Mozilla. Not really sure why it does with PBv4. Suggestions: Maybe make an array for the image url's and use ImgArray[loop][0] for the rating text, and ImgArray[loop][1] for the image url. --- Something like: ImgArray = []; ImgArray[0] = ['rate1','http://yourhost.com/rate_image.gif'] ImgArray[1]... Also, you don't need to escape every (") mark, just use ('), or no slashes at all! Final suggestion: Insert the data via insertcell instead of using an hr line for the border. Looks a bit neater that way.
Last Edit: May 24, 2005 12:38:36 GMT -8 by Jay
|
|