iamonlythird
Forum Replies Created
-
Forum: Plugins
In reply to: [SubMe] Divide mass sending of emailsPlease ignore this, I just installed the plugin on a test environment and noticed that you have already added a feature for this. I do have other questions which I will ask in a new thread.
Forum: Plugins
In reply to: [W3 Total Cache] Does fragment caching work with Disc Enhanced?I aim to do a weekly bump to this thread until we have some official words on this issue. Google is of no help and I have come across other threads with no actual confirmation.
Forum: Plugins
In reply to: [W3 Total Cache] Does fragment caching work with Disc Enhanced?I am bumping this to the top in hopes that any of the developers will see this and respond. Thank you.
This is amazing, thank you VERY much!
Thank yoiu!
Nice thank you.
I have another question. What is the technology behind the badge system? How well does it do in terms of performance?
For example, does it save the values in the user’s metadata? Does it save each task in a separate metadata entry or does it saved them all in one (via an array)?
I have a lot of user activity and concerns that adding this hook will affect my performance too much.
For a few years ago, I actually created my own badge system but removed it specifically because it was affecting performance too much.
Works great, thank you!
I have put this code into test and it is not working. I tested it on fresh install of WP4 too.
Subscribers are still awarded daily points. Maybe there is a bug in your code or do you have a different working approach to this?
Thank you and hope you are having a good weekend!
Forum: Plugins
In reply to: [Rename wp-login.php] Auto redirection for /wp-login.phpJust to highlight that this feature would be great to add to this plugin. I wouldn’t mind chipping in a Paypal donation when this happens.
Thank you!
It works very well, I did this once as well.
That is fine, I solved it with:
$return = $days_since ? round( abs( time() - $days_since ) / DAY_IN_SECONDS ) : -1;Thanks again!
Can you please tell me where exactly you are running this code? Using your code as a template, I added $user_id as an argument and simply called the function but yet again, nothing was returned. Here is the code I used:
function mycred_pro_days_since_last_comment($user_id) { if ( ! is_user_logged_in() ) return; global $wpdb, $mycred; $last_time = $wpdb->get_var( $wpdb->prepare( " SELECT time FROM {$mycred->log_table} WHERE ref = %s AND user_id = %d ORDER BY time DESC LIMIT 0,1;", 'approved_comment', $user_id ) ); if ( $last_time === NULL ) { // User has not received points for a comment at all $return = 'no comments made yet'; } else { // Now you have the timestamp for the last time the user // got points for a comment. Convert this unix timestamp // to number of days $days_since = human_time_diff( $last_time ); $return = "$days_since since last comment"; } return $return; } mycred_pro_days_since_last_comment(1);I am calling this on the front-end, in a page. Did you test this with WP4.0? (sorry about the stupid question, but I can’t see how it is working for you and not me, I’m on a fresh install of WP and mycred install)
EDIT: Please ignore, it works fine. Simply didn’t echo it =) It’s been a long day. Thank you very much!
EDIT 2: Sorry I have one last question. Is it possible to just GET the number in days since last comment? Currently it returns “1 month”, I would want only “30”.
I tried it but still did not return anything.
Here is the full code I tried:
global $wpdb, $mycred; $user_id = 1; $last_time = $wpdb->get_var( $wpdb->prepare( " SELECT time FROM {$mycred->log_table} WHERE ref = %s AND user_id = %d ORDER BY time DESC LIMIT 0,1;", 'approved_comment', $user_id ) ); if ( $time === NULL ) { // User has not received points for a comment at all } else { // Now you have the timestamp for the last time the user // got points for a comment. Convert this unix timestamp // to number of days $now = time(); $days_since = round( ( ( $now - $last_time ) / 86400 ) ); } echo "$days_since days since last comment";Do you know why it is not working?
Thank you for the response.
I tried your query but $days_since is empty. Is there maybe a typo in your query (or code)? I tried with with a couple of user IDs and all of them have an “approved_comment” entry in the DB, but nothing was returned.
As far as I can see, it should be fine but I think we are missing something…?
Forum: Installing WordPress
In reply to: Downgrade from 4.0 to 3.9.1I had to downgrade as well. If anyone else need to do this, do the following:
1. Download WP 3.9.2
2. Delete the wp-config.php file within that package if it exists.
3. Remove the /wp-includes folder and its content.
4. Simply upload all the files and replace the files on your server.
5. Go to login page. You will see a notice about upgrading your Database. Just click the button.
That is it, you have downgraded.