$value) { if(strpos($value, $_GET['keyword']) === FALSE) { unset($logs[$key]); } } } else { $_GET['keyword'] = ''; } $num = count($logs); $multipage = multi($num, $lpp, $page, "$cpscript?mod=modcp&action=log&lpp=$lpp&keyword=".rawurlencode($_GET['keyword'])); $logs = array_slice($logs, $start, $lpp); $keyword = isset($_GET['keyword']) ? dhtmlspecialchars($_GET['keyword']) : ''; $usergroup = array(); $filters = ''; $loglist = array(); foreach($logs as $logrow) { $log = explode("\t", $logrow); if(empty($log[1])) { continue; } $log[1] = dgmdate($log[1], 'y-n-j H:i'); if(strtolower($log[2]) == strtolower($_G['member']['username'])) { $log[2] = ''.$log[2].''; } $log[5] = trim($log[5]); $check = 'modcp_logs_action_'.$log[5]; $log[5] = isset($language[$check]) ? $language[$check] : $log[5]; $log[7] = intval($log[7]); $log[7] = !empty($log[7]) ? ''.strip_tags("{$_G['cache']['forums'][$log[7]]['name']}").'' : ''; $log[8] = str_replace(array('GET={};', 'POST={};', 'mod=modcp;', 'action='.$log[5].';', 'diy=;', 'op='.$log[6].';'), '', $log[8]); $log[8] = cutstr($log['8'], 60); $loglist[] = $log; } function get_log_files($logdir='', $action='action') { $dir = opendir($logdir); $files = array(); while($entry = readdir($dir)) { $files[] = $entry; } closedir($dir); sort($files); $logfile = $action; $logfiles = array(); foreach($files as $file) { if(strpos($file, $logfile) !== FALSE) { $logfiles[] = $file; } } $logfiles = array_slice($logfiles, -2, 2); return $logfiles; } ?>