diff --git a/e107_admin/banlist.php b/e107_admin/banlist.php index f53a6e6e5..b7dde2a4c 100644 --- a/e107_admin/banlist.php +++ b/e107_admin/banlist.php @@ -263,7 +263,7 @@ else /** * Create dropdown with options for ban time - uses internal fixed list of reasonable values */ -function ban_time_dropdown($click_js = '', $zero_text = BANLAN_21, $curval = -1, $drop_name = 'ban_time') +function ban_time_dropdown($click_js = '', $zero_text = LAN_NEVER, $curval = -1, $drop_name = 'ban_time') { global $frm; $intervals = array(0, 1, 2, 3, 6, 8, 12, 24, 36, 48, 72, 96, 120, 168, 336, 672); @@ -274,7 +274,7 @@ function ban_time_dropdown($click_js = '', $zero_text = BANLAN_21, $curval = -1, { if ($i == 0) { - $words = $zero_text ? $zero_text : BANLAN_21; + $words = $zero_text ? $zero_text : LAN_NEVER; } elseif (($i % 24) == 0) { @@ -656,7 +656,7 @@ switch ($action) if ($action == 'edit' || $action == 'add') { - $inhelp = (($action == 'edit') ? '
'.BANLAN_26.($banlist_banexpires ? strftime($pref['ban_date_format'], $banlist_banexpires) : BANLAN_21).'
' : ''); + $inhelp = (($action == 'edit') ? '
'.BANLAN_26.($banlist_banexpires ? strftime($pref['ban_date_format'], $banlist_banexpires) : LAN_NEVER).'
' : ''); $text .= " @@ -897,7 +897,7 @@ switch ($action) $val = e107::getIPHandler()->ipDecode($row['banlist_ip'])."
".$fv.": ".$row['banlist_reason']; break; case 'banlist_banexpires': - $val = ($row['banlist_banexpires'] ? strftime($pref['ban_date_format'], $row['banlist_banexpires']).(($row['banlist_banexpires'] < time()) ? ' ('.BANLAN_34.')' : '') : BANLAN_21)."
".ban_time_dropdown("onchange=\"e107Helper.urlJump('".e_SELF."?newtime-{$row['banlist_ip']}-'+this.value)\""); + $val = ($row['banlist_banexpires'] ? strftime($pref['ban_date_format'], $row['banlist_banexpires']).(($row['banlist_banexpires'] < time()) ? ' ('.BANLAN_34.')' : '') : LAN_NEVER)."
".ban_time_dropdown("onchange=\"e107Helper.urlJump('".e_SELF."?newtime-{$row['banlist_ip']}-'+this.value)\""); break; case 'ban_options': $row_class = ' class="center"'; diff --git a/e107_admin/cron.php b/e107_admin/cron.php index 78a00d7c0..0757c40dd 100644 --- a/e107_admin/cron.php +++ b/e107_admin/cron.php @@ -74,16 +74,13 @@ class cron_admin_ui extends e_admin_ui 'checkboxes' => array('title'=> '', 'type' => null, 'width' =>'5%', 'forced'=> TRUE, 'thclass'=>'center', 'class'=>'center'), 'cron_id' => array('title'=> LAN_ID, 'type' => 'number', 'width' =>'5%', 'forced'=> FALSE, 'nolist'=>TRUE), 'cron_category' => array('title'=> LAN_CATEGORY, 'type' => 'method', 'data' => 'str', 'width'=>'auto','readonly' => 1, 'thclass' => '', 'batch' => TRUE, 'filter'=>TRUE), - - 'cron_name' => array('title'=> "Name", 'type' => 'text', 'width' => 'auto', 'readonly' => 1), - - 'cron_description' => array('title'=> "Description", 'type' => 'text', 'width' => '35%', 'readonly' => 1), - - 'cron_function' => array('title'=> "Function", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'readonly' => 1), - 'cron_tab' => array('title'=> "Tab", 'type' => 'method', 'width' => 'auto'), // Display name - 'cron_lastrun' => array('title'=> "Last-run", 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'readonly' => 2), - 'cron_active' => array('title'=> "Active", 'type' => 'boolean', 'data'=> 'int', 'thclass' => 'center', 'class'=>'center', 'filter' => true, 'batch' => true, 'width' => 'auto'), - 'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'data'=> null, 'noedit'=>TRUE, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center') + 'cron_name' => array('title'=> LAN_CRON_1, 'type' => 'text', 'width' => 'auto', 'readonly' => 1), + 'cron_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'text', 'width' => '35%', 'readonly' => 1), + 'cron_function' => array('title'=> LAN_CRON_2, 'type' => 'text', 'width' => 'auto', 'thclass' => 'left first', 'readonly' => 1), + 'cron_tab' => array('title'=> LAN_CRON_3, 'type' => 'method', 'width' => 'auto'), // Display name + 'cron_lastrun' => array('title'=> LAN_CRON_4, 'type' => 'datestamp', 'data' => 'int', 'width' => 'auto', 'readonly' => 2), + 'cron_active' => array('title'=> LAN_CRON_5, 'type' => 'boolean', 'data'=> 'int', 'thclass' => 'center', 'class'=>'center', 'filter' => true, 'batch' => true, 'width' => 'auto'), + 'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'data'=> null, 'noedit'=>TRUE, 'forced'=>TRUE, 'width' => '10%', 'thclass' => 'center last', 'class' => 'center') ); @@ -126,36 +123,36 @@ class cron_admin_ui extends e_admin_ui $cronDefaults['_system'] = array( 0 => array( - 'name' => 'Test Email', + 'name' => LAN_CRON_01_2, 'function' => 'sendEmail', 'category' => 'mail', - 'description' => 'Send a test email to '.$pref['siteadminemail'].'
Recommended to test the scheduling system.' + 'description' => str_replace("[eml]",$pref['siteadminemail'],LAN_CRON_01_2) ."
". LAN_CRON_01_3 ), 1 => array( - 'name' => 'Mail Queue', + 'name' => LAN_CRON_02_1, 'category' => 'mail', 'function' => 'procEmailQueue', - 'description' => 'Process mail queue' + 'description' => LAN_CRON_02_2 ), 2 => array( - 'name' => 'Mail Bounce Check', + 'name' => LAN_CRON_03_1, 'category' => 'mail', 'function' => 'procEmailBounce', - 'description' => 'Check for bounced emails', + 'description' => LAN_CRON_03_2 // 'available' => vartrue($pref['mail_bounce_auto']) ), 3 => array( - 'name' => 'Ban Retrigger Check', + 'name' => LAN_CRON_04_1, 'category' => 'user', 'function' => 'procBanRetrigger', - 'description' => 'Process bounce retriggers
Only needed if retriggering of bans enabled.', + 'description' => LAN_CRON_04_2 ."
". LAN_CRON_04_3, 'available' => e107::getPref('ban_retrigger') ), 4 => array( - 'name' => 'Database Backup', + 'name' => LAN_CRON_05_1, 'category' => 'backup', 'function' => 'dbBackup', - 'description' => 'Backup the system database to '.e_SYSTEM.'backups/', + 'description' => LAN_CRON_05_1 . '.e_SYSTEM.'."backups/", 'available' => e107::getPref('ban_retrigger') ), ); @@ -251,11 +248,11 @@ class cron_admin_ui extends e_admin_ui if(!$sql->db_Insert('cron',$insert)) { - e107::getMessage()->add("Couldn't Import Prefs", E_MESSAGE_ERROR); + e107::getMessage()->add(LAN_CRON_6, E_MESSAGE_ERROR); } else { - e107::getMessage()->add("Imported: ".$insert['cron_function'], E_MESSAGE_INFO); + e107::getMessage()->add(LAN_CRON_8.":".$insert['cron_function'], E_MESSAGE_INFO); } } @@ -268,7 +265,7 @@ class cron_admin_ui extends e_admin_ui { // print_a($insert); // return; -// + $sql = e107::getDb(); $cron_function = $insert['cron_function']; @@ -276,11 +273,11 @@ class cron_admin_ui extends e_admin_ui if($sql->db_Update('cron',$insert)===FALSE) { - e107::getMessage()->add("Couldn't Import Timing Settings", E_MESSAGE_ERROR); + e107::getMessage()->add(LAN_CRON_7, E_MESSAGE_ERROR); } else { - e107::getMessage()->add("Imported Timing Settings for: ".$cron_function, E_MESSAGE_INFO); + e107::getMessage()->add(LAN_CRON_8.$cron_function, E_MESSAGE_INFO); } } @@ -325,16 +322,19 @@ class cron_admin_ui extends e_admin_ui $mins = floor($ago / 60); $secs = $ago % 60; + + $srch = array("[x]","[y]"); + $repl = array($mins,$secs); - $lastRun = ($mins) ? $mins." minutes and ".$secs." seconds ago." : $secs." seconds ago."; + $lastRun = ($mins) ? str_replace($srch,$repl,LAN_CRON_10) : str_replace($srch,$repl,LAN_CRON_11); // FIX: check syntax + + $lastRefresh = ($ago < 10000) ? $lastRun : LAN_NEVER; - $lastRefresh = ($ago < 10000) ? $lastRun : 'Never'; - - $mes->add("Status: ".$status."", E_MESSAGE_INFO); + $mes->add(LAN_STATUS.":".$status."", E_MESSAGE_INFO); - $mes->add("Active Crons: ".$this->activeCrons."", E_MESSAGE_INFO); - $mes->add("Last cron refresh: ".$lastRefresh, E_MESSAGE_INFO); + $mes->add(LAN_CRON_12.": ".$this->activeCrons."", E_MESSAGE_INFO); + $mes->add(LAN_CRON_13.": ".$lastRefresh, E_MESSAGE_INFO); //FIXME: for Windows, the is_executable() function only checks the file // extensions of exe, com, bat and cmd. @@ -343,16 +343,15 @@ class cron_admin_ui extends e_admin_ui $actualPerm = substr(decoct(fileperms(e_BASE."cron.php")),3); if($isWin) { - $mes->add("Please be sure cron.php is executable.", E_MESSAGE_WARNING); + $mes->add(LAN_CRON_14, E_MESSAGE_WARNING); } if (!$isWin && $actualPerm != 755) // is_executable() is not reliable. { - $mes->add("Please CHMOD /cron.php to 755 ", E_MESSAGE_WARNING); + $mes->add(LAN_CRON_15, E_MESSAGE_WARNING); } elseif (!$active) // show instructions { - $setpwd_message = "Use the following Cron Command: ".rtrim($_SERVER['DOCUMENT_ROOT'], '/').e_HTTP."cron.php ".$pref['e_cron_pwd']."
- Using your server control panel (eg. cPanel,Plesk etc.) please create a crontab to run this command on your server every minute."; + $setpwd_message = LAN_CRON_16.": ".rtrim($_SERVER['DOCUMENT_ROOT'], '/').e_HTTP."cron.php ".$pref['e_cron_pwd']."
". LAN_CRON_17; $mes->add($setpwd_message, E_MESSAGE_INFO); } @@ -388,7 +387,7 @@ class cron_admin_ui extends e_admin_ui } $class_name .= '_cron'; $status = $this->cronExecuteMethod($class_name, $method_name) ? E_MESSAGE_SUCCESS : E_MESSAGE_ERROR; - $mes->add("Running ".$cron_name."", $status); + $mes->add(LAN_CRON_RUNNING.":".$cron_name."", $status); } @@ -427,30 +426,30 @@ class cron_admin_form_ui extends e_admin_form_ui { var $min_options = array( - "*" => LAN_CRON_11, - "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58" => LAN_CRON_12, - "0,5,10,15,20,25,30,35,40,45,50,55" => LAN_CRON_13, - "0,10,20,30,40,50" => LAN_CRON_14, - "0,15,30,45" => LAN_CRON_10, - "0,30" => LAN_CRON_15 + "*" => LAN_CRON_30, + "0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58" => LAN_CRON_31, + "0,5,10,15,20,25,30,35,40,45,50,55" => LAN_CRON_32, + "0,10,20,30,40,50" => LAN_CRON_33, + "0,15,30,45" => LAN_CRON_34, + "0,30" => LAN_CRON_35 ); var $hour_options = array( - "*" => LAN_CRON_16, - "0,2,4,6,8,10,12,14,16,18,20,22" => LAN_CRON_17, - "0,3,6,9,12,15,18,21" => LAN_CRON_18, - "0,6,12,18" => LAN_CRON_19 + "*" => LAN_CRON_36, + "0,2,4,6,8,10,12,14,16,18,20,22" => LAN_CRON_37, + "0,3,6,9,12,15,18,21" => LAN_CRON_38, + "0,6,12,18" => LAN_CRON_39 ); var $cronCategories = array( - 'backup' => 'Backup', + 'backup' => LAN_CRON_BACKUP, 'content' => ADLAN_CL_3, - 'log' => 'Logging', + 'log' => LAN_CRON_LOGGING, 'mail' => ADLAN_136, 'notify' => ADLAN_149, 'user' => LAN_USER, - 'plugin' => 'Plugins' + 'plugin' => ADLAN_CL_7 ); /** @@ -462,15 +461,15 @@ class cron_admin_form_ui extends e_admin_form_ui { $sep = array(); list($min, $hour, $day, $month, $weekday) = explode(" ", $curVal); - $text = (isset($this->min_options[$min])) ? $this->min_options[$min] : LAN_CRON_3.$min; + $text = (isset($this->min_options[$min])) ? $this->min_options[$min] : LAN_CRON_50.$min; $text .= "
"; - $text .= (isset($this->hour_options[$hour])) ? $this->hour_options[$hour] : LAN_CRON_4.$hour; + $text .= (isset($this->hour_options[$hour])) ? $this->hour_options[$hour] : LAN_CRON_51.$hour; $text .= "
"; - $text .= ($day != '*') ? LAN_CRON_5.$day : LAN_CRON_20; + $text .= ($day != '*') ? LAN_CRON_52.$day : LAN_CRON_40; $text .= "
"; - $text .= ($month != '*') ? strftime("%B", mktime(00, 00, 00, $month, 1, 2000)) : LAN_CRON_21; + $text .= ($month != '*') ? strftime("%B", mktime(00, 00, 00, $month, 1, 2000)) : LAN_CRON_41; $text .= "
"; - $text .= ($weekday != '*') ? strftime("%A", mktime(00, 00, 00, 5, $weekday, 2000)) : LAN_CRON_22; + $text .= ($weekday != '*') ? strftime("%A", mktime(00, 00, 00, 5, $weekday, 2000)) : LAN_CRON_42; return $text; } @@ -605,7 +604,7 @@ class cron_admin_form_ui extends e_admin_form_ui $sel_day = ($day[0] == "*") ? "selected='selected'" : ""; - $text .= "\n"; // Every Day + $text .= "\n"; // Every Day for ($i = 1; $i <= 31; $i++) { $sel = (in_array($i, $day)) ? "selected='selected'" : ""; @@ -616,7 +615,7 @@ class cron_admin_form_ui extends e_admin_form_ui \n"; $sel_weekday = ($weekday[0] == "*") ? "selected='selected'" : ""; - $text .= "\n"; // Every Week Day. + $text .= "\n"; // Every Week Day. for ($i = 0; $i <= 6; $i++) diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index 38db15706..8d5103b22 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -85,7 +85,7 @@ define("ADLAN_78", "Extended User Fields"); define("ADLAN_79", "Edit extended user fields"); -define("ADLAN_86", "Foirbbiden"); +define("ADLAN_86", "Forbidden"); define("ADLAN_87", "Access denied!"); //define("ADLAN_88", "Unable to login "); define("ADLAN_89", "Admin Name "); @@ -235,6 +235,7 @@ define("LAN_DELETED_FAILED","Deletion Unsuccessful"); define("LAN_UPDATED_FAILED","Update Unsuccessful"); define("LAN_NO_CHANGE","Nothing updated as no changes were made."); define("LAN_TRY_AGAIN","Please try again."); +define("LAN_NEVER", "Never"); define("LAN_RESET","Reset"); define("LAN_CLEAR","Clear"); diff --git a/e107_languages/English/admin/lan_banlist.php b/e107_languages/English/admin/lan_banlist.php index 8b12beea9..d65d779d4 100644 --- a/e107_languages/English/admin/lan_banlist.php +++ b/e107_languages/English/admin/lan_banlist.php @@ -28,7 +28,7 @@ define('BANLAN_17','Ban Date'); define('BANLAN_18','Ban expires'); define('BANLAN_19','Notes'); define('BANLAN_20','Type'); -define('BANLAN_21','Never'); +//define('BANLAN_21','Never'); define('BANLAN_22','Unknown'); define('BANLAN_23','day(s)'); define('BANLAN_24','hours'); diff --git a/e107_languages/English/admin/lan_cron.php b/e107_languages/English/admin/lan_cron.php index 451941424..87e14ab8f 100644 --- a/e107_languages/English/admin/lan_cron.php +++ b/e107_languages/English/admin/lan_cron.php @@ -15,34 +15,76 @@ if (!defined("PAGE_NAME")) { define("PAGE_NAME", "Schedule Tasks"); } define("LAN_CRON_M_01", "Manage"); define("LAN_CRON_M_02", "Refresh"); - - - +// Table heading define("LAN_CRON_1", "Name"); -define("LAN_CRON_2", "Description"); -define("LAN_CRON_3", "Minute(s):"); -define("LAN_CRON_4", "Hour(s):"); -define("LAN_CRON_5", "Day(s):"); -define("LAN_CRON_6", "Month(s):"); -define("LAN_CRON_7", "Weekday(s):"); -define("LAN_CRON_8", "Active"); -// define("LAN_CRON_9", "Description"); -define("LAN_CRON_10", "Every 15 minutes"); +define("LAN_CRON_2", "Function"); +define("LAN_CRON_3", "Tab"); +define("LAN_CRON_4", "Last-run"); +define("LAN_CRON_5", "Active"); -define("LAN_CRON_11", "Every Minute"); -define("LAN_CRON_12", "Every Other Minute"); -define("LAN_CRON_13", "Every 5 Minutes"); -define("LAN_CRON_14", "Every 10 minutes"); -define("LAN_CRON_15", "Every 30 minutes"); +// Default crons +define("LAN_CRON_01_1", "Test Email"); +define("LAN_CRON_01_2", "Send a test email to [eml]."); // [eml] is automatically replaced by head admin e-mail address. +define("LAN_CRON_01_3", "Recommended to test the scheduling system."); -define("LAN_CRON_16", "Every Hour"); -define("LAN_CRON_17", "Every Other Hour"); -define("LAN_CRON_18", "Every 3 Hours"); -define("LAN_CRON_19", "Every 6 Hours"); +define("LAN_CRON_02_1", "Mail Queue"); +define("LAN_CRON_02_2", "Process mail queue."); -define("LAN_CRON_20", "Every Day"); -define("LAN_CRON_21", "Every Month"); -define("LAN_CRON_22", "Every Week Day"); +define("LAN_CRON_03_1", "Mail Bounce Check"); +define("LAN_CRON_03_2", "'Check for bounced emails."); +define("LAN_CRON_04_1", "Ban Retrigger Check"); +define("LAN_CRON_04_2", "Process bounce retriggers."); +define("LAN_CRON_04_3", "Only needed if retriggering of bans enabled."); + +define("LAN_CRON_05_1", "Database Backup"); +define("LAN_CRON_05_2", "Backup the system database to"); + + +// Error and info messages +define("LAN_CRON_6", "Couldn't Import Prefs"); +define("LAN_CRON_7", "Couldn't Import Timing Settings"); +define("LAN_CRON_8", "Imported Timing Settings for"); +define("LAN_CRON_9", "Imported"); + +define("LAN_CRON_10", "[x] minutes and [y] seconds ago."); // [x] and [y] are automatically replaced. +define("LAN_CRON_11", "[y] seconds ago."); + +define("LAN_CRON_12", "Active Crons"); +define("LAN_CRON_13", "Last cron refresh"); +define("LAN_CRON_14", "Please be sure cron.php is executable."); +define("LAN_CRON_15", "Please CHMOD /cron.php to 755."); + +define("LAN_CRON_16", "Use the following Cron Command"); +define("LAN_CRON_17", "Using your server control panel (eg. cPanel, DirectAdmin, Plesk etc.) please create a crontab to run this command on your server every minute."); + +// leave some room for additions/changes + +define("LAN_CRON_30", "Every Minute"); +define("LAN_CRON_31", "Every Other Minute"); +define("LAN_CRON_32", "Every 5 Minutes"); +define("LAN_CRON_33", "Every 10 minutes"); +define("LAN_CRON_34", "Every 15 minutes"); +define("LAN_CRON_35", "Every 30 minutes"); + +define("LAN_CRON_36", "Every Hour"); +define("LAN_CRON_37", "Every Other Hour"); +define("LAN_CRON_38", "Every 3 Hours"); +define("LAN_CRON_39", "Every 6 Hours"); + +define("LAN_CRON_40", "Every Day"); +define("LAN_CRON_41", "Every Month"); +define("LAN_CRON_42", "Every Week Day"); + +define("LAN_CRON_50", "Minute(s):"); +define("LAN_CRON_51", "Hour(s):"); +define("LAN_CRON_52", "Day(s):"); +define("LAN_CRON_53", "Month(s):"); +define("LAN_CRON_54", "Weekday(s):"); +define("LAN_CRON_55", "Active"); + +define("LAN_CRON_BACKUP", "Backup"); +define("LAN_CRON_LOGGING", "Logging"); +define("LAN_CRON_RUNNING", "Running") ?> \ No newline at end of file