jonioscm
Forum Replies Created
-
Forum: Plugins
In reply to: [Achievements for WordPress] Award for logging in x timesHi Apokh,
Apologies for delay in responding – currently in process of house move so only internet access I have is at work! Looks like you got a bit mixed up with where to add things. I’ll try to clarify what I did.
Your file xlogin.php should just be used for adding the “actions” – it appears you’ve added Unit9’s function in there, too. Whilst it may work, it also might not. Work through the base plugin extension template, just changing the things you need to (ie. the eat pizza/cake sections).
I’d add those other functions to your theme folders functions.php (just make one if you don’t have it already) if you’re only using the one theme. You’ll have to make sure the “require” function in your last code example (mg_achievements_init) is able to find the actual xlogin.php file. I placed it in my theme folder simply because it means I can call it with ‘xlogin.php’ – rather than adding paths.
Hope this helps,
Jon
Forum: Plugins
In reply to: [Achievements for WordPress] Image size for achievements loopIf the uploaded image is actually 32px x 32px – you should be able to target the image via css to force the size. Something like (assuming the table is classed the same) maybe;
.dpa-archive-achievements img { height:32px; width:32px; }Forum: Plugins
In reply to: [Achievements for WordPress] Award for logging in x timesNo problem, Unit9
your_textdomain is for (I believe) translating/language related. There is a bit of info here on text domains.
Hope this helps =o)
Forum: Plugins
In reply to: [Achievements for WordPress] Award for logging in x timesYou’ll need to add the actions via plug-in extension – see here
About halfway down the page is the “Reference Plugin” which should make it straight forward enough. Work through that template making the changes, and you should be right. Save in your theme folder as (for example) achextend.php – then add this to your functions.php;
function mg_achievements_init() { require 'achextend.php'; } add_action( 'dpa_init', 'mg_achievements_init' );I’m pretty sure that should get you up and running. You can then add the achievements in via the wp-admin thingo =o)
You might choose not to save it in the theme folder – depending on how your site is structured. I’m running a local intranet, with a single theme, as the only administrator – so this works for me.
I think that should get you up and going =o)
Forum: Plugins
In reply to: [Achievements for WordPress] Award for logging in x timesJust a thought, but I guess you could use a variable rather than the if statement like this (untested!);
function my_user_login_count($username, $user) { $login_count = intval(get_user_meta($user->ID, 'my_user_count', true)); $login_count++; update_user_meta($user->ID, 'my_user_count', $login_count); $theaction = 'logged_in_' . $login_count . '_times'; do_action($theaction, $current_user->ID); } } add_action('wp_login', 'my_user_login_count', 10, 2);Forum: Plugins
In reply to: [Achievements for WordPress] Award for logging in x timesI went down the same route as Unit9, initially – but changed for flexibility (rather than having to hard code individual achievements. If you go that way, you would essentially add an if statement where the // comment line is – so code might be;
function my_user_login_count($username, $user) { $login_count = intval(get_user_meta($user->ID, 'my_user_count', true)); $login_count++; update_user_meta($user->ID, 'my_user_count', $login_count); if ($login_count == 10) { do_action('logged_in_10_times', $current_user->ID); } if ($login_count == 20) { do_action('logged_in_20_times', $current_user->ID); } } add_action('wp_login', 'my_user_login_count', 10, 2);Forum: Plugins
In reply to: [Achievements for WordPress] Award for logging in x timesBy the way, the ‘user_front_end_login’ is a custom one I added using the instructions from PG here.
Thanks for the amazing plugin – I’ve had heaps of fun =o)
Jon
Forum: Plugins
In reply to: [New User Approve] Feature request: 2x new actionsI’d appreciate this feature, too. Occasionally I get a lot of bot sign-ups in one go, and have to go through the main “user list” to delete the accounts.
Regards,
Jon
Forum: Plugins
In reply to: [BuddyPress Member Profile Stats] Plugin Not Working Anymore…Developer needs to read this;