TinyPortal

General => Chit chat => Topic started by: WSA on October 11, 2006, 08:48:12 PM

Title: Statistics Mod
Post by: WSA on October 11, 2006, 08:48:12 PM
I was over at a vBulletin forum getting ready to talk smack about how the Cardinals are going to lay the woopdown on them bears.

Anyways, as I was going through it, I noticed this little statistical feature.  Is there anyway this can be done using SMF?

Threads: 11,371, This Month: 509 (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.dabearz.com%2Fforums%2Fimages%2Fstyles%2Fmarveltwo%2Fmisc%2Fvbtrends_up.gif&hash=638575f2e9177de5e13ef4bcd4305135e4cc8ec3)(15%)
Posts: 164,583, This Month: 7773 (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.dabearz.com%2Fforums%2Fimages%2Fstyles%2Fmarveltwo%2Fmisc%2Fvbtrends_up.gif&hash=638575f2e9177de5e13ef4bcd4305135e4cc8ec3)(24%)
Members: 2,359, This Month: 115 (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.dabearz.com%2Fforums%2Fimages%2Fstyles%2Fmarveltwo%2Fmisc%2Fvbtrends_up.gif&hash=638575f2e9177de5e13ef4bcd4305135e4cc8ec3)(28%)
Welcome to our newest 5 members, ThreeNagurski, Horus, Daa Bearss 54, chaspal, fkthepackers
Title: Re: Statistics Mod
Post by: jacortina on October 11, 2006, 08:55:45 PM
That depends. What are the percentages representing?
Title: Re: Statistics Mod
Post by: JPDeni on October 11, 2006, 08:57:24 PM
How is the percentage calculated? For that matter, how are the numbers for "this month" calculated? Is it "the number so far in this calendar month, compared to the same number of days from last calendar month"? Or is it "the number from the past 30 days, compared to the number from the previous 30 days"? Or is it "the number from the past 30 days (or the days from this calendar month), compared to a similar period from last year"? There's lots and lots of different ways you can calculate statistics, each one of which would require a different query syntax.

If you don't know what vBulletin's is, what would you like? I can probably come up with the query syntax. From there, it would just be a matter of printing it out.

I see that jacortina has the same question.  :)
Title: Re: Statistics Mod
Post by: WSA on October 11, 2006, 08:58:55 PM
I believe that they are monthly statistics.

So for instance on threads, they have 11,371 to date.  That means at the end of last month, they were at 10,862.  So far this month, they have 509 threads whereas at the same time last month they had say 480.  That makes a 15% increase over the previous month.

It's the same for all of the stats.
Title: Re: Statistics Mod
Post by: akulion on October 11, 2006, 09:00:16 PM
looks very nice
would be cool one to have

Title: Re: Statistics Mod
Post by: WSA on October 11, 2006, 09:00:40 PM
I'm not positive what those stats are based off of.  I just noticed it and thought that would be a neat thing to show.

I guess you could come up with the statistic any way you wanted, but just seeing growth is what I like.
Title: Re: Statistics Mod
Post by: akulion on October 11, 2006, 09:03:54 PM
its definately not calculated off the totals - because if it was then the numbers would be extremely low
Title: Re: Statistics Mod
Post by: jacortina on October 11, 2006, 09:04:54 PM
You can certainly get data on a rolling thirty day basis (and data for the prior 30). You can certainly get month-to-date data and prior month-to-date data.

So, it's a matter of what data/calculations you want.
Title: Re: Statistics Mod
Post by: Jpg on October 11, 2006, 09:08:51 PM
This is possible. Just Plain did one on members during the last month, last week, today. Would be that same just adding the "current" amount. And adding images.
Shouldn't be that hard.
Title: Re: Statistics Mod
Post by: akulion on October 11, 2006, 09:20:35 PM
percentage decrease and increase using a conditional check perhaps?
X2 = This month
X1 = last month
PX = Percentage increase / decrease

For percentage increases:
If X1 - X2 == +ve
then use this formula:
PX = [(X2 - X1)/X1 ] * 100
Print results with green arrow in this case

Else
For percentage decreases:
If X1 - X2 == -ve
then use this formula:
PX = [(X1 - X2)/X2] * 100
Print results with red arrow in this case
Title: Re: Statistics Mod
Post by: JPDeni on October 11, 2006, 09:22:40 PM
The issue is really what the query is for the database to come up with "this month" and "last month". I can guarantee that whatever someone decides on, someone else will come along and ask for it another way. :)
Title: Re: Statistics Mod
Post by: akulion on October 11, 2006, 09:24:12 PM
haha so true

but just a thought: it could be left as on a continual updated mod

as the stats grow on the forum so do the stats in the bloc

and we could always say somethig like:

" well that is very interesting but we are using Hygrons theorem here so it would require a complete mod rewrite which is not possible for now"