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

Diff of /contributions/modules/abuse/abuse.install

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

revision 1.5.6.2 by btmash, Wed May 14 19:13:19 2008 UTC revision 1.5.6.3 by btmash, Fri Jul 18 15:52:51 2008 UTC
# Line 2  Line 2 
2  // $Id$  // $Id$
3    
4  /**  /**
5     * @file
6     * Installs the abuse module
7     */
8    
9    /**
10   * Implementation of hook_install().   * Implementation of hook_install().
11   */   */
12  function abuse_install() {  function abuse_install() {
# Line 92  function abuse_schema() { Line 97  function abuse_schema() {
97          'unsigned' => TRUE,          'unsigned' => TRUE,
98          'not null' => TRUE,          'not null' => TRUE,
99        ),        ),
   
100      ),      ),
101      'primary key' => array('aid'),      'primary key' => array('aid'),
102      'indexes' => array('oid_type' => array('oid', 'type'), 'uid' => array('uid')),      'indexes' => array('oid_type' => array('oid', 'type'), 'uid' => array('uid')),
103    );    );
104    
105    $schema['abuse_warnings'] = array(    $schema['abuse_warnings'] = array(
106      'description' => t('A list of warnings that have been sent out to users for inappropriate content'),      'description' => t('A list of warnings that have been sent out to users for inappropriate content'),
107      'fields' => array(      'fields' => array(
# Line 136  function abuse_schema() { Line 140  function abuse_schema() {
140        ),        ),
141      ),      ),
142      'indexes' => array(      'indexes' => array(
143        'oid_type_created' => array('oid', 'type', 'created'),        'oid_type_created' => array('oid', 'type', 'created'),
144        'uid' => array('uid'),        'uid' => array('uid'),
145        'sent_by_uid' => array('sent_by_uid')        'sent_by_uid' => array('sent_by_uid')
146      ),      ),
147    );    );
# Line 179  function abuse_schema() { Line 183  function abuse_schema() {
183          'not null' => TRUE,          'not null' => TRUE,
184          'default' => 0,          'default' => 0,
185        ),        ),
   
186      ),      ),
187      'primary key' => array('oid', 'type'),      'primary key' => array('oid', 'type'),
188      'indexes' => array(      'indexes' => array(
# Line 225  function abuse_schema() { Line 228  function abuse_schema() {
228          'unsigned' => TRUE,          'unsigned' => TRUE,
229          'not null' => TRUE,          'not null' => TRUE,
230        ),        ),
   
231      ),      ),
232      'indexes' => array(      'indexes' => array(
233        'uid' => array('uid'),        'uid' => array('uid'),
# Line 265  function abuse_schema() { Line 267  function abuse_schema() {
267      ),      ),
268      'primary key' => array('arid'),      'primary key' => array('arid'),
269    );    );
270    
271    return $schema;    return $schema;
272  }  }
273    
274  function abuse_install_default_reasons() {  function abuse_install_default_reasons() {
275    $sql_template = "INSERT INTO {abuse_reasons} (reason, description, argumentation) VALUES ('%s', '%s', '%s')";    $sql_template = "INSERT INTO {abuse_reasons} (reason, description, argumentation) VALUES ('%s', '%s', '%s')";
276    
277    $result1 = db_query($sql_template, "foul language", t('The user wrote very mean things'), t('Please refrain from writing such mean things'));    $result1 = db_query($sql_template, "foul language", t('The user wrote very mean things'), t('Please refrain from writing such mean things'));
278    $result2 = db_query($sql_template, "adult themes", t('The user\'s wrote very explicit language'), t('Please refrain from writing such mean things'));    $result2 = db_query($sql_template, "adult themes", t('The user\'s wrote very explicit language'), t('Please refrain from writing such mean things'));
279    $result3 = db_query($sql_template, "racist or sexist language", t('The user wrote very derogatory comments'), t('Please refrain from writing such mean things'));    $result3 = db_query($sql_template, "racist or sexist language", t('The user wrote very derogatory comments'), t('Please refrain from writing such mean things'));
# Line 280  function abuse_install_default_reasons() Line 282  function abuse_install_default_reasons()
282    
283    if ($result1 && $result2 && $result3 && $result4 && $result5) {    if ($result1 && $result2 && $result3 && $result4 && $result5) {
284      drupal_set_message('Abuse reason table installation was a success');      drupal_set_message('Abuse reason table installation was a success');
285    }    }
286    else {    else {
287      drupal_set_message('Retry from the start (remove abuse sequence and abuse reasons table)');      drupal_set_message('Retry from the start (remove abuse sequence and abuse reasons table)');
288    }    }

Legend:
Removed from v.1.5.6.2  
changed lines
  Added in v.1.5.6.3

  ViewVC Help
Powered by ViewVC 1.1.3