|
Post by Streamstrider on Jul 26, 2012 8:45:04 GMT -8
I'm using the following affiliate code. I'm not wanting to change how it works or anything. I just want to know if there's a way to make all banner images in the affiliates a certain size. That way, it doesn't matter what size the image is; the code changes it to fit the requirement. <script type="text/javascript"> <!--
/*Random Affiliate Table - By Alex - Open Source*/
var Random_Affiliate={
Affiliate_Image: "http://i278.photobucket.com/albums/kk119/Streamstrider182/Forum%20Images/realityshiftbanner-1.jpg", Affiliates_Per_Line: 8, Affiliate_Information: [ ["Fallen Crusade", "http://fallen-crusade.proboards.com/index.cgi", "http://i830.photobucket.com/albums/zz222/Pirate_penguin/FCaffilliate.png"],
["Riddle Me This", "http://megaminounmei.proboards.com/index.cgi", "http://i45.tinypic.com/jj4fq1.jpg"],
["Waiting for the End", "http://waitingfortheend.proboards.com", "http://i447.photobucket.com/albums/qq192/xxchocoii/button.jpg"],
["Nightmare's Gate", "http://nightmaresgate.maxforum.org/", "http://i136.photobucket.com/albums/q184/KaydeGirl/Other/nightmaregate.gif"],
["Souls on Fire", "http://z7.invisionfree.com/Souls_On_Fire/", "http://i1223.photobucket.com/albums/dd506/BIGrpg/affiliates/sof_banner2_88x31.gif"],
["Once Upon a Nightmare", "http://grimm7.proboards.com/index.cgi", "http://i751.photobucket.com/albums/xx160/mercyscar7/ONCE%20UPON%20A%20NIGHTMARE/NIGHTMAREaff8.jpg"],
["Epicenter", "http://epi-center.proboards.com/index.cgi", "http://i1232.photobucket.com/albums/ff364/cheekanzoop/Aff.png"],
["Third World", "http://midnightchoas.proboards.com", "http://i92.photobucket.com/albums/l33/golden_rain305/Backgrounds/dexter_icon-blood.png"],
["The Land of Dheynor", "http://landofdheynor.proboards.com", "http://i54.tinypic.com/2uid7oi.jpg"] //No comma on last line ],
Location_Check: function(){ if(window.location.href.match(/action=home/) || !window.location.href.match(/action/) && !document.modifyForm && !document.postForm && !document.title.match(/\s-\sLogin/)){ this.Execute_Loop(); } }, Execute_Loop: function(){ var Td=document.getElementsByTagName('td'); var i=Td.length-1; do{ if(Td.item(i).className=="catbg" && Td.item(i).colSpan=="2" && Td.item(i).getElementsByTagName('b').item(0) && Td.item(i).getElementsByTagName('b').item(0).innerHTML.match(/^Forum Statistics$/)){ var Affiliate_Title=Td.item(i).parentNode.cloneNode(true); Affiliate_Title.getElementsByTagName('b').item(0).innerHTML = 'Affiliates'; var Affiliate_Row=Td.item(i).parentNode.nextSibling.cloneNode(true); Affiliate_Row.getElementsByTagName('img').item(0).src=this.Affiliate_Image; Affiliate_Row.getElementsByTagName('img').item(0).alt='affiliates'; var Affiliate_Cell=Affiliate_Row.firstChild.nextSibling; Affiliate_Cell.align='center'; Affiliate_Cell.id='Affiliate_Cell'; var Affiliate_End=Td.item(i).parentNode.cloneNode(true); Affiliate_End.firstChild.innerHTML='<div style="float: left;"><font size="1"><a href="javascript: Random_Affiliate.View_All()" id="View_Text">View All Affiliates</a></font></div><div style="float: right;"><font size="1"><a href="javascript: Random_Affiliate.Randomize_Affiliates()">Randomize</a></font></div>'; Td.item(i).parentNode.parentNode.appendChild(Affiliate_Title); Td.item(i).parentNode.parentNode.appendChild(Affiliate_Row); Td.item(i).parentNode.parentNode.appendChild(Affiliate_End); this.Randomize_Affiliates(); break; } i--; } while(i>7); }, Randomize_Affiliates: function(){ document.getElementById('View_Text').parentNode.innerHTML='<a href="javascript: Random_Affiliate.View_All()" id="View_Text">View All Affiliates</a>'; var Affiliate_Cell=document.getElementById('Affiliate_Cell'); Affiliate_Cell.innerHTML=''; for(var a=0;a<this.Affiliates_Per_Line;a++){ var Random_Affiliate = Math.floor((Math.random()*this.Affiliate_Information.length)); safe=0; while(safe<30 && Affiliate_Cell.innerHTML.match(this.Affiliate_Information[Random_Affiliate][0])){ var Random_Affiliate = Math.floor((Math.random()*this.Affiliate_Information.length)); safe++; } Affiliate_Cell.innerHTML+='<a href="'+this.Affiliate_Information[Random_Affiliate][1]+'"><img src="'+this.Affiliate_Information[Random_Affiliate][2]+'" border="0" alt="'+this.Affiliate_Information[Random_Affiliate][0]+'" title="'+this.Affiliate_Information[Random_Affiliate][0]+'" /></a> '; } }, View_All: function(){ document.getElementById('View_Text').parentNode.innerHTML='<a href="javascript: Random_Affiliate.View_Random()" id="View_Text">View Random</a>'; var Affiliate_Cell=document.getElementById('Affiliate_Cell'); var Affiliate_Hold='<span>'; var i=0; for(a=this.Affiliate_Information.length-1;a>=0;a--){ if(!Affiliate_Cell.innerHTML.match(this.Affiliate_Information[a][0])){ (i%this.Affiliates_Per_Line==0)? Affiliate_Hold+='<br/>' : ''; i++; Affiliate_Hold+='<a href="'+this.Affiliate_Information[a][1]+'"><img src="'+this.Affiliate_Information[a][2]+'" border="0" alt="'+this.Affiliate_Information[a][0]+'" title="'+this.Affiliate_Information[a][0]+'" /></a> '; } } Affiliate_Hold+='</span>'; Affiliate_Cell.innerHTML+=Affiliate_Hold; }, View_Random: function(){ document.getElementById('View_Text').parentNode.innerHTML='<a href="javascript: Random_Affiliate.View_All()" id="View_Text">View All Affiliates</a>'; var Affiliate_Cell=document.getElementById('Affiliate_Cell'); Affiliate_Cell.removeChild(Affiliate_Cell.getElementsByTagName('span').item(0)); } }; Random_Affiliate.Location_Check();
//--> </script>
|
|
|
Post by Wormopolis on Jul 29, 2012 4:42:05 GMT -8
Im assuming you want them all to be 88x31?
|
|
|
Post by Streamstrider on Aug 9, 2012 12:59:35 GMT -8
Yes. I want all images placed into the code's affiliate area to be 88x31.
|
|
|
Post by Wormopolis on Aug 10, 2012 0:33:33 GMT -8
Affiliate_Cell.innerHTML+='<a href="'+this.Affiliate_Information[Random_Affiliate][1]+'"><img src="'+this.Affiliate_Information[Random_Affiliate][2]+'" height="31" width="88" border="0" alt="'+this.Affiliate_Information[Random_Affiliate][0]+'" title="'+this.Affiliate_Information[Random_Affiliate][0]+'" /></a> ';
add the red
|
|
|
Post by Streamstrider on Aug 10, 2012 5:58:45 GMT -8
Thanks, Wormo. You're the best.
|
|