Post by michael2 on Jan 19, 2005 13:22:34 GMT
Here is a code i made it is a affiliates manager which can be edited in the admin area
Screen Shots: 1 2
Place in main header
Place in main footer
Screen Shots: 1 2
Place in main header
<script language="JavaScript">
/*
Affiliates Manager Admin Area Editable
Coded by Michael Burrows
Main header
Use freely but do not post in other locations please other than http://sangodesigns.proboards26.com/index.cgi
*/
var aT='None';
var aTc='Black';
var aW='92%';
var yA='Your affiliate code';
var aS='1';
var aI='URL';
if(location.href.indexOf('&type=editaffiliatesettings') != -1){
document.write('<table border="0" class="bordercolor" align="center" cellpadding="3" width="70%" cellspacing="1"><tr><td class="titlebg" align="left"><font color="Black">Affiliates Manager Settings</font><tr><td class="windowbg2" align="center">Change the affiliates<br/>Put the affiliate codes in here:<tr><td class="windowbg2" align="center"><textarea name="aT" id="aT" rows="10" cols="50">'+aT.replace(/<br\/>/ig,"\b+")+'</textarea><tr><td class="windowbg2" align="center">Change the affiliate table title colour:<tr><td class="windowbg2" align="center"><input type="textbox" name="aTc" id="aTc" value="'+aTc.replace(/<br\/>/ig,"\b+")+'"</input><tr><td class="windowbg2" align="center">Change the affiliate table width:<tr><td class="windowbg2" align="center"><input type="textbox" name="aW" id="aW" value="'+aW.replace(/<br\/>/ig,"\b+")+'"></input><tr><td class="windowbg2" align="center">Change your affiliate code:<tr><td class="windowbg2" align="center"><textarea name="yA" id="yA" rows="10" cols="50">'+yA.replace(/<br\/>/ig,"\b+")+'</textarea><tr><td class="windowbg2" align="center">Change the affiliate marquee speed:<tr><td class="windowbg2" align="center"><input type="textbox" name="aS" id="aS" value="'+aS.replace(/<br\/>/ig,"\b+")+'"></input><tr><td class="windowbg2" align="center">Change your affiliate image URL:<tr><td class="windowbg2" align="center"><input type="textbox" name="aI" id="aI" value="'+aI.replace(/<br\/>/ig,"\b+")+'"></input></tr></td></table>');
}
</script>
Place in main footer
<script language="JavaScript">
/*
Affiliates Manager Admin Area Editable
Coded by Michael Burrows
Main footer
Use freely but do not post in other locations please other than http://sangodesigns.proboards26.com/index.cgi
*/
if(location.href.indexOf('action=admin') != -1){
var xZ = document.getElementsByTagName('TD');
for(q=0;q<xZ.length;q++){
if(xZ[q].width=='50%' && xZ[q].vAlign=='top' && xZ[q].innerHTML.match(/Modify Headers and Footers/i)){
xZ[q].innerHTML = xZ[q].innerHTML.replace(/Modify Headers and Footers/i,'Modify Headers and Footers</a><br/><a href="/index.cgi?action=headersfooters&type=editaffiliatesettings">Affiliates Manager Settings</a>')
}}}
if(location.href.indexOf('&type=editaffiliatesettings') != -1){
document.title = document.title.split('-')[0] + ' - Affiliates Manager Settings'
var zE = document.getElementsByTagName('table');
for(t=0;t<zE.length;t++){
if(zE[t].className=='bordercolor' && zE[t].cellPadding=='4'){
zE[t].style.display='none'
}}
for(h=0;h<document.forms.length;h++){
if(document.forms[h].action=='index.cgi?action=headersfooters2'){
var zA = document.forms[h];
zA.onsubmit=sS;
zA.getElementsByTagName('input')[0].style.display='none';
zA.getElementsByTagName('input')[1].value='Save Affiliate Settings';
}}}
if(document.referrer.indexOf('&type=editaffiliatesettings') != -1){
document.title = document.title.split('-')[0] + ' - Affiliates Manager Settings'
var bG = document.getElementsByTagName('TD');
for(v=0;v<bG.length;v++){
if(bG[v].width=='100%' && bG[v].vAlign=='top' && bG[v].innerHTML.match(/Edit Headers \/ Footers/i)){
bG[v].innerHTML = bG[v].innerHTML.replace(/Edit Headers \/ Footers/i,'Edit Affiliate Settings')
bG[v].innerHTML = bG[v].innerHTML.replace(/Your headers and footers have been edited successfully./i,'Your affiliate settings have been edited successfully.')
}}}
function sS(){
var cE = zA.getElementsByTagName('textarea');
for(r=0;r<cE.length;r++){
if(cE[r].name=='header'){
cE[r].value = cE[r].value.replace(/var aT='.*';/i,"var aT='"+document.getElementById("aT").value+"';");
cE[r].value = cE[r].value.replace(/var aTc='.*';/i,"var aTc='"+document.getElementById("aTc").value+"';");
cE[r].value = cE[r].value.replace(/var aW='.*';/i,"var aW='"+document.getElementById('aW').value+"';");
cE[r].value = cE[r].value.replace(/var yA='.*';/i,"var yA='"+document.getElementById("yA").value+"';");
cE[r].value = cE[r].value.replace(/var aS='.*';/i,"var aS='"+document.getElementById("aS").value+"';");
cE[r].value = cE[r].value.replace(/var aI='.*';/i,"var aI='"+document.getElementById("aI").value+"';");
}}}
</script>
<table id='aT' border='0' class='bordercolor' align='center' cellpadding='4' cellspacing='1'><script>document.getElementById("aT").width=aW;</script><tr><td class='titlebg' align='left' colspan='2'><script>document.write("<font color='"+aTc+"'>")</script>Affiliates</font><tr><td class='windowbg2' align='center'><marquee direction='left' id='mQ'onmouseover='this.stop()' onmouseout='this.start()'><script>document.getElementById("mQ").scrollAmount=aS;document.write(aT);</script></marquee><td width='10%' class='windowbg2'><img id='aZ' border='0' onClick='javascript:sS()'><script>document.getElementById("aZ").src=aI;</script><textarea id='aZa' style='display:none;' cols='12' rows='2'></textarea><script>document.getElementById("aZa").value=yA;</script></td></tr></td></table>
<script>
function sS(){
document.getElementById('aZ').style.display="none"
document.getElementById('aZa').style.display=""
}
</script>