• I was studying cubepoint with your blog and found mycred. I think this is really great!! very happy with your plugin.

    I have questions.

    1. http://mycred.me/support/tutorials/how-to-make-your-custom-hook/
    I have tried to make a hook and followed your tutorial.
    When I update my account information on “back-end”, it works great!
    But it’s not working on “front-end”. I think my theme is based on ajax function.

    I have found this on frameworks/classes/themex.user.php

    This is my theme : http://themextemplates.com/demo/lovestory/
    ID: demo
    pwd: demo

    public static function init() {
    
    		//refresh module data
    		add_action('wp', array(__CLASS__, 'refresh'), 1);
    
    		//update user actions
    		add_action('wp', array(__CLASS__, 'updateUser'), 99);
    		add_action('wp_ajax_themex_update_user', array(__CLASS__, 'updateUser'));
    		add_action('wp_ajax_nopriv_themex_update_user', array(__CLASS__, 'updateUser'));
    		add_action('template_redirect', array(__CLASS__, 'activateUser'));
    
    		//add messages filter
    		add_filter('comments_clauses', array( __CLASS__, 'filterMessages'));
    
    		//add avatar filter
    		add_filter('get_avatar', array(__CLASS__, 'getAvatar'), 10, 5);
    
    		//render user profile
    		add_filter('show_user_profile', array(__CLASS__,'renderProfile'));
    		add_filter('edit_user_profile', array(__CLASS__,'renderProfile'));
    
    		//render user toolbar
    		add_filter('show_admin_bar', array(__CLASS__,'renderToolbar'));
    
    		//render gifts template
    		add_action('wp_footer', array(__CLASS__,'renderGifts'));
    
    		//filters user statuses
    		add_action('wp', array(__CLASS__, 'filterStatuses'));
    
    	}

    2. this could be too silly question.
    I am trying to put shortcodes in my php file.

    <?php echo do_shortcode('[mycred_my_rank user_id="1" show_title="1" show_logo="1" first="name"]'); ?>

    I want add li or span there to put some classes. how I could make it?
    it comes only name, logo and title. I need to put some css style and html codes.

    and these kinds of shortcodes, how can I make it all php codes? I may need to put codes in php (templates files).

    <ul class="my-custom-rank-list">
    [mycred_list_ranks wrap=""]
    	<li>%rank_logo% %rank% <div class="req">%min% - %max%</div></li>
    [/mycred_list_ranks]
    </ul>

    I really like your plugin and thanks for great!! plugin, tutorials.

    Thanks,

    http://wordpress.org/plugins/mycred/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author myCred

    (@designbymerovingi)

    Hi hungrygolf.

    1) What exactly is your hook awarding points for? Completing profile details?
    In the tutorial we use the ‘personal_options_update’ and ‘edit_user_profile_update’ action hooks which is what WordPress uses whenever you update your profile or update a users profile.

    If these does not fire when editing your profile from the front, then these hooks do not fire in the front end. Looking at the code you pasted, I would investigate the wp_ajax_themex_update_user and wp_ajax_nopriv_themex_update_user methods which, at a first glance seem to handle the actual profile update. See if they have added some hooks for us to use.

    2) The code you entered I would insert as:

    echo '<ul class="my-custom-rank-list">';
    echo do_shortcode( '[mycred_list_ranks wrap=""]<li>%rank_logo% %rank% <div class="req">%min% - %max%</div></li>[/mycred_list_ranks]' );
    echo '</ul>';
    Thread Starter lava-team

    (@hungrygolf)

    1. no, its not working.

    I have tried to find some which works like wp hooks. but I couldn’t find any of them.
    How can I fix it?

    2. How can I find these hook functions?
    I want to create when users pick up another users as favorite (on theme, profiles.. when you click star, you will become a friend) then the users get points.

    user who request friend gets 10pt.
    user who got a request gets 3pt..etc

    But I can’t find which function I need to find. how can I find?

    3. Leader board.
    it’s not listing. I created new template. it shows only leader board and not showing

    Plugin Author myCred

    (@designbymerovingi)

    Unfortunately I am not able to help you since I do not know the theme you are using. Some themes have hooks, some do not. If you can find the appropirate time in your theme you could add your own hooks and solve the issue.

    You would need to find each instance you want to award points and either hard-code in the points settings or add your custom hooks though either do_action() or apply_filters().

    Hello, is there other solution than do_shortode to use the plugin in templates ?

    Plugin Author myCred

    (@designbymerovingi)

    @li-an

    Depends on what you are trying to achieve. If you want to use a shortcode in your content you can insert it there however if you want to use a shortcode outside the content you must use the do_shortcode() function. There are plugins that lets you insert PHP code into your content if that is the issue.

    Hello Gabriel,
    mycred.me/support/tutorials/how-to-make-your-custom-hook/
    i followed your steps to create custom hook for mycred plugin,i was able to get that hook in the backend, but got confused in the frontend, i want to award points for entering competition on my site, i have made a form in a template and if the user submits an answer i want to award the user
    any help would be appreciated 🙂

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Great one and questions.’ is closed to new replies.