The MU forums have moved to WordPress.org

Releasing my stats setup (37 posts)

  1. drmike
    Member
    Posted 17 years ago #

    Per a number of requests, I'm going to release what we use for stats, hopefully Sunday. I worked out a method of displaying the most popular blogs as well and will include it.

    Got a question though. I would like to single out a single blog as a "Blog of the moment" type and want some input on how to do this. What I'm doing currently is taking the number of page views and dividing it by the number of unique visitors and declairing whichever blog is highest to be featured. (ie stickyness if you're familiar with the term)

    Anyone got a better method?

    Regards,
    -drmike

  2. lunabyte
    Member
    Posted 17 years ago #

    Hmmm...

    If it were me, I'd order the query by # of page views, # of uniques, #of posts, # of comments (if post and comments are available), selecting the blog_id (and link, name if available), set the query as DESC, and then LIMIT 10.

    Take those 10 results, and select a random blog id.

    Depending on what you need, it could be a big query. Also, you may wish to have the same blog for a "few moments" to make it fair on the network, so setting the result of the query in the main options table and a time last updated would probably be a good thing. Then set it to re-query every X minutes.

    just my 2¢

  3. demonicume
    Member
    Posted 17 years ago #

    another question - with you blog of the day, could you post a mini screenshot next to the post name like seen here at Elliot Backs site. i'e gone back and forth wit myself on this and i think that those blog avatar things are actual screen shots. but i dont know how he got them up there. the alt text for the pics all read 'screenshot of ...' if i had a Blog of the day feature, i'd want to display a mini shot of my user's front page.

    is there something out there that does avatars for blogs that we can call when we display a link?

  4. drmike
    Member
    Posted 17 years ago #

    I had planned on doing the mini screenshot but 1) Can't get the Snap preview idea I had had to work and 2) thumbnails.org wants to have every single URL ahead of time.

    Thinking about using the user's avatars like wp.com does by using the avatar plugin.

    I'm finding the stickyness I was using is pulling up old blogs. I'll have to figure out something else.

  5. drmike
    Member
    Posted 17 years ago #

    Just noticed that the site linked to is using http://websnapr.com All the URLs I'm putting in there are queued though. That's not really usable for me. :(

    edit: Even the main site isn't in there, http://daria.be

    reedit: I guess I could do a work around and place the image tags in there for the complete list, not just the blog of the hour.

  6. drmike
    Member
    Posted 17 years ago #

    How do I dump something into the object cache? if you look at daria.be, you see part of the last post for teh featured blogs listing. If you reload the page, since the rss is now older, you no longer see it. trying to figure out a method for keeping it there. suggestions?

  7. kdesilva
    Member
    Posted 17 years ago #

    any luck with this?

  8. drmike
    Member
    Posted 17 years ago #

    Haven't forgotten. Having an issue with the Top Posts script as on my setup, the top 10 posts are all from a single blog. I don't think we want that. That and I still have to work in the avatars.

  9. andrea_r
    Moderator
    Posted 17 years ago #

    Also looking forward to this. :)

  10. drmike
    Member
    Posted 17 years ago #

    Well maybe some imput on how to do a feature blog would help as per above. :)

    Having an issue wiht the top posts list anyway. Need to figure out how to just put in one post from a blog. Kind of hard when the posts are in one table and the count data is in the other.

  11. zappoman
    Member
    Posted 17 years ago #

    Dr. Mike,

    I don't know if you already looked at my plugin or not... it's pretty simple, as it's really just intended to be an example, but...you can see my "top post" plugin here...

    http://heftagaub.wordpress.com/2007/04/06/update-to-wpmu-top-posts-plugin/

    It uses a hits table very similar to what slimstats or wpstats uses... namely it just records a timestamp, blog_id, post_id, etc.

    Anyway, I haven't implemented the idea of eliminating multiple posts from a single blog, but I would imagine that there would be some SQL to do this if you used a structure similar to the one I've chosen.

  12. drmike
    Member
    Posted 17 years ago #

    Normally I'd say just drop them all in there but I;ve got a pair of blogs that do multiple posts each day and they do a fair amount of traffic. So far the top ten has been nothing but them with my third heaviest traveled blog usually coming in with 11-15th.

    I dont want to ding here. :(

  13. andrea_r
    Moderator
    Posted 17 years ago #

    Oooo! I just thought of something for the featured blog/post. In cases where you have a couple of bloggers who post prolifically and get more comments than others, then yeah queries mentioned above will *always* come up with them.

    But what if you set a limit? Pull in the info as above, but instead of taking the top 10, you could:

    - pull a random one
    - drop the top ten or twenty from the array and requery
    - make a check to see if they were picked previously (involves saving the info somewhere)
    - do another check in the query against how long the blog has been set up. (a recent blog that got busy fast may be a good ro bad thing, depending)

    I'm just tossing out ideas here, not saying they're good ones... ;)

  14. suleiman
    Member
    Posted 17 years ago #

    I like the simplicity of a top ten based on hits idea. even though I can't get zappo's plugin to work at the time being.

    EDIT: cancel that, the new version seems to be working great Zapps :)

  15. drmike
    Member
    Posted 17 years ago #

    Top 10 for posts or top 10 for blogs? Blogs works fine. It's posts I'm having an issue with.

    Trying to stay away from arrays as I have issues with coding them.

    I've had good feedback with the current solution of the amount of stickyness (ie total views / total visitors) so I guess we can stay with that for the time being. Probably should/ could work in RSS reads though.

  16. drmike
    Member
    Posted 17 years ago #

    Also one of my top10 bloggers keeps giving me ideas. ;)

    http://daria.be/forums/topic/49

  17. andrea_r
    Moderator
    Posted 17 years ago #

    A post of the day is niiiice.

  18. drmike
    Member
    Posted 17 years ago #

    I'd rather have a list though. if you note on my setup at http://daria.be I have fetch_rss grabing the the last post off of the highlighted blog.

  19. ezequielc
    Member
    Posted 17 years ago #

    drmike,
    I'm looking for a plugin to display the most read blogs in my wpmu.
    I read that you worked on that. Do you have any plans to release it soon?
    Thank you.

  20. drmike
    Member
    Posted 17 years ago #

    Maybe if I didn't have to answer "search the forums for domain mapping" over and over again, I'd have some time to work on it. *grumble*

  21. zappoman
    Member
    Posted 17 years ago #

    Doc, you make me smile. ;) I actually laughed out loud when I read this. I'm not just one of those LOL'ers...

    I mean... actually, out loud...

    ;)

  22. ezequielc
    Member
    Posted 17 years ago #

    Using zappoman's plugin, I got the top blogs by these functions:

    
     	function get_top_blogs($limit = 10, $days_back = 90)
        {
             global $wpdb, $wpmuBaseTablePrefix;
    
             $query = " SELECT blog_id, COUNT(blog_id) AS 'blog_hits'
    				  FROM $this->table_hits
    				  WHERE blog_id <> '1'
    				  AND TO_DAYS(NOW()) - TO_DAYS(FROM_UNIXTIME(hit_time)) <= $days_back
    				  GROUP BY blog_id
    	              ORDER BY blog_hits DESC LIMIT $limit;";
    
    	   $top_blogs_mappings = $wpdb->get_results($query);
    
    	   return $top_blogs_mappings;
    
        }
    
        function get_top_blogs_html($limit = 10, $days_back = 90)
        {
            foreach($this->get_top_blogs($limit, $days_back) as $blog_mapping)
            {
                $details = get_blog_details($blog_mapping->blog_id);
    			echo "<li><a href='http://" . $details->domain . $details->path . "'>" . $details->blogname . " (" . $blog_mapping->blog_hits .")</a></li>";
            }
        }
    

    Thank you zappoman.
    I also posted this code in your blog.

  23. drmike
    Member
    Posted 17 years ago #

    Um, folks we really shouldn't be posting code to the forums here like this. 1) It breaks the layout of the forum so either the posts are all the way to the left or helf the code is hidden along the right so you can't see it and 2) bbpress always strips stuff out anyway.

  24. ezequielc
    Member
    Posted 17 years ago #

    Sorry, drmike.
    But, in the comment box there is a comment saying: "Put code in between backticks." :)

    And if I didnĀ“t put, the A and LI tags were interpreted.

  25. TikoQeri
    Member
    Posted 17 years ago #

    Dr. Mike,

    I like the way you made your site, could you please let me know which plugin did you use and how exactly you install and call the functions within your home page?

    Thanks

  26. suleiman
    Member
    Posted 17 years ago #

    ezequielc, would you mind e-mailing me your modified version at suleiman[at]hadithuna.com?

  27. TikoQeri
    Member
    Posted 17 years ago #

    suleiman,

    are you using WPMU?

    how did you get this page set up, that it shows last registered users, all users etc. ?

    Nice looking site :)

  28. suleiman
    Member
    Posted 17 years ago #

    tiko, i am using wpmu :)

    the only plugins i'm using are the get recent blogs widget and the get most recently updated blogs widgets.

    aside from that there's nothing special. Now the redesign that's in progress....well now that's a different matter altogether ;)

  29. TikoQeri
    Member
    Posted 17 years ago #

    Thanks for your reply suleiman,

    do you mind sharing with me this installation and usage of 2 widgets you have mentioned? I've read zappoman's post and got the code, I'm just not sure how exactly to use it, where the php file should be placed and how do I call these functions from my home page.
    Also, do you happened to know how to get a customized home page that is not like a blog, but rather just a page that works with WPMU options? I've read some about home.php but I'm not sure about the usage of that either. (where do I place it, etc.)

    Thank you in advance for all your help :)

    you may email me at admin [at] diabeticblogs.net

  30. suleiman
    Member
    Posted 17 years ago #

    ####### OFF TOPIC ########

    Tiko, I'll keep this brief because I don't want this important forum thread to run off topic. Here's my suggestion:

    1) Search these forums for "home.php" and "Custom Home Page." WPMU allows the admin to set the home blog to use any theme they want. You can then copy index.php to make a home.php file, and edit it. In my case I didn't really make any edits at all, didn't need to.

    2) Go to http://www.automattic.com and read about widgets. I mentioned the two widgets that I used, and you can grab them from wpmudev.org. They come bundled with explanations of what you need to do to get them working, but it's mostly drag and drop (a term which will make more sense to you as you familiarize yourself with widgets)

    3) Zappoman's code is definitely useable, but it is also something you won't have a great idea of how to play around with unless you familiarize yourself first with PHP and MySQL. If you already are well versed, then I suggest you open up the actual php file and look inside of it for instructions on its use.

    Unfortunately I'm a bit too busy at the time being to work one-on-one with you for your site's development, but if you follow the steps above, you should be more than well on your way :)

    -S.

    ####### OFF TOPIC ########

About this Topic