Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /** Adds transaction to logs database */
- function cp_log($type, $uid, $points, $data){
- $userinfo = get_userdata($uid);
- if($userinfo->user_login==''){ return false; }
- if($points==0 && $type!='reset'){ return false; }
- global $wpdb;
- if( is_array( $data ) && isset( $data["post_id"] ) ) {
- $wpdb->query("INSERT INTO ".CP_DB." (id, uid, type, data, blog_id, points, timestamp)
- VALUES (NULL, '".$uid."', '".$type."', '".$data["post_id"]."', '".$data["blog_id"]."', '".$points."', ".time().");");
- } else {
- $wpdb->query("INSERT INTO ".CP_DB." (id, uid, type, data, points, timestamp)
- VALUES (NULL, '".$uid."', '".$type."', '".$data."', '".$points."', ".time().");");
- }
- do_action('cp_log',$type, $uid, $points, $data);
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement