You are here

function modr8_log_event in modr8 7

Same name and namespace in other branches
  1. 5 modr8_admin.inc \modr8_log_event()
  2. 6 modr8_admin.inc \modr8_log_event()

Moderation event log.

1 call to modr8_log_event()
modr8_log_view in ./modr8_admin.inc
menu callback for moderation log.

File

./modr8_admin.inc, line 751
Admin pages for moderation

Code

function modr8_log_event($modid) {
  if (is_numeric($modid)) {
    $qry = db_select('modr8_log', 'ml')
      ->condition('ml.modid', $modid)
      ->addTag('node_access')
      ->addMetaData('base_table', 'modr8_log');
    $qry
      ->join('users', 'u', 'u.uid = ml.uid');
    $qry
      ->fields('ml')
      ->fields('u', array(
      'name',
    ));
    $events = $qry
      ->execute()
      ->fetchAll();
    if ($events) {
      $event = $events[0];
      $qry = db_select('users', 'u')
        ->condition('u.uid', $event->author_uid)
        ->fields('u', array(
        'name',
        'uid',
      ))
        ->execute()
        ->fetchAll();
      if ($qry) {
        $event->author = $qry[0];
      }
      return theme('moderation_event', array(
        '0' => $event,
      ));
    }
  }
  drupal_not_found();
}