Checking if member is online
-
I’m getting an error all of a sudden to my code
function is_member_online($user_id, $time=5){ global $wp, $wpdb; $user_login = $wpdb->get_var( $wpdb->prepare( " SELECT u.user_login FROM $wpdb->users u JOIN $wpdb->usermeta um ON um.user_id = u.ID WHERE u.ID = $user_id AND um.meta_key = 'last_activity' AND DATE_ADD( um.meta_value, INTERVAL $time MINUTE ) >= UTC_TIMESTAMP() " )); if(isset($user_login) && $user_login !=""){ return true; } else {return false;} }
This checks if bbpress members are online. This is the error that is being resulted
Warning: Missing argument 2 for wpdb::prepare(), called in /hermes/bosweb/web172/b1721/ipg.dnbrawlercom/lsheroes/wp-content/themes/SaveLSHoooo/custom-functions.php on line 15 and defined in /hermes/bosweb/web172/b1721/ipg.dnbrawlercom/lsheroes/wp-includes/wp-db.php on line 992
It has been happening working until recently.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.