This topic has 13 replies, 5 voices, and was last updated 8 years by Abe.

  • Author
  • #27212
     ntkris
    Participant

    Dear lord, this is THE best theme ever and I am literally going to be purchasing it for many if not all of my different sites. I am just now starting to dig in and although I am pretty good at googling things and taking the time to figure things out; I am sorry to say that I am perplexed as hell with the Animated Number thing. Ok, so on ur demo on the front u have the incredibly useful feature of members online, groups of interest and topics created. Its is so freaking awesome! But those demo numbers of course do not reflect my actual numbers so i am wondering, are these just numbers I have to manually update myself or is there some codes or short codes that I can plug in to the text field that will dynamically propagate these numbers in the fields for me? And if there is, can you pretty please with sugar on top tell me what that code is or how do I go about making this reflect my actual numbers?

    #27224
     Catalin
    Moderator

    Hello,

    Welcome in Kleo family, glad you enjoy the theme. To modify the numbers, you need to use this shortcode:

    COPY CODE
    
    
    [kleo_animate_numbers animation="animate-when-almost-visible" timer="3000"]xxx[/kleo_animate_numbers]
    
    

    where xxx is your number. Also take a look at my screenshot.

    Thank you,
    Catalin

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    Attachments:
    You must be logged in to view attached files.
    #27360
     orbitkiller
    Participant

    Hi,

    your theme is really a blast!

    But is there any way to get these numbers shown in your example “xxx” dynamically, by shortcode for example, means that they really reflect the numbers of your current site, without editing them manually?

    Thank you.
    Charel

    #27361
     orbitkiller
    Participant

    Hi, i developed a solution myself, it is not yet finished but it should get you (people that want to use it) an idea.

    Animated Kleo Numbers
    ######
    Issue: Kleo shortcode only lets you animated static number. What we want is to get these animated numbers in real dynamically

    My Solution:

    functions.php EDIT/ADD
    ######

    COPY CODE
    
    
    /**
     * @author orbitkiller
     * @function adds shortcode support to get user and group count for animated kleo numbers
     */
    function ok_get_option_shortcode( $theme_option ) {
    return get_option( $theme_option['key'] );
    }
    add_shortcode( 'get-theme-option', 'ok_get_option_shortcode' );
    
    
    Use de following Option shortcode to retrieve the wanted data
    ######
    [get-theme-option key="<yourOptionNameYouWantDataFrom>"]
    
    
    
    KLEO Animated Number Shortcode MODIFIED
    ######
    members
    [kleo_animate_numbers animation="animate-when-almost-visible" timer="3000"][get-theme-option key="_transient_bp_active_member_count"][/kleo_animate_numbers]
    public blogs
    [kleo_animate_numbers animation="animate-when-almost-visible" timer="3000"][get-theme-option key="blog_public"][/kleo_animate_numbers]
    
    

    Further issues
    ######
    For group count and active topics i did not find any option, but i am developing a function that retrieves these count values and i will put them into custom option.
    I did not have much time today, i will post this function in the coming days to complete this solution…

    Hints
    #######
    Where to find option names / options store data -> /wp-admin/options.php (when logged-in)
    Can be applied to other displayable values if needed/wanted…

    Have fun.
    Charel

    #27837
     orbitkiller
    Participant

    Hi,

    i finally did a whole solution for this issues, at least to the best of my knowledge.

    My Code:

    COPY CODE
    <?php 
    /*******************************************************************
    :: Extends functions.php
    ********************************************************************/
    
    /**
     * @author orbitkiller
     * @function get num rows of db tables / buddypress group / blog count by row
     */
    function ok_get_row_count( $table_name ) {
    	
    	//$table_name -> db table to count the rows of
    	
    	global $wpdb;
    	$array = $wpdb->get_results( "SELECT * FROM $table_name");
    	$rows = mysql_num_rows($count);
    	
    	//simple array iteration with count to retrieve row count
    	$rows = 0;
    	foreach ($array as $key => $value) {
    		$rows++;
    	}
    	
    	return $rows;
    }
    
    /**
     * @author orbitkiller
     * @function adds shortcode support to get user and group count for animated kleo numbers
     */
    function ok_get_option_shortcode( $theme_option ) {
    	return get_option( $theme_option['key'] );
    }
    add_shortcode( 'get-theme-option', 'ok_get_option_shortcode' );
    
    /**
     * @author orbitkiller
     * @function bp add group count and blog count to custom options
     */
    //create options
    add_option( "_ok_bp_member_count", 0, "", "yes");
    add_option( "_ok_bp_group_count", 0, "", "yes");
    add_option( "_ok_bp_blog_count", 0, "", "yes");
    //add_option( "_ok_bp_message_count", 0, "", "yes");
    
    //get bp group count and blog count
    /*
    db table names for extended counts display
    bp active members -> wp_bp_groups_members
    bp active groups -> wp_bp_groups
    bp blogs -> wp_bp_user_blogs
    bp written messages -> wp_bp_messages_messages
    */
    $okBPmembers = ok_get_row_count("wp_bp_groups_members");
    $okBPgroups = ok_get_row_count("wp_bp_groups");
    $okBPblogs = ok_get_row_count("wp_bp_user_blogs");
    //$okBPblogs = ok_get_row_count("wp_bp_messages_messages");
    
    //update options
    update_option( "_ok_bp_member_count", $okBPmembers);
    update_option( "_ok_bp_group_count", $okBPgroups);
    update_option( "_ok_bp_blog_count", $okBPblogs);
    //update_option( "_ok_bp_message_count", $okBPblogs);
    
    ?>

    Hope i could help.

    Bye
    Charel

    #27838
     orbitkiller
    Participant

    Let me correct only one thing, line 16 in my previous code post is not needed.

    #28055
     Abe
    Keymaster

    Hi there, Thanks for your appreciation, it means a lot.
    The animated numbers shortcode supports adding a shortcode inside it that generates a number, for example you can use shortcodes like:

    COPY CODE
    
    [kleo_total_members]
    [kleo_bbpress_stats type=topics]
    [kleo_bp_member_stats field="User type" value="Agent"]
    

    Full example:
    [kleo_animate_numbers animation="animate-when-almost-visible" timer="3000"][kleo_total_members][/kleo_animate_numbers]

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #74008
     pandreas82
    Participant

    Can I find somewhere all these shortcodes and how to use them?

    Thank you!

    Andreas

    #74022
     pandreas82
    Participant

    In general, can I download somehow a demo like this http://seventhqueen.com/themes/kleo/home-default/ in order to see how it has been developed?

    Regards,

    Andreas

    #74646
     pandreas82
    Participant

    Can you answer please?

    #74774
     Abe
    Keymaster

    Hi. Really sorry for the late reply.

    All the shortcodea can be used from the Visual composer interface. Also all the demo pages can be imported from Appearance – Kleo demo data

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

    #76843
     pandreas82
    Participant

    Back to this topic, the question now is this: Which is the shortcode for total groups?

    In general, where are all numbering shortcodes? You can add a shortcode through visual composer, but you can set static values about groups. I would like this info to be dynamic, but don’t know where to find shortcodes..

    Thank you!

    Andreas

    #77939
     pandreas82
    Participant

    Where can I find all numbering shortcodes?

    Can anyone help?

    Thank you!

    #78336
     Abe
    Keymaster

    For groups we don’t have one. All the available shortcodes are seen in the shortcode editor button

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    ---
    @ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.

Viewing 14 posts - 1 through 14 (of 14 total)

The forum ‘KLEO’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?