Post by Ross on Sept 15, 2006 9:05:32 GMT
Global Footer
What this does is it lets Admins/Moderators mark their threads with a special thread icon. First of all, replace this image () in the "Customize Images" part of the admin panel with the image you wish to use. If this new image URL is not called "exclamation.gif", then replace the part in blue with the last part of the new image URL, anything past the last forward slash. In the red, list the usernames of any moderators who can use this icon, separate each username with a "|" line, any members with access to the admin panel can automatically use the icon.
<script type="text/javascript">
<!--
/* Admin thread icon - Ross - support.proboards.com */
var td = document.getElementsByTagName('td');
var is_admin = (td.item(5).innerHTML.match(/action=admin/))? true : (pb_username.match(/^(mod_username_1|mod_username_2)$/))? true : false;
if(document.postForm) {
if(is_admin) {
var post_table = document.postForm.parentNode;
var icon_row = document.createElement('tr');
document.postForm.nosmiles.parentNode.parentNode.parentNode.insertBefore(icon_row, document.postForm.nosmiles.parentNode.parentNode);
var icon_title_cell = icon_row.insertCell(0);
icon_title_cell.className = 'windowbg';
var icon_title_font = document.createElement('font');
icon_title_font.size = '2';
icon_title_font.appendChild(document.createTextNode('Admin Icon:'));
icon_title_cell.appendChild(icon_title_font);
var icon_input_cell = icon_row.insertCell(1);
icon_input_cell.className = 'windowbg';
var icon_input_checkbox = document.createElement('input');
icon_input_checkbox.type = 'checkbox';
icon_input_checkbox.id = 'admin_icon';
if(document.postForm.icon.value == 'exclamation') {
icon_input_checkbox.checked = true;
}
icon_input_cell.appendChild(icon_input_checkbox);
var icon_description_font = document.createElement('font');
icon_description_font.size = '1';
icon_description_font.appendChild(document.createTextNode(' Check this box to use the reserved thread icon.'));
icon_input_cell.appendChild(icon_description_font);
}
document.postForm.icon.parentNode.parentNode.style.display = 'none';
document.postForm.onsubmit = function() {
if(is_admin && document.getElementById('admin_icon').checked == true) {
document.postForm.icon.value = 'exclamation'
} else {
document.postForm.icon.value = 'xx';
}
}
} else if(location.href.match(/board=/) && !location.href.match(/action=display/)) {
for( i = 0; i < td.length; i ++ ) {
if(td.item(i).width == '5%' && td.item(i-1).width == '5%' && td.item(i+1).width.match(/^4(3|8)%$/)) {
if(td.item(i).innerHTML.match(/exclamation.gif/)) {
td.item(i-1).innerHTML = td.item(i).innerHTML;
}
td.item(i).style.display = 'none';
}
}
}
//-->
</script>
What this does is it lets Admins/Moderators mark their threads with a special thread icon. First of all, replace this image () in the "Customize Images" part of the admin panel with the image you wish to use. If this new image URL is not called "exclamation.gif", then replace the part in blue with the last part of the new image URL, anything past the last forward slash. In the red, list the usernames of any moderators who can use this icon, separate each username with a "|" line, any members with access to the admin panel can automatically use the icon.
<script type="text/javascript">
<!--
/* Admin thread icon - Ross - support.proboards.com */
var td = document.getElementsByTagName('td');
var is_admin = (td.item(5).innerHTML.match(/action=admin/))? true : (pb_username.match(/^(mod_username_1|mod_username_2)$/))? true : false;
if(document.postForm) {
if(is_admin) {
var post_table = document.postForm.parentNode;
var icon_row = document.createElement('tr');
document.postForm.nosmiles.parentNode.parentNode.parentNode.insertBefore(icon_row, document.postForm.nosmiles.parentNode.parentNode);
var icon_title_cell = icon_row.insertCell(0);
icon_title_cell.className = 'windowbg';
var icon_title_font = document.createElement('font');
icon_title_font.size = '2';
icon_title_font.appendChild(document.createTextNode('Admin Icon:'));
icon_title_cell.appendChild(icon_title_font);
var icon_input_cell = icon_row.insertCell(1);
icon_input_cell.className = 'windowbg';
var icon_input_checkbox = document.createElement('input');
icon_input_checkbox.type = 'checkbox';
icon_input_checkbox.id = 'admin_icon';
if(document.postForm.icon.value == 'exclamation') {
icon_input_checkbox.checked = true;
}
icon_input_cell.appendChild(icon_input_checkbox);
var icon_description_font = document.createElement('font');
icon_description_font.size = '1';
icon_description_font.appendChild(document.createTextNode(' Check this box to use the reserved thread icon.'));
icon_input_cell.appendChild(icon_description_font);
}
document.postForm.icon.parentNode.parentNode.style.display = 'none';
document.postForm.onsubmit = function() {
if(is_admin && document.getElementById('admin_icon').checked == true) {
document.postForm.icon.value = 'exclamation'
} else {
document.postForm.icon.value = 'xx';
}
}
} else if(location.href.match(/board=/) && !location.href.match(/action=display/)) {
for( i = 0; i < td.length; i ++ ) {
if(td.item(i).width == '5%' && td.item(i-1).width == '5%' && td.item(i+1).width.match(/^4(3|8)%$/)) {
if(td.item(i).innerHTML.match(/exclamation.gif/)) {
td.item(i-1).innerHTML = td.item(i).innerHTML;
}
td.item(i).style.display = 'none';
}
}
}
//-->
</script>