本文整理汇总了PHP中errorlog函数的典型用法代码示例。如果您正苦于以下问题:PHP errorlog函数的具体用法?PHP errorlog怎么用?PHP errorlog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了errorlog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runcron
function runcron($cronid = 0)
{
global $timestamp, $db, $tablepre, $_DCACHE;
$query = $db->query("SELECT * FROM {$tablepre}crons WHERE " . ($cronid ? "cronid='{$cronid}'" : "available>'0' AND nextrun<='{$timestamp}'") . " ORDER BY nextrun LIMIT 1");
if ($cron = $db->fetch_array($query)) {
$lockfile = DISCUZ_ROOT . './forumdata/runcron_' . $cron['cronid'] . '.lock';
$cron['filename'] = str_replace(array('..', '/', '\\'), '', $cron['filename']);
$cronfile = DISCUZ_ROOT . './include/crons/' . $cron['filename'];
if (is_writable($lockfile) && filemtime($lockfile) > $timestamp - 600) {
return NULL;
} else {
@touch($lockfile);
}
@set_time_limit(1000);
@ignore_user_abort(TRUE);
$cron['minute'] = explode("\t", $cron['minute']);
cronnextrun($cron);
extract($GLOBALS, EXTR_SKIP);
if (!@(include $cronfile)) {
errorlog('CRON', $cron['name'] . ' : Cron script(' . $cron['filename'] . ') not found or syntax error', 0);
}
@unlink($lockfile);
}
$query = $db->query("SELECT nextrun FROM {$tablepre}crons WHERE available>'0' ORDER BY nextrun LIMIT 1");
$nextrun = $db->result($query, 0);
if (!$nextrun === FALSE) {
require_once DISCUZ_ROOT . './include/cache.func.php';
$_DCACHE['settings']['cronnextrun'] = $db->result($query, 0);
updatesettings();
}
}
示例2: LoadModel
public function LoadModel()
{
$act = '';
$act = $this->Model . "/" . ucfirst(strtolower($this->M . MODEL_CLASS_FX)) . ".class.php";
$act = str_replace("model", "Model", $act);
if (is_file($act)) {
$act_class = ucfirst(strtolower($this->M . MODEL_CLASS_FX));
$act_class = "\\Model\\" . str_replace("model", "Model", $act_class);
require_once $act;
$Model_obj = new $act_class();
$m = $this->M;
$tm = get_class_methods($Model_obj);
if (!in_array($m, $tm)) {
if (DEBUG) {
errorlog("struts.log", $act . "中 " . $m . "方法不存在");
}
}
$Model_obj->{$m}();
} else {
if (DEBUG) {
errorlog("struts.log", "没有找到该类" . $act);
}
echo "没有找到该类" . $act;
}
}
示例3: runcron
function runcron($cronid = 0, $debug = 0)
{
global $_SGLOBAL, $_SCONFIG, $_SBLOCK, $lang;
//锁定
$lockfile = S_ROOT . './log/cron.lock.log';
if (file_exists($lockfile) && !$debug) {
if ($_SGLOBAL['timestamp'] - filemtime($lockfile) < 300) {
//5分钟
return;
}
}
if (@($fp = fopen($lockfile, 'w'))) {
fwrite($fp, "{$cronid}\n");
fclose($fp);
}
//读取cron列表缓存
if (empty($_SGLOBAL['crons'])) {
errorlog('CRON', $cron['name'] . " : Cron script cache list is empty", 0);
@unlink($lockfile);
return;
}
@set_time_limit(1000);
@ignore_user_abort(TRUE);
$cronids = array();
$crons = $cronid ? array($cronid => $_SGLOBAL['crons'][$cronid]) : $_SGLOBAL['crons'];
if (empty($crons) || !is_array($crons)) {
errorlog('CRON', $cron['name'] . " : Cron script list is empty", 0);
@unlink($lockfile);
return;
}
foreach ($crons as $id => $cron) {
if ($cron['nextrun'] <= $_SGLOBAL['timestamp'] || $id == $cronid) {
$cronids[] = $id;
if (empty($cron[filename])) {
errorlog('CRON', "Cron script({$cron['filename']}) not found", 0);
continue;
}
if ($debug) {
if (!(include S_ROOT . ($cronfile = "./include/cron/{$cron['filename']}"))) {
errorlog('CRON', $cron['name'] . " : Cron script({$cronfile}) syntax error", 0);
}
} else {
if (!@(include S_ROOT . ($cronfile = "./include/cron/{$cron['filename']}"))) {
errorlog('CRON', $cron['name'] . " : Cron script({$cronfile}) syntax error", 0);
}
}
}
}
cronnextrun($cronids);
@unlink($lockfile);
}
示例4: dftp_connect
function dftp_connect($ftphost, $ftpuser, $ftppass, $ftppath, $ftpport = 21, $ftpssl = 0, $silent = 0)
{
global $ftp;
@set_time_limit(0);
$ftphost = wipespecial($ftphost);
$ftpport = intval($ftpport);
$ftpssl = intval($ftpssl);
$ftp['timeout'] = intval($ftp['timeout']);
$func = $ftpssl && function_exists('ftp_ssl_connect') ? 'ftp_ssl_connect' : 'ftp_connect';
if ($func == 'ftp_connect' && !function_exists('ftp_connect')) {
if ($silent) {
return -4;
} else {
errorlog('FTP', "FTP not supported.", 0);
}
}
if ($ftp_conn_id = @$func($ftphost, $ftpport, 20)) {
if ($ftp['timeout'] && function_exists('ftp_set_option')) {
@ftp_set_option($ftp_conn_id, FTP_TIMEOUT_SEC, $ftp['timeout']);
}
if (dftp_login($ftp_conn_id, $ftpuser, $ftppass)) {
if ($ftp['pasv']) {
dftp_pasv($ftp_conn_id, TRUE);
}
if (dftp_chdir($ftp_conn_id, $ftppath)) {
return $ftp_conn_id;
} else {
if ($silent) {
return -3;
} else {
errorlog('FTP', "Chdir '{$ftppath}' error.", 0);
}
}
} else {
if ($silent) {
return -2;
} else {
errorlog('FTP', '530 Not logged in.', 0);
}
}
} else {
if ($silent) {
return -1;
} else {
errorlog('FTP', "Couldn't connect to {$ftphost}:{$ftpport}.", 0);
}
}
dftp_close($ftp_conn_id);
return -1;
}
示例5: show
public function show($str = '')
{
$cgf = new \Config();
if ($str == '') {
$str = 'index.html';
}
if (!is_file(APP_PATH . "/View" . $cgf->TP_PATH . "/" . $str)) {
errorlog(ROOT_PATH . "/struts.log", APP_PATH . "/View" . $cgf->TP_PATH . "/" . $str . "模板文件不存在");
echo APP_PATH . "/View" . $cgf->TP_PATH . "/" . $str . "模板文件不存在";
exit;
}
$url = "Lin" . md5($_SERVER['REQUEST_URI']);
$this->o->obj->display($str, $url);
}
示例6: runcron
function runcron($cronid = 0)
{
global $_G, $_SGLOBAL, $_SBLOCK, $lang;
//鎖定
$lockfile = B_ROOT . './log/cron.lock.log';
if (file_exists($lockfile)) {
if ($_G['timestamp'] - filemtime($lockfile) < 300) {
//5分鐘
return;
}
}
if (@($fp = fopen($lockfile, 'w'))) {
fwrite($fp, "\n");
fclose($fp);
}
//讀取cron列表緩存
if (empty($_SGLOBAL['crons'])) {
return;
}
@set_time_limit(1000);
@ignore_user_abort(true);
$cronids = array();
$crons = $cronid ? array($cronid => $_SGLOBAL['crons'][$cronid]) : $_SGLOBAL['crons'];
if (empty($crons) || !is_array($crons)) {
return;
}
foreach ($crons as $id => $cron) {
if ($cron['nextrun'] <= $_G['timestamp'] || $id == $cronid) {
$cronids[] = $id;
if (!@(include B_ROOT . ($cronfile = "./source/include/cron/{$cron['filename']}"))) {
errorlog('CRON', $cron['name'] . " : Cron script({$cronfile}) not found or syntax error", 0);
}
}
}
cronnextrun($cronids);
@unlink($lockfile);
}
示例7: newscreatesql
function newscreatesql()
{
global $pr, $sd, $debug;
if (!$pr[82]) {
return false;
}
// CFG OPT FUTURE disables script using checklogssql
//if (!$pr[43]) {
if ($debug) {
errorlog("DEBUG checklogsql:Connection failure. Default host not set or SQL off. trying 127.0.0.1.");
$pr[43] = "127.0.0.1";
}
$dbtype = "mysql";
@($connect = dbs_connect($pr[43], $sd[14], $sd[17], $dbtype));
dbs_selectdb("dbscriptbk", $connect, $dbtype);
if ($connect == false) {
errorlog("DEBUG checklogsql:Connection failure. Default host lost. {$pr['43']}");
return false;
}
$mysqlanswer = 1;
$prefix = $sd[30];
$tablename = "_dbs_" . $prefix . "_news43";
$query = "SHOW CREATE TABLE `dbscriptbk`.`_dbs_" . $prefix . "_news43`;";
$silent = 0;
$e = dbs_query($query, $connect, $dbtype);
if ($e == true) {
$mysqlanswer = true;
}
if ($e == false) {
echo "initalizing tables..._dbs_" . $prefix . "_news43 ...";
$query = "CREATE DATABASE IF NOT EXISTS `dbscriptbk`;";
$a = dbs_query($query, $connect, $dbtype);
if ($a == false) {
sqlerr();
}
$query = "CREATE TABLE {$tablename} ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `user` text NOT NULL DEFAULT '0', `plevelview` int(2) unsigned NOT NULL DEFAULT '0', `subject` text NOT NULL, `gutentag` text NOT NULL, `video` text NOT NULL, `message` text NOT NULL, `data` text NOT NULL,PRIMARY KEY (`id`) )\tENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;";
$a = dbs_query($query, $connect, $dbtype);
if ($a == false) {
sqlerr();
$mysqlanswer = false;
} else {
$mysqlanswer = true;
}
// внимание записи ВСЕХ существующих копий дбскрипт будут попадать в эти базы- модификации названия таблиц и т.п. пока отсутствуют CFG OPT FUTURE
## end of creating tables
}
return $mysqlanswer;
}
示例8: explode
$log = explode("\t", fgets($fp, 50));
if ($_SGLOBAL['timestamp'] - $log[0] < 86400) {
$errlog[$log[0]] = $log[1];
}
}
fclose($fp);
}
if (!in_array($dberrno, $errlog)) {
$errlog[$_SGLOBAL['timestamp']] = $dberrno;
@($fp = fopen(S_ROOT . './log/dberror.log', 'w'));
@flock($fp, 2);
foreach (array_unique($errlog) as $dateline => $errno) {
@fwrite($fp, "{$dateline}\t{$errno}");
}
@fclose($fp);
if (function_exists('errorlog')) {
errorlog('MySQL', basename($_SERVER['SCRIPT_NAME']) . " : {$dberror} - " . cutstr($sql, 120), 0);
}
echo "<br><br>An error report has been dispatched to our administrator.";
$email_to = $_SCONFIG['adminemail'];
$email_subject = '[SupeSite] MySQL Error Report';
$email_message = "There seems to have been a problem with the database of your SupeSite.\n\n" . strip_tags($errmsg) . "\n\n" . "Please check-up your MySQL server and forum scripts, similar errors will not be reported again in recent 24 hours\n" . "If you have troubles in solving this problem, please visit SupeSite Community http://www.SupeSite.com.";
include S_ROOT . './function/sendmail.fun.php';
sendmail(array($email_to), $email_subject, $email_message);
} else {
echo '<br><br>Similar error report has beed dispatched to administrator before.';
}
}
echo '</p>';
exit;
}
示例9: errorlog
errorlog('Cron', srealpath($attachfilepath) . ' have no permission to be removed.', 0);
}
} else {
errorlog('Cron', srealpath($attachfilepath) . ' not found.', 0);
}
}
$deletethumbflag = true;
if (!empty($attach['thumbpath'])) {
$attachthumbpath = A_DIR . '/' . $attach['thumbpath'];
if (file_exists($attachthumbpath)) {
if (!@unlink($attachthumbpath)) {
$deletethumbflag = false;
errorlog('Cron', srealpath($attachthumbpath) . ' have no permission to be removed.', 0);
}
} else {
errorlog('Cron', srealpath($attachthumbpath) . ' not found.', 0);
}
}
if ($deletefileflag && $deletethumbflag) {
$uid = $attach['uid'];
$delaidarr[] = $attach['aid'];
if (empty($delsizearr[$uid])) {
$delsizearr[$uid] = $attach['size'];
} else {
$delsizearr[$uid] = $delsizearr[$uid] + $attach['size'];
}
}
}
if (!empty($delaidarr)) {
$_SGLOBAL['db']->query('DELETE FROM ' . tname('attachments') . ' WHERE aid IN (' . simplode($delaidarr) . ')');
}
示例10: handle_admin
function handle_admin(&$admin, &$sockets, &$sockets_seq_data, &$sockets_next_seq, &$clientdata)
{
$from = '';
$rport = 0;
$buf = '';
socket_recvfrom($admin, $buf, 2 * 1024 * 1024, 0, $from, $rport);
#errorlog("BACKEND: ADMIN sockets='".var_export($sockets,TRUE)."'");
#errorlog("BACKEND: ADMIN Received '".$buf."' from ".$from);
if ($buf == 'die') {
return true;
} else {
$parts = split(":", $buf);
if ($parts[0] == 'createSocket') {
$socketNumber = $parts[1];
$targetHost = $parts[2];
$targetPort = $parts[3];
errorlog("BACKEND: createSocket with socketNumber " . $socketNumber . ", host " . $targetHost . ", port " . $targetPort);
$socket = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
if ($socket) {
$result = socket_connect($socket, $targetHost, $targetPort);
if ($result) {
errorlog("BACKEND: Connection succeeded");
$key = $targetHost . ":" . $targetPort . ":" . $socketNumber;
$sockets[$key] = $socket;
errorlog("BACKEND: ADMIN sockets are now '" . var_export($sockets, TRUE) . "' after adding socket " . $socket . " with key ='" . $key . "'");
} else {
errorlog("BACKEND: Connect failed");
}
} else {
errorlog("BACKEND: Cannot create socket");
}
} else {
if ($parts[0] == 'newData') {
$socketNumber = $parts[1];
$targetHost = $parts[2];
$targetPort = $parts[3];
$sequenceNumber = $parts[4];
$sockkey = $targetHost . ":" . $targetPort . ":" . $socketNumber;
$socket = $sockets[$sockkey];
if ($sequenceNumber == 0) {
$sockets_next_seq[$sockkey] = 0;
$sockets_seq_data = array();
}
if ($parts[5] == '*') {
errorlog("BACKEND: newData(" . $sequenceNumber . "), Client requested closing of socket " . $socket . " with key " . $sockkey);
socket_close($socket);
unset($sockets[$sockkey]);
unset($sockets_next_seq[$sockkey]);
unset($sockets_seq_data[$sockkey]);
} else {
if (!$socket) {
errorlog("BACKEND: newData(" . $sequenceNumber . "), Client attempted to send '" . $parts[5] . "' to " . $sockkey);
errorlog("BACKEND: newData(" . $sequenceNumber . "), available sockets are:" . var_export($sockets, TRUE));
array_push($clientdata, '[data]' . $sockkey . ":*");
} else {
$data = str_replace(" ", "+", $parts[5]);
$data = base64_decode($data);
errorlog("BACKEND: newData(" . $sequenceNumber . ") with socketNumber " . $socketNumber . ", host " . $targetHost . ", port " . $targetPort . ", data '" . $data . "'");
$sockets_seq_data[$sockkey][$sequenceNumber] = $data;
if ($sockets_next_seq[$sockkey] == $sequenceNumber) {
while (array_key_exists($sockets_next_seq[$sockkey], $sockets_seq_data[$sockkey])) {
if ($socket) {
$ret = socket_send($socket, $data, strlen($data), 0);
check_sock_error("BACKEND newData");
errorlog("BACKEND: newData(" . $sequenceNumber . "), socket send to '" . $sockkey . " returned " . $ret);
} else {
errorlog("BACKEND: newData(" . $sequenceNumber . "), Unknown socket " . $sockkey);
}
$sockets_next_seq[$sockkey]++;
}
} else {
if ($sockets_next_seq[$sockkey] < $sequenceNumber) {
error_log("BACKEND: newData(" . $sequenceNumber . ") has been queued, current sequence number required is " . $sockets_next_seq[$sockkey]);
} else {
}
}
}
}
} else {
if ($parts[0] == 'getData') {
$val = array_shift($clientdata);
if ($val) {
$ret = socket_sendto($admin, $val, strlen($val), 0, $from, $rport);
check_sock_error("BACKEND getData with data");
errorlog("BACKEND: getData, Sent " . $ret . " bytes from " . strlen($val));
} else {
$val = '[NO_NEW_DATA]';
$ret = socket_sendto($admin, $val, strlen($val), 0, $from, $rport);
check_sock_error("BACKEND getData [NO_NEW_DATA]");
}
} else {
errorlog("BACKEND: Unknown part '" . $parts[0] . "'");
}
}
}
}
return false;
}
示例11: ftpupload
function ftpupload($source, $dest, $havethumb = 0)
{
global $authkey, $ftp;
if ($ftp['on']) {
require_once DISCUZ_ROOT . './include/ftp.func.php';
if (!$ftp['connid']) {
if (!($ftp['connid'] = dftp_connect($ftp['host'], $ftp['username'], authcode($ftp['password'], 'DECODE', md5($authkey)), $ftp['attachdir'], $ftp['port'], $ftp['ssl']))) {
return 0;
}
$ftp['pwd'] = FALSE;
}
$tmp = explode('/', $dest);
if (count($tmp) > 1) {
if (!$ftp['pwd'] && !dftp_chdir($ftp['connid'], $tmp[0])) {
if (!dftp_mkdir($ftp['connid'], $tmp[0])) {
errorlog('FTP', "Mkdir '{$ftp['attachdir']}/{$tmp['0']}' error.", 0);
return 0;
}
if (!function_exists('ftp_chmod') || !dftp_chmod($ftp['connid'], 0777, $tmp[0])) {
dftp_site($ftp['connid'], "'CHMOD 0777 {$tmp['0']}'");
}
if (!dftp_chdir($ftp['connid'], $tmp[0])) {
errorlog('FTP', "Chdir '{$ftp['attachdir']}/{$tmp['0']}' error.", 0);
return 0;
}
dftp_put($ftp['connid'], 'index.htm', $GLOBALS['attachdir'] . '/index.htm', FTP_BINARY);
}
$dest = $tmp[1];
$ftp['pwd'] = TRUE;
}
if (dftp_put($ftp['connid'], $dest, $source, FTP_BINARY)) {
if ($havethumb) {
if (dftp_put($ftp['connid'], $dest . '.thumb.jpg', $source . '.thumb.jpg', FTP_BINARY)) {
@unlink($source);
@unlink($source . '.thumb.jpg');
return 1;
} else {
dftp_delete($ftp['connid'], $dest);
}
} else {
@unlink($source);
return 1;
}
}
errorlog('FTP', "Upload '{$source}' error.", 0);
}
return 0;
}
示例12: fopen
$errlog[$log[0]] = $log[1];
}
}
fclose($fp);
}
if(!in_array($dberrno, $errlog)) {
$errlog[$timestamp] = $dberrno;
@$fp = fopen(NOWHERE_ROOT.'./forumdata/dberror.log', 'w');
@flock($fp, 2);
foreach(array_unique($errlog) as $dateline => $errno) {
@fwrite($fp, "$dateline\t$errno");
}
@fclose($fp);
if(function_exists('errorlog')) {
errorlog('MySQL', basename($GLOBALS['_SERVER']['PHP_SELF'])." : $dberror - ".GlobalCore::cutstr($sql, 120), 0);
}
if($GLOBALS['dbreport']) {
echo "<br><br>An error report has been dispatched to our administrator.";
}
} else {
echo '<br><br>Similar error report has beed dispatched to administrator before.';
}
}
echo '</p>';
function_exists('chobits_exit') ? chobits_exit() : exit();
示例13: getValueFromChar
private function getValueFromChar($ch)
{
$val = ord($ch);
try {
if ($this->type == 'A') {
if ($val > 95) {
throw new Exception(' illegal barcode character ' . $ch . ' for code128A in ' . __FILE__ . ' on line ' . __LINE__);
}
if ($val < 32) {
$val += 64;
} else {
$val -= 32;
}
} elseif ($this->type == 'B') {
if ($val < 32 || $val > 127) {
throw new Exception(' illegal barcode character ' . $ch . ' for code128B in ' . __FILE__ . ' on line ' . __LINE__);
} else {
$val -= 32;
}
} else {
if (!is_numeric($ch) || (int) $ch < 0 || (int) $ch > 99) {
throw new Exception(' illegal barcode character ' . $ch . ' for code128C in ' . __FILE__ . ' on line ' . __LINE__);
} else {
if (strlen($ch) == 1) {
$ch .= '0';
}
$val = (int) $ch;
}
}
} catch (Exception $ex) {
errorlog('die', $ex->getMessage());
}
return $val;
}
示例14: header
header("Location: r.php?tbl=files&m=4&vID=1&vID2=");
}
if ($write == cmsg("LST_SHA_FLS_DL")) {
header("Location: r.php?tbl=files&m=7.9&vID=!0");
}
if ($write == cmsg("LST_SHA_FLS_NO")) {
header("Location: r.php?tbl=files&m=7.9&vID=0&fullfield=on");
}
if ($dbsaa) {
setcookie("dbsa", $dbsaa, time() + 1000);
Header("Location: admin.php?cmd=myprof");
exit;
}
$enterpoint = $veradm;
if ($encoder == "not installed") {
errorlog("Dbscript need an php encoder - iconv or mb_string.");
}
// настройка префиксов для работы с любым языкомым cmd
if ($cmd == "test") {
testcfgs();
exit;
}
if ($cmd == "note") {
bloknot();
exit;
}
if ($cmd == "asql") {
asqledit();
exit;
}
if ($cmd == "cssed") {
示例15: intval
$bbsforumarr[$fid]['allowshare'] = intval($_POST['allowshare'][$fid]);
$bbsforumarr[$fid]['bbsname'] = stripslashes($fourm);
$bbsforumarr[$fid]['pushsetting'] = $_POST['pushsetting'][$fid];
$setting = saddslashes(serialize($_POST['pushsetting'][$fid]));
$bbsforumarr[$fid]['displayorder'] = intval($_POST['displayorder'][$fid]);
$sqlarr[$fid] = "('{$fid}', '" . $bbsforumarr[$fid]['fup'] . "', '{$fourm}', '" . $bbsforumarr[$fid]['type'] . "', '" . $bbsforumarr[$fid]['allowshare'] . "', '{$setting}', '" . $bbsforumarr[$fid]['displayorder'] . "')";
}
}
$formsql = implode(',', $sqlarr);
$formsql = 'INSERT INTO ' . tname('forums') . '(fid, fup, name, type, allowshare, pushsetting, displayorder) VALUES' . $formsql;
$_SGLOBAL['db']->query($formsql);
//¸üÐÂÅäÖûº´æ
updatebbsforumset();
//Ö´ÐоۺÏÌû×Ӽƻ®ÈÎÎñ
if (!@(include S_ROOT . "./include/cron/updatebbsforums.php")) {
errorlog('CRON', "Cronid 7 : Cron script(./include/cron/updatebbsforums.php) not found or syntax error", 0);
}
showmessage('bbsforums_update_success', CPURL . '?action=bbsforums');
}
$_SGLOBAL['grouparr'] = $forums = $showedforums = array();
$query = $_SGLOBAL['db']->query('SELECT * FROM ' . tname('forums') . ' ORDER BY displayorder');
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$value['pushsetting'] = unserialize($value['pushsetting']);
$_SGLOBAL['bbsforumarr'][$value['fid']] = $value;
}
$query = $_SGLOBAL['db_bbs']->query('SELECT type, fup, fid, name FROM ' . tname('forums', 1));
while ($forum = $_SGLOBAL['db_bbs']->fetch_array($query)) {
$forums[] = $forum;
}
$thevalue['forumsstr'] = $class = '';
for ($i = 0; $i < count($forums); $i++) {