diff --git a/do.php b/do.php index e92e36e..5f2ee24 100755 --- a/do.php +++ b/do.php @@ -535,7 +535,7 @@ else if (ig('down') || ig('downf') || if(defined('TrottleLimit')) { - sleep(1); + usleep(1000000 * 0.3); } } @@ -555,8 +555,14 @@ else if (ig('down') || ig('downf') || // else { + $error = true; + is_array($plugin_run_result = Plugins::getInstance()->run('err_navig_download_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook - kleeja_err($lang['ERROR_NAVIGATATION']); + + if($error) + { + kleeja_err($lang['ERROR_NAVIGATATION']); + } } is_array($plugin_run_result = Plugins::getInstance()->run('end_download_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook diff --git a/includes/functions_display.php b/includes/functions_display.php index 93c9bec..7875eaf 100755 --- a/includes/functions_display.php +++ b/includes/functions_display.php @@ -944,8 +944,8 @@ function configField($name, $type = 'text', $select_options = array()) case 'select': $return_value = '' . "\n"; } diff --git a/plugins/advanced_extras/init.php b/plugins/advanced_extras/init.php index 93a2522..df06955 100644 --- a/plugins/advanced_extras/init.php +++ b/plugins/advanced_extras/init.php @@ -32,7 +32,7 @@ $kleeja_plugin['advanced_extras']['information'] = array( # Min version of Kleeja that's requiered to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); @@ -97,20 +97,20 @@ $kleeja_plugin['advanced_extras']['uninstall'] = function ($plg_id) { foreach (array('ar', 'en') as $language) { delete_olang(null, $language, $plg_id); } - - global $SQL , $dbprefix; - $update_query = array( - 'UPDATE' => "{$dbprefix}stats", - 'SET' => "ex_footer = '' , ex_header = '' " - ); - $SQL->build($update_query); + global $SQL , $dbprefix; + $update_query = array( + 'UPDATE' => "{$dbprefix}stats", + 'SET' => "ex_footer = '' , ex_header = '' " + ); - if($SQL->affected()) - { - //delete cache .. - delete_cache('data_extra'); - } + $SQL->build($update_query); + + if($SQL->affected()) + { + //delete cache .. + delete_cache('data_extra'); + } }; diff --git a/plugins/kj_amp_seo/init.php b/plugins/kj_amp_seo/init.php index aa24350..e35b48a 100644 --- a/plugins/kj_amp_seo/init.php +++ b/plugins/kj_amp_seo/init.php @@ -28,7 +28,7 @@ $kleeja_plugin['kj_amp_seo']['information'] = array( # min version of kleeja that's required to run this plugin 'plugin_kleeja_version_min' => '2.0', # max version of kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); @@ -156,7 +156,10 @@ $kleeja_plugin['kj_amp_seo']['uninstall'] = function ($plg_id) { )); - delete_olang(null, null, $plg_id); + //delete language variables + foreach (['ar', 'en'] as $language) { + delete_olang(null, $language, $plg_id); + } }; @@ -230,7 +233,9 @@ $kleeja_plugin['kj_amp_seo']['functions'] = array( header('x-frame-options: SAMEORIGIN'); header('x-xss-protection: 1; mode=block'); - exit($tpl->display('amp', __DIR__)); + echo $tpl->display('amp', __DIR__); + + return ['show' => false]; } ); diff --git a/plugins/kj_ban_admin/init.php b/plugins/kj_ban_admin/init.php index 9111c84..b2c0a26 100644 --- a/plugins/kj_ban_admin/init.php +++ b/plugins/kj_ban_admin/init.php @@ -30,7 +30,7 @@ $kleeja_plugin['kj_ban_admin']['information'] = array( # Min version of Kleeja that's required to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); diff --git a/plugins/kj_download_speed_limit/init.php b/plugins/kj_download_speed_limit/init.php index 4f61e0d..3b76f4b 100644 --- a/plugins/kj_download_speed_limit/init.php +++ b/plugins/kj_download_speed_limit/init.php @@ -29,7 +29,7 @@ $kleeja_plugin['kj_download_speed_limit']['information'] = array( # min version of kleeja that's required to run this plugin 'plugin_kleeja_version_min' => '2.3', # max version of kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); @@ -102,7 +102,10 @@ $kleeja_plugin['kj_download_speed_limit']['uninstall'] = function ($plg_id) { )); - delete_olang(null, null, $plg_id); + //delete language variables + foreach (['ar', 'en'] as $language) { + delete_olang(null, $language, $plg_id); + } }; diff --git a/plugins/kj_ftp/init.php b/plugins/kj_ftp/init.php index 5855180..a11951e 100644 --- a/plugins/kj_ftp/init.php +++ b/plugins/kj_ftp/init.php @@ -35,7 +35,7 @@ $kleeja_plugin['kj_ftp']['information'] = array( # min version of kleeja that's required to run this plugin 'plugin_kleeja_version_min' => '2.0', # max version of kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); @@ -172,9 +172,10 @@ $kleeja_plugin['kj_ftp']['uninstall'] = function ($plg_id) { // 'kj_ftp_home_meta_keywords' // )); - - delete_olang(null, null, $plg_id); - + //delete language variables + foreach (['ar', 'en'] as $language) { + delete_olang(null, $language, $plg_id); + } }; diff --git a/plugins/kj_meta_seo/init.php b/plugins/kj_meta_seo/init.php index bc2a1ba..4b9a32e 100644 --- a/plugins/kj_meta_seo/init.php +++ b/plugins/kj_meta_seo/init.php @@ -29,7 +29,7 @@ $kleeja_plugin['kj_meta_seo']['information'] = array( # min version of kleeja that's required to run this plugin 'plugin_kleeja_version_min' => '2.0', # max version of kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); @@ -171,7 +171,10 @@ $kleeja_plugin['kj_meta_seo']['uninstall'] = function ($plg_id) { )); - delete_olang(null, null, $plg_id); + //delete language variables + foreach (['ar', 'en'] as $language) { + delete_olang(null, $language, $plg_id); + } }; diff --git a/plugins/kj_recaptcha/init.php b/plugins/kj_recaptcha/init.php index ff4fd1b..7453a51 100644 --- a/plugins/kj_recaptcha/init.php +++ b/plugins/kj_recaptcha/init.php @@ -30,7 +30,7 @@ $kleeja_plugin['kj_recaptcha']['information'] = array( # min version of kleeja that's required to run this plugin 'plugin_kleeja_version_min' => '2.0', # max version of kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); diff --git a/plugins/kj_x_sendfile/icon.png b/plugins/kj_x_sendfile/icon.png new file mode 100644 index 0000000..98fdedd Binary files /dev/null and b/plugins/kj_x_sendfile/icon.png differ diff --git a/plugins/kj_x_sendfile/index.html b/plugins/kj_x_sendfile/index.html new file mode 100755 index 0000000..19b7061 --- /dev/null +++ b/plugins/kj_x_sendfile/index.html @@ -0,0 +1,63 @@ + + + + + + Powered by Kleeja + + + +
+
+

403 - Access forbidden!

+
+
+
Powered by Kleeja +
+ + + \ No newline at end of file diff --git a/plugins/kj_x_sendfile/init.php b/plugins/kj_x_sendfile/init.php new file mode 100644 index 0000000..3231418 --- /dev/null +++ b/plugins/kj_x_sendfile/init.php @@ -0,0 +1,160 @@ + array( + 'en' => 'Kleeja X SendFile', + 'ar' => 'كليجا إكس سيند فايل' + ), + # Who wrote this plugin? + 'plugin_developer' => 'Kleeja.com', + # This plugin version + 'plugin_version' => '1.0', + # Explain what is this plugin, why should I use it? + 'plugin_description' => array( + 'en' => 'Enable x-sendfile or X-Accel-Redirect for both Apache or Nginx for better performance.', + 'ar' => 'كليجا إكس سيند فايل' + ), + # Min version of Kleeja that's requiered to run this plugin + 'plugin_kleeja_version_min' => '3.0', + # Max version of Kleeja that support this plugin, use 0 for unlimited + 'plugin_kleeja_version_max' => '3.9', + # Should this plugin run before others?, 0 is normal, and higher number has high priority + 'plugin_priority' => 0 +); + +//after installation message, you can remove it, it's not requiered +$kleeja_plugin['kj_x_sendfile']['first_run']['en'] = " +Thanks for using our klj_x_sendfile plugin. +\n To report bugs reach us on: \nhttps://github.com/awssat/kleeja/issues +\n\n +You can find configurations on settings->kleeja x sendfile. + +\n\n +This plugin require that xsendfile is enabled on either Apache or Nginx:\n +- Apache: https://tn123.org/mod_xsendfile/ \n +- Nginx: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/ + +\n\n +Do NOT use this plugin if you are not certain of your server configuration. +"; +$kleeja_plugin['kj_x_sendfile']['first_run']['ar'] = " +شكراً لإستخدام إضافة كليجا إكس سيند فايل. للإبلاغ عن الأخطاء : \n +https://github.com/awssat/kleeja/issues +\n\n +You can find configurations on settings->kleeja x sendfile. + +\n\n +لاحظ أن هذه الإضافة تتطلب وجود sendfile مفعل على إما خادم انجين اكس او اباتشي:\n +- Apache: https://tn123.org/mod_xsendfile/ \n +- Nginx: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/ + +\n\n +لا تستخدم هذه الإضافة إذا كنت غير متأكد من إعدادات خادمك وتوفر المتطلبات. +"; + +# Plugin Installation function +$kleeja_plugin['kj_x_sendfile']['install'] = function($plg_id) +{ + //new options + $options = array( + 'kj_x_sendfile_enable' => + array( + 'value'=> '0', + 'html' => configField('kj_x_sendfile_enable', 'yesno'), + 'plg_id' => $plg_id, + 'type' => 'kj_x_sendfile', + ), + 'kj_x_sendfile_type' => + array( + 'value'=> 'apache', + 'html' => configField('kj_x_sendfile_type', 'select', ['Apache' => 'apache', 'Nginx' => 'nginx']), + 'plg_id' => $plg_id, + 'type' => 'kj_x_sendfile', + ), + ); + + add_config_r($options); + + //new language variables + add_olang(array( + 'KJ_X_SENDFILE_ENABLE' => 'تفعيل هيدر x-Sendfile/X-Accel-Redirect', + 'KJ_X_SENDFILE_TYPE' => 'نوع الخادم', + 'CONFIG_KLJ_MENUS_KJ_X_SENDFILE' => 'كليجا إكس سيند فايل', + ), + 'ar', + $plg_id); + + add_olang(array( + 'KJ_X_SENDFILE_ENABLE' => 'Enable x-Sendfile/X-Accel-Redirect', + 'KJ_X_SENDFILE_TYPE' => 'Current Server for your hosting', + 'CONFIG_KLJ_MENUS_KJ_X_SENDFILE' => 'Kleeja X Sendfile', + ), + 'en', + $plg_id); +}; + + +//Plugin update function, called if plugin is already installed but version is different than current +$kleeja_plugin['kj_x_sendfile']['update'] = function($old_version, $new_version) +{ + // if(version_compare($old_version, '0.5', '<')){ + // //... update to 0.5 + // } + // + // if(version_compare($old_version, '0.6', '<')){ + // //... update to 0.6 + // } +}; + + +# Plugin Uninstallation, function to be called at unistalling +$kleeja_plugin['kj_x_sendfile']['uninstall'] = function($plg_id) +{ + //delete options + delete_config(array( + 'kj_x_sendfile_enable', + 'kj_x_sendfile_type' + )); + + //delete language variables + foreach (['ar', 'en'] as $language) { + delete_olang(null, $language, $plg_id); + } +}; + + + +# Plugin functions +$kleeja_plugin['kj_x_sendfile']['functions'] = array( + + 'do_page_before_headers_set' => function($args){ + global $config; + + if($config['kj_x_sendfile_enable'] == 0) + return; + + if($config['kj_x_sendfile_type'] == 'apache') + header('X-Sendfile: ' . $args['path_file']); + else + header('X-Accel-Redirect: ' . ltrim($args['path_file'], '.')); + } +); diff --git a/plugins/klj_adfly/init.php b/plugins/klj_adfly/init.php index 47a5443..e78cea1 100644 --- a/plugins/klj_adfly/init.php +++ b/plugins/klj_adfly/init.php @@ -29,15 +29,15 @@ $kleeja_plugin['klj_adfly']['information'] = array( # Min version of Kleeja that's requiered to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); //after installation message, you can remove it, it's not requiered $kleeja_plugin['klj_adfly']['first_run']['ar'] = " -شكراً لاستخدامك إضافة adf.ly ، قم بمراسلتنا بالأخطاء عند ظهورها على البريد:
-info@kleeja.com +شكراً لاستخدامك إضافة adf.ly ، قم بإعلامنا بالأخطاء عند ظهورها على:
+https://github.com/awssat/kleeja/issues

لاحظ:

@@ -50,9 +50,9 @@ info@kleeja.com "; $kleeja_plugin['klj_adfly']['first_run']['en'] = " -Thanks for using adf.ly plugin, to report bugs contact us: +Thanks for using adf.ly plugin, to report bugs:
-info@kleeja.com +https://github.com/awssat/kleeja/issues

Note:

diff --git a/plugins/language_switch/init.php b/plugins/language_switch/init.php index a5bde22..887a470 100644 --- a/plugins/language_switch/init.php +++ b/plugins/language_switch/init.php @@ -29,7 +29,7 @@ $kleeja_plugin['language_switch']['information'] = array( # Min version of Kleeja that's requiered to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); diff --git a/plugins/pdf_viewer/init.php b/plugins/pdf_viewer/init.php index 4318caa..d2bc629 100644 --- a/plugins/pdf_viewer/init.php +++ b/plugins/pdf_viewer/init.php @@ -29,7 +29,7 @@ $kleeja_plugin['pdf_viewer']['information'] = array( # Min version of Kleeja that's requiered to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 10 ); diff --git a/plugins/rebrandly/init.php b/plugins/rebrandly/init.php index b39430b..f439aaa 100644 --- a/plugins/rebrandly/init.php +++ b/plugins/rebrandly/init.php @@ -29,7 +29,7 @@ $kleeja_plugin['rebrandly']['information'] = array( # Min version of Kleeja that's requiered to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); diff --git a/plugins/traidnt_arbah/init.php b/plugins/traidnt_arbah/init.php index c3f6c55..4319129 100644 --- a/plugins/traidnt_arbah/init.php +++ b/plugins/traidnt_arbah/init.php @@ -29,7 +29,7 @@ $kleeja_plugin['traidnt_arbah']['information'] = array( # Min version of Kleeja that's requiered to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 0 ); diff --git a/plugins/video_player/init.php b/plugins/video_player/init.php index 6a88e5d..bf8b797 100644 --- a/plugins/video_player/init.php +++ b/plugins/video_player/init.php @@ -29,7 +29,7 @@ $kleeja_plugin['video_player']['information'] = array( # Min version of Kleeja that's requiered to run this plugin 'plugin_kleeja_version_min' => '2.0', # Max version of Kleeja that support this plugin, use 0 for unlimited - 'plugin_kleeja_version_max' => '3.0', + 'plugin_kleeja_version_max' => '3.9', # Should this plugin run before others?, 0 is normal, and higher number has high priority 'plugin_priority' => 10 );