From aa157c353684c646b9852e4bcea4f6c8d62755a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Fri, 24 Feb 2017 09:31:24 +0100 Subject: [PATCH 01/57] Update e107_plugins/log --- e107_plugins/log/admin_config.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e107_plugins/log/admin_config.php b/e107_plugins/log/admin_config.php index 3a5e845be..81b6b5633 100644 --- a/e107_plugins/log/admin_config.php +++ b/e107_plugins/log/admin_config.php @@ -148,7 +148,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } '); 'main/datasets' => array('caption'=> ADSTAT_LAN_63, 'perm' => 'P'), 'main/rempage' => array('caption'=> ADSTAT_LAN_26, 'perm' => 'P'), 'main/history' => array('caption'=> ADSTAT_LAN_69, 'perm' => 'P'), - 'main/rebuild' => array('caption'=>'Rebuild Statistic Summaries', 'perm'=> 'P'), + 'main/rebuild' => array('caption'=> ADSTAT_LAN_87, 'perm'=> 'P'), ); @@ -159,7 +159,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } '); 'main/edit' => 'main/list' ); - protected $menuTitle = 'Statistic Logging'; + protected $menuTitle = ADSTAT_L3; } @@ -196,7 +196,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } '); class logstats_ui extends e_admin_ui { - protected $pluginTitle = 'Statistic Logging'; + protected $pluginTitle = ADSTAT_L3; protected $pluginName = 'log'; // protected $eventName = 'log-logstats'; // remove comment to enable event triggers in admin. protected $table = 'logstats'; @@ -741,7 +741,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } '); if(!empty($_SESSION['stats_log_files_total'])) { - $text .= $frm->progressBar('rebuild-progress',0,array("btn-label"=>"Rebuild Stats", 'url'=>e_REQUEST_URI)); + $text .= $frm->progressBar('rebuild-progress',0,array("btn-label"=> ADSTAT_LAN_88, 'url'=>e_REQUEST_URI)); } $text .= $frm->close(); @@ -1112,7 +1112,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } '); if($date == 'pageTotal') { - return $this->button('rebuildTotal', 1, 'delete', 'Rebuild'); + return $this->button('rebuildTotal', 1, 'delete', ADSTAT_LAN_89); } @@ -1129,7 +1129,7 @@ e107::css('inline', 'td.last.options { padding-right:20px } '); if(is_readable($file)) { - return $this->button('rebuild', $datestamp, 'delete', 'Rebuild'); + return $this->button('rebuild', $datestamp, 'delete', ADSTAT_LAN_89); } else { From 7ee87b5ef49976df4597b654dc6ca444f1ce900f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Fri, 24 Feb 2017 09:32:46 +0100 Subject: [PATCH 02/57] Update English.php --- e107_plugins/log/languages/English.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_plugins/log/languages/English.php b/e107_plugins/log/languages/English.php index 00744aeb8..4e815cc03 100644 --- a/e107_plugins/log/languages/English.php +++ b/e107_plugins/log/languages/English.php @@ -69,7 +69,7 @@ define("ADSTAT_L49", "sort alphabetically"); define("ADSTAT_L50", "All-time stats"); define("ADSTAT_L51", "Current month stats"); define("ADSTAT_L52", "Previous month stats"); -define("ADSTAT_L53", ""); +define("ADSTAT_L53", "Information"); define("ADSTAT_L54", ""); define("ADSTAT_L55", ""); define("ADSTAT_L56", ""); @@ -78,4 +78,4 @@ define("ADSTAT_L58", ""); define("ADSTAT_L59", ""); define("ADSTAT_L60", ""); -?> \ No newline at end of file +?> From a6f121b63b9bab66bb12c229cc6cf1f5d32d5dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Fri, 24 Feb 2017 09:36:09 +0100 Subject: [PATCH 03/57] Update English_admin.php --- e107_plugins/log/languages/English_admin.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/e107_plugins/log/languages/English_admin.php b/e107_plugins/log/languages/English_admin.php index b30f44af4..209034657 100644 --- a/e107_plugins/log/languages/English_admin.php +++ b/e107_plugins/log/languages/English_admin.php @@ -96,6 +96,10 @@ define ('ADSTAT_LAN_83', 'Following log ID entries removed:'); define ('ADSTAT_LAN_84', 'This proceedure will overwrite the log statistic summaries in your database. (raw log files are left unchanged) Once replaced, the data cannot be recovered. Please backup or export your database first'); define ('ADSTAT_LAN_85', '[x] log files have been found. Click the button below to process these files.'); define ('ADSTAT_LAN_86', 'Total Hits'); +define ('ADSTAT_LAN_87', 'Rebuild Statistic Summaries'); +define ('ADSTAT_LAN_88', 'Rebuild Stats'); +define ('ADSTAT_LAN_89', 'Rebuild'); +define ('ADSTAT_LAN_90', 'Data saved to database with id:'); +define ('ADSTAT_LAN_91', 'Couldn\'t save data to database with id:'); - -?> \ No newline at end of file +?> From 7905d46b07a5bfa3545912b588aaa4ef42c0794c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Fri, 24 Feb 2017 09:37:08 +0100 Subject: [PATCH 04/57] Update stats.php --- e107_plugins/log/stats.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_plugins/log/stats.php b/e107_plugins/log/stats.php index c46fea0a3..815a32d5d 100644 --- a/e107_plugins/log/stats.php +++ b/e107_plugins/log/stats.php @@ -1662,7 +1662,7 @@ class siteStats - + \n"; foreach($recentArray as $key => $info) @@ -2044,4 +2044,4 @@ class siteStats -?> \ No newline at end of file +?> From 1382640393322385be7cdf49e83568333d7362d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Fri, 24 Feb 2017 09:43:00 +0100 Subject: [PATCH 05/57] Update consolidate.php --- e107_plugins/log/consolidate.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e107_plugins/log/consolidate.php b/e107_plugins/log/consolidate.php index 73b2f3c04..b86e84d23 100644 --- a/e107_plugins/log/consolidate.php +++ b/e107_plugins/log/consolidate.php @@ -614,11 +614,11 @@ class logConsolidate if($this->collatePageInfo($pageTotal, $datestamp)) { - $mes->addSuccess( "Data saved to database with id: ".$datestamp); + $mes->addSuccess( ADSTAT_LAN_90.$datestamp); } else { - $mes->addError( "Couldn't save data to database with id: ".$datestamp); + $mes->addError( ADSTAT_LAN_91.$datestamp); } } @@ -844,4 +844,4 @@ class logConsolidate -?> \ No newline at end of file +?> From 426e36458d85eea449663a806b0acd04302d62dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sat, 15 Apr 2017 11:52:45 +0200 Subject: [PATCH 06/57] Update admin.php --- e107_admin/admin.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e107_admin/admin.php b/e107_admin/admin.php index b3828b41b..0e0f60654 100644 --- a/e107_admin/admin.php +++ b/e107_admin/admin.php @@ -577,11 +577,13 @@ TMPO; if(@unlink($file)) { - $mes->addSuccess("Deleted ".$file); + $message = e107::getParser()->lanVars(LAN_UI_FILE_DELETED, array('x'=>$file)); + $mes->addSuccess($message); } else { - $mes->addError("Unable to delete ".$file.". Please remove the file manually."); + $message = e107::getParser()->lanVars(LAN_UI_FILE_DELETED_FAILED, array('x'=>$file)); + $mes->addError($message); } } From 73b4b0486defa2e7420cd7562ca3d3e67b03e515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sat, 15 Apr 2017 11:55:13 +0200 Subject: [PATCH 07/57] Update lan_admin.php --- e107_languages/English/admin/lan_admin.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index 43ca4da27..fcc52e151 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -469,6 +469,8 @@ define("LAN_UI_DELETE_WARNING", "You are about to delete [x] records. Please con define("LAN_UI_BATCH_CREATELINK", "Create Link"); define("LAN_UI_DELETED", "[x] record(s) successfully deleted!"); define("LAN_UI_DELETED_FAILED", "[x] records not found and not deleted!"); +define("LAN_UI_FILE_DELETED", "[x] file successfully deleted!"); +define("LAN_UI_FILE_DELETED_FAILED", "Unable to delete [x]! Please remove the file manually."); define("LAN_UI_BATCH_EXPORT", "Export"); define("LAN_UI_USING_DATABASE_TABLE", "Using [x] database table"); From b9cfbfae9e3eb40c33af439675a5b53c9b7006c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sat, 15 Apr 2017 20:46:30 +0200 Subject: [PATCH 08/57] Update English_admin.php --- e107_plugins/log/languages/English_admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_plugins/log/languages/English_admin.php b/e107_plugins/log/languages/English_admin.php index 209034657..bbef0c6ba 100644 --- a/e107_plugins/log/languages/English_admin.php +++ b/e107_plugins/log/languages/English_admin.php @@ -99,7 +99,7 @@ define ('ADSTAT_LAN_86', 'Total Hits'); define ('ADSTAT_LAN_87', 'Rebuild Statistic Summaries'); define ('ADSTAT_LAN_88', 'Rebuild Stats'); define ('ADSTAT_LAN_89', 'Rebuild'); -define ('ADSTAT_LAN_90', 'Data saved to database with id:'); -define ('ADSTAT_LAN_91', 'Couldn\'t save data to database with id:'); +define("ADSTAT_LAN_90", "Data saved to database with id: [x]"); +define("ADSTAT_LAN_91", "Couldn't save data to database with id: [x]"); ?> From 3044bb58010597c079ba2255b55b2e5cc88b9a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sat, 15 Apr 2017 20:47:12 +0200 Subject: [PATCH 09/57] Update English_admin.php --- e107_plugins/log/languages/English_admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e107_plugins/log/languages/English_admin.php b/e107_plugins/log/languages/English_admin.php index bbef0c6ba..51e888f55 100644 --- a/e107_plugins/log/languages/English_admin.php +++ b/e107_plugins/log/languages/English_admin.php @@ -99,7 +99,7 @@ define ('ADSTAT_LAN_86', 'Total Hits'); define ('ADSTAT_LAN_87', 'Rebuild Statistic Summaries'); define ('ADSTAT_LAN_88', 'Rebuild Stats'); define ('ADSTAT_LAN_89', 'Rebuild'); -define("ADSTAT_LAN_90", "Data saved to database with id: [x]"); -define("ADSTAT_LAN_91", "Couldn't save data to database with id: [x]"); +define ('ADSTAT_LAN_90', "Data saved to database with id: [x]"); +define ('ADSTAT_LAN_91', "Couldn't save data to database with id: [x]"); ?> From 5d8ac073c1193e9d4d7e484a8fd3839a896c0f20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sat, 15 Apr 2017 20:48:58 +0200 Subject: [PATCH 10/57] Update consolidate.php --- e107_plugins/log/consolidate.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/e107_plugins/log/consolidate.php b/e107_plugins/log/consolidate.php index b86e84d23..11e3c8aac 100644 --- a/e107_plugins/log/consolidate.php +++ b/e107_plugins/log/consolidate.php @@ -614,11 +614,13 @@ class logConsolidate if($this->collatePageInfo($pageTotal, $datestamp)) { - $mes->addSuccess( ADSTAT_LAN_90.$datestamp); + $message = e107::getParser()->lanVars(ADSTAT_LAN_90, array('x'=>$datestamp)); + $mes->addSuccess($message); } else { - $mes->addError( ADSTAT_LAN_91.$datestamp); + $message = e107::getParser()->lanVars(ADSTAT_LAN_91, array('x'=>$datestamp)); + $mes->addError($message); } } From 5f2ed569e303e9fc571a5642bfc73d93aa83b488 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 16 Apr 2017 06:32:39 +0200 Subject: [PATCH 11/57] Update Admin Notify Add lang codes. --- e107_admin/notify.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e107_admin/notify.php b/e107_admin/notify.php index 00b50709c..3e747d3f5 100644 --- a/e107_admin/notify.php +++ b/e107_admin/notify.php @@ -144,7 +144,7 @@ class plugin_notify_admin_ui extends e_admin_ui $data = e107::callMethod($val."_notify", 'config'); - $config_category = str_replace("_menu","",ucfirst($val))." Events"; + $config_category = str_replace("_menu","",ucfirst($val))." ".LAN_NOTIFY_01; foreach($data as $v) { @@ -313,7 +313,7 @@ class plugin_notify_admin_ui extends e_admin_ui $tp = e107::getParser(); $frm = e107::getForm(); $uc = e107::getUserClass(); - $uc->fixed_classes['email'] = 'Email Address =>'; + $uc->fixed_classes['email'] = NM_LAN_3; $uc->text_class_link['email'] = 'email'; @@ -593,7 +593,7 @@ class notify_config $data = e107::callMethod($val."_notify", 'config'); - $config_category = str_replace("_menu","",ucfirst($val))." Events"; + $config_category = str_replace("_menu","",ucfirst($val))." ".LAN_NOTIFY_01; foreach($data as $v) { @@ -893,7 +893,7 @@ class notify_config $tp = e107::getParser(); $frm = e107::getForm(); $uc = e107::getUserClass(); - $uc->fixed_classes['email'] = 'Email Address =>'; + $uc->fixed_classes['email'] = NM_LAN_3; $uc->text_class_link['email'] = 'email'; From 78637c753311432488bcdf2cf8edbf1c9fe3a973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 16 Apr 2017 06:34:30 +0200 Subject: [PATCH 12/57] Update users.php --- e107_admin/users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_admin/users.php b/e107_admin/users.php index a1ace3946..a1bae866d 100644 --- a/e107_admin/users.php +++ b/e107_admin/users.php @@ -283,7 +283,7 @@ class users_admin_ui extends e_admin_ui 'user_login' => array('title' => LAN_USER_03, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto'), // Real name (no real vetting) 'user_customtitle' => array('title' => LAN_USER_04, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto'), // No real vetting 'user_password' => array('title' => LAN_PASSWORD, 'tab'=>0, 'type' => 'method', 'data'=>'safestr', 'width' => 'auto'), //TODO add md5 option to form handler? - 'user_sess' => array('title' => USRLAN_175, 'tab'=>0, 'noedit'=>true, 'type' => 'text', 'width' => 'auto'), // Photo + 'user_sess' => array('title' => LAN_SESSION, 'tab'=>0, 'noedit'=>true, 'type' => 'text', 'width' => 'auto'), // Photo 'user_image' => array('title' => LAN_USER_07, 'tab'=>0, 'type' => 'dropdown', 'data'=>'str', 'width' => 'auto'), // Avatar 'user_email' => array('title' => LAN_EMAIL, 'tab'=>0, 'type' => 'text', 'inline'=>true, 'data'=>'str', 'width' => 'auto', 'writeParms'=>array('size'=>'xxlarge')), 'user_hideemail' => array('title' => LAN_USER_10, 'tab'=>0, 'type' => 'boolean', 'data'=>'int', 'width' => 'auto', 'thclass'=>'center', 'class'=>'center', 'filter'=>true, 'batch'=>true, 'readParms'=>'trueonly=1'), From a7e4dbbc821cd540c8b110bcdfdb0e9d3d0757d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 16 Apr 2017 06:37:54 +0200 Subject: [PATCH 13/57] Update event_class.php --- e107_handlers/event_class.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/e107_handlers/event_class.php b/e107_handlers/event_class.php index 6ea97a8fe..b75cb581c 100644 --- a/e107_handlers/event_class.php +++ b/e107_handlers/event_class.php @@ -81,19 +81,19 @@ class e107_event 'user_signup_activated' => NU_LAN_3, 'login' => NU_LAN_4, 'logout' => NU_LAN_5, - 'user_xup_login' => 'User social login', - 'user_xup_signup' => 'User social signup', + 'user_xup_login' => NU_LAN_6, + 'user_xup_signup' => NU_LAN_7, 'user_ban_flood' => NS_LAN_2, - 'user_ban_failed_login' => 'IP banned for multiple failed login attempts', - 'user_profile_display' => "User views profile", - 'user_profile_edit' => "User edits profile" + 'user_ban_failed_login' => NS_LAN_3, + 'user_profile_display' => NU_LAN_8, + 'user_profile_edit' => NU_LAN_9 ), 'administrators' => array( - 'admin_password_update' => "Administrator updates their password", - 'admin_user_created' => 'Administrator creates a new user', - 'admin_user_activated' => "Administrator activates a new user" + 'admin_password_update' => NA_LAN_1, + 'admin_user_created' => NA_LAN_2, + 'admin_user_activated' => NA_LAN_3 ), @@ -102,7 +102,7 @@ class e107_event 'admin_news_created' => NN_LAN_3, 'admin_news_updated' => NN_LAN_4, 'admin_news_deleted' => NN_LAN_5, - 'admin_news_notify' => "News notification triggered", // TODO LAN + 'admin_news_notify' => NN_LAN_6, 'user_news_submit' => NN_LAN_2, ), @@ -348,4 +348,4 @@ class e107_event } } -?> \ No newline at end of file +?> From 3cfb6e9dd71a4fce2e0a5f9d6b5ebc91d57d66c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 16 Apr 2017 06:39:12 +0200 Subject: [PATCH 14/57] Update lan_admin.php --- e107_languages/English/admin/lan_admin.php | 1 + 1 file changed, 1 insertion(+) diff --git a/e107_languages/English/admin/lan_admin.php b/e107_languages/English/admin/lan_admin.php index a50d0aa90..7e5f2b0ed 100644 --- a/e107_languages/English/admin/lan_admin.php +++ b/e107_languages/English/admin/lan_admin.php @@ -290,6 +290,7 @@ define("LAN_NOTWRITABLE"," is not writable, you need to CHMOD 777 the file or fo define("LAN_NOTREADABLE", "Not Readable"); define("LAN_MISSING", "Missing"); define("LAN_UNUSED", "Unused"); +define("LAN_SESSION", "Session"); define("LAN_TOOLTIP", "Tooltip"); define("LAN_TIME","Time"); From 40819246b23edcf76335d7a2d6834201cfba5196 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 16 Apr 2017 06:40:17 +0200 Subject: [PATCH 15/57] Update lan_users.php --- e107_languages/English/admin/lan_users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_languages/English/admin/lan_users.php b/e107_languages/English/admin/lan_users.php index 8d501932d..0b2458a9c 100644 --- a/e107_languages/English/admin/lan_users.php +++ b/e107_languages/English/admin/lan_users.php @@ -176,7 +176,7 @@ define("USRLAN_171", "Random password"); define("USRLAN_172", "User account has been created with the following:"); // define("USRLAN_173", "Login name set"); // define("USRLAN_174", "User name --NAME-- created"); -define("USRLAN_175", "Session"); +// define("USRLAN_175", "Session"); // Moved to lan_admin.php define("USRLAN_179", "User banned: "); define("USRLAN_180", "IP address of {IP} appears on whitelist; IP not banned."); From c94a1ac1097127d74b3a2b2ff7b852f2c135c45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor?= Date: Sun, 16 Apr 2017 06:44:35 +0200 Subject: [PATCH 16/57] Update lan_notify.php --- e107_languages/English/admin/lan_notify.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/e107_languages/English/admin/lan_notify.php b/e107_languages/English/admin/lan_notify.php index b3bca968a..7e18238e8 100644 --- a/e107_languages/English/admin/lan_notify.php +++ b/e107_languages/English/admin/lan_notify.php @@ -6,6 +6,10 @@ * */ +define("NA_LAN_1", "Administrator updates their password"); +define("NA_LAN_2", "Administrator creates a new user"); +define("NA_LAN_3", "Administrator activates a new user"); + define("NT_LAN_1", "Notify"); define("NT_LAN_2", "Receive email notification on"); //define("NT_LAN_3", "Off"); @@ -18,18 +22,25 @@ define("NU_LAN_2", "User signup"); define("NU_LAN_3", "User account verification"); define("NU_LAN_4", "User login"); define("NU_LAN_5", "User logout"); +define("NU_LAN_6", "User social login"); +define("NU_LAN_7", "User social signup"); +define("NU_LAN_8", "User views profile"); +define("NU_LAN_9", "User edits profile"); define("NS_LAN_1", "Security Events"); define("NS_LAN_2", "IP banned for flooding site"); +define("NS_LAN_3", "IP banned for multiple failed login attempts"); define("NN_LAN_1", "News Events"); define("NN_LAN_2", "News item submitted by user"); define("NN_LAN_3", "News item posted by admin"); define("NN_LAN_4", "News item edited by admin"); define("NN_LAN_5", "News item deleted by admin"); +define("NN_LAN_6", "News notification triggered"); define("NM_LAN_1", "Mail Events"); define("NM_LAN_2", "Bulk email run complete"); +define("NM_LAN_3", "Email Address =>"); define("NF_LAN_1", "File Events"); define("NF_LAN_2", "File uploaded by user"); From 9656fc29f80e96c43d2e09834fed41820be697d1 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Thu, 20 Apr 2017 09:21:27 +0100 Subject: [PATCH 17/57] PM cleanup... --- e107_plugins/pm/templates/pm_menu_template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_plugins/pm/templates/pm_menu_template.php b/e107_plugins/pm/templates/pm_menu_template.php index 0fb507213..fb758b42d 100644 --- a/e107_plugins/pm/templates/pm_menu_template.php +++ b/e107_plugins/pm/templates/pm_menu_template.php @@ -27,7 +27,7 @@ if (!defined('e107_INIT')) { exit; } define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); -define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); +//define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); define('NEWPM_ANIMATION', ""); /* $sc_style['PM_SEND_PM_LINK']['pre'] = "

"; From 3489288b4730cb0146e62dd8fee99ffd8a6f0245 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Thu, 20 Apr 2017 09:22:55 +0100 Subject: [PATCH 18/57] PM Cleanup --- e107_plugins/pm/pm_shortcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_plugins/pm/pm_shortcodes.php b/e107_plugins/pm/pm_shortcodes.php index c31fe8fbe..22fa97d0d 100644 --- a/e107_plugins/pm/pm_shortcodes.php +++ b/e107_plugins/pm/pm_shortcodes.php @@ -646,7 +646,7 @@ if(!class_exists('plugin_pm_pm_shortcodes')) if($pm_outbox['outbox']['filled'] < 100) { $link = $this->url('action/new'); - return "".PM_SEND_LINK.""; + return "".LAN_PLUGIN_PM_NEW.""; } return ''; } From 328908869973ccc815b62ab745c1a84e07a1c200 Mon Sep 17 00:00:00 2001 From: rica-carv Date: Thu, 20 Apr 2017 09:43:06 +0100 Subject: [PATCH 19/57] Icons reverted from PNG -> Glyphs Icons reverted from PNG to Glyphs - Can PNG's be deleted? - PM_OUTBOX_ICON is a candidate to Fontawesome stacked icon, since there's no native fontawesome outbox icon... - NEWPM_ANIMATION is a candidate to Fontawesome animated icon, since there's no native fontawesome animated new message icon... --- e107_plugins/pm/templates/pm_menu_template.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/e107_plugins/pm/templates/pm_menu_template.php b/e107_plugins/pm/templates/pm_menu_template.php index fb758b42d..13d0c21eb 100644 --- a/e107_plugins/pm/templates/pm_menu_template.php +++ b/e107_plugins/pm/templates/pm_menu_template.php @@ -25,10 +25,15 @@ if (!defined('e107_INIT')) { exit; } -define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); -define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); +//define('PM_INBOX_ICON', "".LAN_PLUGIN_PM_INBOX.""); +define('PM_INBOX_ICON', e107::getParser()->toGlyph('fa-inbox')); +//define('PM_OUTBOX_ICON', "".LAN_PLUGIN_PM_OUTBOX.""); +// Icon candidate to stacked fontawesome icons... +define('PM_OUTBOX_ICON', e107::getParser()->toGlyph('fa-inbox').e107::getParser()->toGlyph('fa-arrow-up')); //define('PM_SEND_LINK', LAN_PLUGIN_PM_NEW); -define('NEWPM_ANIMATION', ""); +//define('NEWPM_ANIMATION', ""); +// Icon candidate to animated fontawesome icons... +define('NEWPM_ANIMATION', e107::getParser()->toGlyph('fa-envelope')); /* $sc_style['PM_SEND_PM_LINK']['pre'] = "

"; $sc_style['PM_SEND_PM_LINK']['post'] = ""; From 2e2d34d4a67555bc3e1e721983ddf950afae7bfc Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 20 Apr 2017 12:07:49 -0700 Subject: [PATCH 20/57] Downloads: Fixes sub-category rendering on older themes. --- e107_plugins/download/handlers/download_class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/e107_plugins/download/handlers/download_class.php b/e107_plugins/download/handlers/download_class.php index cadd06a32..038e1e19c 100644 --- a/e107_plugins/download/handlers/download_class.php +++ b/e107_plugins/download/handlers/download_class.php @@ -638,7 +638,8 @@ class download $subText .= $tp->parseTemplate($DOWNLOAD_CAT_TABLE_END, TRUE, $sc); - $dl_text .= $ns->tablerender($dl_title, $subText, 'download-list', true); + // $dl_text .= $ns->tablerender($dl_title, $subText, 'download-list', true); + $dl_text .= $subText; } }// End of subcategory display From 40558eeedba2b4bcebc32699995df9ed763cd4d1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 21 Apr 2017 12:13:12 -0700 Subject: [PATCH 21/57] Fixes #2588 - admin-menu icon. --- e107_handlers/admin_ui.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index aceffa02d..cc1d97931 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -1578,8 +1578,17 @@ class e_admin_dispatcher if(!$selected) $selected = $request->getMode().'/'.$request->getAction(); $selected = vartrue($this->adminMenuAliases[$selected], $selected); - $icon = (deftrue('e_CURRENT_PLUGIN')) ? e107::getPlugin()->getIcon(e_CURRENT_PLUGIN, 32, '') : e107::getParser()->toIcon($this->adminMenuIcon); + $icon = ''; + if(!empty($this->adminMenuIcon)) + { + $icon = e107::getParser()->toIcon($this->adminMenuIcon); + } + elseif(deftrue('e_CURRENT_PLUGIN')) + { + $icon = e107::getPlugin()->getIcon(e_CURRENT_PLUGIN, 32, ''); + } + return e107::getNav()->admin($icon."".$this->menuTitle."", $selected, $var); } From caee889b7f97b8316e2d8678379039d388217afe Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 21 Apr 2017 14:21:29 -0700 Subject: [PATCH 22/57] Fixes Plugin Database structure update detection. --- e107_admin/update_routines.php | 5 ++++- e107_handlers/admin_ui.php | 2 +- e107_handlers/db_verify_class.php | 11 ++++++++--- e107_handlers/plugin_class.php | 10 +++++----- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/e107_admin/update_routines.php b/e107_admin/update_routines.php index 061700fba..2329b9fd4 100644 --- a/e107_admin/update_routines.php +++ b/e107_admin/update_routines.php @@ -235,12 +235,15 @@ class e107Update { return false; } - + $frm = e107::getForm(); $tp = e107::getParser(); $text = ""; + + uksort($list, "strnatcasecmp"); + foreach($list as $path=>$val) { $name = !empty($val['@attributes']['lan']) ? $tp->toHtml($val['@attributes']['lan'],false,'TITLE') : $val['@attributes']['name']; diff --git a/e107_handlers/admin_ui.php b/e107_handlers/admin_ui.php index cc1d97931..5d28eabfc 100644 --- a/e107_handlers/admin_ui.php +++ b/e107_handlers/admin_ui.php @@ -1588,7 +1588,7 @@ class e_admin_dispatcher { $icon = e107::getPlugin()->getIcon(e_CURRENT_PLUGIN, 32, ''); } - + return e107::getNav()->admin($icon."".$this->menuTitle."", $selected, $var); } diff --git a/e107_handlers/db_verify_class.php b/e107_handlers/db_verify_class.php index 4ce0e217e..e9827981a 100644 --- a/e107_handlers/db_verify_class.php +++ b/e107_handlers/db_verify_class.php @@ -55,7 +55,6 @@ class db_verify function __construct() { - $sql = e107::getDb(); $sql->gen('SET SQL_QUOTE_SHOW_CREATE = 1'); @@ -74,8 +73,6 @@ class db_verify } - - $this->sqlLanguageTables = $this->getSqlLanguages(); // $this->loadCreateTableData(); @@ -84,6 +81,13 @@ class db_verify } + public function clearCache() + { + + return e107::getCache()->clear(self::cachetag, true); + + } + private function load() { $mes = e107::getMessage(); @@ -232,6 +236,7 @@ class db_verify } } } + } diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 294440746..cac3ae919 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -1050,10 +1050,9 @@ class e107plugin { return FALSE; } - - // require_once(e_HANDLER."db_verify_class.php"); - $dbv = e107::getSingleton('db_verify', e_HANDLER."db_verify_class.php"); - + + + $dbv = e107::getObject('db_verify', "{e_HANDLER}db_verify_class.php"); $plg = e107::getPlug(); @@ -1075,6 +1074,7 @@ class e107plugin if($dbv->errors()) { + $mes->addDebug("Plugin Update(s) Required - db structure change [".$path."]"); $needed[$path] = $data; } } @@ -1119,7 +1119,7 @@ class e107plugin { $log->addDebug("Plugin: {$path} requires an update."); } - + return count($needed) ? $needed : FALSE; } From fe46bc7a5079a4ebddc61ebfaaf1ac6509a48fa1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 21 Apr 2017 14:37:40 -0700 Subject: [PATCH 23/57] Update Available popover scrolling fix. --- e107_core/shortcodes/batch/admin_shortcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 9e58120d0..796768ac7 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1838,7 +1838,7 @@ Inverse 10 10 { $template = $$tmpl; - return $template['start']. '
  • '.$tp->toGlyph('fa-database').'
  • ' .$template['end']; + return $template['start']. '
  • '.$tp->toGlyph('fa-database').'
  • ' .$template['end']; } From 572d1a0da069d2adcd7fba253948e355c76487f3 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 21 Apr 2017 16:40:47 -0700 Subject: [PATCH 24/57] InfoPanel "Website Stats" moved to e107_plugins/user/e_dashboard.php . FlexPanel drag-n-drop now working with plugin e_dashboard addons. --- e107_admin/includes/flexpanel.php | 36 ++- e107_admin/includes/infopanel.php | 382 +++++------------------------- e107_plugins/user/e_dashboard.php | 380 ++++++++++++++++++++++++++++- 3 files changed, 456 insertions(+), 342 deletions(-) diff --git a/e107_admin/includes/flexpanel.php b/e107_admin/includes/flexpanel.php index 65aeb6140..f830747fa 100644 --- a/e107_admin/includes/flexpanel.php +++ b/e107_admin/includes/flexpanel.php @@ -212,11 +212,11 @@ class adminstyle_flexpanel extends adminstyle_infopanel // --------------------- Website Status --------------------------- - $ns->setStyle('flexpanel'); + /* $ns->setStyle('flexpanel'); $ns->setUniqueId('core-infopanel_website_status'); - $coreInfoPanelWebsiteStatus = $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(), "core-infopanel_website_status", true); + $coreInfoPanelWebsiteStatus = '';// 'hi';/// "
    ".$this->renderAddonDashboards()."
    "; $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderAddonDashboards(), "core-infopanel_website_status", true); $info = $this->getMenuPosition('core-infopanel_website_status'); - $panels[$info['area']][$info['weight']] .= $coreInfoPanelWebsiteStatus; + $panels[$info['area']][$info['weight']] .= $coreInfoPanelWebsiteStatus;*/ // --------------------- Latest Comments -------------------------- @@ -254,6 +254,26 @@ class adminstyle_flexpanel extends adminstyle_infopanel } } + + // --------------------- Plugin Addon Dashboards ---------------------- eg. e107_plugin/user/e_dashboard.php + $dashboards = $this->getAddonDashboards(); + if(!empty($dashboards)) + { + $ns->setStyle('flexpanel'); + foreach($dashboards as $val) + { + $id = $val['mode']; + $ns->setUniqueId($id); + $inc = $ns->tablerender($val['caption'], $val['text'], $val['mode'], true); + + $info = $this->getMenuPosition($id); + + $panels[$info['area']][$info['weight']] .= $inc; + } + + } + + // Sorting panels. foreach($panels as $key => $value) { @@ -292,7 +312,7 @@ class adminstyle_flexpanel extends adminstyle_infopanel { $user_pref = $this->getUserPref(); - if(varset($user_pref['core-flexpanel-order'][$id])) + if(!empty($user_pref['core-flexpanel-order'][$id])) { return $user_pref['core-flexpanel-order'][$id]; } @@ -311,6 +331,14 @@ class adminstyle_flexpanel extends adminstyle_infopanel return $positions[$layout][$id]; } + if(strpos($id,'plug-infopanel-') === 0) // addon dashboards default to area 2. + { + $default = array( + 'area' => 'menu-area-02', + 'weight' => 1000, + ); + } + return $default; } diff --git a/e107_admin/includes/infopanel.php b/e107_admin/includes/infopanel.php index f7866925a..d0a88b90b 100644 --- a/e107_admin/includes/infopanel.php +++ b/e107_admin/includes/infopanel.php @@ -264,7 +264,7 @@ class adminstyle_infopanel - $text3 .= $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(),"",true); + // $text3 .= $ns->tablerender(LAN_WEBSITE_STATUS, $this->renderWebsiteStatus(),"",true); @@ -364,7 +364,7 @@ class adminstyle_infopanel } } - +/* private function renderChart() { @@ -374,51 +374,62 @@ class adminstyle_infopanel { return $this->renderStats('log'); } - /* elseif(e107::isInstalled('awstats')) - { - return $this->renderStats('awstats'); - }*/ + else { return $this->renderStats('demo'); } - } + }*/ function renderWebsiteStatus() { - $tp = e107::getParser(); + return; + /* $tp = e107::getParser(); $tab = array(); $tab['e-stats'] = array('caption'=>$tp->toGlyph('fa-signal').' '.LAN_STATS, 'text'=>$this->renderChart()); $tab['e-online'] = array('caption'=>$tp->toGlyph('fa-user').' '.LAN_ONLINE.' ('.$this->renderOnlineUsers('count').')', 'text'=>$this->renderOnlineUsers()); - return e107::getForm()->tabs($tab); + return e107::getForm()->tabs($tab);*/ } - function renderAddonDashboards() + function getAddonDashboards() { - $panel = array(); - $ns = e107::getRender(); + $arr = array(); - $text = ''; if($plugs = e107::getAddonConfig('e_dashboard',null, 'chart')) { foreach($plugs as $plug => $val) { + $adg = e107::getAddon($plug,'e_dashboard'); + + if(!empty($adg->chartCaption)) + { + $cap = $adg->chartCaption; + } + else + { + $cap = defset('LAN_PLUGIN_'.strtoupper($plug).'_NAME', ucfirst($plug)); + } + foreach($val as $k=>$item) { + + if(!empty($item)) { // $var[] = $item; - $renderMode = 'plug-infopanel-'.$plug; + $renderMode = 'plug-infopanel-'.$plug."-".intval($k); - if(isset($item[$k]['text'])) + + if(!isset($item['text'])) { + foreach ($item as $key => $v) // make sure the ids are unique. { $newkey = eHelper::dasherize($plug.'-'.$k.'-'.$key); @@ -427,12 +438,16 @@ class adminstyle_infopanel } $t = e107::getForm()->tabs($item); - $cap = defset('LAN_PLUGIN_'.strtoupper($plug).'_NAME', ucfirst($plug)); - $text .= $ns->tablerender($cap, $t, $renderMode, true); + + + + // $text .= $ns->tablerender($cap, $t, $renderMode, true); + $arr[] = array('caption'=>$cap, 'text'=>$t, 'mode'=>$renderMode); } else { - $text .= $ns->tablerender($item['caption'], $item['text'], $renderMode, true); + // $text .= $ns->tablerender($item['caption'], $item['text'], $renderMode, true); + $arr[] = array('caption'=>$item['caption'], 'text'=>$item['text'], 'mode'=>$renderMode); } } } @@ -440,129 +455,29 @@ class adminstyle_infopanel } } + + return $arr; + } + + + + function renderAddonDashboards() + { + $ns = e107::getRender(); + $arr = $this->getAddonDashboards(); + $text = ''; + + foreach($arr as $val) + { + $text .= $ns->tablerender($val['caption'], $val['text'], $val['mode'], true); + + } + return $text; } - function renderOnlineUsers($data=false) - { - - $ol = e107::getOnline(); - $tp = e107::getParser(); - $multilan = e107::getPref('multilanguage'); - - $panelOnline = " - -
    ".ADSTAT_L18."Information".ADSTAT_L53."
    - - - - - - "; - - - $panelOnline .= (!empty($multilan)) ? "" : ""; - - - $panelOnline .= " - - - - - - - - - "; - - $panelOnline .= (!empty($multilan)) ? "" : ""; - - $panelOnline .= " - - - "; - - - - $online = $ol->userList() + $ol->guestList(); - - if($data == 'count') - { - return count($online); - } - - // echo "Users: ".print_a($online); - - $lng = e107::getLanguage(); - - foreach ($online as $val) - { - $panelOnline .= " - - - - - - "; - - $panelOnline .= (!empty($multilan)) ? "" : ""; - - - $panelOnline .= " - - "; - } - - - $panelOnline .= "
    ".LAN_TIMESTAMP."".LAN_USER."".LAN_IP."".LAN_PAGE."".LAN_AGENT."".LAN_LANG."
    ".e107::getDateConvert()->convert_date($val['user_currentvisit'],'%H:%M:%S')."".$this->renderOnlineName($val['online_user_id'])."".e107::getIPHandler()->ipDecode($val['user_ip'])."".$tp->html_truncate(basename($val['user_location']),50,"...")."".$this->browserIcon($val)."convert($val['user_language'])."\">".$val['user_language']."
    "; - - return $panelOnline; - } - - - function browserIcon($row) - { - - $types = array( - "ie" => "MSIE", - 'chrome' => 'Chrome', - 'firefox' => 'Firefox', - 'seamonkey' => 'Seamonkey', - // 'Chromium/xyz - 'safari' => "Safari", - 'opera' => "Opera" - ); - - - if($row['user_bot'] === true) - { - return ""; - } - - foreach($types as $icon=>$b) - { - if(strpos($row['user_agent'], $b)!==false) - { - return ""; - } - } - - return ""; // FIXME find a default icon. - } - - - function renderOnlineName($val) - { - if($val==0) - { - return LAN_GUEST; - } - return $val; - } - - function renderLatestComments() { $sql = e107::getDb(); @@ -768,202 +683,11 @@ class adminstyle_infopanel return $text; } - - private function getStats($type) - { - /* - - if(file_exists(e_PLUGIN."awstats/awstats.graph.php")) - { - require_once(e_PLUGIN."awstats/awstats.graph.php"); - $stat = new awstats; - - if($data = $stat->getData()) - { - return $data; - } - - // return; - } - */ if($type == 'demo') - { - $data = array(); - - $months = e107::getDate()->terms('month'); - - $data['labels'] = array($months[0], //"January", - $months[1], //"February", - $months[2], //"March", - $months[3], //"April", - $months[4], //"May", - $months[5], //"June", - $months[6] //"July" - ); - - $data['datasets'][] = array( - 'fillColor' => "rgba(220,220,220,0.5)", - 'strokeColor' => "rgba(220,220,220,1)", - 'pointColor ' => "rgba(220,220,220,1)", - 'pointStrokeColor' => "#fff", - 'data' => array(65,59,90,81,56,55,40), - 'title' => ADLAN_168// "Visits" - ); - - $data['datasets'][] = array( - 'fillColor' => "rgba(151,187,205,0.5)", - 'strokeColor' => "rgba(151,187,205,1)", - 'pointColor ' => "rgba(151,187,205,1)", - 'pointStrokeColor' => "#fff", - 'data' => array(28,48,40,19,96,27,100), - 'title' => ADLAN_169 //"Unique Visits" - ); - - return $data; - } - - - - $sql = e107::getDB(); - - $td = date("Y-m-j", time()); - $dayarray[$td] = array(); - $pagearray = array(); - - $qry = " - SELECT * from #logstats WHERE log_id REGEXP('[[:digit:]]+\-[[:digit:]]+\-[[:digit:]]+') - ORDER BY CONCAT(LEFT(log_id,4), SUBSTRING(log_id, 6, 2), LPAD(SUBSTRING(log_id, 9), 2, '0')) - DESC LIMIT 0,9 - "; - - if($amount = $sql->gen($qry)) - { - $array = $sql->db_getList(); - - $ttotal = 0; - $utotal = 0; - - foreach($array as $key => $value) - { - extract($value); - $log_id = substr($log_id, 0, 4).'-'.substr($log_id, 5, 2).'-'.str_pad(substr($log_id, 8), 2, '0', STR_PAD_LEFT); - if(is_array($log_data)) { - $entries[0] = $log_data['host']; - $entries[1] = $log_data['date']; - $entries[2] = $log_data['os']; - $entries[3] = $log_data['browser']; - $entries[4] = $log_data['screen']; - $entries[5] = $log_data['referer']; - } - else - { - $entries = explode(chr(1), $log_data); - } - - $dayarray[$log_id]['daytotal'] = $entries[0]; - $dayarray[$log_id]['dayunique'] = $entries[1]; - - unset($entries[0]); - unset($entries[1]); - - foreach($entries as $entry) - { - if($entry) - { - list($url, $total, $unique) = explode("|", $entry); - if(strstr($url, "/")) - { - $urlname = preg_replace("/\.php|\?.*/", "", substr($url, (strrpos($url, "/")+1))); - } - else - { - $urlname = preg_replace("/\.php|\?.*/", "", $url); - } - $dayarray[$log_id][$urlname] = array('url' => $url, 'total' => $total, 'unique' => $unique); - if (!isset($pagearray[$urlname]['total'])) $pagearray[$urlname]['total'] = 0; - if (!isset($pagearray[$urlname]['unique'])) $pagearray[$urlname]['unique'] = 0; - $pagearray[$urlname]['total'] += $total; - $pagearray[$urlname]['unique'] += $unique; - $ttotal += $total; - $utotal += $unique; - } - } - } - } - - $logfile = e_LOG.'logp_'.date('z.Y', time()).'.php'; // was logi_ ?? - if(is_readable($logfile)) - { - require($logfile); - } - - - - if(vartrue($pageInfo)) - { - foreach($pageInfo as $fkey => $fvalue) - { - $dayarray[$td][$fkey]['total'] += $fvalue['ttl']; - $dayarray[$td][$fkey]['unique'] += $fvalue['unq']; - $dayarray[$td]['daytotal'] += $fvalue['ttl']; - $dayarray[$td]['dayunique'] += $fvalue['unq']; - $pagearray[$fkey]['total'] += $fvalue['ttl']; - $pagearray[$fkey]['unique'] += $fvalue['unq']; - $ttotal += $fvalue['ttl']; - $utotal += $fvalue['unq']; - } - } - - - $visitors = array(); - $unique = array(); - - - ksort($dayarray); - foreach($dayarray as $k=>$v) - { - $unix = strtotime($k); - - $visitors[] = intval(vartrue($v['daytotal'])); - $unique[] = intval(vartrue($v['dayunique'])); - $label[] = "'".date("D",$unix)."'"; - } - - $data = array(); - - $data['labels'] = $label; - - //visitors - $data['datasets'][] = array( - 'fillColor' => "rgba(220,220,220,0.5)", - 'strokeColor' => "rgba(220,220,220,1)", - 'pointColor ' => "rgba(220,220,220,1)", - 'pointStrokeColor' => "#fff", - 'data' => $visitors - - ); - - - //Unique Visitors - $data['datasets'][] = array( - 'fillColor' => "rgba(151,187,205,0.5)", - 'strokeColor' => "rgba(151,187,205,1)", - 'pointColor ' => "rgba(151,187,205,1)", - 'pointStrokeColor' => "#fff", - 'data' => $unique - ); - - - - return $data; - - - } - - private function renderStats($type) +/* private function renderStats($type) { $data = $this->getStats($type); @@ -994,7 +718,7 @@ class adminstyle_infopanel return $text; - } + }*/ } ?> diff --git a/e107_plugins/user/e_dashboard.php b/e107_plugins/user/e_dashboard.php index 74aecaf93..b90900123 100644 --- a/e107_plugins/user/e_dashboard.php +++ b/e107_plugins/user/e_dashboard.php @@ -14,22 +14,263 @@ if (!defined('e107_INIT')) { exit; } class user_dashboard // plugin-folder + '_url' { - private $title; - + private $title; + + public $chartCaption = LAN_WEBSITE_STATUS; + function chart() { $config = array(); - + $tp = e107::getParser(); + $config[] = array( - - 'text' => $this->registered('thismonth'), - 'caption' => $this->title, + 0 => array( 'text' => $this->renderChart(), 'caption' => $tp->toGlyph('fa-signal').' '.LAN_STATS), + 1 => array('caption' =>$tp->toGlyph('fa-user').' '.LAN_ONLINE.' ('.$this->renderOnlineUsers('count').')', 'text'=>$this->renderOnlineUsers()), + + 2 => array( 'text' => $this->registered('user_new_thismonth'), 'caption' => $this->title), ); return $config; } + private function renderChart() + { + if (e107::isInstalled('log')) + { + return $this->renderStats('log'); + } + else + { + return $this->renderStats('demo'); + } + + } + + + private function getStats($type) + { + + if($type == 'demo') + { + $data = array(); + + $months = e107::getDate()->terms('month'); + + $data['labels'] = array($months[0], //"January", + $months[1], //"February", + $months[2], //"March", + $months[3], //"April", + $months[4], //"May", + $months[5], //"June", + $months[6] //"July" + ); + + $data['datasets'][] = array( + 'fillColor' => "rgba(220,220,220,0.5)", + 'strokeColor' => "rgba(220,220,220,1)", + 'pointColor ' => "rgba(220,220,220,1)", + 'pointStrokeColor' => "#fff", + 'data' => array(65,59,90,81,56,55,40), + 'title' => ADLAN_168// "Visits" + ); + + $data['datasets'][] = array( + 'fillColor' => "rgba(151,187,205,0.5)", + 'strokeColor' => "rgba(151,187,205,1)", + 'pointColor ' => "rgba(151,187,205,1)", + 'pointStrokeColor' => "#fff", + 'data' => array(28,48,40,19,96,27,100), + 'title' => ADLAN_169 //"Unique Visits" + ); + + return $data; + } + + + + $sql = e107::getDB(); + + $td = date("Y-m-j", time()); + $dayarray[$td] = array(); + $pagearray = array(); + + $qry = " + SELECT * from #logstats WHERE log_id REGEXP('[[:digit:]]+\-[[:digit:]]+\-[[:digit:]]+') + ORDER BY CONCAT(LEFT(log_id,4), SUBSTRING(log_id, 6, 2), LPAD(SUBSTRING(log_id, 9), 2, '0')) + DESC LIMIT 0,9 + "; + + if($amount = $sql->gen($qry)) + { + $array = $sql->db_getList(); + + $ttotal = 0; + $utotal = 0; + + foreach($array as $key => $value) + { + extract($value); + $log_id = substr($log_id, 0, 4).'-'.substr($log_id, 5, 2).'-'.str_pad(substr($log_id, 8), 2, '0', STR_PAD_LEFT); + if(is_array($log_data)) { + $entries[0] = $log_data['host']; + $entries[1] = $log_data['date']; + $entries[2] = $log_data['os']; + $entries[3] = $log_data['browser']; + $entries[4] = $log_data['screen']; + $entries[5] = $log_data['referer']; + } + else + { + $entries = explode(chr(1), $log_data); + } + + $dayarray[$log_id]['daytotal'] = $entries[0]; + $dayarray[$log_id]['dayunique'] = $entries[1]; + + unset($entries[0]); + unset($entries[1]); + + foreach($entries as $entry) + { + if($entry) + { + list($url, $total, $unique) = explode("|", $entry); + if(strstr($url, "/")) + { + $urlname = preg_replace("/\.php|\?.*/", "", substr($url, (strrpos($url, "/")+1))); + } + else + { + $urlname = preg_replace("/\.php|\?.*/", "", $url); + } + $dayarray[$log_id][$urlname] = array('url' => $url, 'total' => $total, 'unique' => $unique); + if (!isset($pagearray[$urlname]['total'])) $pagearray[$urlname]['total'] = 0; + if (!isset($pagearray[$urlname]['unique'])) $pagearray[$urlname]['unique'] = 0; + $pagearray[$urlname]['total'] += $total; + $pagearray[$urlname]['unique'] += $unique; + $ttotal += $total; + $utotal += $unique; + } + } + } + } + + $logfile = e_LOG.'logp_'.date('z.Y', time()).'.php'; // was logi_ ?? + if(is_readable($logfile)) + { + require($logfile); + } + + + + if(vartrue($pageInfo)) + { + foreach($pageInfo as $fkey => $fvalue) + { + $dayarray[$td][$fkey]['total'] += $fvalue['ttl']; + $dayarray[$td][$fkey]['unique'] += $fvalue['unq']; + $dayarray[$td]['daytotal'] += $fvalue['ttl']; + $dayarray[$td]['dayunique'] += $fvalue['unq']; + $pagearray[$fkey]['total'] += $fvalue['ttl']; + $pagearray[$fkey]['unique'] += $fvalue['unq']; + $ttotal += $fvalue['ttl']; + $utotal += $fvalue['unq']; + } + } + + + $visitors = array(); + $unique = array(); + + + ksort($dayarray); + foreach($dayarray as $k=>$v) + { + $unix = strtotime($k); + + $visitors[] = intval(vartrue($v['daytotal'])); + $unique[] = intval(vartrue($v['dayunique'])); + $label[] = "'".date("D",$unix)."'"; + } + + $data = array(); + + $data['labels'] = $label; + + //visitors + $data['datasets'][] = array( + 'fillColor' => "rgba(220,220,220,0.5)", + 'strokeColor' => "rgba(220,220,220,1)", + 'pointColor ' => "rgba(220,220,220,1)", + 'pointStrokeColor' => "#fff", + 'data' => $visitors + + ); + + + //Unique Visitors + $data['datasets'][] = array( + 'fillColor' => "rgba(151,187,205,0.5)", + 'strokeColor' => "rgba(151,187,205,1)", + 'pointColor ' => "rgba(151,187,205,1)", + 'pointStrokeColor' => "#fff", + 'data' => $unique + ); + + + + return $data; + + + } + + + private function renderStats($type) + { + + $data = $this->getStats($type); + + + $cht = e107::getChart(); + $cht->setType('line'); + $cht->setOptions(array( + 'annotateDisplay' => true, + 'annotateFontSize' => 8 + )); + $cht->setData($data,'canvas'); + $text = $cht->render('canvas'); + + + if($type == 'demo') + { + $text .= "
    ".ADLAN_170."".ADLAN_171."
    "; + } + else + { + $text .= "
    + ".ADLAN_168."   + ".ADLAN_169." +
    "; + } + + + return $text; + + } + + + + + + + + + + + + + /** * TODO Switch to line-filled graph and add unactivated users also. * @param string $when @@ -120,7 +361,7 @@ class user_dashboard // plugin-folder + '_url' $cht->setData($data); // redraw to fix sizing issue. - e107::js('footer-inline', " + /* e107::js('footer-inline', " $('a[data-toggle=\"tab\"]').on('shown.bs.tab', function (e) { @@ -129,14 +370,135 @@ class user_dashboard // plugin-folder + '_url' }) - "); + ");*/ return "
    ".$cht->render($id, $width, $height)."
    "; // return "
    ".$cht->render('projection', 320, 380)."
    "; - } + } + + + + function renderOnlineUsers($data=false) + { + + $ol = e107::getOnline(); + $tp = e107::getParser(); + $multilan = e107::getPref('multilanguage'); + + $panelOnline = " + + + + + + + + "; + + + $panelOnline .= (!empty($multilan)) ? "" : ""; + + + $panelOnline .= " + + + + + + + + + "; + + $panelOnline .= (!empty($multilan)) ? "" : ""; + + $panelOnline .= " + + + "; + + + + $online = $ol->userList() + $ol->guestList(); + + if($data == 'count') + { + return count($online); + } + + // echo "Users: ".print_a($online); + + $lng = e107::getLanguage(); + + foreach ($online as $val) + { + $panelOnline .= " + + + + + + "; + + $panelOnline .= (!empty($multilan)) ? "" : ""; + + + $panelOnline .= " + + "; + } + + + $panelOnline .= "
    ".LAN_TIMESTAMP."".LAN_USER."".LAN_IP."".LAN_PAGE."".LAN_AGENT."".LAN_LANG."
    ".e107::getDateConvert()->convert_date($val['user_currentvisit'],'%H:%M:%S')."".$this->renderOnlineName($val['online_user_id'])."".e107::getIPHandler()->ipDecode($val['user_ip'])."".$tp->html_truncate(basename($val['user_location']),50,"...")."".$this->browserIcon($val)."convert($val['user_language'])."\">".$val['user_language']."
    "; + + return $panelOnline; + } + + + function browserIcon($row) + { + + $types = array( + "ie" => "MSIE", + 'chrome' => 'Chrome', + 'firefox' => 'Firefox', + 'seamonkey' => 'Seamonkey', + // 'Chromium/xyz + 'safari' => "Safari", + 'opera' => "Opera" + ); + + + if($row['user_bot'] === true) + { + return ""; + } + + foreach($types as $icon=>$b) + { + if(strpos($row['user_agent'], $b)!==false) + { + return ""; + } + } + + return ""; // FIXME find a default icon. + } + + + private function renderOnlineName($val) + { + if($val==0) + { + return LAN_GUEST; + } + return $val; + } + + } \ No newline at end of file From c9fbf2ee4d69f1cc956fe07071fca93ccb8283c1 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 21 Apr 2017 16:45:54 -0700 Subject: [PATCH 25/57] Remove title from update popover. --- e107_core/shortcodes/batch/admin_shortcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 796768ac7..9c3805f55 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1838,7 +1838,7 @@ Inverse 10 10 { $template = $$tmpl; - return $template['start']. '
  • '.$tp->toGlyph('fa-database').'
  • ' .$template['end']; + return $template['start']. '
  • '.$tp->toGlyph('fa-database').'
  • ' .$template['end']; } From f96e0de826eb92b489d756dbaac43d607d370472 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 21 Apr 2017 17:09:03 -0700 Subject: [PATCH 26/57] Flexpanel equal-height row options. --- .../includes/layouts/flexpanel_default.php | 4 +- e107_themes/bootstrap3/admin_style.css | 42 +++++++++++++++++++ e107_web/js/core/admin.flexpanel.js | 7 +++- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/e107_admin/includes/layouts/flexpanel_default.php b/e107_admin/includes/layouts/flexpanel_default.php index fa4159ffb..46ba26a30 100644 --- a/e107_admin/includes/layouts/flexpanel_default.php +++ b/e107_admin/includes/layouts/flexpanel_default.php @@ -37,7 +37,7 @@ $FLEXPANEL_LAYOUT = ' -
    +
    -
    +