Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  May 23rd, 2017, 12:04pm


Board Hacks
Important News
Please read the notes posted with any codes carefully, as they will usually tell you where they need to go.
Welcome to the Conforums Hacks Board!

All codes here have been tested but we accept no responsibility if these codes do not work on your board, or have an adverse effect when used in combination with other codes.

This board is read only. Any queries or requests for codes should be made on the Coding Forum

Helpful sites
Google
Dynamic Drive

The Staff
Roger
Dave
GIzzy



« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Moderators Dropdown  (Read 2221 times)
Roger
Conforums Administrator


member is offline

Avatar

"Pure intentions, its about the journey, not particularly the end result."


Homepage PM

Gender: Male
Posts: 12606
xx Moderators Dropdown
« Thread started on: Dec 8th, 2003, 10:07pm »

Code submitted by Ben Woodruff.


<script language="Javascript"
type="text/javascript">

// Moderators drop down box
// Created by Ben Woodruff
// http://hurritech.com

if(window.location.href.indexOf("conforums") != -1) {
tables = document.getElementsByTagName("table");
for(a=0;a<tables.length;a++){
for(b=0;b<tables[a].rows.length;b++){
for(c=0;c<tables[a].rows[b].cells.length;c++){
if(tables[a].rows[b].cells[c].width=="24%" && tables[a].rows[b].cells[c].className.match("titlebg")){addhead()}
if(tables[a].rows[b].cells[c].width=="24%" && tables[a].rows[b].cells[c].vAlign=="middle" && tables[a].rows[b].cells[c].className.match("windowbg2")){listmods()}
if(tables[a].rows[b].cells[c].colSpan=="5" && tables[a].rows[b].cells[c].className.match("catbg")){tables[a].rows[b].cells[c].colSpan="6";}}}}
function addhead(){add=tables[a].rows[b].insertCell();add.className="titlebg"; add.innerHTML='<table width="100" border="0" cellspacing="0" cellpadding="0"><tr><td align="middle"><table width="24%"><tr><td align="middle"><center><font class=text1><b>Moderators</b></font></center></td></tr></table></td></tr></table>';}
function listmods(){add=tables[a].rows[b].insertCell();add.className="windowbg";}
var td = document.getElementsByTagName('td')
for(i=0;i<td.length;i++){
if(td[i].width=="66%" && td[i].align=="left" && td[i].className.match("windowbg2")){
if(td[i].innerHTML.match(/none/i)){
var dropdown = '<select name="drop-mods"><option value="javascript:void(0);">Moderators</option><option value="#">None</option></select>'
// dropdown+='<option value="index.cgi?action=mlstaff">Moderators</option>
td[i].nextSibling.nextSibling.nextSibling.nextSibling.innerHTML="<center>" + dropdown + "</center>"} else {
modname = new Array();var A = td[i].getElementsByTagName("A");
for(a=0;a<A.length;a++){if(A[a].href.indexOf("=viewprofile&username=")!=-1){modname[modname.length]=A[a].outerHTML;}}
var dropdown = '<select name="drop-mods" onChange="if(this.options[this.selectedIndex].value) window.location=this.options[this.selectedIndex].value;">'
// dropdown+='<option value="index.cgi?action=mlstaff">Moderators</option>
dropdown+='<option value="javascript:void(0);">Moderators</option>'
for (a=0;a<modname.length;a++) {
var splitit = modname[a].split(/href="/i); var modlnk = splitit[1].split(/">/i)
dropdown+='<option value="' + modlnk[0] + '">' + modname[a] + '</option>'
}
dropdown+='</select>';td[i].nextSibling.nextSibling.nextSibling.nextSibling.innerHTML = "<center>" + dropdown + "</center>"
}}}
getMod=document.getElementsByTagName("I");
for(m=0;m<getMod.length;m++){if(getMod[m].innerHTML.indexOf("Moderator: ")!=-1 || getMod[m].innerHTML.indexOf("Moderators: ")!=-1){getMod[m].innerHTML="";}}}
</script>

If you'd like to see a preview of this code's effects click here


This code goes in the Main footers only....
« Last Edit: Jul 5th, 2006, 7:49pm by Garet » User IP Logged

Roger Sutton
User Image
Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Back To Top
Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls