function YellowLine($text, $search = FALSE) { if ($search === FALSE) { $search = clearInputText(__paramInit('string', 'search', null, '')); } $s = preg_split('/[\\s]+/', $search); for ($i = 0; $i < count($s); ++$i) { if ($s[$i]) { $text = preg_replace('/(' . preg_quote($s[$i]) . ')/i', "<span style='background-color: yellow; margin: 0;'>\$1</span>", $text); } } return $text; }
$content = '../content22.php'; $footer = $rpath . 'footer.html'; $template = 'template2.php'; $log_pp = __paramInit('int', 'log_pp', 'log_pp', 20); $gray_ip = new gray_ip($log_pp); $task = __paramInit('string', 'task', 'task'); $page = __paramInit('int', 'page', 'page', 1); $filter = array(); $cmd = __paramInit('string', 'cmd', null, ''); $search_name = __paramInit('string', 'search_name', null, ''); $adm = __paramInit('string', 'adm', null, 0); $primary_id = __paramInit('string', 'primary_id', null, 0); $f_ip = __paramInit('string', 'f_ip', null, ''); $t_ip = __paramInit('string', 't_ip', null, ''); $admins = $gray_ip->getAdmins(); $search_name = clearInputText($search_name); if (!$page) { $page = 1; } elseif ($page < 0) { header_location_exit('/404.php'); exit; } if ($task == 'checklogin') { $login = __paramInit('string', 'login', 'login'); $result = array(); $result['success'] = false; if ($login) { $users = new users(); $users->GetUser($login); if ($users->uid) { $result['success'] = true;
$timeChecked = ''; $shiftEnabled = 'disabled="disabled"'; $timeEnabled = 'disabled="disabled"'; $shiftId = -1; switch (__paramInit('string', 'period', null, 'shift')) { case 'shift': $shiftChecked = 'checked'; $shiftEnabled = ''; $shiftId = __paramInit('int', 'shifts_list', null, -1); break; case 'time': $timeChecked = 'checked'; $timeEnabled = ''; break; } $search = clearInputText($search); if ($cmd == 'filter') { $fromD = __paramInit('string', 'from_d', null, ''); $fromM = __paramInit('string', 'from_m', null, ''); $fromY = __paramInit('string', 'from_y', null, ''); $fromH = __paramInit('string', 'from_h', null, ''); $fromI = __paramInit('string', 'from_i', null, ''); $filter = admin_log::getDatePeriod($error, $fromD, $fromM, $fromY, $toD, $toM, $toY); if (!$error) { $error = admin_log::checkTimePeriod($bIsNull, $fromH, $fromI, $toH, $toI); if (!$error) { if (!$bIsNull) { $filter['time'] = array($fromH . ':' . $fromI . ' - ' . $toH . ':' . $toI); } else { $filter['time'] = array('00:00 - 23:59'); }
} $_SESSION['admin_log_user'] = $_SERVER['REQUEST_URI']; $menu_item = 4; $rpath = '../../'; $css_file = array('moderation.css', 'new-admin.css', 'nav.css'); $js_file = array('zeroclipboard/ZeroClipboard.js', 'user_search.js', 'admin_log.js', 'banned.js'); $header = $rpath . 'header.php'; $inner_page = "index_inner.php"; $content = '../content22.php'; $footer = $rpath . 'footer.html'; $template = 'template2.php'; $filter = array(); $cmd = __paramInit('string', 'cmd', 'cmd', ''); $page = __paramInit('int', 'page', 'page', 1); $search_phone = __paramInit('string', 'search_phone', 'search_phone', ''); $search_phone = clearInputText($search_phone); $sbr_meta = new sbr_meta(); if (!$page) { $page = 1; } elseif ($page < 0) { header_location_exit('/404.php'); exit; } $search_phone_exact = __paramInit('string', 'search_phone_exact', null, ''); if ($cmd == 'filter') { $filter['search_phone'] = $search_phone; $filter['search_phone_exact'] = $search_phone_exact; $users = $sbr_meta->searchUsersPhone($count, $filter, $page); $pages = ceil($count / 50); if (!$users && $page > 1) { $sHref = e_url('page', null);
$sStopWords = clearInputText(__paramInit('array', null, 'words', '')); if (stop_words::updateAdminStopWords($sStopWords)) { $_SESSION['admin_stop_words_success'] = TRUE; header('Location: /siteadmin/stop_words/?site=words'); exit; } else { $error = 'Ошибка при сохранеии стоп-слов'; } } else { $sStopWords = implode(', ', stop_words::getAdminStopWords(false)); } } else { // Запрещенные выражения if ($cmd == 'go') { $sStopRegex = clearInputText(__paramInit('array', null, 'regex', '')); $sTestText = clearInputText(__paramInit('array', null, 'test', '')); $sBadRegex = stop_words::validateAdminStopRegex($sStopRegex); if (!$sBadRegex) { $action = __paramInit('string', null, 'action', ''); if ($action == 'update') { if (stop_words::updateAdminStopRegex($sStopRegex)) { $_SESSION['admin_stop_words_success'] = TRUE; header('Location: /siteadmin/stop_words/'); exit; } else { $error = 'Ошибка при сохранеии стоп-слов'; } } else { $stop_words->setStopRegex($sStopRegex); $sUserMode = $stop_words->replace($sTestText, 'html', false); $sAdminMode = $stop_words->replace($sTestText, 'html', true);
} if ($cmd == 'go') { $fromDs = __paramInit('string', 's_from_d', null, ''); $fromMs = __paramInit('string', 's_from_m', null, ''); $fromYs = __paramInit('string', 's_from_y', null, ''); $fromDc = __paramInit('string', 'c_from_d', null, ''); $fromMc = __paramInit('string', 'c_from_m', null, ''); $fromYc = __paramInit('string', 'c_from_y', null, ''); $spamer = __paramInit('string', 'spamer', null, ''); $spamer_ex = __paramInit('string', 'spamer_ex', null, ''); $kwd = __paramInit('string', 'kwd', null, ''); $user = __paramInit('string', 'user', null, ''); $user_ex = __paramInit('string', 'user_ex', null, ''); $spamer = clearInputText($spamer); $kwd = clearInputText($kwd); $user = clearInputText($user); $filter = $oSpam->getDatePeriod($error, 's', $fromDs, $fromMs, $fromYs, $toDs, $toMs, $toYs); if (!$error) { $aDateC = $oSpam->getDatePeriod($error, 'c', $fromDc, $fromMc, $fromYc, $toDc, $toMc, $toYc); if (!$error) { $filter = array_merge($filter, $aDateC); $filter['spamer'] = $spamer; $filter['spamer_ex'] = $spamer_ex; $filter['kwd'] = $kwd; $filter['user'] = $user; $filter['user_ex'] = $user_ex; } } } if (!$error) { $spam = $oSpam->getSpam($count, $filter, $page);