Post by Yasa on Apr 17, 2008 16:05:05 GMT
Recently, my forum told me it needed to update, so I updated it to the new version of Proboards. However, upon doing so, many of my previously working codes have crapped out and died...
Forum URL: www.narutopg.proboards49.com/index.cgi
This code, which used to be cross browser, doesn't seem to work on FireFox, but it does on IE. It's not the whole code... everything appears perfectly fine BUT the Category Background on FireFox.
Also, this Info Center (which I have just found hasn't been touched since 2005) doesn't work either.
So, if anyone could help me figure out why they are no longer working, I would greatly appreciate it ^_^
Forum URL: www.narutopg.proboards49.com/index.cgi
<Script Type="Text/Javascript">
<!--
/* By Twilight of The World */
/* The Background Alignment */
{ document.write('<style type="text/css">Body{background-position:top center;background-repeat:repeat;background-attachment:fixed}</style>'); }
/* The Menu Images Height in Pixels */
var cssMenu = [
'.menubg { height: 30; }',
'.menubg { height: 30; }',
'.menubg { height: 30; }',];
document.write('<style type="text/css">'+cssMenu[pb_skinid-1]+'</style>');
/* The Menu Text's Alignments */
var MenAlign = [
'document.getElementsByTagName("td")[5].align="right";',
'document.getElementsByTagName("td")[5].align="right";',
'document.getElementsByTagName("td")[5].align="right";',];
document.write('<script>'+MenAlign[pb_skinid-1]+'</script>');
var cssSkin = [];
/* First Break if for Class, second Break is for the Image URL */
cssSkin["1"] = [
["titlebg", "http://i48.photobucket.com/albums/f228/yasakura7984/cat-2.gif"],
["catbg", "http://img.photobucket.com/albums/v638/TheHarbor/Resurrection/title.gif"],
["menubg", "http://i48.photobucket.com/albums/f228/yasakura7984/cat-2.gif"],
["newstitlebg","http://i48.photobucket.com/albums/f228/yasakura7984/cat-2.gif"]
]
cssSkin["2"] = [
["titlebg", "http://img96.imageshack.us/img96/3515/catimage16rx.png"],
["catbg", "http://img96.imageshack.us/img96/6500/titleimage19bu.png"],
["menubg", "http://img96.imageshack.us/img96/3515/catimage16rx.png"],
["newstitlebg","http://img96.imageshack.us/img96/3515/catimage16rx.png"]];
var iSheet = document.styleSheets.item(0);
var isIE = (document.all)? true : false;
if(iSheet){
if(cssSkin[pb_skinid]){
for(s = 0; s < cssSkin[pb_skinid].length; s ++){
var tRule = "." + cssSkin[pb_skinid][s][0];
var tVal = cssSkin[pb_skinid][s][1];
if(isIE){
iSheet.addRule(tRule, "background-image: url(" + tVal + ")");
} else {
iSheet.insertRule(tRule + "{" + "background-image: url(" + tVal + ")}", 0);
}}}}
//-->
</Script>
This code, which used to be cross browser, doesn't seem to work on FireFox, but it does on IE. It's not the whole code... everything appears perfectly fine BUT the Category Background on FireFox.
<script type="text/javascript">
<!--
/*
Info Center 102
created by Ross, Copyright - 2005
this code may not be reposted
http://support.proboards.com
keep this header intact at all times
*/
// Member of the month settings. Leave blank for none
var motm = [
"haru", // Member Username
"Leon" //Display Name
];
// For the 'Forum Age'. Enter the forums start date in the form of 'DD','MM','YYYY' or leave blank to not use this feature.
var startDate = ['12','08','2005'];
// The titles used on each section of the Info Center.
var titles = [
"Info Center",
"Forum Stats",
"Birthdays & Events",
"Members Online"
];
var style = [
"#1D3945", // Color of the dividing lines
"dashed", // Style of the dividing lines
"Head Image URL", // Head image URL (Leave blank for none)
"Base Image URL" // base image URL (Leave blank for none)
];
//Edit the names of the staff groups, their corresponding group number(s) and an optional color for the group. Repeat the pattern for more groups.
var staff = []; var s = 0;
staff[s++] = ["Administrators","1","FF0000"];
staff[s++] = ["Global Moderators","2","0000FF"];
staff[s++] = ["Moderators","3","006600"];
// Do not edit below this line unless you know what you're doing
if(location.href.match(/\.com\/?(index.cgi)?\??(&?action=home)?(&?page=affiliates)?(#\w+)?$/)) {
var td = document.getElementsByTagName('td');
var div = document.createElement('div');
// Forum Age
var sta = new Date();
sta.setDate(startDate[0]);
sta.setMonth(startDate[1]-1);
sta.setYear(startDate[2]);
var cur = new Date();
var dif = cur - sta;
var totalMonth = 0;
var totalYear = 0;
var totalDay = Math.floor(dif/(60 * 60 * 24 * 1000)) + 1;
while(totalDay > 365) {
totalDay -= 365;
totalYear++;
}
while(totalDay > 30) {
totalDay -= 30;
totalMonth++;
}
var age = totalDay+' days';
if(totalMonth > 0)
age += ', '+totalMonth+' months';
if(totalYear > 0)
age += ', '+totalYear+' year';
age += '.';
// Starting Totals
var updated = 0;
var boards = 0;
var categories = 0;
var subs = 0;
// Box Styles
var b = [];
b['r'] = 'border-right: '+style[0]+' '+style[1]+' 1px;';
b['l'] = 'border-left: '+style[0]+' '+style[1]+' 1px;';
b['b'] = 'border-bottom: '+style[0]+' '+style[1]+' 1px; padding-bottom: 5px;';
b['pad'] = 'padding-right: 10px; padding-left: 20px; padding-bottom: 5px; padding-top: -1px;';
b['sep'] = 'padding-right: 10px; padding-left: 10px;';
for (i=0; i<td.length; i++)
{
if(td[i].width == '66%' && td[i].className == 'windowbg2')
{
boards++;
if(td[i].innerHTML.match(/\((\d+) sub/))
subs += parseInt(RegExp.$1);
if(td[i-1].innerHTML.match(/\[\*\]/))
updated++;
}
else if(td[i].className=='catbg' && td[i].innerHTML.match(/a name/i))
categories++;
else if(td[i].innerHTML.match(/<b>Info Center<\/b>/i)
&& td[i].parentNode.parentNode.parentNode.className == 'bordercolor'
&& td[i].parentNode.parentNode.parentNode.width == '100%')
{
td[i].parentNode.parentNode.className = 'infocenter';
var iCell = td[i].getElementsByTagName('td');
var iHolder = '';
var posts = td[i].innerHTML.match(/Total Posts: (.+?)</)? parseInt(RegExp.$1.replace(/,/g,'')) : '';
var topics = td[i].innerHTML.match(/Total Topics: (.+?) &nb/)? parseInt(RegExp.$1.replace(/,/g,'')) : '';
var pb_date = td.item(2).getElementsByTagName('font').item(0).innerHTML.split(/<br>/i)[1];
if(pb_username == 'Guest')
var pms = 'Please <a href="?action=login">Login</a> to access this feature.';
else
var pms = 'You have <a href="?action=pm">'+ (td.item(2).innerHTML.match(/, (\d+) are new./)? +RegExp.$1+' Unread Messages</a>' : '1 Unread Message</a>');
var members = iCell[5].innerHTML.match(/Total Members: <a.+?>(.+?)<\/a>/i)? RegExp.$1 : 0;
var newmember = iCell[5].innerHTML.match(/Newest Member: (<a.+?>.+?<\/a>)/i)? RegExp.$1 : 'N/A';
var lastpost = iCell[4].innerHTML.match(/Last Updated Topic: (<a.+?>.+?<\/a>)( )?by /i)? RegExp.$1 : 'N/A';
var lastposter = iCell[4].innerHTML.match(/<\/a>\s?by (<a.+?>.+?<\/a>)\s?\(/i)? 'By the Member: '+RegExp.$1 : (iCell[4].innerHTML.match(/by\s(.+?)\s\(/)? 'By the Guest '+RegExp.$1 : 'N/A');
var lastdate = iCell[4].innerHTML.match(/(.+\)(.+)?)?\((.+?at.+?)\)<br>View/i)? RegExp.$3 : 'N/A';
var totals = [
(td[i].innerHTML.match(/(Total Posts: .+?)</)? RegExp.$1 : ''),
(td[i].innerHTML.match(/(Total Topics: .+?) &nb/)? RegExp.$1 : ''),
('Posts per Topic: '+ Math.round(posts / topics)),
// ('Topics per Board: '+ Math.round(topics / boards)),
('Posts per Board: '+ Math.round(posts / boards))
];
var stats = '<table width="100%"><tr><td width="100%" style="'+b['pad']+'">';
stats += '<div style="'+b['b']+'">';
for(t=0; t<totals.length; t++) {
stats += '<span style="'+b['sep']+'">'+totals[t]+'</span>';
if(totals[t+1])
stats += '-';
}
stats += '</div>';
stats += '<table width="100%"><tr><td width="40%" style="'+b['r']+'">';
stats += 'There are a total of '+members+' registered members.<br />';
stats += 'We would like to welcome '+newmember+' as the newest member to join '+document.title.split(/-/)[0];
stats += '</td><td width="30%" style="'+b['pad']+'">';
stats += 'The Last Post Made was: '+ lastpost+'<br />';
stats += 'Made On: '+lastdate+'<br />';
stats += lastposter;
stats += '</td></tr></table>';
stats += '</td></tr></table>';
iCell[0].getElementsByTagName('b').item(0).innerHTML = titles[0];
iCell[1].getElementsByTagName('b').item(0).innerHTML = titles[1];
iCell[3].innerHTML = stats;
iCell[3].colSpan = '2';
iCell[2].style.display = 'none';
// Head & Base Images
var infoTable = td[i].parentNode.parentNode.parentNode;
if(style[2].match(/^http:\/\//i)) {
var headCenter = document.createElement('center');
var headImg = document.createElement('img');
headImg.src = style[2];
headCenter.appendChild( headImg );
infoTable.parentNode.insertBefore(headCenter, infoTable)
}
if(style[3].match(/^http:\/\//i)) {
var baseCenter = document.createElement('center');
var baseImg = document.createElement('img');
baseImg.src = style[3];
baseCenter.appendChild( baseImg );
infoTable.parentNode.insertBefore(baseCenter, infoTable.nextSibling)
}
// Birthdays and Events
var events = '';
events += '<table width="100%"><tr><td width="100%" style="'+b['b']+'"><font size="1">';
var events_str = '';
var x = iCell.length - 5;
if(iCell[x].innerHTML.match(/action=calendarview/)) {
var totalEvents = iCell[x].getElementsByTagName('a').length;
var event_plural = (totalEvents == 1)? ['is',''] : ['are','s'];
events_str += '<tr><td width="100%" style="'+b['b']+'">';
events_str += 'There '+event_plural[0]+' '+totalEvents +' event'+event_plural[1]+' this month.';
events_str += '</td><tr><tr><td width="100%" style="'+b['pad']+'">';
events_str += iCell[x].innerHTML;
events_str += '</td><tr>';
iCell[x-2].style.display = 'none';
x-=4;
}
if(iCell[x].innerHTML.match(/((\d+) birthdays? today.)/)) {
var memberBirthdays = parseInt(RegExp.$1);
var allBirthdays = iCell[x].innerHTML.split(/<br>/i)[1];
if(iCell[x].innerHTML.match(/group\d+/)) {
var staffBirthdays = 0;
var a = iCell[x].getElementsByTagName('a');
for(l=0; l<a.length; l++) {
if(a.item(l).className) {
staffBirthdays++;
memberBirthdays--;
}
}
var staff_plural = (staffBirthdays == 1)? ['is',''] : ['are','s'];
events += 'There '+staff_plural[0]+' '+staffBirthdays+' staff member'+staff_plural[1]+' celebrating their birthday'+staff_plural[1]+' today. ';
}
if(memberBirthdays != 0) {
var member_plural = (memberBirthdays == 1)? ['is',''] : ['are','s'];
events += 'There '+member_plural[0]+' '+memberBirthdays+' member'+member_plural[1]+' celebrating their birthday'+member_plural[1]+' today. ';
}
if(memberBirthdays != 0 || staffBirthdays != 0) {
events += '</font></td></tr><tr><td width="100%" style="'+b['pad']+'">';
events += '<font size="1">'+allBirthdays;
}
iCell[x-2].style.display = 'none';
if(events_str.length > 0) {
iCell[x-1].parentNode.style.display = 'none';
iCell[x-3].parentNode.style.display = 'none';
}
else
x-=4;
}
if(events.length > 120 || events_str.length > 0) {
x+=4;
events += '</td></tr>'+ events_str +'</table>';
iCell[x-3].getElementsByTagName('b').item(0).innerHTML = titles[2];
iCell[x-1].colSpan = '2';
iCell[x-1].innerHTML = events;
}
// Users Online
var z = iCell.length - 1;
var a = iCell[z].getElementsByTagName('a');
var onlineTotals = '';
for(j=0; j<a.length; j++) {
for(s=0; s<staff.length; s++) {
if(!staff[s][2])
staff[s][2] = '';
groupCount = (staff[s][3])? staff[s][3] : 0;
if(a[j].className && a[j].className.match(new RegExp('group'+staff[s][1]+'$'))) {
groupCount++;
}
staff[s][3] = groupCount;
}
}
var mostOn = iCell[z].innerHTML.match(/(M.{15}e was .+<br>)/i)? RegExp.$1 : '';
var totalOn = 0;
for(s=0; s<staff.length; s++) {
onlineTotals += '<font color="'+staff[s][2]+'">'+ ((staff[s][3])? staff[s][3] : 0) +' '+staff[s][0]+'</font><br />';
totalOn += parseInt(staff[s][3]);
}
iCell[z].innerHTML.match(/((\d+) Member(s)?),/)
onlineTotals += RegExp.$1 +'<br />';
totalOn += parseInt(RegExp.$2);
if(iCell[z].innerHTML.match(/ ((\d+) Invisible) User(s)?./)) {
onlineTotals += RegExp.$1 + ' Member' + RegExp.$3 +'<br />';
totalOn += parseInt(RegExp.$2);
}
if(iCell[z].innerHTML.match(/((<a.+?>)?(\d+) Guest(s)?(<\/a>)?)(\.|\,)/i)) {
onlineTotals += RegExp.$1 +'<br />';
totalOn += parseInt(RegExp.$3);
}
var usersOnline = '<table width="100%"><tr><td vAlign"top" width="28%" rowSpan="3" style="'+b['r']+'">';
usersOnline += onlineTotals;
usersOnline += '</td><td width="72%" style="'+b['pad']+b['b']+'">';
usersOnline += 'There are currently '+totalOn+' members online. '+mostOn;
usersOnline += '</td></tr><tr><td vAlign="top" width="82%" style="'+b['pad']+b['b']+'">';
usersOnline += iCell[z].innerHTML.split(/<br>/i)[1];
usersOnline += '</td></tr><tr><td style="'+b['pad']+'">';
usersOnline += pms;
if(startDate[0] && startDate[0].match(/\d+/))
usersOnline += ' &nb'+'sp; - &nb'+'sp; Forum Age: '+age;
if(motm[0].match(/\w+/))
usersOnline += ' &nb'+'sp; - &nb'+'sp; <br>The Ninja of the Month belongs to <a href="?action=viewprofile&user='+motm[0]+'">'+motm[1]+'</a>';
usersOnline += '</td></tr></table>';
iCell[z-3].getElementsByTagName('b').item(0).innerHTML = titles[3];
iCell[z-2].style.display = 'none';
iCell[z-1].colSpan = '2';
iCell[z-1].innerHTML = usersOnline;
}
}
}
//-->
</script>
Also, this Info Center (which I have just found hasn't been touched since 2005) doesn't work either.
So, if anyone could help me figure out why they are no longer working, I would greatly appreciate it ^_^