mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-15 20:49:41 +01:00
hello github! 😘
This commit is contained in:
BIN
plugins/kj_download_speed_limit/icon.png
Normal file
BIN
plugins/kj_download_speed_limit/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
55
plugins/kj_download_speed_limit/index.html
Executable file
55
plugins/kj_download_speed_limit/index.html
Executable file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256"/>
|
||||
<title>Powered by Kleeja</title>
|
||||
<style type="text/css">* {
|
||||
font-size: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
color: #CECFCE;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-size: 100%;
|
||||
color: #69788E;
|
||||
margin: 10px 30px;
|
||||
background: #F7F7F7;
|
||||
}
|
||||
|
||||
a:link, a:visited {
|
||||
text-decoration: none;
|
||||
color: #CECFCE;
|
||||
}
|
||||
|
||||
a:active, a:hover {
|
||||
text-decoration: underline;
|
||||
color: #111;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-family: "Trebuchet MS", Helvetica, sans-serif;
|
||||
font-size: 1.70em;
|
||||
font-weight: normal;
|
||||
color: #333333;
|
||||
margin-top: 0;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.content_box {
|
||||
border: 1px dashed #CECFCE;
|
||||
background: #FFFFFF;
|
||||
padding: 10px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}</style>
|
||||
</head>
|
||||
<body title="كليجا"><br/>
|
||||
<div class="content_box"><h1><span style="font-size:250%;color:#D80000;">403 - Access forbidden!</span></h1></div>
|
||||
<br/>
|
||||
<div class="content_box"><span style="font-size: 140%">Powered by <a target="_blank"
|
||||
href="http://www.kleeja.com">Kleeja</a></span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
127
plugins/kj_download_speed_limit/init.php
Normal file
127
plugins/kj_download_speed_limit/init.php
Normal file
@@ -0,0 +1,127 @@
|
||||
<?php
|
||||
# kleeja plugin
|
||||
#
|
||||
# version: 1.0
|
||||
# developer: kleeja team
|
||||
|
||||
# prevent illegal run
|
||||
if (!defined('IN_PLUGINS_SYSTEM')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
# plugin basic information
|
||||
$kleeja_plugin['kj_download_speed_limit']['information'] = array(
|
||||
# the casual name of this plugin, anything can a human being understands
|
||||
'plugin_title' => array(
|
||||
'en' => 'KJ Download Speed Limit',
|
||||
'ar' => 'تحديد سرعة التحميل'
|
||||
),
|
||||
# who wrote this plugin?
|
||||
'plugin_developer' => 'kleeja.com',
|
||||
# this plugin version
|
||||
'plugin_version' => '1.1',
|
||||
# explain what is this plugin, why should i use it?
|
||||
'plugin_description' => array(
|
||||
'en' => 'Limit files download speed for each group',
|
||||
'ar' => 'تحديد سرعة تحميل الملفات لكل مجموعة'
|
||||
),
|
||||
|
||||
# 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',
|
||||
# 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_download_speed_limit']['first_run']['ar'] = "
|
||||
تجد خيار تحديد سرعة التحميل في إعدادات كل مجموعة <br><br>
|
||||
شكراً لاستخدامك الإضافة، قم بمراسلتنا بالأخطاء عند ظهورها على البريد: <br>
|
||||
info@kleeja.com
|
||||
";
|
||||
|
||||
$kleeja_plugin['kj_download_speed_limit']['first_run']['en'] = "
|
||||
You will find the ability to change speed limit in each group settings.<Br><br>
|
||||
Thank you for using our plugin, if you encounter any bugs and errors, contact us: <br>
|
||||
info@kleeja.com
|
||||
";
|
||||
|
||||
# plugin installation function
|
||||
$kleeja_plugin['kj_download_speed_limit']['install'] = function ($plg_id) {
|
||||
//new options
|
||||
$options = array(
|
||||
'kj_download_speed_limit_number' =>
|
||||
array(
|
||||
'value' => '30',
|
||||
'html' => configField('kj_download_speed_limit_number'),
|
||||
'plg_id' => $plg_id,
|
||||
'type' => 'groups',
|
||||
'order' => '1',
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
add_config_r($options);
|
||||
|
||||
|
||||
//new language variables
|
||||
add_olang(array(
|
||||
'KJ_DOWNLOAD_SPEED_LIMIT_NUMBER' => 'سرعة التحميل (كيلوبايت/ثانية)'
|
||||
),
|
||||
'ar',
|
||||
$plg_id);
|
||||
|
||||
add_olang(array(
|
||||
'KJ_DOWNLOAD_SPEED_LIMIT_NUMBER' => 'Download Speed (KB/Second)',
|
||||
),
|
||||
'en',
|
||||
$plg_id);
|
||||
};
|
||||
|
||||
|
||||
//plugin update function, called if plugin is already installed but version is different than current
|
||||
$kleeja_plugin['kj_download_speed_limit']['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
|
||||
// }
|
||||
|
||||
//you could use update_config, update_olang
|
||||
};
|
||||
|
||||
|
||||
# plugin uninstalling, function to be called at uninstalling
|
||||
$kleeja_plugin['kj_download_speed_limit']['uninstall'] = function ($plg_id) {
|
||||
//delete options
|
||||
delete_config(array(
|
||||
'kj_download_speed_limit_number',
|
||||
));
|
||||
|
||||
|
||||
delete_olang(null, null, $plg_id);
|
||||
};
|
||||
|
||||
|
||||
# plugin functions
|
||||
$kleeja_plugin['kj_download_speed_limit']['functions'] = array(
|
||||
'down_go_page' => function ($args) {
|
||||
global $config;
|
||||
|
||||
$givenSize = floatval(trim($config['kj_download_speed_limit_number']));
|
||||
|
||||
if($givenSize === 0){
|
||||
return;
|
||||
}
|
||||
|
||||
define('TrottleLimit', true);
|
||||
|
||||
$chunksize = round($givenSize * 1024);
|
||||
|
||||
return compact('chunksize');
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user