Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

eMember and MyCred Plugin – show a page once to new (logged-in) member

by

Tips and Tricks HQ Support Portal › Forums › WP eMember › eMember and MyCred Plugin – show a page once to new (logged-in) member

Tagged: members, membership, mycred, points

  • This topic has 7 replies, 3 voices, and was last updated 10 years, 7 months ago by jurgenvt.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • October 6, 2014 at 11:40 am #11565
    jurgenvt
    Member

    Hi, I have created a WP+buddypres+emamber site which works great.

    one challange though.

    all members get “points”when they become a member.

    for this i am using the Mycred plugin [http://mycred.me]

    i need some kind of page that is shown to a new (logged-in) member only once.

    in this page (or function) i can do:

    echo do_shortcode( ‘[mycred_give amount=”10″ log=”new membership points” ref=”newmember_points”]’ );

    which will give the member 10 points.

    is there a designated spot in the code where i can do this, or is there a setting i can show only once to an new logged-in member?

    looking forward to your reply

    edit: moderation of new members is required in this website, so i cannot log them in after registration right away.

    October 6, 2014 at 10:42 pm #65861
    wzp
    Moderator

    There really isn’t any support for “once only” display of content.

    The closest thing I can think of is…

    1. They register to a “Welcome” membership level, that awards them their credits.
    2. You then use the eMember API to upgrade them to a “Working” membership level:

      https://www.tipsandtricks-hq.com/wordpress-membership/api-updating-a-member-account-using-http-get-or-post-933

    3. Upgrading them prevents them from getting access to the previous “Welcome” level.

    October 6, 2014 at 11:16 pm #65862
    admin
    Keymaster

    The best way to do this is to use after registration hook so the points are awarded after the registration is complete. It doesn’t rely on a user visiting a page (that can always be tampered)

    Here is a sample/example snippet of code to show you what I mean:

    add_action('user_register', 'give_member_registration_points');
    function give_member_registration_points($user_id)
    {
    $ref = "newmember_points";
    $user_id = $user_id;
    $amount = "10";
    $log = "new membership points";

    //Give points here
    $mycred = mycred();
    $mycred->add_creds(
    $ref,
    $user_id,
    $amount,
    $log
    );
    }

    October 8, 2014 at 12:22 pm #65863
    jurgenvt
    Member

    Hi admin,

    this seems really promessing

    where do i put this code

    thank you so much!

    October 8, 2014 at 10:57 pm #65864
    admin
    Keymaster

    You can add that custom code to your functions.php file of the theme.

    October 11, 2014 at 4:40 pm #65865
    jurgenvt
    Member

    sorry to bother again,

    i seem to miss something, because when i put this in my functions.php

    my website turns to white.

    error log:

    PHP Parse error: syntax error, unexpected T_VARIABLE in /…localpathhere…/functions.php on line 1394

    code in functions.php

    <?php
    add_action('user_register', 'give_member_registration_points');
    function give_member_registration_points($user_id) {
    $ref = 'newmember_points';
    $user_id = $user_id;
    $amount = '10';
    $log = 'new membership points';

    //Give points here
    $mycred = mycred();
    $mycred->add_creds(
    $ref,
    $user_id,
    $amount,
    $log
    );
    }
    ?>

    i understand there must be something wrong with then $mycred variable , my skills ar not sufficient unfortunatly..

    i know this beyond your support, but im trying anyway..

    thank you

    October 11, 2014 at 11:00 pm #65866
    wzp
    Moderator

    $log = ‘new membership points’

    There’s supposed to be a semicolon at the end of that line. I have edited your post and corrected the code.

    October 12, 2014 at 7:01 pm #65867
    jurgenvt
    Member

    i should have known that! thank you

    and this works like a charm!, thank you so much!

    problem solved!

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ