Plugin Author
myCred
(@designbymerovingi)
Hey!
The above codes for for CubePoints and not myCRED.
To show a logged in users balance you could use:
echo do_shortcode( '[mycred_my_balance]' );
This will load the mycred_my_balance shortcode that disaplays the current users points balance if they are logged in, if not, it returns an empty string.
hey!
well it showed an error!
Fatal error: Call to undefined function do_shortcode() in /home/content/70/11464570/html/sys/balance.php on line 2
do i have to put it in the wordpress folder?
thanks again
hello, I didnt have cube points installed can you please tell me the difference between mycred and cubepoints
thanks in advance
Plugin Author
myCred
(@designbymerovingi)
Ah well that means you are trying to insert this code outside of WordPress. You could try with including the shortcode file from wordpress. It’s located in wp-includes/shortcodes.php
Both myCRED and CubePoints are “points management systems”. myCRED just does this in a different way from CubePoints. With myCRED you get far more flexibility on how your points work or “look”. You can for example choose any type of format for your points (whole number or using decimals), interact with more third party plugins and above all, most parts of myCRED is documented. As much time as I spend on adding new features or fixing bugs, I also spend on documenting everything so you can better acquaint yourself with myCRED.
okay, but do I need cubepoints for the code to work? because im getting error š
Plugin Author
myCred
(@designbymerovingi)
If you want the code snippet you entered to work, you would need to ask in the Cubepoints support forum. This is the forum for myCRED related issues.
yes but im using mycred since mycred is better than cubepoints, how can I do this for mycred please help me and im so sorry for bothering
thanks in advance š
um okay, I will just install cubepoints and use the codes and post a new support ticket,
thanks
Plugin Author
myCred
(@designbymerovingi)
Regarding $wpdb:
There are tons of support forums and web blogs for how to include the wpdb class outside WordPress and should be your first point of entry. Here is one example.
You get any users point balance directly from the usermeta table. One example would be to use the get_user_meta function.
Once you have initiated WordPress you could initi myCRED by including the mycred.php file and mycred-functions.php file:
/wp-content/plugins/mycred/mycred.php
/wp-content/plugins/mycred/includes/mycred-functions.php
Now you have access to all myCRED functions and could use the mycred_get_users_cred function to get a users point balance.
$user_id = get_current_user_id();
echo 'You have ' . mycred_get_users_cred( $user_id ) . ' points.';
Plugin Author
myCred
(@designbymerovingi)
Ah I am sorry I was not fast enough in my reply. Good luck.
hey, thank you it’s defiantly working, im using your cubepoints plugin, the best feature I like it, that I was looking for a developer to edit your plugin by awarding users different amount for different posts, you sir are awesome, I just found what i want š