Forum Replies Created

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter ajh77

    (@ajh77)

    Thread Starter ajh77

    (@ajh77)

    Does anyone have any thoughts on where the error is in my code please

    ANY help would be VERY much appreciated !!

    Thread Starter ajh77

    (@ajh77)

    Ok…making progress…when I press bookmark, the button changes to “remove bookmark” when I press that the button won’t remove it, meaning the button should go back to “bookmark” and it is not

    any ideas why ?

    Thread Starter ajh77

    (@ajh77)

    I think I found error : spelling ?

    mbremove should be bmremove
    mbadd should be bmadd

    Do you think making those changes will fix my problem ?

    Thread Starter ajh77

    (@ajh77)

    Yes, please put one of the posts in correct category and delete the one that is in wrong category please

    Thank you

    Thread Starter ajh77

    (@ajh77)

    Below is javascript code to bookmark specific member profiles on my website, when I click the bookmark button it does not bookmark the profile I am asking to be bookmarked.

    Link code:

    // Bookmark link
                        if($this->logged_in_user != $id) {
                            $bookmarked = get_user_meta($this->logged_in_user, 'erns-bookmarked_profiles', true);
                            $bookmarkedT = false;
                            if(!empty($bookmarked)) {
                                $bookmarked = json_decode($bookmarked, true);
                                if(in_array($id, $bookmarked)) {
                                    $bookmarkedT = TRUE;
                                }
                            }
                            if($bookmarkedT) {
                                $display .= '
    Remove Bookmark
    ';
                            } else {
                                $display .= '
    Bookmark
    ';
                            }
                        }
    Javescript to write to database to bookmark/unbookmark the profile:
    $('.lnk-bookmark').on('click', function (e) {
            e.preventDefault();
            var $lnk = $(this);
            var todo = ($($lnk).hasClass('bmadd') ? 'add' : 'remove');
            var userid = $($lnk).attr('id');
            userid = userid.replace('bm-', '');
            if(!$($lnk).hasClass('disabled')) {
                $($lnk).addClass('disabled');
                $.post(
                    ERNSCustom.AdminAjax,
                    {
                        'action' : 'erns_profile_bookmark',
                        'todo' : todo,
                        'userid' : userid
                    },
                    function(response){
                        if(response && response.status=='success') {
                            if(todo == 'add') {
    $($lnk).removeClass('bmadd').addClass('mbremove').html('Remove Bookmark');
                            } else {
    $($lnk).removeClass('mbremove').addClass('mbadd').html('Bookmark');
                            }
                        }
                        $($lnk).removeClass('disabled');
                }, "json");
            }
        });

    The link is suppose to trigger the code to bookmark or unbookmark the individual profiles.

    How do I get the code to trigger because it won’t now

    Thread Starter ajh77

    (@ajh77)

    I have a paid membership site so I don’t want people to be able to share their user names. This is why I want this in place

    How might I go about doing this ?

    Thread Starter ajh77

    (@ajh77)

    I have tried with admin login and user accounts I have created. Same problem in Chrome and IE

    Developer removed “Remember Me’ with the hope the problem was fixed and that did not fix it

Viewing 8 replies - 1 through 8 (of 8 total)