<?php
/* ====================
[BEGIN_COT_EXT]
Hooks=moderation.page.mnotfind
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

if(in_array('banlist', $moderauth)) {
  require_once cot_langfile('banlist', 'plug');

  cot::$db->registerTable('banlist');
  cot::$db->registerTable('banlist_msg');

  $sql = $db->query("SELECT * FROM $db_banlist_msg ORDER by banmsg_date DESC");

  $ii = 0;
  foreach ($sql->fetchAll() as $row)
  {
    $t->assign(cot_generate_usertags($row['banmsg_userid'], 'ADMIN_BANLIST_ROW_USER_'));
  	$t->assign(array(
  		'ADMIN_BANLIST_ROW_ID' => $row['banmsg_id'],
  		'ADMIN_BANLIST_ROW_DELURL' => cot_url('moderation', 'm=banlist&a=msgdelete&id='.$row['banmsg_id'].'&'.cot_xg()),
      'ADMIN_BANLIST_ROW_DATE' => cot_date('d.m.Y H:i', $row['banmsg_date']),
  		'ADMIN_BANLIST_ROW_REASON' => $row['banmsg_reason'],
  		'ADMIN_BANLIST_ROW_ODDEVEN' => cot_build_oddeven($ii)
  	));

  	$t->parse('MAIN.LINE_BANLIST.MSG_ROW');
  	$ii++;
  }
  $t->assign(array(
  	'ADMIN_BANLIST_MSG_CNT' => $ii,
  ));

  $t->parse('MAIN.LINE_BANLIST');
}