Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Display codes ONLY on index


  • Please log in to reply

#1
Gemnius

Gemnius

    New Member

  • Member
  • Pip
  • 8 posts
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.invisionfr...ityv2/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:
<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:
<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>

Edited by Gemnius, 07 May 2008 - 01:07 PM.

  • 0

Advertisements







Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP