Agent Moose
12-22-2007, 11:11 PM
I have created a Code Index, that basicly takes topics from a page and sorts them to make it easy for viewers to read. But, it only works on FF, anyone know why?
function code_index_v3() {
$(function() {
if(location.href.match(/.smcindex/i)){
var title = "SMC Code Index V3"
var board = "8"
var index = "smcindex"
};
if(location.href.match(/.zbindex/i)){
var title = "ZetaBoard Code Index V3"
var board = "27"
var index = "zbindex"
};
if(location.href.match(/.smcindex/i)||location.href.match(/.zbindex/i)){
document.title = title;
navigation = $("div.nav").html();
pages = $("tr td.middletext").html();
online = $("tr.windowbg2 td[colspan='8']").html();
$("#bodyarea,img[alt='New'],#news_box").hide();
$("#bodyarea").before("<br/><div class='nav' style='font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;'>"+navigation+" > <b><a class='nav' href='"+location.pathname+"/index.php/board,"+board+".0."+index+"/sort,subject.html'>Code Index</a></b></div><br/><center>Search the Code Index<form id='searchform' name='searchform' accept-charset='ISO-8859-1' method='post' action='http://smcodes.smfforfree3.com/index.php?action=search2'><input type='text' size='40' name='search'/><input id='brd"+board+"' type='hidden' checked='checked' value='"+board+"' name='brd["+board+"]'/><input type='submit' value='Search' name='submit'/></form></center><br/><div class='tborder'><div class='catbg' style='padding: 5px 5px 5px 10px;'>"+title+" - <span class='smalltext'>Sort By: <a href='"+location.pathname+"/board,"+board+".0."+index+"/sort,replies/desc.html'>Replies</a> | <a href='"+location.pathname+"/board,"+board+".0."+index+"/sort,views/desc.html'>Views</a> | <a href='"+location.pathname+"/board,"+board+".0."+index+"/sort,subject.html'>Subject</a></span></div><div><table width='100%' cellpadding='1' cellspacing='0'><tr><td class='titlebg2' colspan='5'>"+online+"</td></tr></table></div><div><table width='100%' cellpadding='1' cellspacing='0'><tr><td class='titlebg2' colspan='5'>"+pages+"</td></tr></table></div><div><table width='100%' border='0' cellspacing='1' cellpadding='4' id='code'></table></div><div><table width='100%' cellpadding='1' cellspacing='0'><tr><td class='titlebg2' colspan='5'>"+pages+"</td></tr></table></div></div>")
var codes = $("span");
for(s=0;s<codes.length;s++){
if(codes[s].id.match(/msg/i)&&$(codes[s]).parent("td.windowbg").html()){
var topic = $(codes[s]).html();
var creator = $(codes[s]).parent().next().html();
document.getElementById("code").innerHTML += "<tr><td class='windowbg' width='50%'>"+topic+"</td><td class='windowbg' width='50%'>"+creator+"</td></tr>";
};};
$("a").each(function(){
if(this.href.match(/\/sort,/i)) {
this.href = this.href.replace("/sort,subject","."+index+"/sort,subject");
this.href = this.href.replace("/sort,starter","."+index+"/sort,starter");
this.href = this.href.replace("/sort,replies","."+index+"/sort,replies");
this.href = this.href.replace("/sort,views","."+index+"/sort,views");
};});
$("a").each(function(){if(this.href.match("#bot")&&this.href.match("."+index+"/")){$(this).hide(); }});
};
$("a").each(function(){if(this.href.match(/board,/i)){
this.href = this.href.replace("board,23.0.html","board,8.0.smcindex/sort,subject.html");
this.href = this.href.replace("board,28.0.html","board,27.0.zbindex/sort,subject.html");
};});
});};
code_index_v3();
function code_index_v3() {
$(function() {
if(location.href.match(/.smcindex/i)){
var title = "SMC Code Index V3"
var board = "8"
var index = "smcindex"
};
if(location.href.match(/.zbindex/i)){
var title = "ZetaBoard Code Index V3"
var board = "27"
var index = "zbindex"
};
if(location.href.match(/.smcindex/i)||location.href.match(/.zbindex/i)){
document.title = title;
navigation = $("div.nav").html();
pages = $("tr td.middletext").html();
online = $("tr.windowbg2 td[colspan='8']").html();
$("#bodyarea,img[alt='New'],#news_box").hide();
$("#bodyarea").before("<br/><div class='nav' style='font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;'>"+navigation+" > <b><a class='nav' href='"+location.pathname+"/index.php/board,"+board+".0."+index+"/sort,subject.html'>Code Index</a></b></div><br/><center>Search the Code Index<form id='searchform' name='searchform' accept-charset='ISO-8859-1' method='post' action='http://smcodes.smfforfree3.com/index.php?action=search2'><input type='text' size='40' name='search'/><input id='brd"+board+"' type='hidden' checked='checked' value='"+board+"' name='brd["+board+"]'/><input type='submit' value='Search' name='submit'/></form></center><br/><div class='tborder'><div class='catbg' style='padding: 5px 5px 5px 10px;'>"+title+" - <span class='smalltext'>Sort By: <a href='"+location.pathname+"/board,"+board+".0."+index+"/sort,replies/desc.html'>Replies</a> | <a href='"+location.pathname+"/board,"+board+".0."+index+"/sort,views/desc.html'>Views</a> | <a href='"+location.pathname+"/board,"+board+".0."+index+"/sort,subject.html'>Subject</a></span></div><div><table width='100%' cellpadding='1' cellspacing='0'><tr><td class='titlebg2' colspan='5'>"+online+"</td></tr></table></div><div><table width='100%' cellpadding='1' cellspacing='0'><tr><td class='titlebg2' colspan='5'>"+pages+"</td></tr></table></div><div><table width='100%' border='0' cellspacing='1' cellpadding='4' id='code'></table></div><div><table width='100%' cellpadding='1' cellspacing='0'><tr><td class='titlebg2' colspan='5'>"+pages+"</td></tr></table></div></div>")
var codes = $("span");
for(s=0;s<codes.length;s++){
if(codes[s].id.match(/msg/i)&&$(codes[s]).parent("td.windowbg").html()){
var topic = $(codes[s]).html();
var creator = $(codes[s]).parent().next().html();
document.getElementById("code").innerHTML += "<tr><td class='windowbg' width='50%'>"+topic+"</td><td class='windowbg' width='50%'>"+creator+"</td></tr>";
};};
$("a").each(function(){
if(this.href.match(/\/sort,/i)) {
this.href = this.href.replace("/sort,subject","."+index+"/sort,subject");
this.href = this.href.replace("/sort,starter","."+index+"/sort,starter");
this.href = this.href.replace("/sort,replies","."+index+"/sort,replies");
this.href = this.href.replace("/sort,views","."+index+"/sort,views");
};});
$("a").each(function(){if(this.href.match("#bot")&&this.href.match("."+index+"/")){$(this).hide(); }});
};
$("a").each(function(){if(this.href.match(/board,/i)){
this.href = this.href.replace("board,23.0.html","board,8.0.smcindex/sort,subject.html");
this.href = this.href.replace("board,28.0.html","board,27.0.zbindex/sort,subject.html");
};});
});};
code_index_v3();