Board Logo

 Username:    Password:    Stay logged in: Welcome Guest. Please Login or Register.  Mar 22nd, 2018, 06:58am

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
Dynamic Drive

The Staff

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

member is offline


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

Homepage PM

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

Code submitted by Ben Woodruff.

<script language="Javascript"

// Moderators drop down box
// Created by Ben Woodruff

if(window.location.href.indexOf("conforums") != -1) {
tables = document.getElementsByTagName("table");
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')
if(td[i].width=="66%" && td[i].align=="left" && td[i].className.match("windowbg2")){
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");
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>"
for(m=0;m<getMod.length;m++){if(getMod[m].innerHTML.indexOf("Moderator: ")!=-1 || getMod[m].innerHTML.indexOf("Moderators: ")!=-1){getMod[m].innerHTML="";}}}

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
| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls