Welcome Guest ( Log In | Register )

      
Discover the best free computer help!
Learn more about Geeks to Go by taking the tour. Spyware, virus, trojan, fake security or privacy alerts? Read the malware cleaning guide.
 
Reply to this topicStart new topic
Display codes ONLY on index
Gemnius
post May 6 2008, 03:00 PM
Post #1


New Member
*
Posts: 8
OS: i.e.



Hey,
I've got an Invisionfree board, and I just needed to know if it was possible to either edit or add something to a code to make it display ONLY on my index page...
I've got some really nice codes, and I'd love to thank the authors for them, but some of them look kind of weird on my members page.

Forum Link:
http://z9.invisionfree.com/divinityv2/index.php?

Example:
I've got a Top 6 Members on my index page, but when I go to my members page, it's still there. So I wanted to see if there was any way I could make it display only on my index page.

That's the main code I'd prefer to be on the index page. So I'd appreciate it if someone could just see if they could get that one to work how I need it.

Here's the code for it:
CODE
<div class="tableborder">
  <div class='maintitle' align='left'>Statistics - Top 6</div>

     <table width="100%" border="0" cellspacing="1" cellpadding="4">
       <tr>
         <th align="center" width="20%" class='titlemedium'>Top Posters</th>
         <th align="left" width="20%" class='titlemedium'>Newest Member</th>
         <th align="center" width="60%" class='titlemedium'>Latest Replies</th>

       </tr>        <tr>
         <td class="row2" align="center" width='20%'><div id='n_topp'>Loading...</div></td>
         <td class="row3" align="center" width='20%'><div id='n_users'>Loading...</div></td>
         <td class="row2" nowrap="nowrap" width='60%'><div id='n_topics'>Loading...</div></td>

       </tr>
     </table>
   </div>


Footers:
CODE
<script type='text/javascript'>
/*
CopyRighted TheInfernoSin
Of TheCodingZone.com and IFCode.com(codejs.com)
Owner of Uni-code.com
*/
topsix = {
grab: (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(),
grab2: (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(),
grab3: (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest(),
domain: "http://"+location.hostname+location.pathname,
stats: function(){
var zzz = new Array();
var blah = "";
var varz = "act=Members&s=&name_box=all&filter=ALL&sort_order=desc&max_results=10";
topsix.grab.open("POST",topsix.domain+"?act=Members",true);
topsix.grab.onreadystatechange = function(){
  if (topsix.grab.readyState == 4) {
   div = document.createElement("div");
   div.innerHTML = topsix.grab.responseText;
   a = div.getElementsByTagName("a");
    for(x=0;x<a.length;x++){
     if(!a[x].parentNode.innerHTML.match(/Logged in as:/i) && a[x].href.match(/showuser/i)){
      /*if( a[x].parentNode.parentNode.parentNode.childNodes[9].innerHTML != null){
       posts = a[x].parentNode.parentNode.parentNode.childNodes[9].innerHTML;
      }*/
if(a[x].parentNode.parentNode.parentNode.getElementsByTagName("td")[4].innerHTML != null){
posts = a[x].parentNode.parentNode.parentNode.getElementsByTagName("td")[4].innerHTML;
}
      zzz.push("<tr><td width='50%'><a href='"+a[x]+"'>"+a[x].innerHTML+"</a></td><td width='50%' align='center'>"+posts+"</td></tr>");
     }
    }
   zzz.reverse();
   for(y=0;y<6;y++){
    if(zzz[y] == null) continue;
    blah += zzz[y];
   }
   document.getElementById("n_users").innerHTML = "<table><tr><td width='50%'><b>Members:</b></td><td width='50%'><b>Posts:</b></td></tr>"+blah +"</table>";
  }
}
topsix.grab.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
topsix.grab.setRequestHeader("Content-length", varz.length);
topsix.grab.send(varz);
},
threads: function(){
var topic = new Array();
var u_topics = "";
topsix.grab2.open("POST",topsix.domain+"?act=site",true);
topsix.grab2.onreadystatechange = function(){
  if (topsix.grab2.readyState == 4) {
   div = document.createElement("div");
   div.innerHTML = topsix.grab2.responseText;
  
   var t = div.getElementsByTagName("div");
   id = 2;
    for(y=0;y<t.length;y++){
     if(t[y].className=="row2" && t[y].firstChild.nodeName=="STRONG"){
      t_t = "<a href='"+t[y].firstChild.firstChild+"'>"+t[y].firstChild.firstChild.innerHTML+"</a>";
      t_p = t[y].parentNode.getElementsByTagName("div")[parseInt(id)].getElementsByTagName("a")[0];
      tp = "<a href='"+t_p+"'>"+t_p.innerHTML+"</a>";
      t_v = t[y].parentNode.getElementsByTagName("div")[parseInt(id)].innerHTML;
      if(t_v.match(/Read\:\s(\d+)?/i)){
       t_v = RegExp.$1;
      }
      t_r = t[y].parentNode.getElementsByTagName("div")[parseInt(id)].innerHTML;
      if(t_r.match(/Comments\:\s(\d+)?/i)){
       t_r = RegExp.$1;
      }
     var topic2 = "<tr><td width='60%'>"+t_t+"</td><td width='20%'>"+tp+" </td><td width='10%' align='center'>"+t_v+"</td><td width='10%' align='center'>"+t_r+"</td></tr>";
     topic.push(topic2);
    id = parseInt(id) + 2;
     }
    }
   for(r=0;r<6;r++){
    if(topic[r] == null) continue;
   u_topics += topic[r];
   }
   u_topics  = "<table><tr><td width='60%'><b>Threads:</b></td><td width='20%'><b>Last Poster:</b></td><td width='10%'><b>Views:</b></td><td width='10%'><b>Replies:</b></td></tr>" + u_topics + "</table>";
   document.getElementById("n_topics").innerHTML = u_topics;
  }
}
topsix.grab2.send("");
},
toposters: function(){
var member = new Array();
var u_member = "";
topsix.grab3.open("POST",topsix.domain+"?act=Members&max_results=10&sort_key=posts&sort_order=desc",true);
topsix.grab3.onreadystatechange = function(){
  if (topsix.grab3.readyState == 4) {
   div = document.createElement("div");
   div.innerHTML = topsix.grab3.responseText;
   var c = div.getElementsByTagName("a");
    for(v=0;v<c.length;v++){
     if(!c[v].parentNode.innerHTML.match(/Logged in as:/i) && c[v].href.match(/showuser/i) && c[v].parentNode.nodeName=="STRONG"){
      post = c[v].parentNode.parentNode.parentNode;
      posts = post.getElementsByTagName("td")[4].innerHTML;
      utop = "<a href='"+c[v]+"'>"+c[v].innerHTML+"</a>";
      member.push("<tr><td width='50%'>"+utop+"</a></td><td width='50%' align='center'>"+posts+"</td></tr>");
     }
    }
   for(e=0;e<6;e++){
    if(member[e] == null) continue;
   u_member += member[e];
   }
   u_member = "<table><tr><td width='50%'><b>Members:</b></td><td width='50%'><b>Posts:</b></td></tr>" + u_member + "</table>";
   document.getElementById("n_topp").innerHTML = u_member;
  }
}
topsix.grab3.send("");
}  

}
topsix.stats();
topsix.threads();
topsix.toposters();

</script>


This post has been edited by Gemnius: May 7 2008, 01:07 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Collapse

> Similar Topics

    Topic Title Replies / Views Topic Information
No New Posts   11 / 269 12th May 2006 - 09:45 PM
tubui started - last by lorothrigs
No new   29 / 2,273 16th November 2006 - 12:40 PM
Kyomi started - last by Metallica
No New Posts   4 / 257 16th September 2008 - 08:16 AM
gengammy started - last by happyrock
No New Posts   2 / 83 29th November 2008 - 06:13 PM
Gunz started - last by 10Ck3D

RSS Time is now: 2nd December 2008 - 01:33 AM
Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk.