| 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 |
| 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; |
| 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 |
| 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 |
} |
} |
| 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 |
|
|
| 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; |
| 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 { |