
Code:
- <script type="text/javascript">
- <!--
- /*
- Code Index by Cr0w
- Copyright 2006
- Do not repost
- */
-
- //Last Update
- var lastup="Wednesday November 15th, 2006 8:45PM"; //Most recent update
-
- //Database Info
- var dbthread="8"; //The thread where your index will be
- var dbforum="abc"; //The board id where your index is in
-
- //Sections
- var sections=[];
- sections[0]=["Category Name","Category ID"];
- sections[1]=["Category Name","Category ID"];
- sections[2]=["Category Name","Category ID"];
-
- //Codes
- var codes=[];
- codes[0]=["Code Name 1","Thread Number","Category ID"];
- codes[1]=["Code Name 2","Thread Number","Category ID"];
- codes[2]=["Code Name 3","Thread Number","Category ID"];
- codes[3]=["Code Name 4","Thread Number","Category ID"];
- codes[4]=["Code Name 5","Thread Number","Category ID"];
- codes[5]=["Code Name 6","Thread Number","Category ID"];
- codes[6]=["Code Name 7","Thread Number","Category ID"];
- codes[7]=["Code Name 8","Thread Number","Category ID"];
- codes[8]=["Code Name 9","Thread Number","Category ID"];
- codes[9]=["Code Name 10","Thread Number","Category ID"];
- codes[10]=["Code Name 11","Thread Number","Category ID"];
- codes[11]=["Code Name 12","Thread Number","Category ID"];
-
- //Do not edit below
-
- function showdb(){
- var td=document.getElementsByTagName("td");
- for(t=6;t<td.length;t++){
- td[t].style.display="none";
- }
- document.getElementById('code_database').innerHTML='<table cellspacing="1" cellpadding="4" class="border" width="'+vf_width+'" align="center" id="codedb"><tr><td class="title1" colspan="2" align="center">Code Database</td></tr><tr><td class="title2" width="20%" align="center">Navigation</td><td class="title2" width="80%" align="center">Main</td></tr><tr><td class="window1" width="20%" valign="top"><div id="navhere"></div><div id="searchit"></div></td><td class="window1" width="80%" valign="top"><div id="dbmain"></div></td></tr></table>';
- var nav=document.getElementById("navhere");
- var main=document.getElementById("dbmain");
- var search=document.getElementById("searchit");
- /* Categories */
- nav.innerHTML="";
- nav.innerHTML+="<b>Categories</b><br />";
- for(l=0;l<sections.length;l++){
- var catnum=l+1;
- nav.innerHTML+=catnum+". <a href='javascript:void(0)' onclick=\"catchange('"+sections[l][1]+"')\">"+sections[l][0]+"</a><br />";
- }
- nav.innerHTML+="<br />";
- nav.innerHTML+="<b>Other</b><br />";
- nav.innerHTML+="1. <a href='javascript:void(0)' onclick='location.reload()'>Recent Codes</a><br />";
- nav.innerHTML+="2. <a href='javascript:void(0)' onclick='showfulldb()'>All Codes</a><br />";
- nav.innerHTML+="3. <a href='javascript:void(0)' onclick='aboutdb()'>About</a><br /><br />";
-
- /* Main DB Page */
- main.innerHTML="";
- main.innerHTML+="<u><b>Database Info</b></u>";
- main.innerHTML+="<br />";
- main.innerHTML+="<b>Total Codes:</b> "+codes.length+"<br />";
- main.innerHTML+="<b>Last Updated:</b> "+lastup+"<br /><br />";
- main.innerHTML+="<b><u>Last 5 Codes</u></b><br /><br />";
- var FiveNew="";
- var num=1;
- for(t=codes.length-1;t>codes.length-6;t--){
- FiveNew+=num+". <a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[t][1]+"/'>"+codes[t][0]+"</a><br />";
- num=num+1;
- }
- main.innerHTML+=FiveNew;
-
- /* Search DB */
- search.innerHTML="";
- search.innerHTML+="<b>Search:</b><br />";
- search.innerHTML+="<input type='text' id='lookfor' /> ";
- search.innerHTML+="<input type='submit' onclick='searchdb()' value='Go' />";
- }
-
- function searchdb(){
- codes.sort();
- sections.sort();
- var main=document.getElementById("dbmain");
- var searchthis=document.getElementById('lookfor');
- main.innerHTML="<b><u>Search Results</u></b><br /><br />";
- for(i=0;i<codes.length;i++){
- if(codes[i][0].match(new RegExp(searchthis.value, 'gi'))){
- main.innerHTML+="<li><a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[i][1]+"/'>"+codes[i][0]+"</a></li>";
- }
- }
- }
- function catchange(tothis){
- codes.sort();
- sections.sort();
- var main=document.getElementById("dbmain");
- main.innerHTML="";
- var num=1;
- for(q=0;q<codes.length;q++){
- if(codes[q][2]==tothis){
- main.innerHTML+=num+". <a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[q][1]+"/'>"+codes[q][0]+"</a><br />";
- num=num+1;
- }
- }
- }
- function aboutdb(){
- codes.sort();
- sections.sort();
- var main=document.getElementById("dbmain");
- main.innerHTML="";
- main.innerHTML+="<b><u><font size='+1'>";
- main.innerHTML+="This code database is coded by Cr0w. It is available for use by any forum, as long as it is not reposted without written permission from it's creator.<br /><br />If you encounter any errors with this code, or find anyone who has reposted/ripped this code, please email Cr0w at <a href='mailto:admin@cr0wonline.com'>admin@cr0wonline.com</a>. Thank you.";
- main.innerHTML+="</font></u></b>";
- }
- function showfulldb(){
- codes.sort();
- sections.sort();
- var main=document.getElementById("dbmain");
- main.innerHTML="";
- for(t=0;t<codes.length;t++){
- var t2=t+1;
- main.innerHTML+=t2+". <a href='/board/"+dbforum+"/action/view_topic/topic/"+codes[t][1]+"/'>"+codes[t][0]+"</a><br />";
- }
- }
- if(location.href.match("topic/"+dbthread)){
- showdb();
- }
- //-->
- </script>