• Resolved kikismedia

    (@kikismedia)


    I’m trying to display user count and total topics created and replies by all users in my web site header but I could not

    Please help me out

    I will like to display it like this
    Our (1000)users have created (100)topics with (100)replies

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Robin W

    (@robin-w)

    thanks for your post.

    Without knowing your level of coding or otherwise, it’s hard to know how much help you want.

    This code gives a shortcode and function to do that

    add_shortcode ('kiki-stats' , 'kiki_show_stats' ) ;
    
    function kiki_show_stats() {
    	$user_count = count_users();
    	$users = $user_count['total_users'] ;
    	$topic_count = wp_count_posts('topic');
    	$topics = $topic_count->publish;
    	$reply_count = wp_count_posts('reply');
    	$replies = $reply_count->publish ;
        $text = 'Our '.$users.' users have created '.$topics. ' topics with '.$replies.' replies.' ;
    	echo $text ;
    }

    Put this in your child theme’s function file – or use
    https://en-gb.www.ads-software.com/plugins/code-snippets/

    then in a postm page or widget put

    [kiki-stats]

    and see that it works

    if using in code just call the function

    kiki_show_stats() ;

    if none of that makes sense, come back

    Thread Starter kikismedia

    (@kikismedia)

    I’m using it in code
    Is this right?
    <?php kiki_show_stats(); ?>

    Plugin Author Robin W

    (@robin-w)

    yep that should work

    Thread Starter kikismedia

    (@kikismedia)

    Thanks it worked is there a way I can apply css tag to it

    Thread Starter kikismedia

    (@kikismedia)

    God bless u for helping me out, I have been trying to display the count but was unable to thanks for the help

    Plugin Author Robin W

    (@robin-w)

    yes just change this line

    $text = 'Our '.$users.' users have created '.$topics. ' topics with '.$replies.' replies.' ;

    to

    $text = '<div class="my-style">Our '.$users.' users have created '.$topics. ' topics with '.$replies.' replies.</div>' ;

    and change the word my-style to whatever name you want

    Thread Starter kikismedia

    (@kikismedia)

    I got it thanks alot I can I ask for another help

    Plugin Author Robin W

    (@robin-w)

    you can always ask……. ?? ??

    Thread Starter kikismedia

    (@kikismedia)

    Thanks

    So first
    Is there a way I can display
    Total user online currently and guest a + time spent online on front-page.php

    Like this
    Members Online:
    user 1,user 2 user 3, user 4, user 5,user 6,user 7,user 8,user 9, user 10
    (3552 Members and 8030 Guests online in last 5 minutes!)

    And also in single-topic page I will like to display
    Total user user viewing this
    For example :
    User viewing this topic :user 1,user 2 user 3, user 4, user 5,user 6,user 7,user 8,user 9, user 10 (total user viewing this (100) + 023 guest)

    Plugin Author Robin W

    (@robin-w)

    hmmm….far from easy due to some basics

    WordPress can only log user activity – ie when a user does something within the site. The major issue with this is that a user shutting down a tab on their browser does nothing on the WordPress site so users can appear on line when they are not.

    There are plugins that do achieve total users on line, but again the stats are not particularly accurate. eg

    https://www.ads-software.com/plugins/wp-useronline/

    as for users viewing a particular topic, that would need customised code beyond any free help, and will give you a false impression – having a topic open in a tab does not mean a user is actually doing anything – they may well be watching TV in another room

    Thread Starter kikismedia

    (@kikismedia)

    I really understand thanks for the help and fast response

    I have been trying to customize the author image in single-topic, like this one currently that’s WordPress is using border-radius to make the author image circle I couldn’t figure mine out all author image are in square form in my site

    Plugin Author Robin W

    (@robin-w)

    put this in the custom css tab of my plugin

    #bbpress-forums div.bbp-forum-author img.avatar, #bbpress-forums div.bbp-reply-author img.avatar, #bbpress-forums div.bbp-topic-author img.avatar {
    	border-radius: 50%;
    }		 
    
    #bbpress-forums #bbp-single-user-details #bbp-user-avatar img.avatar {
    	border-radius: 50%;
    }
    Thread Starter kikismedia

    (@kikismedia)

    Thanks alot

    Thread Starter kikismedia

    (@kikismedia)

    How can i get bbpress user full name

    Plugin Author Robin W

    (@robin-w)

    sorry, can you post this in the bbpress forum as it relates to bbpress rather than my plugin

    https://bbpress.org/forums/

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Urgent help with bbPress count’ is closed to new replies.