The MU forums have moved to WordPress.org

Wordpress MU : Show TOTAL NUMBER of Comments over all Blogs (12 posts)

  1. setubal28
    Member
    Posted 15 years ago #

    Hi,

    Can't find the way, i'm searching but can't find this :
    HOW to show TOTAL NUMBERS of comments writed by bloggers on wordpress MU community ?

    Example :
    Posts : 3
    Blogs (mu) : 59
    Comments : ???

    Thanks you so but, i'm going to have no hair at this moment.. I'm stresssseedddd

    Thanks you,
    Patrick

  2. andrea_r
    Moderator
    Posted 15 years ago #

    You could use the sitewide feed and snag a count from that.
    You could use a paid plugin - http://premium.wpmudev.org/project/Blog-Activity

    or you coudl write the SQL statement and pull it out of the db. ;)

  3. MrBrian
    Member
    Posted 15 years ago #

    Comments for each blog are posted in the wp_x_comments database table (with x being the blog ID). You'd have to iterate through each one of those tables and get the row count for the table. This could be done a different way, I dont know.

  4. MrBrian
    Member
    Posted 15 years ago #

    Haha, posted at the same time. I like Andreas idea better :P.

  5. andrea_r
    Moderator
    Posted 15 years ago #

    Well, my #3 is the same as yours. :D Great minds and all.

  6. demonicume
    Member
    Posted 15 years ago #

    try this for the comment count.

  7. setubal28
    Member
    Posted 15 years ago #

    Demonicum,

    Your code works on my Friend Mu, not in mine We got the latest Mu version :

    Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/web/mysite/ftp/www/blog/wp-content/themes/theme_admin/sidebar.php on line 33

    [LINE 33] : $comment_count = mysql_result($results2, 0);

    Maybe conflit with plugins I have installed before..I don't know wich one...

    Mr Brian and Andrea,
    Thanks for your ideas, but I'm not developper ;(
    Maybe I should pay developpers to make me that...Well, No money for the moment ;(

    So, If somebody, have another solution, something like demonicume, simple but working differently please post here.

    Thank's a lot !!

  8. quenting
    Member
    Posted 15 years ago #

    cache post counts and comments counts in wp_blogs. you won't regret it.

  9. setubal28
    Member
    Posted 15 years ago #

    Hey Quenting, you have a great site, with comments numbers in header !!!

    Please, be a french gentleman, give your code man ;) You'll not regret it, God is big :)
    a++

  10. t3ch33
    Member
    Posted 15 years ago #

    Adding to what MrBrian said, if you don't want to count the number of posts on each table, you can:

    1. create a table called SITEWIDECOMMENTS with a field named TOTALCOMMENTS.

    2. add a sql statement that will increase the count each time a comment is posted.

    3. then, just echo the value of TOTALCOMMENTS wherever you want to show the total sitewide comments.

  11. setubal28
    Member
    Posted 15 years ago #

    .. A lot of developpers here. Thanks t3ch33.

  12. d_kc
    Member
    Posted 15 years ago #

    Andrea, you said:
    "You could use the sitewide feed and snag a count from that."

    How do I grab the comments and the post count from the site wide feed ? Keeping in mind that I will be using supercache, how much of a performance hit this would cause ?

About this Topic