/[drupal]/contributions/modules/abuse/abuse.module
ViewVC logotype

Diff of /contributions/modules/abuse/abuse.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.34.4.3 by btmash, Fri Jul 18 15:52:51 2008 UTC revision 1.34.4.4 by btmash, Wed Oct 15 17:50:58 2008 UTC
# Line 303  function abuse_cron() { Line 303  function abuse_cron() {
303        db_query('UPDATE {abuse_status} SET assigned_to_uid=0 WHERE status=%d OR status=%d OR status=%d', ABUSE_PENDING, ABUSE_HIDDEN, ABUSE_SUPERADMIN);        db_query('UPDATE {abuse_status} SET assigned_to_uid=0 WHERE status=%d OR status=%d OR status=%d', ABUSE_PENDING, ABUSE_HIDDEN, ABUSE_SUPERADMIN);
304        variable_set('abuse_cleanup_timestamp', $timestamp);        variable_set('abuse_cleanup_timestamp', $timestamp);
305    }    }
306      // Clean out any and all items from abuse status that are no longer in the node, comments or users table.  Used JUST IN CASE nodeapi and comment hook do not properly delete off a node, comment or users.
307      db_query("DELETE FROM {abuse_status} WHERE type='node' AND oid NOT IN (SELECT nid FROM {node})");
308      db_query("DELETE FROM {abuse_status} WHERE type='comment' AND oid NOT IN (SELECT cid FROM {comments})");
309      db_query("DELETE FROM {abuse_status} WHERE type='user' AND oid NOT IN (SELECT uid FROM {users})");
310  }  }
311    
312  /**  /**
# Line 482  function abuse_forms() { Line 486  function abuse_forms() {
486  }  }
487    
488  /**  /**
489     * Implementation of hook_form_alter().
490     */
491    function abuse_form_alter(&$form, $form_state, $form_id) {
492    
493    }
494    
495    /**
496   * Implementation of abuse specific functions   * Implementation of abuse specific functions
497   */   */
498  function abuse_title_callback($title, $type = array()) {  function abuse_title_callback($title, $type = array()) {
# Line 716  function _abuse_load($obj, $second_value Line 727  function _abuse_load($obj, $second_value
727          return false;          return false;
728        }        }
729        $object->title = check_plain($comment->subject);        $object->title = check_plain($comment->subject);
730        $object->name = check_markup($comment->name, $comment->format, FALSE);        $object->name = check_plain($comment->name);
731        $object->uid = $comment->uid;        $object->uid = $comment->uid;
732        $object->content_type = 'comment';        $object->content_type = 'comment';
733        $object->description = check_markup($comment->comment, $comment->format, FALSE);        $object->description = check_markup($comment->comment, $comment->format, FALSE);
# Line 724  function _abuse_load($obj, $second_value Line 735  function _abuse_load($obj, $second_value
735        $object->path = array('URL' => 'node/'. $comment->nid, 'QUERY' => NULL, 'BREADCRUMB' => 'comment-'. $comment->cid);        $object->path = array('URL' => 'node/'. $comment->nid, 'QUERY' => NULL, 'BREADCRUMB' => 'comment-'. $comment->cid);
736        $object->link = 'node/'. $comment->nid .'#comment-'. $comment->cid;        $object->link = 'node/'. $comment->nid .'#comment-'. $comment->cid;
737        break;        break;
738        case 'user':
739          $account = user_load(array('uid' => $oid));
740          user_build_content($account);
741          $object->title = check_plain($account->name);
742          $object->uid = $oid;
743          $object->content_type = 'user';
744          $object->description = theme('user_profile', $account);
745          $object->status = $user->status;
746          $object->path = array('URL' => 'user/'. $oid, 'QUERY' => NULL, 'BREADCRUMB' => NULL);
747          $object->link = 'user/'. $oid;
748          break;
749    }    }
750    $object->reports = _abuse_load_reports($object->type, $object->oid);    $object->reports = _abuse_load_reports($object->type, $object->oid);
751    $object->history = _abuse_load_history($object->type, $object->oid);    $object->history = _abuse_load_history($object->type, $object->oid);

Legend:
Removed from v.1.34.4.3  
changed lines
  Added in v.1.34.4.4

  ViewVC Help
Powered by ViewVC 1.1.3