Recent Topics

Statistical info about your blog

Started by on Dec 14, 2003 – Contents updated: Dec 14, 2003

Dec 14, 2003 16:59    

Howdy all,

I'm working on a BlogStats class that will return basic statistical information about the blog. The main purpose for this is to generate a number of posts so a random blog entry can be displayed. (example: random quotes, images, links, etc.)

I am looking for input on what would be used if it was included. Currently, I have the ability to determine the number of posts in a given blog and am working on a function that will return a random number based on the number of posts. Other ideas would be:
[list]

  • Number of contributing authors

  • Total comments received

  • Total trackbacks & pingbacks[/list:u]

  • Any input would be appreciated,
    Travis S

    Dec 16, 2003 16:10

    How about

      Total posts blogged Total referrals from external sites Average posts per day (sort of like an activity indicator) Average comments per day[/list:u] If you made a hack so I could get these values plus the ones you added, I'd sure like to use it for a ?disp=blogstats :) -Vegar

    Dec 16, 2003 18:42

    Hey Vegar,

    Hack? This is going to go straight into the CVS code! :) I'm one of the evo developers... :)

    Those are some good ideas. I'll see if I can't incorporate them. As far as setting it as one of the "disp" settings, I'm not sure how that'd be setup, but I'm sure it wouldn't be that hard.

    Dec 16, 2003 18:50

    Oops, sorry, I didn't know. :oops:

    The ?disp part should be pretty easy, though, if you're planning on making something like <?php echo $blogstats['totalcmnts']; ?> for displaying it. (You get the point, even if my example is shitty code. :p)Wouldn't that be just adding another case to the disp switch? (take a look at the fplanque2002 skin, for example)

    Oh, and since this is the feature request section, I'm going to suggest some more stats items :P

      Average posts per day, per author (displayed on the profile or something - like in this forum) Author's percent of total posts (also like in this forum)[/list:u] -Vegar

    Dec 17, 2003 22:03

    Oh, and another suggestion:

      Average words per post[/list:u] -Vegar

    Jan 04, 2004 18:12

    How are things moving along? Just curious...

    -Vegar

    Jan 04, 2004 19:31

    Slowly right now... I've been working on an eCommerce site for a client, and I have two other coming up that are going to require setting up a CMS, so I'm a bit swamped :)

    I've got a basic part of it done, but it's still not enough to release it.

    Jan 04, 2004 21:12

    Okay, good to hear you are making progress (if slow). I'm looking forward to getting that code. :)

    I made a box for it on my [url=http://funky-m.com/index.php?disp=stats]stats page[/url] called "other facts". I tried to make it count the number of posts/comments and such myself, but I haven't been able to get it to work. In that box, that's where I'd put the statistical information you're working on. :)

    -Vegar

    Jan 04, 2004 22:04

    Ask and ye shall be given...

    I just added the file /b2evocore/_class_blogstats.php to the CVS and updated the _main.php file in the same directory. All it does right now is check to see the number of posts, but it's a start. :) You can download those two files from the [url=http://sourceforge.net/cvs/?group_id=85535]SourceForge.net CVS[/url].

    It hasn't been tested much by me, so go ahead and try to break it! Here is how I call it:

    Total blog entries: 
    <?php 
    $BlogStats = new 
    		BlogStats( 	2,						// Blog
    					'', 					// year/month/(day)
    					'', 					// Week
    					'', 					// Category(s): 1,2,3
    					array( ), 				// Same as above except array
    					'', 					// Author
    					'', 					// Number of posts to display per page
    					'', 					// Start results @
    					'', 					// End results @
    					'', 					// Search string
    					'', 					// Search for sentence or words
    					'', 					// Require exact match?
    					'posts', 				// Type of display
    					'', 					// Start of display (age)
    					'now' );				// End of display
    
    echo $BlogStats->total_posts;	
    ?>


    Of course, all of those variables should change the total # of posts around, so go ahead and change 'em to see what you get.

    Let me know if you come across any unexpected results...

    Jan 25, 2004 02:29

    o.O

    b2evo has referer stats built in already


    Form is loading...

    Free CMS – This forum is powered by b2evolution CMS, a complete engine for your website.