1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-19 04:02:28 +02:00

LAN File fixes. Hide comment status when comments are not enabled. etc.

This commit is contained in:
Cameron 2015-04-07 00:32:53 -07:00
parent 72a7fd4b45
commit 6b9256c872
4 changed files with 22 additions and 12 deletions

View File

@ -337,7 +337,9 @@ class banlist_form_ui extends e_admin_form_ui
// $val = ($curVal ? strftime($pref['ban_date_format'], $curVal).(($curVal < time()) ? ' ('.BANLAN_34.')' : '') : LAN_NEVER); // ."<br />".$this->banexpires();
// $val .= " (".$curVal.")";
// $mod = preg_replace('/[^\w]/', '', vartrue($_GET['mode'], ''));
$val = vartrue($curVal) ? $date->computeLapse(time(), $curVal) : LAN_NEVER;
$val = vartrue($curVal) ? $date->computeLapse(time(), $curVal) : LAN_NEVER;
$val = str_replace("ago", "", $val); // quick fix for the 'ago'.
if(vartrue($curVal) && $curVal < time())
{

View File

@ -344,11 +344,11 @@ class cron_admin_ui extends e_admin_ui
$frm = e107::getForm();
e107::getCache()->CachePageMD5 = '_';
$lastload = e107::getCache()->retrieve('cronLastLoad', FALSE, TRUE, TRUE);
$lastload = e107::getCache()->retrieve('cronLastLoad', false, true, true);
$ago = (time() - $lastload);
$active = ($ago < 901) ? TRUE : FALSE;
$active = ($ago < 1200) ? true : false; // longer than 20 minutes, so lets assume it's inactive.
$status = ($active) ? LAN_ENABLED : LAN_DISABLED; // "Enabled" : "Offline";
$mins = floor($ago / 60);
@ -365,13 +365,12 @@ class cron_admin_ui extends e_admin_ui
$mes->addInfo(LAN_CRON_11.": <b>".$this->activeCrons."</b>");
$mes->addInfo(LAN_CRON_12.": ".$lastRefresh."<br /><br />");
//FIXME: for Windows, the is_executable() function only checks the file
// extensions of exe, com, bat and cmd.
$isWin = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
$actualPerm = substr(decoct(fileperms(e_BASE."cron.php")),3);
if($isWin)
{
$mes->addWarning(LAN_CRON_13);
@ -402,9 +401,9 @@ class cron_admin_ui extends e_admin_ui
function cronExecute($cron_id)
{
$sql = e107::getDb();
if($sql->db_Select("cron","cron_name,cron_function","cron_id = ".intval($cron_id)))
if($sql->select("cron","cron_name,cron_function","cron_id = ".intval($cron_id)))
{
$row = $sql->db_Fetch(MYSQL_ASSOC);
$row = $sql->fetch(MYSQL_ASSOC);
$class_func = $row['cron_function'];
$cron_name = $row['cron_name'];
}

View File

@ -423,7 +423,12 @@ class admin_shortcodes
$oldconfigs = array();
$oldconfigs['e-news'][0] = array('icon'=>E_16_NEWS, 'title'=>ADLAN_LAT_2, 'url'=> e_ADMIN."newspost.php?mode=sub&amp;action=list", 'total'=>$submitted_news);
$oldconfigs['e-comment'][0] = array('icon'=>E_16_COMMENT, 'title'=>ADLAN_LAT_9, 'url'=> e_ADMIN_ABS."comment.php?searchquery=&filter_options=comment_blocked__2", 'total'=>$comments_pending);
if(empty($pref['comments_disabled']))
{
$oldconfigs['e-comment'][0] = array('icon'=>E_16_COMMENT, 'title'=>ADLAN_LAT_9, 'url'=> e_ADMIN_ABS."comment.php?searchquery=&filter_options=comment_blocked__2", 'total'=>$comments_pending);
}
$oldconfigs['e-upload'][0] = array('icon'=>E_16_UPLOADS, 'title'=>ADLAN_LAT_7, 'url'=> e_ADMIN."upload.php", 'total'=>$active_uploads);
$messageTypes = array('Broken Download', 'Dev Team Message');
@ -1092,8 +1097,12 @@ class admin_shortcodes
$oldconfigs['e-user'][0] = array('icon'=>E_16_USER, 'title'=>ADLAN_110, 'url'=> e_ADMIN_ABS."users.php?searchquery=&amp;filter_options=user_ban__0", 'total'=>$members);
$oldconfigs['e-user'][1] = array('icon'=>E_16_USER, 'title'=>ADLAN_111, 'url'=> e_ADMIN."users.php?searchquery=&amp;filter_options=user_ban__2", 'total'=>$unverified);
$oldconfigs['e-user'][2] = array('icon'=>E_16_BANLIST, 'title'=>ADLAN_112, 'url'=> e_ADMIN."users.php?searchquery=&filter_options=user_ban__1", 'total'=>$banned);
$oldconfigs['e-comments'][0] = array('icon'=>E_16_COMMENT, 'title'=>ADLAN_114, 'url'=> e_ADMIN_ABS."comment.php", 'total'=>$comments);
if(empty($pref['comments_disabled']))
{
$oldconfigs['e-comments'][0] = array('icon'=>E_16_COMMENT, 'title'=>ADLAN_114, 'url'=> e_ADMIN_ABS."comment.php", 'total'=>$comments);
}
if($flo = $sql->count('generic', '(*)', "WHERE gen_type='failed_login'"))
{
//$text .= "\n\t\t\t\t\t<div style='padding-bottom: 2px;'>".E_16_FAILEDLOGIN." <a href='".e_ADMIN_ABS."fla.php'>".ADLAN_146.": $flo</a></div>";

View File

@ -82,7 +82,7 @@ define("BANLAN_74", "Banlist Maintenance");
define("BANLAN_75", "Remove expired bans from list");
define("BANLAN_76", "Execute");
define("BANLAN_77", "Messages/Ban Periods");
// define("BANLAN_78", "Hit count exceeded (--HITS-- requests within allotted time)");
define("BANLAN_78", "Hit count exceeded (--HITS-- requests within allotted time)");
define("BANLAN_79", "CSV Export format:");
define("BANLAN_80", "CSV Import format:");
define("BANLAN_81", "Ban Action Log");