We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Today's top poster and posts in statistics; By Gorgor
Topic Started: Feb 3 2010, 11:31 PM (2,217 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: Gorgor
Today's top poster and posts in statistics
 
Code name: Today's top poster and posts in statistics
Description: Adds two lines right after the total posts. One for the amount of posts today, and one for the top poster today
Preview:

Uses double ad credits when viewing the index page

Code
 
<script>
// Posts and top poster today code
// Made by Gorgor
error = "<b>N/A</b>"
if(location.href.match("index")){
$.get(main_url+"stats/top_posters/", function(data){
var posts2day = $("td:contains(Total posts today)", data).html()
var poster = $("td:contains(#1)", data).next().html()
newposts = posts2day.split(":")
if(poster == null){
poster = error
}
$("td:contains(Total Forum Posts)").each(function(){
$(this).children("strong:first").after("<br>Total Forum Posts Today: <b>"+newposts[1]+"</b><br>The top poster today is: "+poster)
})
})
}
</script>
Edit the blue to what you want it to say for top poster today if nobody posted that day.
Offline Profile Quote Post Goto Top
 
Im Gold
Member
[ *  * ]
where is the preview?
Offline Profile Quote Post Goto Top
 
Henry69a
Member Avatar
Juste Milieu
[ * ]
Where do you put the code?
Offline Profile Quote Post Goto Top
 
DaPizzaMan
Member Avatar
#TeamSupport

Henry69a
Mar 11 2012, 08:30 AM
Where do you put the code?
If the placement is not mentioned, you could assume it is meant to go Below the Board.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It doesn't work any longer because it requires AJAX on a page that forbids it.
Offline Profile Quote Post Goto Top
 
Akhil-10
Member Avatar
Imagination Is The Beginning Of Creation
[ *  * ]
below the board?

its hard to change each day the top poster! auto change is nice
Offline Profile Quote Post Goto Top
 
plopi
Member
[ * ]
Cory
Mar 11 2012, 06:17 PM
It doesn't work any longer because it requires AJAX on a page that forbids it.
Didn't understand what you meant with this.

I was wondering if doing this is still possible.
Tried to add the script but it didn't do anything.
Edited by plopi, Nov 29 2016, 09:26 PM.
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
It means you cannot fetch the data from that page with AJAX because that page, along with many others, had restrictions placed on them because many people were over-using AJAX to fetch data from those pages, which eats up the bandwidth.

This is basically not probable to accomplish due to these restrictions.
Offline Profile Quote Post Goto Top
 
plopi
Member
[ * ]
Hm I see, what if I convert the html page top today posters into xml and then make a table, with the information in the xml, in the index page? do you think its possible?
Offline Profile Quote Post Goto Top
 
Cory
Member Avatar
Member
[ *  *  *  *  *  *  *  *  * ]
But then it wouldn't auto-update, would it? ???
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply