Home Forums WTI Like Post PRO I am missing a message

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #302
    DenisCGN
    Participant

    Hello,
    I dont really remeber if I asked this allready.

    I a missing a message.

    • First time visitor visits a POST with no voting on it
      Hey, be the first to vote!
    • First time visitor visits a POST with 1 voting on it
      1 (number displayed) visitor like this, what about you?
    • First time visitor visits a POST with more than 1 voting on it
      15 (number displayed) visitors like this, what about you?

    This messages for visitors that are just looking at the websites posts.

    Now I need these message:

    • First time visitor votes for a post.
      Thanks for voting this post!
    • First time visitor that is remembered by the website.
      you like this post allready!

    All other message can be as they are. I am just missing messages for new visitors if there 1 or more votings for a post. Right now there is only the number.

    How can I do this, or better can you out this in the settings of the plugin?

    Cheers,
    Denis

    #317
    Webtechideas
    Keymaster

    We think we had done this for you earlier using hook. If you have changed the theme or our plugin, then look for the previous one. The hook available which you can use is:

    apply_filters( 'wti_like_post_load_message', $msg, $post_id, $like_count, $unlike_count )

    You need to attach a function to the above hook. There you need to check for the like, unlike count. Depending upon those values you will have return the message.

    Thanks

    #324
    DenisCGN
    Participant

    Yes, you did, but I cant find it anymore.
    Isnt it easier to add this to the plugin itself?
    Maybe other users need this, too.

    Cheers,
    Denis

    #325
    Webtechideas
    Keymaster

    There are so many plugin users and they have different requested functionality. We include those which are generic and add filters for those which will help in customizing as per user. So the hook is there which will help you in modifying the output. Since we had done this for you earlier, we must have sent code/file to you. Please check your mailbox and search for wti_like_post_load_message.

    Thanks

    #326
    DenisCGN
    Participant

    Hi,

    I got this:

    add_filter( 'wti_like_post_load_message', 'wti_like_post_load_message', 10, 4 );
    
    function wti_like_post_load_message( $post_id, $like_count, $unlike_count, $msg ) {
        if ( $like_count == 1 ) {
            $msg = 'User likes this image.';
        } else if ( $like_count > 1 ) {
            $msg = 'Users already like this image.';
        }
        
        return $msg;
    }

    If you go on this page : http://partykompass.de/ueberschrift-9/

    then there is only the HEART and the number 1.

    I need “1 person allready voted.”

    If you go to this page: http://partykompass.de/zu-guter-letzt-die-ueberschrift-16/

    then there is only the HEART and the number 2.

    I need “2 persons allready vote.”

    And now comes the tricky part. If you vote. then first it shows “thanks for voting” and if you reload the page it says “you allready voted this image”. If you want to vote again, it says “please wait 60 minutes to vote again”.

    This is what I need.

    I need to versions to show the visitor until he votes.

    With the code above it does not work.

    I need somehow to check if the user allready voted.

    If not, I need the message for only 1 vote, and a message for more than 1 vote.

    Or am I missing, something?
    Denis

    • This reply was modified 5 years, 5 months ago by DenisCGN.
    #328
    Webtechideas
    Keymaster

    You need to change the message a little bit like $msg = 'User likes this image.'; to $msg = $like_count . ' user likes this image.'; Similarly you need to do for the else section. Also change the message content as per your like.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘WTI Like Post PRO’ is closed to new topics and replies.