Advertisement
Viruthagiri

cp_core.php

Jan 30th, 2012
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /** Adds transaction to logs database */
  2. function cp_log($type, $uid, $points, $data){
  3.     $userinfo = get_userdata($uid);
  4.     if($userinfo->user_login==''){ return false; }
  5.     if($points==0 && $type!='reset'){ return false; }
  6.     global $wpdb;
  7. if( is_array( $data ) && isset( $data["post_id"] ) ) {
  8. $wpdb->query("INSERT INTO ".CP_DB." (id, uid, type, data, blog_id, points, timestamp)
  9. VALUES (NULL, '".$uid."', '".$type."', '".$data["post_id"]."', '".$data["blog_id"]."', '".$points."', ".time().");");
  10. } else {
  11. $wpdb->query("INSERT INTO ".CP_DB." (id, uid, type, data, points, timestamp)
  12. VALUES (NULL, '".$uid."', '".$type."', '".$data."', '".$points."', ".time().");");
  13. }
  14.     do_action('cp_log',$type, $uid, $points, $data);
  15.     return true;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement