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

Diff of /contributions/modules/hidden/hidden.module

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

revision 1.8, Thu Dec 18 15:29:07 2008 UTC revision 1.8.2.1, Fri Mar 13 11:44:09 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: hidden.module,v 1.7 2008/12/13 18:42:43 ekes Exp $  // $Id: hidden.module,v 1.8 2008/12/18 15:29:07 ekes Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 573  function hidden_link($type, $item = NULL Line 573  function hidden_link($type, $item = NULL
573    
574    if ($type == 'comment') {    if ($type == 'comment') {
575      $target = $item->cid;      $target = $item->cid;
576        $iscomment = TRUE;
577    }    }
578    elseif ($type == 'node') {    elseif ($type == 'node') {
579      $target = $item->nid;      $target = $item->nid;
580        $iscomment = FALSE;
581    }    }
582    else {    else {
583      return $links;      return $links;
# Line 590  function hidden_link($type, $item = NULL Line 592  function hidden_link($type, $item = NULL
592          'title' => t('hide'),          'title' => t('hide'),
593          'href' => "hidden/$type/$target/hide",          'href' => "hidden/$type/$target/hide",
594          'query' => drupal_get_destination(),          'query' => drupal_get_destination(),
595            'fragment' => ($iscomment) ? "comment-$target" : '',
596        );        );
597      }      }
598      // not hidden and is published      // not hidden and is published
# Line 601  function hidden_link($type, $item = NULL Line 604  function hidden_link($type, $item = NULL
604          'title' => t('report'),          'title' => t('report'),
605          'href' => "hidden/$type/$target/report",          'href' => "hidden/$type/$target/report",
606          'query' => drupal_get_destination(),          'query' => drupal_get_destination(),
607            'fragment' => ($iscomment) ? "comment-$target" : '',
608        );        );
609      }      }
610    }    }
# Line 1212  function _hidden_reported_hide($type, $i Line 1216  function _hidden_reported_hide($type, $i
1216      return db_query($query, $id, $uid, time(), $rid, $public, $private);      return db_query($query, $id, $uid, time(), $rid, $public, $private);
1217    }    }
1218    elseif ($type == 'comment') {    elseif ($type == 'comment') {
1219      $query = "INSERT INTO {hidden_reported_comment} (cid, uid, created, rid, publicnote, privatenote) VALUES (%d, %d, %d, %d, %d, '%s', '%s')";      $query = "INSERT INTO {hidden_reported_comment} (cid, uid, created, rid, publicnote, privatenote) VALUES (%d, %d, %d, %d, '%s', '%s')";
1220      return db_query($query, $id, $uid, time(), $rid, $public, $private);      return db_query($query, $id, $uid, time(), $rid, $public, $private);
1221    }    }
1222    
# Line 1742  function _hidden_log($action, $descripti Line 1746  function _hidden_log($action, $descripti
1746    if ($action > 50) {    if ($action > 50) {
1747      $log = _hidden_settings_logging();      $log = _hidden_settings_logging();
1748      if ($log[$action]['enabled']) {      if ($log[$action]['enabled']) {
1749        watchdog('hidden', $description .' '. $titles, (($action == HIDDEN_LOG_DEBUG_FILTER) ? WATCHDOG_NOTICE : WATCHDOG_ERROR));        watchdog('hidden', $description .' '. $titles, array(), (($action == HIDDEN_LOG_DEBUG_FILTER) ? WATCHDOG_NOTICE : WATCHDOG_ERROR));
1750        //TODO deal with arrays and links        //TODO deal with arrays and links
1751      }      }
1752      return;      return;
# Line 1753  function _hidden_log($action, $descripti Line 1757  function _hidden_log($action, $descripti
1757      if ($email[$action]['when'] == HIDDEN_MAIL_LATER) {      if ($email[$action]['when'] == HIDDEN_MAIL_LATER) {
1758        $query = "INSERT INTO {hidden_log} (hidetime, action, description, ids, uid) VALUES (%d, %d, '%s', '%s', %d)";        $query = "INSERT INTO {hidden_log} (hidetime, action, description, ids, uid) VALUES (%d, %d, '%s', '%s', %d)";
1759        if (! db_query($query, time(), $action, $description ."\n". $titles, serialize($items), $user->uid)) {        if (! db_query($query, time(), $action, $description ."\n". $titles, serialize($items), $user->uid)) {
1760          watchdog('hidden', 'Error writing log to database', WATCHDOG_ERROR);          watchdog('hidden', 'Error writing log to database',array() , WATCHDOG_ERROR);
1761        }        }
1762      }      }
1763      else {      else {

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.8.2.1

  ViewVC Help
Powered by ViewVC 1.1.2