• Resolved chuyqwerty

    (@chuyqwerty)


    Is there a way to be notified when a user ranks up? (similar to point notifications)
    But maybe instead of just being in the top right corner, is there a way I can have it in the center of the screen, bigger, and showing the rank image?

    Also, I think I am missing something but I cant remove the decimal. When I remove it, 5 points becomes 500 points and I dont want that. Please help.

    Thank you so much. This plugin is amazing

    https://wordpress.org/plugins/mycred/

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

    (@designbymerovingi)

    Hi.

    There is no “rank notifications” built-in to myCRED. Ranks are awarded automatically however they do trigger a custom hook that you could use to insert a modal pop up for example with your own content.

    mycred_user_got_promoted – fires when a user has been promoted and
    mycred_user_got_demoted – fires when a user got demoted.

    Regarding removing decimals, you can not change if you want to start using or stop using decimals once you have run the myCRED setup. So if you setup myCRED to use decimals, you can not change it back to all of the sudden stop using it.

    You have actually not removed decimals but just the character that separates the the main number and the decimal value. So 4.00 becomes 400 which is still 4.00 but with the dot gone.

    Thread Starter chuyqwerty

    (@chuyqwerty)

    Ok thank you so much for your answer.
    How would I use mycred_user_got_promoted to create a pop up? I am not very familiar with PHP.. Would you be able to help me create a very simple pop up (kind of like the one for points) please?

    Thank you so much

    Plugin Author myCred

    (@designbymerovingi)

    Sure.

    Here is a code snippet you can use.

    You will need to adjust the message that is shown to the user and apply your own CSS styling of course but it will show a popup modal each time a user is promoted.

    Paste the code into your themes functions.php file and you are good to go.
    (requires myCRED 1.4 or higher).

    When testing, remember that some browser popup blockers will block this modal too!
    Regarding the javascript, check out the doc for .dialog() to add features to it or to change size etc.

    Thread Starter chuyqwerty

    (@chuyqwerty)

    Thank you so much!!

    I am not sure what to do with the doc for .dialog.. but I am sure it would help me because the code you gave me works, but the message is not a pop up, it just shows up at the bottom of the page under the footer.

    How would I fix this?

    You have been SUPER great help. I really appreciate this.

    Thank you!

    Thread Starter chuyqwerty

    (@chuyqwerty)

    Oh, and i bet its a simple thing to do, but how would I show the rank’s logo as well? (Sorry for all the questions)

    Thank you!

    Plugin Author myCred

    (@designbymerovingi)

    The logo is just a featured image in a post so you can use native WordPress functions to get any detail of the rank post you want.

    For example you can use get_the_post_thumbnail to get the featured image.

    Regarding the popup issue, sounds like a javascript issue. Check if you are getting a javascript error on the page when it loads.

    Thread Starter chuyqwerty

    (@chuyqwerty)

    Ok, thank you so much. You done too much already so I wont bother you anymore. I will try to figure out the rest. Thank you so much! You’re the best 🙂

    Plugin Author myCred

    (@designbymerovingi)

    No worries. let me know if you require any further assistance.

    Thread Starter chuyqwerty

    (@chuyqwerty)

    Ok, well since you offered.. lol

    I got the modal to work properly and I styled it how I want and everything is almost exactly how I want, except for one thing..

    I cant get the rank logo to display. I been reading that link you gave me, but it always gets the post featured image of the current post I am currently on, not from the rank post. I dont know how to set it so it grabs it from a specific post. Maybe I have to set the post ID, but I do not know how to properly do that. Please help? 🙂

    Thanks again.

    Plugin Author myCred

    (@designbymerovingi)

    Morning.

    I am pretty sure the reason you get the current post is because you are not using the correct post ID.

    Have a look at my code.
    You will see that I store the rank post ID under the $rank_post_id variable. An example of this is my use of get_post_title. Anything that you want to show that requires a post ID, must use the $rank variable (or whatever you choose to call it).

    // Show Thumbnail
    echo get_the_post_thumbnail( $rank_post_id );
    
    // Show Rank title
    echo get_the_title( $rank_post_id );
    
    // Get the entire rank post object
    $rank_post = get_post( $rank_post_id );
    
    // Get a custom post meta
    echo get_post_meta( $rank_post_id, 'my_own_info', true );

    Edit: I have updated the code and renamed the $rank variable to $rank_post_id to avoid any confusion by others, but of course you can name it anything you want.

    Thread Starter chuyqwerty

    (@chuyqwerty)

    I finally got it to work! THANK YOU!
    Here is the image 🙂

    Thank you so much!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Rank Notification’ is closed to new replies.