mirror of
https://github.com/kleeja-official/kleeja.git
synced 2025-12-16 04:59:42 +01:00
coding style fixes
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,3 +27,4 @@ Project_Default.xml
|
||||
.project
|
||||
.vscode/launch.json
|
||||
.htaccess
|
||||
.php_cs.cache
|
||||
|
||||
420
admin/index.php
420
admin/index.php
@@ -12,160 +12,166 @@
|
||||
* @ignore
|
||||
*/
|
||||
define('IN_KLEEJA', true);
|
||||
define ('PATH' , '../');
|
||||
define ('IN_ADMIN' , true);
|
||||
define ('PATH', '../');
|
||||
define ('IN_ADMIN', true);
|
||||
require_once PATH . 'includes/common.php';
|
||||
|
||||
|
||||
|
||||
$go_to = ig('cp') ? g('cp') : 'start';
|
||||
$username = $usrcp->name();
|
||||
$AJAX_ACP = defined('AJAX_ACP');
|
||||
$go_to = ig('cp') ? g('cp') : 'start';
|
||||
$username = $usrcp->name();
|
||||
$AJAX_ACP = defined('AJAX_ACP');
|
||||
$config['enable_captcha'] = ! defined('STOP_CAPTCHA');
|
||||
|
||||
|
||||
#for security
|
||||
if (!$username)
|
||||
//for security
|
||||
if (! $username)
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('user_not_admin_admin_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
redirect(PATH . 'ucp.php?go=login&return=' . urlencode(ADMIN_PATH . '?cp=' . $go_to));
|
||||
redirect(PATH . 'ucp.php?go=login&return=' . urlencode(ADMIN_PATH . '?cp=' . $go_to));
|
||||
}
|
||||
|
||||
#get language of admin
|
||||
//get language of admin
|
||||
get_lang('acp');
|
||||
|
||||
//
|
||||
//need to login again
|
||||
//
|
||||
if(
|
||||
(empty($_SESSION['ADMINLOGIN']) || $_SESSION['ADMINLOGIN'] != md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl'])) ||
|
||||
(empty($_SESSION['USER_SESS']) || $_SESSION['USER_SESS'] != session_id()) ||
|
||||
(empty($_SESSION['ADMINLOGIN_T']) || $_SESSION['ADMINLOGIN_T'] < time())
|
||||
)
|
||||
{
|
||||
if(ig('go') && g('go') == 'login')
|
||||
{
|
||||
if (ip('submit'))
|
||||
{
|
||||
//login
|
||||
$ERRORS = array();
|
||||
$pass_field = 'lpass_' . preg_replace('/[^0-9]/', '', sha1($klj_session . sha1($config['h_key']) . p('kid')));
|
||||
if (
|
||||
(empty($_SESSION['ADMINLOGIN']) || $_SESSION['ADMINLOGIN'] != md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl'])) ||
|
||||
(empty($_SESSION['USER_SESS']) || $_SESSION['USER_SESS'] != session_id()) ||
|
||||
(empty($_SESSION['ADMINLOGIN_T']) || $_SESSION['ADMINLOGIN_T'] < time())
|
||||
) {
|
||||
if (ig('go') && g('go') == 'login')
|
||||
{
|
||||
if (ip('submit'))
|
||||
{
|
||||
//login
|
||||
$ERRORS = [];
|
||||
$pass_field = 'lpass_' . preg_replace('/[^0-9]/', '', sha1($klj_session . sha1($config['h_key']) . p('kid')));
|
||||
|
||||
|
||||
if(!empty($_SESSION['SHOW_CAPTCHA']))
|
||||
if (! empty($_SESSION['SHOW_CAPTCHA']))
|
||||
{
|
||||
if(!kleeja_check_captcha())
|
||||
if (! kleeja_check_captcha())
|
||||
{
|
||||
$ERRORS[] = $lang['WRONG_VERTY_CODE'];
|
||||
}
|
||||
}
|
||||
|
||||
if (empty(p('lname')) || empty(p($pass_field)))
|
||||
{
|
||||
$ERRORS[] = $lang['EMPTY_FIELDS'];
|
||||
}
|
||||
elseif(!user_can('enter_acp'))
|
||||
{
|
||||
$ERRORS[] = $lang['U_NOT_ADMIN'];
|
||||
}
|
||||
elseif(!kleeja_check_form_key('admin_login'))
|
||||
{
|
||||
$ERRORS[] = $lang['INVALID_FORM_KEY'];
|
||||
}
|
||||
{
|
||||
$ERRORS[] = $lang['EMPTY_FIELDS'];
|
||||
}
|
||||
elseif (! user_can('enter_acp'))
|
||||
{
|
||||
$ERRORS[] = $lang['U_NOT_ADMIN'];
|
||||
}
|
||||
elseif (! kleeja_check_form_key('admin_login'))
|
||||
{
|
||||
$ERRORS[] = $lang['INVALID_FORM_KEY'];
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('admin_login_submit', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
if(empty($ERRORS))
|
||||
{
|
||||
if($f = $usrcp->data(p('lname'), p($pass_field), false, 3600*6, true))
|
||||
{
|
||||
$_SESSION['USER_SESS'] = session_id();
|
||||
$_SESSION['ADMINLOGIN'] = md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl']);
|
||||
//to make sure, sometime setting time from functions doesn't work
|
||||
if (empty($ERRORS))
|
||||
{
|
||||
if ($f = $usrcp->data(p('lname'), p($pass_field), false, 3600*6, true))
|
||||
{
|
||||
$_SESSION['USER_SESS'] = session_id();
|
||||
$_SESSION['ADMINLOGIN'] = md5(sha1($config['h_key']) . $usrcp->name() . $config['siteurl']);
|
||||
//to make sure, sometime setting time from functions doesn't work
|
||||
$_SESSION['ADMINLOGIN_T'] = time() + 18000;
|
||||
unset($_SESSION['SHOW_CAPTCHA']);
|
||||
|
||||
redirect('./' . basename(ADMIN_PATH) . '?cp=' . $go_to);
|
||||
$SQL->close();
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Wrong entries
|
||||
$ERRORS[] = $lang['LOGIN_ERROR'];
|
||||
redirect('./' . basename(ADMIN_PATH) . '?cp=' . $go_to);
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Wrong entries
|
||||
$ERRORS[] = $lang['LOGIN_ERROR'];
|
||||
$_SESSION['SHOW_CAPTCHA'] = function_exists('gd_info') && ! defined('STOP_CAPTCHA');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//let's see if there is errors
|
||||
if(sizeof($ERRORS))
|
||||
{
|
||||
$errs = '';
|
||||
foreach($ERRORS as $r)
|
||||
{
|
||||
$errs .= '- ' . $r . '. <br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//let's see if there is errors
|
||||
if (sizeof($ERRORS))
|
||||
{
|
||||
$errs = '';
|
||||
|
||||
//show template login .
|
||||
$action = './' . basename(ADMIN_PATH) . '?go=login&cp=' . $go_to;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('admin_login');
|
||||
$KEY_FOR_WEE = sha1(microtime() . sha1($config['h_key']));
|
||||
$KEY_FOR_PASS = preg_replace('/[^0-9]/', '', sha1($klj_session . sha1($config['h_key']) . $KEY_FOR_WEE));
|
||||
$not_you = sprintf($lang['USERNAME_NOT_YOU'], '<a href="' .$config['siteurl'] . 'ucp.php?go=logout">', '</a>');
|
||||
foreach ($ERRORS as $r)
|
||||
{
|
||||
$errs .= '- ' . $r . '. <br />';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$show_captcha = !empty($_SESSION['SHOW_CAPTCHA']);
|
||||
//show template login .
|
||||
$action = './' . basename(ADMIN_PATH) . '?go=login&cp=' . $go_to;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('admin_login');
|
||||
$KEY_FOR_WEE = sha1(microtime() . sha1($config['h_key']));
|
||||
$KEY_FOR_PASS = preg_replace('/[^0-9]/', '', sha1($klj_session . sha1($config['h_key']) . $KEY_FOR_WEE));
|
||||
$not_you = sprintf($lang['USERNAME_NOT_YOU'], '<a href="' . $config['siteurl'] . 'ucp.php?go=logout">', '</a>');
|
||||
|
||||
$show_captcha = ! empty($_SESSION['SHOW_CAPTCHA']);
|
||||
|
||||
$extra_header_admin_login = '';
|
||||
$err = false;
|
||||
if(!empty($errs))
|
||||
{
|
||||
$err = true;
|
||||
}
|
||||
$err = false;
|
||||
|
||||
if (! empty($errs))
|
||||
{
|
||||
$err = true;
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('before_display_template_admin_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
if (ig('_ajax_') || ig('check_msgs'))
|
||||
{
|
||||
echo_ajax(401, $lang['HV_NOT_PRVLG_ACCESS']);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $tpl->display('admin_login');
|
||||
}
|
||||
header('HTTP/1.0 401 Unauthorized');
|
||||
|
||||
$SQL->close();
|
||||
exit;
|
||||
}#end login
|
||||
if (ig('_ajax_') || ig('check_msgs'))
|
||||
{
|
||||
echo_ajax(401, $lang['HV_NOT_PRVLG_ACCESS']);
|
||||
}
|
||||
else
|
||||
{
|
||||
echo $tpl->display('admin_login');
|
||||
}
|
||||
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
}//end login
|
||||
|
||||
|
||||
|
||||
//ummm let's say it's illegal action
|
||||
if ($_SERVER['REQUEST_METHOD'] == 'POST' && defined('STOP_CSRF'))
|
||||
{
|
||||
$t_reff = explode('/', $_SERVER['HTTP_REFERER']);
|
||||
$t_host = explode('/', $_SERVER['HTTP_HOST']);
|
||||
if ($t_reff[2] != $t_host[0])
|
||||
{
|
||||
$usrcp->logout_cp();
|
||||
$t_reff = explode('/', $_SERVER['HTTP_REFERER']);
|
||||
$t_host = explode('/', $_SERVER['HTTP_HOST']);
|
||||
|
||||
redirect($config['siteurl']);
|
||||
$SQL->close();
|
||||
exit;
|
||||
}
|
||||
if ($t_reff[2] != $t_host[0])
|
||||
{
|
||||
$usrcp->logout_cp();
|
||||
|
||||
redirect($config['siteurl']);
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//current admin theme color
|
||||
if(ig('change_theme'))
|
||||
if (ig('change_theme'))
|
||||
{
|
||||
$admin_theme_color = g('change_theme', 'str', 'dark');
|
||||
|
||||
if(in_array($admin_theme_color, array('dark', 'light')))
|
||||
if (in_array($admin_theme_color, ['dark', 'light']))
|
||||
{
|
||||
$usrcp->kleeja_set_cookie('klj_adm_theme_color', $admin_theme_color, time() + 31536000);
|
||||
}
|
||||
@@ -176,14 +182,14 @@ if(ig('change_theme'))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!($admin_theme_color = $usrcp->kleeja_get_cookie('klj_adm_theme_color')))
|
||||
if (! ($admin_theme_color = $usrcp->kleeja_get_cookie('klj_adm_theme_color')))
|
||||
{
|
||||
$admin_theme_color = 'dark';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
(!defined('LAST_VISIT')) ? define('LAST_VISIT', time() - 3600 * 12) : null;
|
||||
(! defined('LAST_VISIT')) ? define('LAST_VISIT', time() - 3600 * 12) : null;
|
||||
//last visit
|
||||
$last_visit = defined('LAST_VISIT') && preg_match('/[0-9]{10}/', LAST_VISIT) ? kleeja_date(LAST_VISIT) : false;
|
||||
|
||||
@@ -191,39 +197,39 @@ $last_visit = defined('LAST_VISIT') && preg_match('/[0-9]{10}/', LAST_VISIT) ?
|
||||
//exceptional
|
||||
//it won't be included in the menu list
|
||||
//
|
||||
$ext_expt = array(
|
||||
$ext_expt = [
|
||||
'start',
|
||||
'b_lgoutcp',
|
||||
'i_exts'
|
||||
);
|
||||
];
|
||||
|
||||
//confirm message
|
||||
$ext_confirm = array();
|
||||
$ext_confirm = [];
|
||||
|
||||
|
||||
//formkey extension, CSRF protection
|
||||
$GET_FORM_KEY_GLOBAL = kleeja_add_form_key_get('GLOBAL_FORM_KEY');
|
||||
$ext_formkey = array();
|
||||
$ext_formkey = [];
|
||||
|
||||
|
||||
//default icons
|
||||
$ext_icons = array(
|
||||
'configs' => 'sliders',
|
||||
'files' => 'folder-open-o',
|
||||
'img_ctrl' => 'image',
|
||||
'calls' => 'envelope',
|
||||
'reports' => 'bell',
|
||||
'users' => 'user-o',
|
||||
'search' => 'search',
|
||||
'plugins' => 'plug',
|
||||
'ban' => 'minus-circle',
|
||||
'rules' => 'institution',
|
||||
'styles' => 'paint-brush',
|
||||
'extra' => 'window-restore',
|
||||
$ext_icons = [
|
||||
'configs' => 'sliders',
|
||||
'files' => 'folder-open-o',
|
||||
'img_ctrl' => 'image',
|
||||
'calls' => 'envelope',
|
||||
'reports' => 'bell',
|
||||
'users' => 'user-o',
|
||||
'search' => 'search',
|
||||
'plugins' => 'plug',
|
||||
'ban' => 'minus-circle',
|
||||
'rules' => 'institution',
|
||||
'styles' => 'paint-brush',
|
||||
'extra' => 'window-restore',
|
||||
'check_update' => 'download',
|
||||
'repair' => 'wrench',
|
||||
'repair' => 'wrench',
|
||||
|
||||
);
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -233,29 +239,29 @@ $ext_icons = array(
|
||||
$SHOW_LIST = true;
|
||||
|
||||
//get adm extensions
|
||||
$adm_extensions = array();
|
||||
$adm_extensions = [];
|
||||
|
||||
if (($dh = @opendir(ADM_FILES_PATH)) !== false)
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if(strpos($file, '.php') !== false)
|
||||
{
|
||||
$adm_extensions[] = str_replace('.php', '', $file);
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if (strpos($file, '.php') !== false)
|
||||
{
|
||||
$adm_extensions[] = str_replace('.php', '', $file);
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
|
||||
//no extensions ?
|
||||
if(!$adm_extensions || !is_array($adm_extensions))
|
||||
if (! $adm_extensions || ! is_array($adm_extensions))
|
||||
{
|
||||
if(ig('_ajax_'))
|
||||
{
|
||||
echo_ajax(888, 'Error while loading admin extensions!.');
|
||||
}
|
||||
if (ig('_ajax_'))
|
||||
{
|
||||
echo_ajax(888, 'Error while loading admin extensions!.');
|
||||
}
|
||||
|
||||
big_error('No Extensions', 'Error while loading admin extensions !');
|
||||
big_error('No Extensions', 'Error while loading admin extensions !');
|
||||
}
|
||||
|
||||
|
||||
@@ -268,54 +274,55 @@ is_array($plugin_run_result = Plugins::getInstance()->run('begin_admin_page', ge
|
||||
* 'configs' word listed as dangrous requested word
|
||||
* so we replaced this word with 'options' instead.
|
||||
*/
|
||||
if($go_to == 'options')
|
||||
if ($go_to == 'options')
|
||||
{
|
||||
$go_to = 'a_configs';
|
||||
$go_to = 'a_configs';
|
||||
}
|
||||
|
||||
//no request or wrong !
|
||||
if(!$go_to || empty($go_to) || !in_array($go_to, $adm_extensions))
|
||||
if (! $go_to || empty($go_to) || ! in_array($go_to, $adm_extensions))
|
||||
{
|
||||
$go_to = 'start';
|
||||
$go_to = 'start';
|
||||
}
|
||||
|
||||
//make array for menu
|
||||
$adm_extensions_menu = $adm_topmenu = array();
|
||||
$adm_extensions_menu = $adm_topmenu = [];
|
||||
|
||||
|
||||
//sort the items as alphabetic !
|
||||
sort($adm_extensions);
|
||||
$i = 0;
|
||||
$i = 0;
|
||||
$cr_time = LAST_VISIT > 0 ? LAST_VISIT : time() - 3600*12;
|
||||
|
||||
|
||||
// check calls and reports numbers
|
||||
if(ig('check_msgs') || !ig('_ajax_')):
|
||||
if (ig('check_msgs') || ! ig('_ajax_')):
|
||||
|
||||
//small bubble system
|
||||
//any item can show what is inside it as unread messages
|
||||
$kbubbles = array();
|
||||
$kbubbles = [];
|
||||
|
||||
//for calls and reports
|
||||
foreach(array('call'=>'calls', 'reports'=>'reports') as $table=>$n)
|
||||
foreach (['call'=>'calls', 'reports'=>'reports'] as $table=>$n)
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 'COUNT(' . $table[0] . '.id) AS total_rows',
|
||||
'FROM' => "`{$dbprefix}" . $table . "` " . $table[0]
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'COUNT(' . $table[0] . '.id) AS total_rows',
|
||||
'FROM' => "`{$dbprefix}" . $table . '` ' . $table[0]
|
||||
];
|
||||
|
||||
$fetched = $SQL->fetch_array($SQL->build($query));
|
||||
$fetched = $SQL->fetch_array($SQL->build($query));
|
||||
|
||||
$kbubbles[$n] = $fetched['total_rows'];
|
||||
$kbubbles[$n] = $fetched['total_rows'];
|
||||
|
||||
$SQL->freeresult();
|
||||
$SQL->freeresult();
|
||||
}
|
||||
|
||||
#if ajax, echo differntly
|
||||
if(ig('check_msgs'))
|
||||
//if ajax, echo differntly
|
||||
if (ig('check_msgs'))
|
||||
{
|
||||
$SQL->close();
|
||||
exit($kbubbles['calls'] . '::' . $kbubbles['reports']);
|
||||
$SQL->close();
|
||||
|
||||
exit($kbubbles['calls'] . '::' . $kbubbles['reports']);
|
||||
}
|
||||
|
||||
//add your own bubbles here
|
||||
@@ -324,48 +331,48 @@ is_array($plugin_run_result = Plugins::getInstance()->run('kbubbles_admin_page',
|
||||
endif;
|
||||
|
||||
|
||||
foreach($adm_extensions as $m)
|
||||
foreach ($adm_extensions as $m)
|
||||
{
|
||||
//some exceptions
|
||||
if(@in_array($m, $ext_expt))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
//some exceptions
|
||||
if (@in_array($m, $ext_expt))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('foreach_ext_admin_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$s = $m;
|
||||
$m = isset($m[1]) && $m[1] == '_' ? substr($m , 2) : $m;
|
||||
$s = $m;
|
||||
$m = isset($m[1]) && $m[1] == '_' ? substr($m, 2) : $m;
|
||||
|
||||
|
||||
++$i;
|
||||
$adm_extensions_menu[$i] = array(
|
||||
'm' => $m,
|
||||
'i' => $i+1,
|
||||
'i2' => $i+2,
|
||||
'icon' => !empty($ext_icons[$m]) ? $ext_icons[$m] : 'puzzle-piece',
|
||||
++$i;
|
||||
$adm_extensions_menu[$i] = [
|
||||
'm' => $m,
|
||||
'i' => $i+1,
|
||||
'i2' => $i+2,
|
||||
'icon' => ! empty($ext_icons[$m]) ? $ext_icons[$m] : 'puzzle-piece',
|
||||
|
||||
'lang' => !empty($lang['R_'. strtoupper($m)]) ? $lang['R_'. strtoupper($m)] : (!empty($olang['R_' . strtoupper($m)]) ? $olang['R_' . strtoupper($m)] : strtoupper($m)),
|
||||
'link' => './' . basename(ADMIN_PATH) . '?cp=' . ($m == 'configs' ? 'options' : $s) . (@in_array($m, $ext_formkey) ? '&' . $GET_FORM_KEY_GLOBAL : ''),
|
||||
'confirm' => (@in_array($m, $ext_confirm)) ? true : false,
|
||||
'current' => ($s == $go_to) ? true : false,
|
||||
'goto' => str_replace('a_configs', 'options', $s),
|
||||
'bubble' => !emptY($kbubbles[$m]) ? '<span class="badge badge-pill badge-warning bubble_' . $m . '"' . ($kbubbles[$m] == 0 ? ' style="display:none"' : '') . '>' . $kbubbles[$m] . '</span>' : '',
|
||||
'counter' => !emptY($kbubbles[$m]) ? $kbubbles[$m] : ''
|
||||
);
|
||||
'lang' => ! empty($lang['R_' . strtoupper($m)]) ? $lang['R_' . strtoupper($m)] : (! empty($olang['R_' . strtoupper($m)]) ? $olang['R_' . strtoupper($m)] : strtoupper($m)),
|
||||
'link' => './' . basename(ADMIN_PATH) . '?cp=' . ($m == 'configs' ? 'options' : $s) . (@in_array($m, $ext_formkey) ? '&' . $GET_FORM_KEY_GLOBAL : ''),
|
||||
'confirm' => (@in_array($m, $ext_confirm)) ? true : false,
|
||||
'current' => ($s == $go_to) ? true : false,
|
||||
'goto' => str_replace('a_configs', 'options', $s),
|
||||
'bubble' => ! emptY($kbubbles[$m]) ? '<span class="badge badge-pill badge-warning bubble_' . $m . '"' . ($kbubbles[$m] == 0 ? ' style="display:none"' : '') . '>' . $kbubbles[$m] . '</span>' : '',
|
||||
'counter' => ! emptY($kbubbles[$m]) ? $kbubbles[$m] : ''
|
||||
];
|
||||
|
||||
//add another item to array for title='' in href or other thing
|
||||
$adm_extensions_menu[$i]['title'] = $adm_extensions_menu[$i]['lang'];
|
||||
//add another item to array for title='' in href or other thing
|
||||
$adm_extensions_menu[$i]['title'] = $adm_extensions_menu[$i]['lang'];
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('endforeach_ext_admin_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
}
|
||||
|
||||
|
||||
#to attach kleeja version in the menu start item
|
||||
//to attach kleeja version in the menu start item
|
||||
$assigned_klj_ver = preg_replace('!#([a-z0-9]+)!', '', KLEEJA_VERSION);
|
||||
|
||||
#for plugins
|
||||
//for plugins
|
||||
$styleePath = null;
|
||||
|
||||
//get it
|
||||
@@ -375,13 +382,12 @@ if (file_exists(ADM_FILES_PATH . '/' . $go_to . '.php'))
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run("require_admin_page_begin_{$go_to}", get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
if($include)
|
||||
{
|
||||
include_once ADM_FILES_PATH . '/' . $go_to . '.php';
|
||||
}
|
||||
if ($include)
|
||||
{
|
||||
include_once ADM_FILES_PATH . '/' . $go_to . '.php';
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run("require_admin_page_end_{$go_to}", get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -389,7 +395,7 @@ else
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run("not_exists_{$go_to}", get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
if(!empty($include_alternative) && file_exists($include_alternative))
|
||||
if (! empty($include_alternative) && file_exists($include_alternative))
|
||||
{
|
||||
include_once $include_alternative;
|
||||
}
|
||||
@@ -407,22 +413,23 @@ else
|
||||
|
||||
|
||||
//no style defined
|
||||
if(empty($stylee))
|
||||
if (empty($stylee))
|
||||
{
|
||||
$text = $lang['NO_TPL_SHOOSED'];
|
||||
$stylee = 'admin_info';
|
||||
$text = $lang['NO_TPL_SHOOSED'];
|
||||
$stylee = 'admin_info';
|
||||
}
|
||||
|
||||
|
||||
$go_menu_html = '';
|
||||
if(isset($go_menu))
|
||||
|
||||
if (isset($go_menu))
|
||||
{
|
||||
foreach($go_menu as $m=>$d)
|
||||
{
|
||||
foreach ($go_menu as $m=>$d)
|
||||
{
|
||||
$go_menu_html .= '<li class="' . ($d['current'] ? 'active' : '') . '" id="c_' . $d['goto'] . '">' .
|
||||
'<a' . ($m == 'site' ? ' target="_blank" ' : ' ') . 'href="' . $d['link'] . '" ' . ($d['confirm'] ? ' onclick="javascript:return confirm_form();"' : '') . '>' .
|
||||
'<a' . ($m == 'site' ? ' target="_blank" ' : ' ') . 'href="' . $d['link'] . '" ' . ($d['confirm'] ? ' onclick="javascript:return confirm_form();"' : '') . '>' .
|
||||
$d['name'] . '</a></li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//add extra html to header or footer
|
||||
@@ -432,33 +439,34 @@ is_array($plugin_run_result = Plugins::getInstance()->run('end_admin_page', get_
|
||||
|
||||
|
||||
//header
|
||||
if(!ig('_ajax_'))
|
||||
if (! ig('_ajax_'))
|
||||
{
|
||||
echo $tpl->display("admin_header");
|
||||
echo $tpl->display('admin_header');
|
||||
}
|
||||
|
||||
|
||||
//body
|
||||
if(!ig('_ajax_'))
|
||||
if (! ig('_ajax_'))
|
||||
{
|
||||
$is_ajax = 'no';
|
||||
echo $tpl->display($stylee, $styleePath);
|
||||
$is_ajax = 'no';
|
||||
echo $tpl->display($stylee, $styleePath);
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_ajax = 'yes';
|
||||
$is_ajax = 'yes';
|
||||
|
||||
echo_ajax(1,
|
||||
empty($adminAjaxContent) ? $tpl->display($stylee, $styleePath) : $adminAjaxContent,
|
||||
$go_menu_html
|
||||
);
|
||||
echo_ajax(1,
|
||||
empty($adminAjaxContent) ? $tpl->display($stylee, $styleePath) : $adminAjaxContent,
|
||||
$go_menu_html
|
||||
);
|
||||
}
|
||||
|
||||
//footer
|
||||
if(!ig('_ajax_'))
|
||||
if (! ig('_ajax_'))
|
||||
{
|
||||
echo $tpl->display("admin_footer");
|
||||
echo $tpl->display('admin_footer');
|
||||
}
|
||||
//close db
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
|
||||
374
do.php
374
do.php
@@ -30,120 +30,121 @@ if (ig('id') || ig('filename'))
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('begin_download_id_filename', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'f.id, f.real_filename, f.name, f.folder, f.size, f.time, f.uploads, f.type',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'LIMIT' => "1",
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'f.id, f.real_filename, f.name, f.folder, f.size, f.time, f.uploads, f.type',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'LIMIT' => '1',
|
||||
];
|
||||
|
||||
#if user system is default, we use users table
|
||||
if((int) $config['user_system'] == 1)
|
||||
{
|
||||
$query['SELECT'] .= ', u.name AS fusername, u.id AS fuserid';
|
||||
$query['JOINS'] = array(
|
||||
array(
|
||||
'LEFT JOIN' => "{$dbprefix}users u",
|
||||
'ON' => 'u.id=f.user'
|
||||
)
|
||||
);
|
||||
}
|
||||
//if user system is default, we use users table
|
||||
if ((int) $config['user_system'] == 1)
|
||||
{
|
||||
$query['SELECT'] .= ', u.name AS fusername, u.id AS fuserid';
|
||||
$query['JOINS'] = [
|
||||
[
|
||||
'LEFT JOIN' => "{$dbprefix}users u",
|
||||
'ON' => 'u.id=f.user'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
if (ig('filename'))
|
||||
{
|
||||
$filename_l = (string) $SQL->escape(g('filename'));
|
||||
if(ig('x'))
|
||||
{
|
||||
$query['WHERE'] = "f.name='" . $filename_l . '.' . $SQL->escape(g('x')) . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query['WHERE'] = "f.name='" . $filename_l . "'";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$id_l = g('id', 'int');
|
||||
$query['WHERE'] = "f.id=" . $id_l;
|
||||
}
|
||||
if (ig('filename'))
|
||||
{
|
||||
$filename_l = (string) $SQL->escape(g('filename'));
|
||||
|
||||
if (ig('x'))
|
||||
{
|
||||
$query['WHERE'] = "f.name='" . $filename_l . '.' . $SQL->escape(g('x')) . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$query['WHERE'] = "f.name='" . $filename_l . "'";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$id_l = g('id', 'int');
|
||||
$query['WHERE'] = 'f.id=' . $id_l;
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_download_id_filename', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
if ($SQL->num_rows($result) != 0)
|
||||
{
|
||||
$file_info = $SQL->fetch_array($result);
|
||||
if ($SQL->num_rows($result) != 0)
|
||||
{
|
||||
$file_info = $SQL->fetch_array($result);
|
||||
|
||||
$SQL->freeresult($result);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
// some vars
|
||||
$id = $file_info['id'];
|
||||
$name = $fname = $file_info['name'];
|
||||
// some vars
|
||||
$id = $file_info['id'];
|
||||
$name = $fname = $file_info['name'];
|
||||
$real_filename = $file_info['real_filename'];
|
||||
$type = $file_info['type'];
|
||||
$size = $file_info['size'];
|
||||
$time = $file_info['time'];
|
||||
$uploads = $file_info['uploads'];
|
||||
$type = $file_info['type'];
|
||||
$size = $file_info['size'];
|
||||
$time = $file_info['time'];
|
||||
$uploads = $file_info['uploads'];
|
||||
|
||||
|
||||
$fname2 = str_replace('.', '-', htmlspecialchars($name));
|
||||
$name = $real_filename != '' ? str_replace('.' . $type, '', htmlspecialchars($real_filename)) : $name;
|
||||
$name = strlen($name) > 70 ? substr($name, 0, 70) . '...' : $name;
|
||||
$fusername = $config['user_system'] == 1 && $file_info['fuserid'] > -1 ? $file_info['fusername'] : false;
|
||||
$userfolder = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $file_info['fuserid'] . '.html' : 'ucp.php?go=fileuser&id=' . $file_info['fuserid']);
|
||||
$fname2 = str_replace('.', '-', htmlspecialchars($name));
|
||||
$name = $real_filename != '' ? str_replace('.' . $type, '', htmlspecialchars($real_filename)) : $name;
|
||||
$name = strlen($name) > 70 ? substr($name, 0, 70) . '...' : $name;
|
||||
$fusername = $config['user_system'] == 1 && $file_info['fuserid'] > -1 ? $file_info['fusername'] : false;
|
||||
$userfolder = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $file_info['fuserid'] . '.html' : 'ucp.php?go=fileuser&id=' . $file_info['fuserid']);
|
||||
|
||||
if (ig('filename'))
|
||||
{
|
||||
$url_file = $config['mod_writer'] ? $config['siteurl'] . "downf-" . $fname2 . ".html" : $config['siteurl'] . "do.php?downf=" . $fname;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_file = $config['mod_writer'] ? $config['siteurl'] . "down-" . $file_info['id'] . ".html" : $config['siteurl'] . "do.php?down=" . $file_info['id'];
|
||||
}
|
||||
if (ig('filename'))
|
||||
{
|
||||
$url_file = $config['mod_writer'] ? $config['siteurl'] . 'downf-' . $fname2 . '.html' : $config['siteurl'] . 'do.php?downf=' . $fname;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_file = $config['mod_writer'] ? $config['siteurl'] . 'down-' . $file_info['id'] . '.html' : $config['siteurl'] . 'do.php?down=' . $file_info['id'];
|
||||
}
|
||||
|
||||
if(!empty($config['livexts']))
|
||||
{
|
||||
$livexts = explode(',', $config['livexts']);
|
||||
if (! empty($config['livexts']))
|
||||
{
|
||||
$livexts = explode(',', $config['livexts']);
|
||||
|
||||
if (in_array($type, $livexts))
|
||||
{
|
||||
if (ig('filename'))
|
||||
{
|
||||
$url_filex = $config['mod_writer'] ? $config['siteurl'] . "downexf-" . $fname2 . ".html" : $config['siteurl'] . "do.php?downexf=" . $fname;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_filex = $config['mod_writer'] ? $config['siteurl'] . "downex-" . $file_info['id'] . ".html" : $config['siteurl'] . "do.php?downex=" . $file_info['id'];
|
||||
}
|
||||
|
||||
redirect($url_filex, false);
|
||||
}
|
||||
}
|
||||
{
|
||||
if (ig('filename'))
|
||||
{
|
||||
$url_filex = $config['mod_writer'] ? $config['siteurl'] . 'downexf-' . $fname2 . '.html' : $config['siteurl'] . 'do.php?downexf=' . $fname;
|
||||
}
|
||||
else
|
||||
{
|
||||
$url_filex = $config['mod_writer'] ? $config['siteurl'] . 'downex-' . $file_info['id'] . '.html' : $config['siteurl'] . 'do.php?downex=' . $file_info['id'];
|
||||
}
|
||||
|
||||
$REPORT = ($config['mod_writer']) ? $config['siteurl'] . "report-" . $file_info['id'] . ".html" : $config['siteurl'] . "go.php?go=report&id=" . $file_info['id'];
|
||||
$seconds_w = user_can('enter_acp') ? 0 : $config['sec_down'];
|
||||
$time = kleeja_date($time);
|
||||
$size = readable_size($size);
|
||||
redirect($url_filex, false);
|
||||
}
|
||||
}
|
||||
|
||||
$file_ext_icon = file_exists('images/filetypes/' . $type . '.png') ? 'images/filetypes/' . $type . '.png' : 'images/filetypes/file.png';
|
||||
$sty = 'download';
|
||||
$title = $name . ' - ' . $lang['DOWNLAOD'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//file not exists
|
||||
$REPORT = ($config['mod_writer']) ? $config['siteurl'] . 'report-' . $file_info['id'] . '.html' : $config['siteurl'] . 'go.php?go=report&id=' . $file_info['id'];
|
||||
$seconds_w = user_can('enter_acp') ? 0 : $config['sec_down'];
|
||||
$time = kleeja_date($time);
|
||||
$size = readable_size($size);
|
||||
|
||||
$file_ext_icon = file_exists('images/filetypes/' . $type . '.png') ? 'images/filetypes/' . $type . '.png' : 'images/filetypes/file.png';
|
||||
$sty = 'download';
|
||||
$title = $name . ' - ' . $lang['DOWNLAOD'];
|
||||
}
|
||||
else
|
||||
{
|
||||
//file not exists
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('not_exists_qr_downlaod_file', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
kleeja_err($lang['FILE_NO_FOUNDED']);
|
||||
}
|
||||
kleeja_err($lang['FILE_NO_FOUNDED']);
|
||||
}
|
||||
|
||||
$show_style = true;
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('b4_showsty_downlaod_id_filename', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
//add http reffer to session to prevent errors with some browsers !
|
||||
//add http reffer to session to prevent errors with some browsers !
|
||||
$_SESSION['HTTP_REFERER'] = $file_info['id'];
|
||||
|
||||
// show style
|
||||
if($show_style)
|
||||
if ($show_style)
|
||||
{
|
||||
Saaheader($title);
|
||||
echo $tpl->display($sty);
|
||||
@@ -157,24 +158,24 @@ if (ig('id') || ig('filename'))
|
||||
//
|
||||
//download file
|
||||
//
|
||||
# guidelines for _get variable names
|
||||
#
|
||||
# down: [0-9], default, came from do.php?id=[0-9]
|
||||
# downf: [a-z0-9].[ext], came from do.php?filename=[a-z0-9].[ext]
|
||||
#
|
||||
# img: [0-9], default, direct from do.php?img=[0-9]
|
||||
# imgf: [a-z0-9].[ext], direct from do.php?imgf=[a-z0-9].[ext]
|
||||
#
|
||||
# thmb: [0-9], default, direct from do.php?thmb=[0-9]
|
||||
# thmbf: [a-z0-9].[ext], direct from do.php?thmbf=[a-z0-9].[ext]
|
||||
#
|
||||
# live extensions feature uses downex, downexf as in down & downf
|
||||
#
|
||||
# x : used only for html links, where x = extension, downf is filename without extension
|
||||
// guidelines for _get variable names
|
||||
//
|
||||
// down: [0-9], default, came from do.php?id=[0-9]
|
||||
// downf: [a-z0-9].[ext], came from do.php?filename=[a-z0-9].[ext]
|
||||
//
|
||||
// img: [0-9], default, direct from do.php?img=[0-9]
|
||||
// imgf: [a-z0-9].[ext], direct from do.php?imgf=[a-z0-9].[ext]
|
||||
//
|
||||
// thmb: [0-9], default, direct from do.php?thmb=[0-9]
|
||||
// thmbf: [a-z0-9].[ext], direct from do.php?thmbf=[a-z0-9].[ext]
|
||||
//
|
||||
// live extensions feature uses downex, downexf as in down & downf
|
||||
//
|
||||
// x : used only for html links, where x = extension, downf is filename without extension
|
||||
|
||||
else if (ig('down') || ig('downf') ||
|
||||
ig('img') || ig('imgf') ||
|
||||
ig('thmb') || ig('thmbf') ||
|
||||
elseif (ig('down') || ig('downf') ||
|
||||
ig('img') || ig('imgf') ||
|
||||
ig('thmb') || ig('thmbf') ||
|
||||
ig('downex') || ig('downexf'))
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('begin_down_go_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
@@ -192,7 +193,7 @@ else if (ig('down') || ig('downf') ||
|
||||
|
||||
$isset_down_h = ig('downf') && ig('x') ? 'downloadf-' . g('downf') . '-' . g('x') . '.html' : (ig('down') ? 'download' . g('down') . '.html' : '');
|
||||
|
||||
if (!empty($_SERVER['HTTP_REFERER'])
|
||||
if (! empty($_SERVER['HTTP_REFERER'])
|
||||
&& strpos($_SERVER['HTTP_REFERER'], $isset_down_h) !== false)
|
||||
{
|
||||
$not_reffer = false;
|
||||
@@ -200,24 +201,24 @@ else if (ig('down') || ig('downf') ||
|
||||
|
||||
$isset_down = ig('downf') ? 'do.php?filename=' . g('downf') : (ig('down') ? 'do.php?id=' . g('down') : '');
|
||||
|
||||
if (!empty($_SERVER['HTTP_REFERER'])
|
||||
if (! empty($_SERVER['HTTP_REFERER'])
|
||||
&& strpos($_SERVER['HTTP_REFERER'], $isset_down) !== false)
|
||||
{
|
||||
$not_reffer = false;
|
||||
}
|
||||
|
||||
if (!empty($_SERVER['HTTP_REFERER'])
|
||||
&& strpos($config['siteurl'], str_replace(array('http://', 'www.', 'https://'), '', htmlspecialchars($_SERVER['HTTP_REFERER']))))
|
||||
if (! empty($_SERVER['HTTP_REFERER'])
|
||||
&& strpos($config['siteurl'], str_replace(['http://', 'www.', 'https://'], '', htmlspecialchars($_SERVER['HTTP_REFERER']))))
|
||||
{
|
||||
$not_reffer = false;
|
||||
}
|
||||
|
||||
if (isset($_SERVER["HTTP_RANGE"]))
|
||||
if (isset($_SERVER['HTTP_RANGE']))
|
||||
{
|
||||
$not_reffer = false;
|
||||
}
|
||||
|
||||
if(isset($_SESSION['HTTP_REFERER']))
|
||||
if (isset($_SESSION['HTTP_REFERER']))
|
||||
{
|
||||
$not_reffer = false;
|
||||
|
||||
@@ -230,7 +231,7 @@ else if (ig('down') || ig('downf') ||
|
||||
{
|
||||
if (ig('downf'))
|
||||
{
|
||||
$go_to = $config['siteurl'] . ($config['mod_writer'] && ig('x') ? "downloadf-" . g('downf') . '-' . g('x') . ".html" : "do.php?filename=" . g('downf'));
|
||||
$go_to = $config['siteurl'] . ($config['mod_writer'] && ig('x') ? 'downloadf-' . g('downf') . '-' . g('x') . '.html' : 'do.php?filename=' . g('downf'));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -239,6 +240,7 @@ else if (ig('down') || ig('downf') ||
|
||||
|
||||
redirect($go_to);
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -255,7 +257,7 @@ else if (ig('down') || ig('downf') ||
|
||||
{
|
||||
$var = ig('downf') ? 'downf' : (ig('imgf') ? 'imgf' : (ig('thmbf') ? 'thmbf' : (ig('downexf') ? 'downexf' : false)));
|
||||
|
||||
#x, represent the extension, came from html links
|
||||
//x, represent the extension, came from html links
|
||||
if (ig('x') && $var)
|
||||
{
|
||||
$filename = $SQL->escape(g($var)) . '.' . $SQL->escape(g('x'));
|
||||
@@ -275,54 +277,53 @@ else if (ig('down') || ig('downf') ||
|
||||
//is internet explore 6 ?
|
||||
$is_ie6 = is_browser('ie6');
|
||||
|
||||
$livexts = explode(",", $config['livexts']);
|
||||
$livexts = explode(',', $config['livexts']);
|
||||
|
||||
//get info file
|
||||
$query = array('SELECT' => 'f.id, f.name, f.real_filename, f.folder, f.type, f.size, f.time',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'WHERE' => $is_id_filename ? "f.name='" . $filename . "'" . (ig('downexf') ? " AND f.type IN ('" . implode("', '", $livexts) . "')" : '') :
|
||||
$query = ['SELECT' => 'f.id, f.name, f.real_filename, f.folder, f.type, f.size, f.time',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'WHERE' => $is_id_filename ? "f.name='" . $filename . "'" . (ig('downexf') ? " AND f.type IN ('" . implode("', '", $livexts) . "')" : '') :
|
||||
'f.id=' . $id . (ig('downex') ? " AND f.type IN ('" . implode("', '", $livexts) . "')" : ''),
|
||||
'LIMIT' => '1'
|
||||
);
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_down_go_page_filename', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$is_live = false;
|
||||
$pre_ext = !empty($filename) && strpos($filename, '.') !== false ? explode('.', $filename) : array();
|
||||
$pre_ext = ! empty($filename) && strpos($filename, '.') !== false ? explode('.', $filename) : [];
|
||||
$pre_ext = array_pop($pre_ext);
|
||||
|
||||
|
||||
$is_image = in_array(strtolower(trim($pre_ext)), array('gif', 'jpg', 'jpeg', 'bmp', 'png')) ? true : false;
|
||||
$is_image = in_array(strtolower(trim($pre_ext)), ['gif', 'jpg', 'jpeg', 'bmp', 'png']) ? true : false;
|
||||
|
||||
#initiate variables
|
||||
//initiate variables
|
||||
$ii = $n = $rn = $t = $f = $ftime = $d_size = null;
|
||||
|
||||
|
||||
if ($SQL->num_rows($result))
|
||||
{
|
||||
|
||||
$row = $SQL->fetch($result);
|
||||
|
||||
$ii = $row['id'];
|
||||
$n = $row['name'];
|
||||
$rn = $row['real_filename'];
|
||||
$t = strtolower(trim($row['type']));
|
||||
$f = $row['folder'];
|
||||
$ftime = $row['time'];
|
||||
$ii = $row['id'];
|
||||
$n = $row['name'];
|
||||
$rn = $row['real_filename'];
|
||||
$t = strtolower(trim($row['type']));
|
||||
$f = $row['folder'];
|
||||
$ftime = $row['time'];
|
||||
$d_size = $row['size'];
|
||||
|
||||
|
||||
#img or not
|
||||
$is_image = in_array($t, array('gif', 'jpg', 'jpeg', 'bmp', 'png')) ? true : false;
|
||||
#live url
|
||||
//img or not
|
||||
$is_image = in_array($t, ['gif', 'jpg', 'jpeg', 'bmp', 'png']) ? true : false;
|
||||
//live url
|
||||
$is_live = in_array($t, $livexts) ? true : false;
|
||||
|
||||
|
||||
$SQL->free($result);
|
||||
|
||||
//fix bug where a user can override files wait counter
|
||||
if (!$is_image && (ig('img') || ig('thmb')))
|
||||
if (! $is_image && (ig('img') || ig('thmb')))
|
||||
{
|
||||
$go_to = $config['siteurl'] . ($config['mod_writer'] ? 'download' . $ii . '.html' : 'do.php?id=' . $ii);
|
||||
redirect($go_to);
|
||||
@@ -330,14 +331,14 @@ else if (ig('down') || ig('downf') ||
|
||||
|
||||
|
||||
//check if the vistor is new in this page before updating kleeja counter
|
||||
if (!preg_match('/,' . $ii . ',/i', $usrcp->kleeja_get_cookie('oldvistor')) && !isset($_SERVER['HTTP_RANGE']))
|
||||
if (! preg_match('/,' . $ii . ',/i', $usrcp->kleeja_get_cookie('oldvistor')) && ! isset($_SERVER['HTTP_RANGE']))
|
||||
{
|
||||
//updates number of uploads ..
|
||||
$update_query = array(
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}files",
|
||||
'SET' => 'uploads=uploads+1, last_down=' . time(),
|
||||
'WHERE' => $is_id_filename ? "name='" . $filename . "'" : 'id=' . $id,
|
||||
);
|
||||
'SET' => 'uploads=uploads+1, last_down=' . time(),
|
||||
'WHERE' => $is_id_filename ? "name='" . $filename . "'" : 'id=' . $id,
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_update_no_uploads_down', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$SQL->build($update_query);
|
||||
@@ -380,25 +381,26 @@ else if (ig('down') || ig('downf') ||
|
||||
}
|
||||
|
||||
//download process
|
||||
$path_file = ig('thmb') || ig('thmbf') ? "./{$f}/thumbs/{$n}" : "./{$f}/{$n}";
|
||||
$chunksize = 8192;
|
||||
$path_file = ig('thmb') || ig('thmbf') ? "./{$f}/thumbs/{$n}" : "./{$f}/{$n}";
|
||||
$chunksize = 8192;
|
||||
$resuming_on = true;
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('down_go_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
# this is a solution to ignore downloading through the file, redirect to the actual file
|
||||
# where you can add 'define("MAKE_DOPHP_301_HEADER", true);' in config.php to stop the load
|
||||
# if there is any.ead
|
||||
// this is a solution to ignore downloading through the file, redirect to the actual file
|
||||
// where you can add 'define("MAKE_DOPHP_301_HEADER", true);' in config.php to stop the load
|
||||
// if there is any.ead
|
||||
if (defined('MAKE_DOPHP_301_HEADER'))
|
||||
{
|
||||
header('HTTP/1.1 301 Moved Permanently');
|
||||
header('Location: ' . $path_file);
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
//start download ,,
|
||||
if (!is_readable($path_file))
|
||||
if (! is_readable($path_file))
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('down_file_not_exists', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
@@ -412,7 +414,7 @@ else if (ig('down') || ig('downf') ||
|
||||
}
|
||||
}
|
||||
|
||||
if (!($size = @kleeja_filesize($path_file)))
|
||||
if (! ($size = @kleeja_filesize($path_file)))
|
||||
{
|
||||
$size = $d_size;
|
||||
}
|
||||
@@ -423,7 +425,7 @@ else if (ig('down') || ig('downf') ||
|
||||
{
|
||||
$h_name = "filename*=UTF-8''" . rawurlencode(htmlspecialchars_decode($name));
|
||||
}
|
||||
else if (is_browser('opera, safari, konqueror'))
|
||||
elseif (is_browser('opera, safari, konqueror'))
|
||||
{
|
||||
$h_name = 'filename="' . str_replace('"', '', htmlspecialchars_decode($name)) . '"';
|
||||
}
|
||||
@@ -439,11 +441,11 @@ else if (ig('down') || ig('downf') ||
|
||||
$mime_type = get_mime_for_header($ext);
|
||||
|
||||
|
||||
#disable execution time limit
|
||||
//disable execution time limit
|
||||
@set_time_limit(0);
|
||||
|
||||
#disable output buffering
|
||||
#TODO check effectiveness
|
||||
//disable output buffering
|
||||
//TODO check effectiveness
|
||||
$level = ob_get_level();
|
||||
while ($level > 0)
|
||||
{
|
||||
@@ -451,7 +453,7 @@ else if (ig('down') || ig('downf') ||
|
||||
$level--;
|
||||
}
|
||||
|
||||
if (!is_null($SQL))
|
||||
if (! is_null($SQL))
|
||||
{
|
||||
$SQL->close();
|
||||
}
|
||||
@@ -459,64 +461,64 @@ else if (ig('down') || ig('downf') ||
|
||||
session_write_close();
|
||||
|
||||
|
||||
// required for IE, otherwise Content-Disposition may be ignored
|
||||
if(@ini_get('zlib.output_compression'))
|
||||
{
|
||||
@ini_set('zlib.output_compression', 'Off');
|
||||
}
|
||||
// required for IE, otherwise Content-Disposition may be ignored
|
||||
if (@ini_get('zlib.output_compression'))
|
||||
{
|
||||
@ini_set('zlib.output_compression', 'Off');
|
||||
}
|
||||
|
||||
|
||||
#open the file
|
||||
//open the file
|
||||
if (($fp = @fopen($path_file, 'rb')) === false)
|
||||
{
|
||||
#so ... it's failed to open !
|
||||
header("HTTP/1.0 404 Not Found");
|
||||
//so ... it's failed to open !
|
||||
header('HTTP/1.0 404 Not Found');
|
||||
@fclose($fp);
|
||||
big_error($lang['FILE_NO_FOUNDED'], $lang['NOT_FOUND']);
|
||||
}
|
||||
|
||||
#Unsetting all previously set headers.
|
||||
//Unsetting all previously set headers.
|
||||
header_remove();
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('do_page_before_headers_set', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
#send file headers
|
||||
//send file headers
|
||||
header('Pragma: public');
|
||||
header('Accept-Ranges: bytes');
|
||||
header("Content-Description: File Transfer");
|
||||
header('Content-Description: File Transfer');
|
||||
header("Content-Type: $mime_type");
|
||||
header('Date: ' . gmdate('D, d M Y H:i:s', empty($ftime) ? time() : $ftime) . ' GMT');
|
||||
#header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $ftime) . ' GMT');
|
||||
#header('Content-Encoding: none');
|
||||
//header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $ftime) . ' GMT');
|
||||
//header('Content-Encoding: none');
|
||||
header('Content-Disposition: ' . ($is_image || $is_live ? 'inline' : 'attachment') . '; ' . $h_name);
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('do_page_headers_set', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
#if(!$is_image && !$is_live && $is_ie8)
|
||||
#{
|
||||
# header('X-Download-Options: noopen');
|
||||
#}
|
||||
//if(!$is_image && !$is_live && $is_ie8)
|
||||
//{
|
||||
// header('X-Download-Options: noopen');
|
||||
//}
|
||||
|
||||
#header(($is_ie6 ? 'Expires: -1' : 'Expires: Mon, 26 Jul 1997 05:00:00 GMT'));
|
||||
#(($is_ie8) ? '; authoritative=true; X-Content-Type-Options: nosniff;' : '')
|
||||
//header(($is_ie6 ? 'Expires: -1' : 'Expires: Mon, 26 Jul 1997 05:00:00 GMT'));
|
||||
//(($is_ie8) ? '; authoritative=true; X-Content-Type-Options: nosniff;' : '')
|
||||
|
||||
|
||||
#add multipart download and resume support
|
||||
if (isset($_SERVER["HTTP_RANGE"]) && $resuming_on)
|
||||
//add multipart download and resume support
|
||||
if (isset($_SERVER['HTTP_RANGE']) && $resuming_on)
|
||||
{
|
||||
list($a, $range) = explode("=", $_SERVER["HTTP_RANGE"], 2);
|
||||
list($range) = explode(",", $range, 2);
|
||||
list($range, $range_end) = explode("=", $range);
|
||||
$range = round(floatval($range), 0);
|
||||
$range_end = !$range_end ? $size - 1 : round(floatval($range_end), 0);
|
||||
list($a, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
|
||||
list($range) = explode(',', $range, 2);
|
||||
list($range, $range_end) = explode('=', $range);
|
||||
$range = round(floatval($range), 0);
|
||||
$range_end = ! $range_end ? $size - 1 : round(floatval($range_end), 0);
|
||||
|
||||
$partial_length = $range_end - $range + 1;
|
||||
header("HTTP/1.1 206 Partial Content");
|
||||
header('HTTP/1.1 206 Partial Content');
|
||||
header("Content-Length: $partial_length");
|
||||
header("Content-Range: bytes " . ($range - $range_end / $size));
|
||||
header('Content-Range: bytes ' . ($range - $range_end / $size));
|
||||
|
||||
fseek($fp, $range);
|
||||
}
|
||||
@@ -526,27 +528,27 @@ else if (ig('down') || ig('downf') ||
|
||||
header("Content-Length: $partial_length");
|
||||
}
|
||||
|
||||
#output file
|
||||
//output file
|
||||
$bytes_sent = 0;
|
||||
|
||||
#read and output the file in chunks
|
||||
while (!feof($fp) && (!connection_aborted()) && ($bytes_sent < $partial_length))
|
||||
//read and output the file in chunks
|
||||
while (! feof($fp) && (! connection_aborted()) && ($bytes_sent < $partial_length))
|
||||
{
|
||||
$buffer = fread($fp, $chunksize);
|
||||
print($buffer);
|
||||
flush();
|
||||
$bytes_sent += strlen($buffer);
|
||||
|
||||
if(defined('TrottleLimit'))
|
||||
if (defined('TrottleLimit'))
|
||||
{
|
||||
usleep(1000000 * 0.3);
|
||||
usleep(1000000 * 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
fclose($fp);
|
||||
|
||||
|
||||
if(function_exists('fastcgi_finish_request'))
|
||||
if (function_exists('fastcgi_finish_request'))
|
||||
{
|
||||
fastcgi_finish_request();
|
||||
}
|
||||
@@ -563,7 +565,7 @@ else
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('err_navig_download_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
if($error)
|
||||
if ($error)
|
||||
{
|
||||
kleeja_err($lang['ERROR_NAVIGATATION']);
|
||||
}
|
||||
@@ -572,4 +574,4 @@ else
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('end_download_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
#<-- EOF
|
||||
//<-- EOF
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
// we deprecated download.php , so we have to put it for those who upgraded
|
||||
// to this version
|
||||
//
|
||||
require 'do.php';
|
||||
require 'do.php';
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
*/
|
||||
|
||||
|
||||
#no direct access
|
||||
if (!defined('IN_COMMON'))
|
||||
//no direct access
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,73 +21,73 @@ interface KleejaUploader
|
||||
|
||||
/**
|
||||
* set the allowed extensions of uploaded files
|
||||
* @param array $allowed_file_extensions an array of allowed extensions, and sizes ['gif'=>122, 'png'=>2421 ..]
|
||||
* @param array $allowed_file_extensions an array of allowed extensions, and sizes ['gif'=>122, 'png'=>2421 ..]
|
||||
* @return void
|
||||
*/
|
||||
function setAllowedFileExtensions($allowed_file_extensions);
|
||||
public function setAllowedFileExtensions($allowed_file_extensions);
|
||||
|
||||
|
||||
/**
|
||||
* get the allowed extensions of uploaded files
|
||||
* @return array
|
||||
*/
|
||||
function getAllowedFileExtensions();
|
||||
public function getAllowedFileExtensions();
|
||||
|
||||
|
||||
/**
|
||||
* set the allowed limit of the uploaded files
|
||||
* @param int $limit
|
||||
* @param int $limit
|
||||
* @return void
|
||||
*/
|
||||
function setUploadFieldsLimit($limit);
|
||||
public function setUploadFieldsLimit($limit);
|
||||
|
||||
/**
|
||||
* get the allowed limit of the uploaded files
|
||||
* @return int
|
||||
*/
|
||||
function getUploadFieldsLimit();
|
||||
public function getUploadFieldsLimit();
|
||||
|
||||
|
||||
/**
|
||||
* add an information message to output it to the user
|
||||
* @param string $message
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function addInfoMessage($message);
|
||||
public function addInfoMessage($message);
|
||||
|
||||
/**
|
||||
* add an error message to output it to the user
|
||||
* @param string $message
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function addErrorMessage($message);
|
||||
public function addErrorMessage($message);
|
||||
|
||||
/**
|
||||
* get all the messages
|
||||
* @return array
|
||||
*/
|
||||
function getMessages();
|
||||
public function getMessages();
|
||||
|
||||
/**
|
||||
* save the file information to the database
|
||||
* @param array $fileInfo
|
||||
* @param array $fileInfo
|
||||
* @return void
|
||||
*/
|
||||
function saveToDatabase($fileInfo);
|
||||
public function saveToDatabase($fileInfo);
|
||||
|
||||
|
||||
/**
|
||||
* generate a box of the result and add it to addInfoMessage
|
||||
* @param array $fileInfo
|
||||
* @param array $fileInfo
|
||||
* @return void
|
||||
*/
|
||||
function generateOutputBox($fileInfo);
|
||||
public function generateOutputBox($fileInfo);
|
||||
|
||||
|
||||
/**
|
||||
* here happens the magic, call this on upload submit
|
||||
* @param int $uploadType upload from files input or links
|
||||
* @param int $uploadType upload from files input or links
|
||||
* @return void
|
||||
*/
|
||||
function upload($uploadType);
|
||||
public function upload($uploadType);
|
||||
}
|
||||
|
||||
@@ -8,332 +8,336 @@
|
||||
*/
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_configs";
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i','', g('smt', 'str', 'general'));
|
||||
$stylee = 'admin_configs';
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
//words
|
||||
$action = basename(ADMIN_PATH) . '?cp=options&smt=' . $current_smt;
|
||||
$action = basename(ADMIN_PATH) . '?cp=options&smt=' . $current_smt;
|
||||
$n_submit = $lang['UPDATE_CONFIG'];
|
||||
$options = '';
|
||||
#$current_type = ig('type') ? g('type') : 'general';
|
||||
$options = '';
|
||||
//$current_type = ig('type') ? g('type') : 'general';
|
||||
$CONFIGEXTEND = false;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_configs');
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_configs');
|
||||
|
||||
//secondary menu
|
||||
$query = array(
|
||||
$query = [
|
||||
'SELECT' => 'DISTINCT(c.type), c.display_order, p.plg_disabled, c.plg_id',
|
||||
'FROM' => "{$dbprefix}config c",
|
||||
'JOINS' => array(
|
||||
array(
|
||||
'FROM' => "{$dbprefix}config c",
|
||||
'JOINS' => [
|
||||
[
|
||||
'LEFT JOIN' => "{$dbprefix}plugins p",
|
||||
'ON' => 'p.plg_id=c.plg_id'
|
||||
)
|
||||
),
|
||||
'WHERE' => "c.option <> '' AND c.type <> 'groups'",
|
||||
'ON' => 'p.plg_id=c.plg_id'
|
||||
]
|
||||
],
|
||||
'WHERE' => "c.option <> '' AND c.type <> 'groups'",
|
||||
'ORDER BY' => 'c.display_order'
|
||||
);
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row = $SQL->fetch_array($result))
|
||||
while ($row = $SQL->fetch_array($result))
|
||||
{
|
||||
if($row['type'] == 'KLIVE'){
|
||||
if ($row['type'] == 'KLIVE')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($row['plg_id'] > 0 && (is_null($row['plg_disabled']) || $row['plg_disabled'] == 1)) {
|
||||
if ($row['plg_id'] > 0 && (is_null($row['plg_disabled']) || $row['plg_disabled'] == 1))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$name = !empty($lang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])]) ? $lang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])] : (!empty($olang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])]) ? $olang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])] : $lang['CONFIG_KLJ_MENUS_OTHER']);
|
||||
$go_menu[$row['type']] = array('name'=>$name, 'link'=>$action . '&smt=' . $row['type'], 'goto'=>$row['type'], 'current'=> $current_smt == $row['type']);
|
||||
$name = ! empty($lang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])]) ? $lang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])] : (! empty($olang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])]) ? $olang['CONFIG_KLJ_MENUS_' . strtoupper($row['type'])] : $lang['CONFIG_KLJ_MENUS_OTHER']);
|
||||
$go_menu[$row['type']] = ['name'=>$name, 'link'=>$action . '&smt=' . $row['type'], 'goto'=>$row['type'], 'current'=> $current_smt == $row['type']];
|
||||
}
|
||||
|
||||
$go_menu['all'] = array('name'=>$lang['CONFIG_KLJ_MENUS_ALL'], 'link'=>$action . '&smt=all', 'goto'=>'all', 'current'=> $current_smt == 'all');
|
||||
$go_menu['all'] = ['name'=>$lang['CONFIG_KLJ_MENUS_ALL'], 'link'=>$action . '&smt=all', 'goto'=>'all', 'current'=> $current_smt == 'all'];
|
||||
|
||||
//
|
||||
// Check form key
|
||||
//
|
||||
if (ip('submit'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_configs'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_configs'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//general varaibles
|
||||
#$action = basename(ADMIN_PATH) . '?cp=options&type=' .$current_type;
|
||||
$STAMP_IMG_URL = file_exists(PATH . 'images/watermark.gif') ? PATH . 'images/watermark.gif' : PATH . 'images/watermark.png';
|
||||
$stylfiles = $lngfiles = $authtypes = $time_zones = '';
|
||||
$optionss = array();
|
||||
//$action = basename(ADMIN_PATH) . '?cp=options&type=' .$current_type;
|
||||
$STAMP_IMG_URL = file_exists(PATH . 'images/watermark.gif') ? PATH . 'images/watermark.gif' : PATH . 'images/watermark.png';
|
||||
$stylfiles = $lngfiles = $authtypes = $time_zones = '';
|
||||
$optionss = [];
|
||||
$n_googleanalytics = '<a href="http://www.google.com/analytics">Google Analytics</a>';
|
||||
|
||||
$query = array(
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}config",
|
||||
'ORDER BY' => 'display_order, type ASC'
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}config",
|
||||
'ORDER BY' => 'display_order, type ASC'
|
||||
];
|
||||
|
||||
$CONFIGEXTEND = $SQL->escape($current_smt);
|
||||
$CONFIGEXTEND = $SQL->escape($current_smt);
|
||||
$CONFIGEXTENDLANG = $go_menu[$current_smt]['name'];
|
||||
|
||||
if($current_smt != 'all')
|
||||
|
||||
if ($current_smt != 'all')
|
||||
{
|
||||
$query['WHERE'] = "type = '" . $SQL->escape($current_smt) . "' OR type = ''";
|
||||
|
||||
if($current_smt == 'interface')
|
||||
{
|
||||
$query['WHERE'] .= " OR name='language'";
|
||||
}
|
||||
$query['WHERE'] = "type = '" . $SQL->escape($current_smt) . "' OR type = ''";
|
||||
|
||||
if ($current_smt == 'interface')
|
||||
{
|
||||
$query['WHERE'] .= " OR name='language'";
|
||||
}
|
||||
}
|
||||
else if($current_smt == 'all')
|
||||
elseif ($current_smt == 'all')
|
||||
{
|
||||
$query['WHERE'] = "type <> 'groups' OR type = ''";
|
||||
$query['WHERE'] = "type <> 'groups' OR type = ''";
|
||||
}
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$thumbs_are = get_config('thmb_dims');
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
if($row['type'] == 'KLIVE')
|
||||
if ($row['type'] == 'KLIVE')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if($row['name'] == 'language' && $current_smt == 'interface')
|
||||
{
|
||||
$row['type'] = 'interface';
|
||||
}
|
||||
|
||||
|
||||
#make new lovely array !!
|
||||
$con[$row['name']] = $row['value'];
|
||||
|
||||
if($row['name'] == 'thumbs_imgs')
|
||||
{
|
||||
list($thmb_dim_w, $thmb_dim_h) = array_map('trim', @explode('*', $thumbs_are));
|
||||
}
|
||||
else if($row['name'] == 'time_zone')
|
||||
{
|
||||
$zones = time_zones();
|
||||
foreach($zones as $z=>$t)
|
||||
{
|
||||
$time_zones .= '<option ' . ($con['time_zone'] == $t ? 'selected="selected"' : '') . ' value="' . $t . '">' . $z . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
else if($row['name'] == 'language')
|
||||
{
|
||||
//get languages
|
||||
if ($dh = @opendir(PATH . 'lang'))
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if(strpos($file, '.') === false && $file != '..' && $file != '.')
|
||||
{
|
||||
$lngfiles .= '<option ' . ($con['language'] == $file ? 'selected="selected"' : '') . ' value="' . $file . '">' . $file . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
}
|
||||
else if($row['name'] == 'user_system')
|
||||
{
|
||||
//get auth types
|
||||
//fix previous choices in old kleeja
|
||||
if(in_array($con['user_system'], array('2', '3', '4')))
|
||||
{
|
||||
$con['user_system'] = str_replace(array('2', '3', '4'), array('phpbb', 'vb', 'mysmartbb'), $con['user_system']);
|
||||
}
|
||||
|
||||
$authtypes .= '<option value="1"' . ($con['user_system']=='1' ? ' selected="selected"' : '') . '>' . $lang['NORMAL'] . '</option>' . "\n";
|
||||
if ($dh = @opendir(PATH . 'includes/auth_integration'))
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if(strpos($file, '.php') !== false)
|
||||
{
|
||||
$file = trim(str_replace('.php', '', $file));
|
||||
$authtypes .= '<option value="' . $file . '"' . ($con['user_system'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('while_fetch_adm_config', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
//options from database [UNDER TEST]
|
||||
if(!empty($row['option']))
|
||||
{
|
||||
$optionss[$row['name']] = array(
|
||||
'option' => '<div class="form-group">' . "\n" .
|
||||
'<label for="' . $row['name'] . '">' . (!empty($lang[strtoupper($row['name'])]) ? $lang[strtoupper($row['name'])] : $olang[strtoupper($row['name'])]) . '</label>' . "\n" .
|
||||
'<div class="box">' . (empty($row['option']) ? '' : $tpl->admindisplayoption($row['option'])) . '</div>' . "\n" .
|
||||
'</div>' . "\n" . '<div class="clear"></div>',
|
||||
'type' => $row['type'],
|
||||
'display_order' => $row['display_order'],
|
||||
);
|
||||
}
|
||||
|
||||
//when submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
//-->
|
||||
$new[$row['name']] = p($row['name'], 'str', $con[$row['name']]);
|
||||
|
||||
//save them as you want ..
|
||||
if($row['name'] == 'thumbs_imgs')
|
||||
{
|
||||
if(p('thmb_dim_w', 'int') < 10)
|
||||
{
|
||||
$_POST['thmb_dim_w'] = 10;
|
||||
}
|
||||
|
||||
if(p('thmb_dim_h', 'int') < 10)
|
||||
{
|
||||
$_POST['thmb_dim_h'] = 10;
|
||||
}
|
||||
|
||||
$thumbs_were = p('thmb_dim_w', 'int') . '*' . p('thmb_dim_h', 'int');
|
||||
update_config('thmb_dims', $thumbs_were);
|
||||
}
|
||||
else if($row['name'] == 'livexts')
|
||||
{
|
||||
$new['livexts'] = implode(',', array_map('trim', explode(',', p('livexts'))));
|
||||
}
|
||||
else if($row['name'] == 'prefixname')
|
||||
{
|
||||
$new['prefixname'] = preg_replace('/[^a-z0-9_\-\}\{\:\.]/', '', strtolower(p('prefixname')));
|
||||
}
|
||||
else if($row['name'] == 'siteurl')
|
||||
{
|
||||
if(p('siteurl')[strlen(p('siteurl'))-1] != '/')
|
||||
{
|
||||
$new['siteurl'] .= '/';
|
||||
}
|
||||
}
|
||||
else if($row['name'] == 'mod_writer')
|
||||
if ($row['name'] == 'language' && $current_smt == 'interface')
|
||||
{
|
||||
if($new['mod_writer'] == 1)
|
||||
$row['type'] = 'interface';
|
||||
}
|
||||
|
||||
|
||||
//make new lovely array !!
|
||||
$con[$row['name']] = $row['value'];
|
||||
|
||||
if ($row['name'] == 'thumbs_imgs')
|
||||
{
|
||||
list($thmb_dim_w, $thmb_dim_h) = array_map('trim', @explode('*', $thumbs_are));
|
||||
}
|
||||
elseif ($row['name'] == 'time_zone')
|
||||
{
|
||||
$zones = time_zones();
|
||||
|
||||
foreach ($zones as $z=>$t)
|
||||
{
|
||||
if(!file_exists(PATH . '.htaccess') && file_exists(PATH . 'htaccess.txt') && function_exists('rename'))
|
||||
{
|
||||
rename(PATH . 'htaccess.txt', PATH . '.htaccess');
|
||||
}
|
||||
$time_zones .= '<option ' . ($con['time_zone'] == $t ? 'selected="selected"' : '') . ' value="' . $t . '">' . $z . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
else if($row['name'] == 'language')
|
||||
{
|
||||
$got_lang = preg_replace('[^a-zA-Z0-9]', '', $new[$row['name']]);
|
||||
|
||||
|
||||
//all groups
|
||||
foreach ($d_groups as $group_id => $group_info)
|
||||
elseif ($row['name'] == 'language')
|
||||
{
|
||||
//get languages
|
||||
if ($dh = @opendir(PATH . 'lang'))
|
||||
{
|
||||
update_config('language', $got_lang, true, $group_id);
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if (strpos($file, '.') === false && $file != '..' && $file != '.')
|
||||
{
|
||||
$lngfiles .= '<option ' . ($con['language'] == $file ? 'selected="selected"' : '') . ' value="' . $file . '">' . $file . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
}
|
||||
elseif ($row['name'] == 'user_system')
|
||||
{
|
||||
//get auth types
|
||||
//fix previous choices in old kleeja
|
||||
if (in_array($con['user_system'], ['2', '3', '4']))
|
||||
{
|
||||
$con['user_system'] = str_replace(['2', '3', '4'], ['phpbb', 'vb', 'mysmartbb'], $con['user_system']);
|
||||
}
|
||||
|
||||
delete_cache('data_lang' . $got_lang);
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('after_submit_adm_config', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$authtypes .= '<option value="1"' . ($con['user_system']=='1' ? ' selected="selected"' : '') . '>' . $lang['NORMAL'] . '</option>' . "\n";
|
||||
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}config",
|
||||
'SET' => "value='" . $SQL->escape($new[$row['name']]) . "'",
|
||||
'WHERE' => "name='" . $row['name'] . "'"
|
||||
);
|
||||
if ($dh = @opendir(PATH . 'includes/auth_integration'))
|
||||
{
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if (strpos($file, '.php') !== false)
|
||||
{
|
||||
$file = trim(str_replace('.php', '', $file));
|
||||
$authtypes .= '<option value="' . $file . '"' . ($con['user_system'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>' . "\n";
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
}
|
||||
|
||||
if($current_smt != 'all')
|
||||
{
|
||||
$query['WHERE'] .= " AND type = '" . $SQL->escape($current_smt) . "'";
|
||||
}
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('while_fetch_adm_config', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$SQL->build($update_query);
|
||||
}
|
||||
//options from database [UNDER TEST]
|
||||
if (! empty($row['option']))
|
||||
{
|
||||
$optionss[$row['name']] = [
|
||||
'option' => '<div class="form-group">' . "\n" .
|
||||
'<label for="' . $row['name'] . '">' . (! empty($lang[strtoupper($row['name'])]) ? $lang[strtoupper($row['name'])] : $olang[strtoupper($row['name'])]) . '</label>' . "\n" .
|
||||
'<div class="box">' . (empty($row['option']) ? '' : $tpl->admindisplayoption($row['option'])) . '</div>' . "\n" .
|
||||
'</div>' . "\n" . '<div class="clear"></div>',
|
||||
'type' => $row['type'],
|
||||
'display_order' => $row['display_order'],
|
||||
];
|
||||
}
|
||||
|
||||
//when submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
//-->
|
||||
$new[$row['name']] = p($row['name'], 'str', $con[$row['name']]);
|
||||
|
||||
//save them as you want ..
|
||||
if ($row['name'] == 'thumbs_imgs')
|
||||
{
|
||||
if (p('thmb_dim_w', 'int') < 10)
|
||||
{
|
||||
$_POST['thmb_dim_w'] = 10;
|
||||
}
|
||||
|
||||
if (p('thmb_dim_h', 'int') < 10)
|
||||
{
|
||||
$_POST['thmb_dim_h'] = 10;
|
||||
}
|
||||
|
||||
$thumbs_were = p('thmb_dim_w', 'int') . '*' . p('thmb_dim_h', 'int');
|
||||
update_config('thmb_dims', $thumbs_were);
|
||||
}
|
||||
elseif ($row['name'] == 'livexts')
|
||||
{
|
||||
$new['livexts'] = implode(',', array_map('trim', explode(',', p('livexts'))));
|
||||
}
|
||||
elseif ($row['name'] == 'prefixname')
|
||||
{
|
||||
$new['prefixname'] = preg_replace('/[^a-z0-9_\-\}\{\:\.]/', '', strtolower(p('prefixname')));
|
||||
}
|
||||
elseif ($row['name'] == 'siteurl')
|
||||
{
|
||||
if (p('siteurl')[strlen(p('siteurl'))-1] != '/')
|
||||
{
|
||||
$new['siteurl'] .= '/';
|
||||
}
|
||||
}
|
||||
elseif ($row['name'] == 'mod_writer')
|
||||
{
|
||||
if ($new['mod_writer'] == 1)
|
||||
{
|
||||
if (! file_exists(PATH . '.htaccess') && file_exists(PATH . 'htaccess.txt') && function_exists('rename'))
|
||||
{
|
||||
rename(PATH . 'htaccess.txt', PATH . '.htaccess');
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($row['name'] == 'language')
|
||||
{
|
||||
$got_lang = preg_replace('[^a-zA-Z0-9]', '', $new[$row['name']]);
|
||||
|
||||
|
||||
//all groups
|
||||
foreach ($d_groups as $group_id => $group_info)
|
||||
{
|
||||
update_config('language', $got_lang, true, $group_id);
|
||||
}
|
||||
|
||||
delete_cache('data_lang' . $got_lang);
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('after_submit_adm_config', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}config",
|
||||
'SET' => "value='" . $SQL->escape($new[$row['name']]) . "'",
|
||||
'WHERE' => "name='" . $row['name'] . "'"
|
||||
];
|
||||
|
||||
if ($current_smt != 'all')
|
||||
{
|
||||
$query['WHERE'] .= " AND type = '" . $SQL->escape($current_smt) . "'";
|
||||
}
|
||||
|
||||
$SQL->build($update_query);
|
||||
}
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
$types = array();
|
||||
$types = [];
|
||||
|
||||
foreach($optionss as $key => $option)
|
||||
foreach ($optionss as $key => $option)
|
||||
{
|
||||
if(empty($types[$option['type']]))
|
||||
{
|
||||
$types[$option['type']] = '<ol class="breadcrumb">' .
|
||||
'<li class="breadcrumb-item"><a href="#">'. $lang['R_CONFIGS'] .'</a></li>' .
|
||||
'<li class="breadcrumb-item active">'. $go_menu[$option['type']]['name'] .'</li>' .
|
||||
if (empty($types[$option['type']]))
|
||||
{
|
||||
$types[$option['type']] = '<ol class="breadcrumb">' .
|
||||
'<li class="breadcrumb-item"><a href="#">' . $lang['R_CONFIGS'] . '</a></li>' .
|
||||
'<li class="breadcrumb-item active">' . $go_menu[$option['type']]['name'] . '</li>' .
|
||||
'</ol>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($types as $typekey => $type)
|
||||
foreach ($types as $typekey => $type)
|
||||
{
|
||||
$options .= $type;
|
||||
|
||||
$options .= $type;
|
||||
foreach($optionss as $key => $option)
|
||||
{
|
||||
if($option['type'] == $typekey)
|
||||
{
|
||||
$options .= str_replace(
|
||||
array('<input ', '<select ', '<td>', '</td>', '<label>', '<tr>', '</tr>'),
|
||||
array('<input class="form-control" ', '<select class="form-control" ', '<div class="form-group">', '</div>', '<label class="form-check-label">', '', ''),
|
||||
foreach ($optionss as $key => $option)
|
||||
{
|
||||
if ($option['type'] == $typekey)
|
||||
{
|
||||
$options .= str_replace(
|
||||
['<input ', '<select ', '<td>', '</td>', '<label>', '<tr>', '</tr>'],
|
||||
['<input class="form-control" ', '<select class="form-control" ', '<div class="form-group">', '</div>', '<label class="form-check-label">', '', ''],
|
||||
$option['option']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//after submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
|
||||
#some configs need refresh page ..
|
||||
$need_refresh_configs = array('language');
|
||||
|
||||
|
||||
|
||||
//some configs need refresh page ..
|
||||
$need_refresh_configs = ['language'];
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('after_submit_adm_config', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
//empty ..
|
||||
/*
|
||||
if (empty(p('sitename')) || empty(p('siteurl')) || empty(p('foldername')) || empty(p('filesnum')))
|
||||
{
|
||||
$text = $lang['EMPTY_FIELDS'];
|
||||
$stylee = "admin_err";
|
||||
}
|
||||
elseif (!is_numeric(p('filesnum')) || !is_numeric(p('sec_down')))
|
||||
{
|
||||
$text = $lang['NUMFIELD_S'];
|
||||
$stylee = "admin_err";
|
||||
}
|
||||
else
|
||||
{
|
||||
*/
|
||||
//empty ..
|
||||
/*
|
||||
if (empty(p('sitename')) || empty(p('siteurl')) || empty(p('foldername')) || empty(p('filesnum')))
|
||||
{
|
||||
$text = $lang['EMPTY_FIELDS'];
|
||||
$stylee = "admin_err";
|
||||
}
|
||||
elseif (!is_numeric(p('filesnum')) || !is_numeric(p('sec_down')))
|
||||
{
|
||||
$text = $lang['NUMFIELD_S'];
|
||||
$stylee = "admin_err";
|
||||
}
|
||||
else
|
||||
{
|
||||
*/
|
||||
|
||||
#delete cache ..
|
||||
delete_cache('data_config');
|
||||
|
||||
|
||||
foreach($need_refresh_configs as $l)
|
||||
{
|
||||
if(ip($l) && p($l) != $config[$l])
|
||||
{
|
||||
header('Location: ' . basename(ADMIN_PATH));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
//delete cache ..
|
||||
delete_cache('data_config');
|
||||
|
||||
kleeja_admin_info($lang['CONFIGS_UPDATED'], true, '', true, $action, 3);
|
||||
//}
|
||||
}#submit
|
||||
|
||||
foreach ($need_refresh_configs as $l)
|
||||
{
|
||||
if (ip($l) && p($l) != $config[$l])
|
||||
{
|
||||
header('Location: ' . basename(ADMIN_PATH));
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
kleeja_admin_info($lang['CONFIGS_UPDATED'], true, '', true, $action, 3);
|
||||
//}
|
||||
}//submit
|
||||
|
||||
@@ -9,22 +9,23 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
//check _GET Csrf token
|
||||
if(!kleeja_check_form_key_get('GLOBAL_FORM_KEY'))
|
||||
if (! kleeja_check_form_key_get('GLOBAL_FORM_KEY'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH), 2);
|
||||
kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH), 2);
|
||||
}
|
||||
|
||||
|
||||
//remove just the administator session
|
||||
if ($usrcp->logout_cp())
|
||||
{
|
||||
redirect($config['siteurl']);
|
||||
$SQL->close();
|
||||
exit;
|
||||
redirect($config['siteurl']);
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -9,30 +9,30 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
#number of images per page
|
||||
//number of images per page
|
||||
$files_acp_perpage = defined('ACP_FILES_PER_PAGE') ? ACP_FILES_PER_PAGE : 20;
|
||||
|
||||
|
||||
#display
|
||||
$stylee = "admin_files";
|
||||
//display
|
||||
$stylee = 'admin_files';
|
||||
|
||||
$url_or = isset($_REQUEST['order_by']) ? '&order_by=' . htmlspecialchars($_REQUEST['order_by']) . (isset($_REQUEST['order_way']) ? '&order_by=1' : '') : '';
|
||||
$url_or2 = isset($_REQUEST['order_by']) ? '&order_by=' . htmlspecialchars($_REQUEST['order_by']) : '';
|
||||
$url_lst = isset($_REQUEST['last_visit']) ? '&last_visit=' . htmlspecialchars($_REQUEST['last_visit']) : '';
|
||||
$url_sea = ig('search_id') ? '&search_id=' . g('search_id') : '';
|
||||
$url_pg = ig('page') ? '&page=' . g('page', 'int') : '';
|
||||
$page_action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . $url_or . $url_sea . $url_lst;
|
||||
$ord_action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . $url_pg . $url_sea . $url_lst;
|
||||
$url_or = isset($_REQUEST['order_by']) ? '&order_by=' . htmlspecialchars($_REQUEST['order_by']) . (isset($_REQUEST['order_way']) ? '&order_by=1' : '') : '';
|
||||
$url_or2 = isset($_REQUEST['order_by']) ? '&order_by=' . htmlspecialchars($_REQUEST['order_by']) : '';
|
||||
$url_lst = isset($_REQUEST['last_visit']) ? '&last_visit=' . htmlspecialchars($_REQUEST['last_visit']) : '';
|
||||
$url_sea = ig('search_id') ? '&search_id=' . g('search_id') : '';
|
||||
$url_pg = ig('page') ? '&page=' . g('page', 'int') : '';
|
||||
$page_action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . $url_or . $url_sea . $url_lst;
|
||||
$ord_action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . $url_pg . $url_sea . $url_lst;
|
||||
$page2_action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . $url_or2 . $url_sea . $url_lst;
|
||||
$action = $page_action . $url_pg;
|
||||
$is_search = $affected = false;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_files');
|
||||
$action = $page_action . $url_pg;
|
||||
$is_search = $affected = false;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_files');
|
||||
|
||||
//
|
||||
// Check form key
|
||||
@@ -40,360 +40,367 @@ $H_FORM_KEYS = kleeja_add_form_key('adm_files');
|
||||
|
||||
if (ip('submit'))
|
||||
{
|
||||
#wrong form
|
||||
if(!kleeja_check_form_key('adm_files'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
|
||||
$del = array();
|
||||
|
||||
#gather to-be-deleted file ids
|
||||
foreach ($_POST as $key => $value)
|
||||
//wrong form
|
||||
if (! kleeja_check_form_key('adm_files'))
|
||||
{
|
||||
if(preg_match('/del_(?P<digit>\d+)/', $key))
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
|
||||
$del = [];
|
||||
|
||||
//gather to-be-deleted file ids
|
||||
foreach ($_POST as $key => $value)
|
||||
{
|
||||
if (preg_match('/del_(?P<digit>\d+)/', $key))
|
||||
{
|
||||
$del[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
#delete them once by once
|
||||
$ids = array();
|
||||
$files_num = $imgs_num = $sizes = 0;
|
||||
|
||||
//TODO use IN(...)
|
||||
foreach ($del as $key => $id)
|
||||
//delete them once by once
|
||||
$ids = [];
|
||||
$files_num = $imgs_num = $sizes = 0;
|
||||
|
||||
//TODO use IN(...)
|
||||
foreach ($del as $key => $id)
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 'f.id, f.name, f.folder, f.size, f.type',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'WHERE' => 'f.id = ' . intval($id),
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'f.id, f.name, f.folder, f.size, f.type',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'WHERE' => 'f.id = ' . intval($id),
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//delete from folder ..
|
||||
@kleeja_unlink (PATH . $row['folder'] . '/' . $row['name']);
|
||||
//delete thumb
|
||||
if (file_exists(PATH . $row['folder'] . '/thumbs/' . $row['name'] ))
|
||||
{
|
||||
@kleeja_unlink (PATH . $row['folder'] . '/thumbs/' . $row['name'] );
|
||||
}
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//delete from folder ..
|
||||
@kleeja_unlink (PATH . $row['folder'] . '/' . $row['name']);
|
||||
//delete thumb
|
||||
if (file_exists(PATH . $row['folder'] . '/thumbs/' . $row['name'] ))
|
||||
{
|
||||
@kleeja_unlink (PATH . $row['folder'] . '/thumbs/' . $row['name'] );
|
||||
}
|
||||
|
||||
$is_image = in_array(strtolower(trim($row['type'])), array('gif', 'jpg', 'jpeg', 'bmp', 'png')) ? true : false;
|
||||
$is_image = in_array(strtolower(trim($row['type'])), ['gif', 'jpg', 'jpeg', 'bmp', 'png']) ? true : false;
|
||||
|
||||
$ids[] = $row['id'];
|
||||
if($is_image)
|
||||
{
|
||||
$imgs_num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$files_num++;
|
||||
}
|
||||
$sizes += $row['size'];
|
||||
}
|
||||
}
|
||||
$ids[] = $row['id'];
|
||||
|
||||
if ($is_image)
|
||||
{
|
||||
$imgs_num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$files_num++;
|
||||
}
|
||||
$sizes += $row['size'];
|
||||
}
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('submit_files_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
$SQL->freeresult($result);
|
||||
|
||||
//no files to delete
|
||||
if(isset($ids) && sizeof($ids))
|
||||
{
|
||||
$query_del = array(
|
||||
'DELETE' => "{$dbprefix}files",
|
||||
'WHERE' => "`id` IN (" . implode(',', $ids) . ")"
|
||||
);
|
||||
|
||||
$SQL->build($query_del);
|
||||
|
||||
//update number of stats
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "sizes=sizes-$sizes, files=files-$files_num, imgs=imgs-$imgs_num",
|
||||
);
|
||||
//no files to delete
|
||||
if (isset($ids) && sizeof($ids))
|
||||
{
|
||||
$query_del = [
|
||||
'DELETE' => "{$dbprefix}files",
|
||||
'WHERE' => '`id` IN (' . implode(',', $ids) . ')'
|
||||
];
|
||||
|
||||
$SQL->build($update_query);
|
||||
if($SQL->affected())
|
||||
{
|
||||
delete_cache('data_stats');
|
||||
$affected = true;
|
||||
}
|
||||
}
|
||||
|
||||
#show msg now
|
||||
$text = ($affected && (isset($ids) && sizeof($ids)) ? $lang['FILES_UPDATED'] : $lang['NO_UP_CHANGE_S']) .
|
||||
'<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . str_replace('&', '&', $action) . '\');", 2000);</script>' . "\n";
|
||||
$stylee = "admin_info";
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQL->build($query_del);
|
||||
|
||||
//
|
||||
//Delete all user files [only one user]
|
||||
//
|
||||
if(ig('deletefiles'))
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 'f.id, f.size, f.name, f.folder',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
);
|
||||
//update number of stats
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "sizes=sizes-$sizes, files=files-$files_num, imgs=imgs-$imgs_num",
|
||||
];
|
||||
|
||||
#get search filter
|
||||
$filter = get_filter(g('search_id'), 'file_search', false, 'filter_uid');
|
||||
|
||||
if(!$filter)
|
||||
{
|
||||
kleeja_admin_err($lang['ADMIN_DELETE_FILES_NOF']);
|
||||
}
|
||||
$SQL->build($update_query);
|
||||
|
||||
$query['WHERE'] = build_search_query(unserialize(htmlspecialchars_decode($filter['filter_value'])));
|
||||
|
||||
if($query['WHERE'] == '')
|
||||
{
|
||||
kleeja_admin_err($lang['ADMIN_DELETE_FILES_NOF']);
|
||||
}
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$sizes = false;
|
||||
$ids = array();
|
||||
$files_num = $imgs_num = 0;
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//delete from folder ..
|
||||
@kleeja_unlink (PATH . $row['folder'] . "/" . $row['name']);
|
||||
|
||||
//delete thumb
|
||||
if (file_exists(PATH . $row['folder'] . "/thumbs/" . $row['name']))
|
||||
{
|
||||
@kleeja_unlink (PATH . $row['folder'] . "/thumbs/" . $row['name']);
|
||||
}
|
||||
|
||||
$is_image = in_array(strtolower(trim($row['type'])), array('gif', 'jpg', 'jpeg', 'bmp', 'png')) ? true : false;
|
||||
|
||||
$ids[] = $row['id'];
|
||||
if($is_image)
|
||||
{
|
||||
$imgs_num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$files_num++;
|
||||
}
|
||||
$sizes += $row['size'];
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
|
||||
if(($files_num + $imgs_num) == 0)
|
||||
{
|
||||
kleeja_admin_err($lang['ADMIN_DELETE_FILES_NOF']);
|
||||
}
|
||||
else
|
||||
{
|
||||
//update number of stats
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "sizes=sizes-$sizes, files=files-$files_num, imgs=imgs-$imgs_num",
|
||||
);
|
||||
|
||||
$SQL->build($update_query);
|
||||
if($SQL->affected())
|
||||
{
|
||||
delete_cache('data_stats');
|
||||
}
|
||||
|
||||
//delete all files in just one query
|
||||
$query_del = array(
|
||||
'DELETE' => "{$dbprefix}files",
|
||||
'WHERE' => "`id` IN (" . implode(',', $ids) . ")"
|
||||
);
|
||||
|
||||
$SQL->build($query_del);
|
||||
|
||||
kleeja_admin_info(sprintf($lang['ADMIN_DELETE_FILES_OK'], ($files_num + $imgs_num)));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//begin default files page
|
||||
//
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'COUNT(f.id) AS total_files',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'ORDER BY' => 'f.id '
|
||||
);
|
||||
|
||||
#if user system is default, we use users table
|
||||
if((int) $config['user_system'] == 1)
|
||||
{
|
||||
$query['JOINS'] = array(
|
||||
array(
|
||||
'LEFT JOIN' => "{$dbprefix}users u",
|
||||
'ON' => 'u.id=f.user'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$do_not_query_total_files = false;
|
||||
|
||||
//posts search ..
|
||||
if(ig('search_id'))
|
||||
{
|
||||
#get search filter
|
||||
$filter = get_filter(g('search_id'), 'file_search', false, 'filter_uid');
|
||||
$deletelink = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&deletefiles=' . g('search_id');
|
||||
$is_search = true;
|
||||
$query['WHERE'] = build_search_query(unserialize(htmlspecialchars_decode($filter['filter_value'])));
|
||||
}
|
||||
else if(isset($_REQUEST['last_visit']))
|
||||
{
|
||||
$query['WHERE'] = "f.time > " . intval($_REQUEST['last_visit']);
|
||||
}
|
||||
|
||||
#to-be-deleted
|
||||
#it is becoming a headache for a big websites. We do not have the time to figure out a solution
|
||||
|
||||
if(isset($_REQUEST['order_by']) && in_array($_REQUEST['order_by'], array('real_filename', 'size', 'user', 'user_ip', 'uploads', 'time', 'type', 'folder', 'report')))
|
||||
{
|
||||
$query['ORDER BY'] = "f." . $SQL->escape($_REQUEST['order_by']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_not_query_total_files = true;
|
||||
}
|
||||
|
||||
if(!ig('search_id'))
|
||||
{
|
||||
//display files or display pics and files only in search
|
||||
$img_types = array('gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG');
|
||||
$query['WHERE'] = $query['WHERE'] . (empty($query['WHERE']) ? '' : ' AND ') . "f.type NOT IN ('" . implode("', '", $img_types) . "')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_not_query_total_files = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query['ORDER BY'] .= (isset($_REQUEST['order_way']) && (int) $_REQUEST['order_way'] == 1) ? ' ASC' : ' DESC';
|
||||
|
||||
$nums_rows = 0;
|
||||
if($do_not_query_total_files)
|
||||
{
|
||||
$nums_rows = get_actual_stats('files');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result_p = $SQL->build($query);
|
||||
$n_fetch = $SQL->fetch_array($result_p);
|
||||
$nums_rows = $n_fetch['total_files'];
|
||||
$SQL->freeresult($result_p);
|
||||
}
|
||||
|
||||
|
||||
//pager
|
||||
$currentPage= ig('page') ? g('page', 'int') : 1;
|
||||
$Pager = new Pagination($files_acp_perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
|
||||
$no_results = false;
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('query_files_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
if ($nums_rows > 0)
|
||||
{
|
||||
$query['SELECT'] = 'f.*' . ((int) $config['user_system'] == 1 ? ', u.name AS username' : '');
|
||||
$query['LIMIT'] = "$start, $files_acp_perpage";
|
||||
$result = $SQL->build($query);
|
||||
$sizes = false;
|
||||
$num = 0;
|
||||
#if Kleeja integtared we dont want make alot of queries
|
||||
$ids_and_names = array();
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['user'] . '.html' : 'ucp.php?go=fileuser&id=' . $row['user']);
|
||||
|
||||
|
||||
$file_info = array('::ID::' => $row['id'], '::NAME::' => $row['name'], '::DIR::' => $row['folder'], '::FNAME::' => $row['real_filename']);
|
||||
|
||||
$is_image = in_array(strtolower(trim($row['type'])), array('gif', 'jpg', 'jpeg', 'bmp', 'png')) ? true : false;
|
||||
|
||||
$url = kleeja_get_link($is_image ? 'image': 'file', $file_info);
|
||||
|
||||
|
||||
#for username in integrated user system
|
||||
if($row['user'] != '-1' and (int) $config['user_system'] != 1)
|
||||
{
|
||||
if(!in_array($row['user'], $ids_and_names))
|
||||
{
|
||||
$row['username'] = $usrcp->usernamebyid($row['user']);
|
||||
$ids_and_names[$row['user']] = $row['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['username'] = $ids_and_names[$row['user']];
|
||||
}
|
||||
}
|
||||
|
||||
$file_name = $row['real_filename'] == '' ? $row['name'] : $row['real_filename'];
|
||||
|
||||
//make new lovely arrays !!
|
||||
$arr[] = array(
|
||||
'id' => $row['id'],
|
||||
'name' => "<a title=\"" . $file_name . "\" href=\"" .$url . "\" target=\"blank\">" .
|
||||
shorten_text($file_name, 25) . "</a>",
|
||||
'fullname' => $file_name,
|
||||
'size' => readable_size($row['size']),
|
||||
'ups' => $row['uploads'],
|
||||
'direct' => $row['id_form'] == 'direct' ? true : false,
|
||||
'time_human'=> kleeja_date($row['time']),
|
||||
'time' => kleeja_date($row['time'], false),
|
||||
'type' => $row['type'],
|
||||
'typeicon' => file_exists(PATH . "images/filetypes/". $row['type'] . ".png") ? PATH . "images/filetypes/" . $row['type'] . ".png" : PATH. 'images/filetypes/file.png',
|
||||
'folder' => $row['folder'],
|
||||
'report' => $row['report'] > 4 ? "<span style=\"color:red;font-weight:bold\">" . $row['report'] . "</span>":$row['report'],
|
||||
'user' => $row['user'] == '-1' ? $lang['GUST'] : '<a href="' . $userfile . '" target="_blank">' . $row['username'] . '</a>',
|
||||
'ip' => '<a href="http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . $row['user_ip'] . '&do_search=Search" target="_new">' . $row['user_ip'] . '</a>',
|
||||
'showfilesbyip' => basename(ADMIN_PATH) . '?cp=h_search&s_input=1&s_value=' . $row['user_ip']
|
||||
);
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('arr_files_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
//no result ..
|
||||
$no_results = true;
|
||||
}
|
||||
|
||||
|
||||
#update f_lastvisit
|
||||
if(!$is_search)
|
||||
{
|
||||
if (filter_exists('f_lastvisit', 'filter_uid', 'lastvisit', $userinfo['id'])) {
|
||||
update_filter('f_lastvisit', time(), 'lastvisit', false, $userinfo['id']);
|
||||
} else {
|
||||
insert_filter('f_lastvisit', time(), 'lastvisit', time(), $userinfo['id']);
|
||||
if ($SQL->affected())
|
||||
{
|
||||
delete_cache('data_stats');
|
||||
$affected = true;
|
||||
}
|
||||
}
|
||||
|
||||
//show msg now
|
||||
$text = ($affected && (isset($ids) && sizeof($ids)) ? $lang['FILES_UPDATED'] : $lang['NO_UP_CHANGE_S']) .
|
||||
'<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . str_replace('&', '&', $action) . '\');", 2000);</script>' . "\n";
|
||||
$stylee = 'admin_info';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//
|
||||
//Delete all user files [only one user]
|
||||
//
|
||||
if (ig('deletefiles'))
|
||||
{
|
||||
$query = [
|
||||
'SELECT' => 'f.id, f.size, f.name, f.folder',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
];
|
||||
|
||||
//get search filter
|
||||
$filter = get_filter(g('search_id'), 'file_search', false, 'filter_uid');
|
||||
|
||||
if (! $filter)
|
||||
{
|
||||
kleeja_admin_err($lang['ADMIN_DELETE_FILES_NOF']);
|
||||
}
|
||||
|
||||
$query['WHERE'] = build_search_query(unserialize(htmlspecialchars_decode($filter['filter_value'])));
|
||||
|
||||
if ($query['WHERE'] == '')
|
||||
{
|
||||
kleeja_admin_err($lang['ADMIN_DELETE_FILES_NOF']);
|
||||
}
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$sizes = false;
|
||||
$ids = [];
|
||||
$files_num = $imgs_num = 0;
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//delete from folder ..
|
||||
@kleeja_unlink (PATH . $row['folder'] . '/' . $row['name']);
|
||||
|
||||
//delete thumb
|
||||
if (file_exists(PATH . $row['folder'] . '/thumbs/' . $row['name']))
|
||||
{
|
||||
@kleeja_unlink (PATH . $row['folder'] . '/thumbs/' . $row['name']);
|
||||
}
|
||||
|
||||
$is_image = in_array(strtolower(trim($row['type'])), ['gif', 'jpg', 'jpeg', 'bmp', 'png']) ? true : false;
|
||||
|
||||
$ids[] = $row['id'];
|
||||
|
||||
if ($is_image)
|
||||
{
|
||||
$imgs_num++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$files_num++;
|
||||
}
|
||||
$sizes += $row['size'];
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
|
||||
if (($files_num + $imgs_num) == 0)
|
||||
{
|
||||
kleeja_admin_err($lang['ADMIN_DELETE_FILES_NOF']);
|
||||
}
|
||||
else
|
||||
{
|
||||
//update number of stats
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "sizes=sizes-$sizes, files=files-$files_num, imgs=imgs-$imgs_num",
|
||||
];
|
||||
|
||||
$SQL->build($update_query);
|
||||
|
||||
if ($SQL->affected())
|
||||
{
|
||||
delete_cache('data_stats');
|
||||
}
|
||||
|
||||
//delete all files in just one query
|
||||
$query_del = [
|
||||
'DELETE' => "{$dbprefix}files",
|
||||
'WHERE' => '`id` IN (' . implode(',', $ids) . ')'
|
||||
];
|
||||
|
||||
$SQL->build($query_del);
|
||||
|
||||
kleeja_admin_info(sprintf($lang['ADMIN_DELETE_FILES_OK'], ($files_num + $imgs_num)));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//begin default files page
|
||||
//
|
||||
|
||||
$query = [
|
||||
'SELECT' => 'COUNT(f.id) AS total_files',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'ORDER BY' => 'f.id '
|
||||
];
|
||||
|
||||
//if user system is default, we use users table
|
||||
if ((int) $config['user_system'] == 1)
|
||||
{
|
||||
$query['JOINS'] = [
|
||||
[
|
||||
'LEFT JOIN' => "{$dbprefix}users u",
|
||||
'ON' => 'u.id=f.user'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
$do_not_query_total_files = false;
|
||||
|
||||
//posts search ..
|
||||
if (ig('search_id'))
|
||||
{
|
||||
//get search filter
|
||||
$filter = get_filter(g('search_id'), 'file_search', false, 'filter_uid');
|
||||
$deletelink = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&deletefiles=' . g('search_id');
|
||||
$is_search = true;
|
||||
$query['WHERE'] = build_search_query(unserialize(htmlspecialchars_decode($filter['filter_value'])));
|
||||
}
|
||||
elseif (isset($_REQUEST['last_visit']))
|
||||
{
|
||||
$query['WHERE'] = 'f.time > ' . intval($_REQUEST['last_visit']);
|
||||
}
|
||||
|
||||
//to-be-deleted
|
||||
//it is becoming a headache for a big websites. We do not have the time to figure out a solution
|
||||
|
||||
if (isset($_REQUEST['order_by']) && in_array($_REQUEST['order_by'], ['real_filename', 'size', 'user', 'user_ip', 'uploads', 'time', 'type', 'folder', 'report']))
|
||||
{
|
||||
$query['ORDER BY'] = 'f.' . $SQL->escape($_REQUEST['order_by']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_not_query_total_files = true;
|
||||
}
|
||||
|
||||
if (! ig('search_id'))
|
||||
{
|
||||
//display files or display pics and files only in search
|
||||
$img_types = ['gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG'];
|
||||
$query['WHERE'] = $query['WHERE'] . (empty($query['WHERE']) ? '' : ' AND ') . "f.type NOT IN ('" . implode("', '", $img_types) . "')";
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_not_query_total_files = false;
|
||||
}
|
||||
|
||||
|
||||
//some vars
|
||||
$total_pages = $Pager->getTotalPages();
|
||||
$page_nums = $Pager->print_nums($page_action);
|
||||
|
||||
$query['ORDER BY'] .= (isset($_REQUEST['order_way']) && (int) $_REQUEST['order_way'] == 1) ? ' ASC' : ' DESC';
|
||||
|
||||
$nums_rows = 0;
|
||||
|
||||
if ($do_not_query_total_files)
|
||||
{
|
||||
$nums_rows = get_actual_stats('files');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result_p = $SQL->build($query);
|
||||
$n_fetch = $SQL->fetch_array($result_p);
|
||||
$nums_rows = $n_fetch['total_files'];
|
||||
$SQL->freeresult($result_p);
|
||||
}
|
||||
|
||||
|
||||
//pager
|
||||
$currentPage= ig('page') ? g('page', 'int') : 1;
|
||||
$Pager = new Pagination($files_acp_perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
|
||||
$no_results = false;
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('query_files_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
if ($nums_rows > 0)
|
||||
{
|
||||
$query['SELECT'] = 'f.*' . ((int) $config['user_system'] == 1 ? ', u.name AS username' : '');
|
||||
$query['LIMIT'] = "$start, $files_acp_perpage";
|
||||
$result = $SQL->build($query);
|
||||
$sizes = false;
|
||||
$num = 0;
|
||||
//if Kleeja integtared we dont want make alot of queries
|
||||
$ids_and_names = [];
|
||||
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$userfile = $config['siteurl'] . ($config['mod_writer'] ? 'fileuser-' . $row['user'] . '.html' : 'ucp.php?go=fileuser&id=' . $row['user']);
|
||||
|
||||
|
||||
$file_info = ['::ID::' => $row['id'], '::NAME::' => $row['name'], '::DIR::' => $row['folder'], '::FNAME::' => $row['real_filename']];
|
||||
|
||||
$is_image = in_array(strtolower(trim($row['type'])), ['gif', 'jpg', 'jpeg', 'bmp', 'png']) ? true : false;
|
||||
|
||||
$url = kleeja_get_link($is_image ? 'image': 'file', $file_info);
|
||||
|
||||
|
||||
//for username in integrated user system
|
||||
if ($row['user'] != '-1' and (int) $config['user_system'] != 1)
|
||||
{
|
||||
if (! in_array($row['user'], $ids_and_names))
|
||||
{
|
||||
$row['username'] = $usrcp->usernamebyid($row['user']);
|
||||
$ids_and_names[$row['user']] = $row['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['username'] = $ids_and_names[$row['user']];
|
||||
}
|
||||
}
|
||||
|
||||
$file_name = $row['real_filename'] == '' ? $row['name'] : $row['real_filename'];
|
||||
|
||||
//make new lovely arrays !!
|
||||
$arr[] = [
|
||||
'id' => $row['id'],
|
||||
'name' => '<a title="' . $file_name . '" href="' . $url . '" target="blank">' .
|
||||
shorten_text($file_name, 25) . '</a>',
|
||||
'fullname' => $file_name,
|
||||
'size' => readable_size($row['size']),
|
||||
'ups' => $row['uploads'],
|
||||
'direct' => $row['id_form'] == 'direct' ? true : false,
|
||||
'time_human' => kleeja_date($row['time']),
|
||||
'time' => kleeja_date($row['time'], false),
|
||||
'type' => $row['type'],
|
||||
'typeicon' => file_exists(PATH . 'images/filetypes/' . $row['type'] . '.png') ? PATH . 'images/filetypes/' . $row['type'] . '.png' : PATH . 'images/filetypes/file.png',
|
||||
'folder' => $row['folder'],
|
||||
'report' => $row['report'] > 4 ? '<span style="color:red;font-weight:bold">' . $row['report'] . '</span>':$row['report'],
|
||||
'user' => $row['user'] == '-1' ? $lang['GUST'] : '<a href="' . $userfile . '" target="_blank">' . $row['username'] . '</a>',
|
||||
'ip' => '<a href="http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . $row['user_ip'] . '&do_search=Search" target="_new">' . $row['user_ip'] . '</a>',
|
||||
'showfilesbyip' => basename(ADMIN_PATH) . '?cp=h_search&s_input=1&s_value=' . $row['user_ip']
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('arr_files_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
//no result ..
|
||||
$no_results = true;
|
||||
}
|
||||
|
||||
|
||||
//update f_lastvisit
|
||||
if (! $is_search)
|
||||
{
|
||||
if (filter_exists('f_lastvisit', 'filter_uid', 'lastvisit', $userinfo['id']))
|
||||
{
|
||||
update_filter('f_lastvisit', time(), 'lastvisit', false, $userinfo['id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
insert_filter('f_lastvisit', time(), 'lastvisit', time(), $userinfo['id']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//some vars
|
||||
$total_pages = $Pager->getTotalPages();
|
||||
$page_nums = $Pager->print_nums($page_action);
|
||||
$current_page = $Pager->getCurrentPage();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,41 +8,41 @@
|
||||
*/
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
#number of images per page
|
||||
//number of images per page
|
||||
$images_acp_perpage = defined('ACP_IMAGES_PER_PAGE') ? ACP_IMAGES_PER_PAGE : 20;
|
||||
|
||||
|
||||
#display
|
||||
$stylee = "admin_img";
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . (ig('page') ? '&page=' . g('page', 'int') : '') .
|
||||
(ig('last_visit') ? '&last_visit='.g('last_visit', 'int') : '') .
|
||||
//display
|
||||
$stylee = 'admin_img';
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . (ig('page') ? '&page=' . g('page', 'int') : '') .
|
||||
(ig('last_visit') ? '&last_visit=' . g('last_visit', 'int') : '') .
|
||||
(ig('smt') ? '&smt=' . g('smt') : '');
|
||||
$action_search = basename(ADMIN_PATH) . "?cp=h_search";
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_img_ctrl');
|
||||
$is_search = false;
|
||||
$action_search = basename(ADMIN_PATH) . '?cp=h_search';
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_img_ctrl');
|
||||
$is_search = false;
|
||||
|
||||
//
|
||||
// Check form key
|
||||
//
|
||||
if (ip('submit'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_img_ctrl'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_img_ctrl'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
|
||||
$del = array();
|
||||
$del = [];
|
||||
$num = $sizes = 0;
|
||||
|
||||
|
||||
foreach ($_POST as $key => $value)
|
||||
foreach ($_POST as $key => $value)
|
||||
{
|
||||
if(preg_match('/del_(?P<digit>\d+)/', $key))
|
||||
if (preg_match('/del_(?P<digit>\d+)/', $key))
|
||||
{
|
||||
$del[$key] = $value;
|
||||
}
|
||||
@@ -51,218 +51,218 @@ if (ip('submit'))
|
||||
//TODO better way
|
||||
foreach ($del as $key => $id)
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}files",
|
||||
'WHERE' => '`id` = ' . intval($id),
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}files",
|
||||
'WHERE' => '`id` = ' . intval($id),
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//delete from folder ..
|
||||
@kleeja_unlink(PATH . $row['folder'] . '/' . $row['name']);
|
||||
//delete thumb
|
||||
if (file_exists(PATH . $row['folder'] . '/thumbs/' . $row['name'] ))
|
||||
{
|
||||
@kleeja_unlink(PATH . $row['folder'] . '/thumbs/' . $row['name'] );
|
||||
}
|
||||
$ids[] = $row['id'];
|
||||
$num++;
|
||||
$sizes += $row['size'];
|
||||
}
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//delete from folder ..
|
||||
@kleeja_unlink(PATH . $row['folder'] . '/' . $row['name']);
|
||||
//delete thumb
|
||||
if (file_exists(PATH . $row['folder'] . '/thumbs/' . $row['name'] ))
|
||||
{
|
||||
@kleeja_unlink(PATH . $row['folder'] . '/thumbs/' . $row['name'] );
|
||||
}
|
||||
$ids[] = $row['id'];
|
||||
$num++;
|
||||
$sizes += $row['size'];
|
||||
}
|
||||
|
||||
$SQL->free($result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('submit_imgctrl_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
//no files to delete
|
||||
if(isset($ids) && sizeof($ids))
|
||||
{
|
||||
$query_del = array(
|
||||
'DELETE' => "{$dbprefix}files",
|
||||
'WHERE' => "`id` IN (" . implode(',', $ids) . ")"
|
||||
);
|
||||
|
||||
$SQL->build($query_del);
|
||||
if (isset($ids) && sizeof($ids))
|
||||
{
|
||||
$query_del = [
|
||||
'DELETE' => "{$dbprefix}files",
|
||||
'WHERE' => '`id` IN (' . implode(',', $ids) . ')'
|
||||
];
|
||||
|
||||
//update number of stats
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "sizes=sizes-$sizes, imgs=imgs-$num",
|
||||
);
|
||||
$SQL->build($query_del);
|
||||
|
||||
//update number of stats
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "sizes=sizes-$sizes, imgs=imgs-$num",
|
||||
];
|
||||
|
||||
$SQL->build($update_query);
|
||||
|
||||
if ($SQL->affected())
|
||||
{
|
||||
delete_cache('data_stats');
|
||||
$affected = true;
|
||||
}
|
||||
}
|
||||
|
||||
$SQL->build($update_query);
|
||||
if($SQL->affected())
|
||||
{
|
||||
delete_cache('data_stats');
|
||||
$affected = true;
|
||||
}
|
||||
}
|
||||
|
||||
//after submit
|
||||
$text = ($affected ? $lang['FILES_UPDATED'] : $lang['NO_UP_CHANGE_S']) .
|
||||
'<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') .
|
||||
'&page=' . (ig('page') ? g('page', 'int') : '1') . '\');", 2000);</script>' . "\n";
|
||||
$text = ($affected ? $lang['FILES_UPDATED'] : $lang['NO_UP_CHANGE_S']) .
|
||||
'<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') .
|
||||
'&page=' . (ig('page') ? g('page', 'int') : '1') . '\');", 2000);</script>' . "\n";
|
||||
|
||||
$stylee = "admin_info";
|
||||
$stylee = 'admin_info';
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = [
|
||||
'SELECT' => 'COUNT(f.id) AS total_files',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'ORDER BY' => 'f.id DESC'
|
||||
];
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'COUNT(f.id) AS total_files',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'ORDER BY' => 'f.id DESC'
|
||||
);
|
||||
|
||||
#if user system is default, we use users table
|
||||
if((int) $config['user_system'] == 1)
|
||||
{
|
||||
$query['JOINS'] = array(
|
||||
array(
|
||||
'LEFT JOIN' => "{$dbprefix}users u",
|
||||
'ON' => 'u.id=f.user'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$img_types = array('gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG');
|
||||
|
||||
#
|
||||
# There is a bug with IN statement in MySQL and they said it will solved at 6.0 version
|
||||
# forums.mysql.com/read.php?10,243691,243888#msg-243888
|
||||
# $query['WHERE'] = "f.type IN ('" . implode("', '", $img_types) . "')";
|
||||
#
|
||||
|
||||
$query['WHERE'] = "(f.type = '" . implode("' OR f.type = '", $img_types) . "')";
|
||||
|
||||
|
||||
$do_not_query_total_files = false;
|
||||
|
||||
if(ig('last_visit'))
|
||||
{
|
||||
$query['WHERE'] .= " AND f.time > " . g('last_visit', 'int');
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_not_query_total_files = true;
|
||||
}
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('query_imgctrl_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
$nums_rows = 0;
|
||||
if($do_not_query_total_files)
|
||||
{
|
||||
$nums_rows = get_actual_stats('imgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result_p = $SQL->build($query);
|
||||
$n_fetch = $SQL->fetch_array($result_p);
|
||||
$nums_rows = $n_fetch['total_files'];
|
||||
$SQL->freeresult($result_p);
|
||||
}
|
||||
|
||||
//pager
|
||||
$currentPage= ig('page') ? g('page', 'int') : 1;
|
||||
$Pager = new Pagination($images_acp_perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
|
||||
|
||||
$no_results = $affected = $sizes = false;
|
||||
if ($nums_rows > 0)
|
||||
{
|
||||
|
||||
$query['SELECT'] = 'f.*' . ((int) $config['user_system'] == 1 ? ', u.name AS username' : '');
|
||||
$query['LIMIT'] = "$start, $images_acp_perpage";
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$tdnum = $num = 0;
|
||||
#if Kleeja integrated we dont want make alot of queries
|
||||
$ids_and_names = array();
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$file_info = array('::ID::' => $row['id'], '::NAME::' => $row['name'], '::DIR::' => $row['folder'], '::FNAME::' => $row['real_filename']);
|
||||
|
||||
$url = kleeja_get_link('image', $file_info);
|
||||
|
||||
$url_thumb = kleeja_get_link('thumb', $file_info);
|
||||
|
||||
|
||||
#for username in integrated user system
|
||||
if($row['user'] != '-1' and (int) $config['user_system'] != 1)
|
||||
{
|
||||
if(!in_array($row['user'], $ids_and_names))
|
||||
{
|
||||
$row['username'] = $usrcp->usernamebyid($row['user']);
|
||||
$ids_and_names[$row['user']] = $row['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['username'] = $ids_and_names[$row['user']];
|
||||
}
|
||||
}
|
||||
|
||||
$file_name = $row['real_filename'] == '' ? $row['name'] : $row['real_filename'];
|
||||
|
||||
|
||||
//make new lovely arrays !!
|
||||
$arr[] = array(
|
||||
'id' => $row['id'],
|
||||
'tdnum' => $tdnum == 0 ? '<ul>': '',
|
||||
'tdnum2' => $tdnum == 4 ? '</ul>' : '',
|
||||
'name' => shorten_text($file_name, 25),
|
||||
'ip' => htmlspecialchars($row['user_ip']),
|
||||
'href' => $url,
|
||||
'size' => readable_size($row['size']),
|
||||
'ups' => $row['uploads'],
|
||||
'time' => date('d-m-Y h:i a', $row['time']),
|
||||
'user' => (int) $row['user'] == -1 ? $lang['GUST'] : $row['username'],
|
||||
'is_user' => (int) $row['user'] == -1 ? 0 : 1,
|
||||
'thumb_link'=> $url_thumb
|
||||
);
|
||||
|
||||
//fix ...
|
||||
$tdnum = $tdnum == 4 ? 0 : $tdnum+1;
|
||||
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('arr_imgctrl_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
//if user system is default, we use users table
|
||||
if ((int) $config['user_system'] == 1)
|
||||
{
|
||||
$query['JOINS'] = [
|
||||
[
|
||||
'LEFT JOIN' => "{$dbprefix}users u",
|
||||
'ON' => 'u.id=f.user'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$img_types = ['gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG'];
|
||||
|
||||
//
|
||||
// There is a bug with IN statement in MySQL and they said it will solved at 6.0 version
|
||||
// forums.mysql.com/read.php?10,243691,243888#msg-243888
|
||||
// $query['WHERE'] = "f.type IN ('" . implode("', '", $img_types) . "')";
|
||||
//
|
||||
|
||||
$query['WHERE'] = "(f.type = '" . implode("' OR f.type = '", $img_types) . "')";
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_results = true;
|
||||
}
|
||||
$do_not_query_total_files = false;
|
||||
|
||||
#update f_lastvisit
|
||||
if(!$is_search)
|
||||
{
|
||||
if (filter_exists('i_lastvisit', 'filter_uid', 'lastvisit', $userinfo['id'])) {
|
||||
update_filter('i_lastvisit', time(), 'lastvisit', false, $userinfo['id']);
|
||||
} else {
|
||||
insert_filter('i_lastvisit', time(), 'lastvisit', time(), $userinfo['id']);
|
||||
if (ig('last_visit'))
|
||||
{
|
||||
$query['WHERE'] .= ' AND f.time > ' . g('last_visit', 'int');
|
||||
}
|
||||
else
|
||||
{
|
||||
$do_not_query_total_files = true;
|
||||
}
|
||||
}
|
||||
|
||||
//pages
|
||||
$total_pages = $Pager->getTotalPages();
|
||||
$page_nums = $Pager->print_nums(basename(ADMIN_PATH). '?cp=' . basename(__file__, '.php') .
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('query_imgctrl_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
$nums_rows = 0;
|
||||
|
||||
if ($do_not_query_total_files)
|
||||
{
|
||||
$nums_rows = get_actual_stats('imgs');
|
||||
}
|
||||
else
|
||||
{
|
||||
$result_p = $SQL->build($query);
|
||||
$n_fetch = $SQL->fetch_array($result_p);
|
||||
$nums_rows = $n_fetch['total_files'];
|
||||
$SQL->freeresult($result_p);
|
||||
}
|
||||
|
||||
//pager
|
||||
$currentPage= ig('page') ? g('page', 'int') : 1;
|
||||
$Pager = new Pagination($images_acp_perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
|
||||
|
||||
$no_results = $affected = $sizes = false;
|
||||
|
||||
if ($nums_rows > 0)
|
||||
{
|
||||
$query['SELECT'] = 'f.*' . ((int) $config['user_system'] == 1 ? ', u.name AS username' : '');
|
||||
$query['LIMIT'] = "$start, $images_acp_perpage";
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$tdnum = $num = 0;
|
||||
//if Kleeja integrated we dont want make alot of queries
|
||||
$ids_and_names = [];
|
||||
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$file_info = ['::ID::' => $row['id'], '::NAME::' => $row['name'], '::DIR::' => $row['folder'], '::FNAME::' => $row['real_filename']];
|
||||
|
||||
$url = kleeja_get_link('image', $file_info);
|
||||
|
||||
$url_thumb = kleeja_get_link('thumb', $file_info);
|
||||
|
||||
|
||||
//for username in integrated user system
|
||||
if ($row['user'] != '-1' and (int) $config['user_system'] != 1)
|
||||
{
|
||||
if (! in_array($row['user'], $ids_and_names))
|
||||
{
|
||||
$row['username'] = $usrcp->usernamebyid($row['user']);
|
||||
$ids_and_names[$row['user']] = $row['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$row['username'] = $ids_and_names[$row['user']];
|
||||
}
|
||||
}
|
||||
|
||||
$file_name = $row['real_filename'] == '' ? $row['name'] : $row['real_filename'];
|
||||
|
||||
|
||||
//make new lovely arrays !!
|
||||
$arr[] = [
|
||||
'id' => $row['id'],
|
||||
'tdnum' => $tdnum == 0 ? '<ul>': '',
|
||||
'tdnum2' => $tdnum == 4 ? '</ul>' : '',
|
||||
'name' => shorten_text($file_name, 25),
|
||||
'ip' => htmlspecialchars($row['user_ip']),
|
||||
'href' => $url,
|
||||
'size' => readable_size($row['size']),
|
||||
'ups' => $row['uploads'],
|
||||
'time' => date('d-m-Y h:i a', $row['time']),
|
||||
'user' => (int) $row['user'] == -1 ? $lang['GUST'] : $row['username'],
|
||||
'is_user' => (int) $row['user'] == -1 ? 0 : 1,
|
||||
'thumb_link'=> $url_thumb
|
||||
];
|
||||
|
||||
//fix ...
|
||||
$tdnum = $tdnum == 4 ? 0 : $tdnum+1;
|
||||
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('arr_imgctrl_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_results = true;
|
||||
}
|
||||
|
||||
//update f_lastvisit
|
||||
if (! $is_search)
|
||||
{
|
||||
if (filter_exists('i_lastvisit', 'filter_uid', 'lastvisit', $userinfo['id']))
|
||||
{
|
||||
update_filter('i_lastvisit', time(), 'lastvisit', false, $userinfo['id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
insert_filter('i_lastvisit', time(), 'lastvisit', time(), $userinfo['id']);
|
||||
}
|
||||
}
|
||||
|
||||
//pages
|
||||
$total_pages = $Pager->getTotalPages();
|
||||
$page_nums = $Pager->print_nums(basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') .
|
||||
(ig('last_visit') ? '&last_vists=' . g('last_visit', 'int') : '') .
|
||||
(ig('smt') ? '&smt=' . g('smt') : '')
|
||||
, 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"');
|
||||
$current_page = $Pager->getCurrentPage();
|
||||
}
|
||||
(ig('smt') ? '&smt=' . g('smt') : ''), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"');
|
||||
$current_page = $Pager->getCurrentPage();
|
||||
}
|
||||
|
||||
@@ -6,19 +6,19 @@
|
||||
* @license ./docs/license.txt
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_calls";
|
||||
$stylee = 'admin_calls';
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&smt=' . $current_smt;
|
||||
$msg_sent = ig('sent') ? g('sent', 'int') : false;
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&smt=' . $current_smt;
|
||||
$msg_sent = ig('sent') ? g('sent', 'int') : false;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_calls');
|
||||
$there_queue = preg_match('!:del_[a-z0-9]{0,3}calls:!i', $config['queue']);
|
||||
|
||||
@@ -27,147 +27,145 @@ $there_queue = preg_match('!:del_[a-z0-9]{0,3}calls:!i', $config['queue']);
|
||||
//
|
||||
if (ip('submit'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_calls'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_calls'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#add delete process to the queue
|
||||
if($current_smt == 'del_d30' || $current_smt == 'del_all')
|
||||
//add delete process to the queue
|
||||
if ($current_smt == 'del_d30' || $current_smt == 'del_all')
|
||||
{
|
||||
|
||||
if(strpos($config['queue'], ':' . $current_smt . 'calls:') !== false)
|
||||
{
|
||||
kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
update_config('queue', $config['queue'] . ':' . $current_smt . 'calls:');
|
||||
kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'));
|
||||
}
|
||||
if (strpos($config['queue'], ':' . $current_smt . 'calls:') !== false)
|
||||
{
|
||||
kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
update_config('queue', $config['queue'] . ':' . $current_smt . 'calls:');
|
||||
kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'c.*',
|
||||
'FROM' => "`{$dbprefix}call` c",
|
||||
'ORDER BY' => 'c.id DESC'
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'c.*',
|
||||
'FROM' => "`{$dbprefix}call` c",
|
||||
'ORDER BY' => 'c.id DESC'
|
||||
];
|
||||
|
||||
|
||||
if($current_smt == 'show_h24')
|
||||
if ($current_smt == 'show_h24')
|
||||
{
|
||||
$query['WHERE'] = 'c.time > ' . intval(time() - 3600 * 24);
|
||||
$query['WHERE'] = 'c.time > ' . intval(time() - 3600 * 24);
|
||||
}
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
|
||||
//pagination
|
||||
$nums_rows = $SQL->num_rows($result);
|
||||
$nums_rows = $SQL->num_rows($result);
|
||||
$currentPage = ig('page') ? g('page', 'int') : 1;
|
||||
$Pager = new Pagination($perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
$Pager = new Pagination($perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
|
||||
|
||||
$no_results = false;
|
||||
$del_nums = array();
|
||||
$del_nums = [];
|
||||
|
||||
if ($nums_rows > 0)
|
||||
{
|
||||
$query['LIMIT'] = "$start,$perpage";
|
||||
$result = $SQL->build($query);
|
||||
$query['LIMIT'] = "$start,$perpage";
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//make new lovely arrays !!
|
||||
$arr[] = array(
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'mail' => $row['mail'],
|
||||
'text' => htmlspecialchars($row['text']),
|
||||
'human_time'=> kleeja_date($row['time']),
|
||||
'time' => kleeja_date($row['time'], false),
|
||||
'ip' => $row['ip'],
|
||||
'sent' => $row['id'] == $msg_sent,
|
||||
'ip_finder' => 'http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . $row['ip'] . '&do_search=Search'
|
||||
);
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//make new lovely arrays !!
|
||||
$arr[] = [
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'mail' => $row['mail'],
|
||||
'text' => htmlspecialchars($row['text']),
|
||||
'human_time'=> kleeja_date($row['time']),
|
||||
'time' => kleeja_date($row['time'], false),
|
||||
'ip' => $row['ip'],
|
||||
'sent' => $row['id'] == $msg_sent,
|
||||
'ip_finder' => 'http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . $row['ip'] . '&do_search=Search'
|
||||
];
|
||||
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
$sen[$row['id']] = p('v_' . $row['id']);
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
$sen[$row['id']] = p('v_' . $row['id']);
|
||||
|
||||
|
||||
//when submit !!
|
||||
if (ip('submit'))
|
||||
{
|
||||
if ($del[$row['id']])
|
||||
{
|
||||
$del_nums[] = $row['id'];
|
||||
}
|
||||
}
|
||||
//when submit !!
|
||||
if (ip('submit'))
|
||||
{
|
||||
if ($del[$row['id']])
|
||||
{
|
||||
$del_nums[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
if (ip('reply_submit'))
|
||||
{
|
||||
if ($sen[$row['id']])
|
||||
{
|
||||
$to = $row['mail'];
|
||||
$subject = $lang['REPLY_CALL'] . ':' . $config['sitename'];
|
||||
$message = "\n " . $lang['REPLY_CALL'] . " " . $row['name'] . "\r\n " . $lang['REPLIED_ON_CAL'] . " : " . $config['sitename'] .
|
||||
"\r\n " . $lang['BY_EMAIL'] . ": " . $row['mail'] . "\r\n" . $lang['ADMIN_REPLIED'] . "\r\n" . $sen[$row['id']] . "\r\n\r\n Kleeja.com ";
|
||||
if (ip('reply_submit'))
|
||||
{
|
||||
if ($sen[$row['id']])
|
||||
{
|
||||
$to = $row['mail'];
|
||||
$subject = $lang['REPLY_CALL'] . ':' . $config['sitename'];
|
||||
$message = "\n " . $lang['REPLY_CALL'] . ' ' . $row['name'] . "\r\n " . $lang['REPLIED_ON_CAL'] . ' : ' . $config['sitename'] .
|
||||
"\r\n " . $lang['BY_EMAIL'] . ': ' . $row['mail'] . "\r\n" . $lang['ADMIN_REPLIED'] . "\r\n" . $sen[$row['id']] . "\r\n\r\n Kleeja.com ";
|
||||
|
||||
$send = send_mail($to, $message, $subject, $config['sitemail'], $config['sitename']);
|
||||
$send = send_mail($to, $message, $subject, $config['sitemail'], $config['sitename']);
|
||||
|
||||
if ($send)
|
||||
{
|
||||
//
|
||||
//We will redirect to pages of results and show info msg there !
|
||||
//
|
||||
kleeja_admin_info($lang['IS_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERR_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
if ($send)
|
||||
{
|
||||
//
|
||||
//We will redirect to pages of results and show info msg there !
|
||||
//
|
||||
kleeja_admin_info($lang['IS_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERR_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
}
|
||||
else
|
||||
{
|
||||
$no_results = true;
|
||||
$no_results = true;
|
||||
}
|
||||
|
||||
//if deleted
|
||||
if(sizeof($del_nums))
|
||||
if (sizeof($del_nums))
|
||||
{
|
||||
$query_del = array(
|
||||
'DELETE' => "`{$dbprefix}call`",
|
||||
'WHERE' => "id IN('" . implode("', '", $del_nums) . "')"
|
||||
);
|
||||
$query_del = [
|
||||
'DELETE' => "`{$dbprefix}call`",
|
||||
'WHERE' => "id IN('" . implode("', '", $del_nums) . "')"
|
||||
];
|
||||
|
||||
$SQL->build($query_del);
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
|
||||
$total_pages = $Pager->getTotalPages();
|
||||
$page_nums = $Pager->print_nums(basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"');
|
||||
$page_nums = $Pager->print_nums(basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"');
|
||||
|
||||
//after submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
$text = ($SQL->affected() ? $lang['CALLS_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $action . '\'); check_msg_and_reports();", 2000);</script>' . "\n";
|
||||
kleeja_admin_info($text, true, '', true, $action);
|
||||
$text = ($SQL->affected() ? $lang['CALLS_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $action . '\'); check_msg_and_reports();", 2000);</script>' . "\n";
|
||||
kleeja_admin_info($text, true, '', true, $action);
|
||||
}
|
||||
|
||||
|
||||
//secondary menu
|
||||
$go_menu = array(
|
||||
'general' => array('name'=>$lang['R_CALLS'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'),
|
||||
'show_h24' => array('name'=>$lang['SHOW_FROM_24H'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=show_h24', 'goto'=>'show_h24', 'current'=> $current_smt == 'show_h24'),
|
||||
#CHECK IF IT'S ALREADY DONE ?
|
||||
'del_d30' => array('name'=>$lang['DELETE_EARLIER_30DAYS'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=del_d30', 'goto'=>'del_d30', 'current'=> $current_smt == 'del_d30', 'confirm'=>true),
|
||||
'del_all' => array('name'=>$lang['DELETE_ALL'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=del_all', 'goto'=>'del_all', 'current'=> $current_smt == 'del_all', 'confirm'=>true),
|
||||
);
|
||||
$go_menu = [
|
||||
'general' => ['name'=>$lang['R_CALLS'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'],
|
||||
'show_h24' => ['name'=>$lang['SHOW_FROM_24H'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=show_h24', 'goto'=>'show_h24', 'current'=> $current_smt == 'show_h24'],
|
||||
//CHECK IF IT'S ALREADY DONE ?
|
||||
'del_d30' => ['name'=>$lang['DELETE_EARLIER_30DAYS'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=del_d30', 'goto'=>'del_d30', 'current'=> $current_smt == 'del_d30', 'confirm'=>true],
|
||||
'del_all' => ['name'=>$lang['DELETE_ALL'], 'link'=> basename(ADMIN_PATH) . '?cp=e_calls&smt=del_all', 'goto'=>'del_all', 'current'=> $current_smt == 'del_all', 'confirm'=>true],
|
||||
];
|
||||
|
||||
@@ -6,18 +6,18 @@
|
||||
* @license ./docs/license.txt
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_reports";
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i','', g('smt', 'str', 'general'));
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&smt=' . $current_smt;
|
||||
$msg_sent = ig('sent') ? g('sent', 'int') : false;
|
||||
$stylee = 'admin_reports';
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&smt=' . $current_smt;
|
||||
$msg_sent = ig('sent') ? g('sent', 'int') : false;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_reports');
|
||||
$there_queue = preg_match('!:del_[a-z0-9]{0,3}reports:!i', $config['queue']);
|
||||
|
||||
@@ -27,146 +27,144 @@ $there_queue = preg_match('!:del_[a-z0-9]{0,3}reports:!i', $config['queue']);
|
||||
//
|
||||
if (ip('submit'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_reports'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_reports'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#add delete process to the queue
|
||||
if($current_smt == 'del_d30' || $current_smt == 'del_all')
|
||||
//add delete process to the queue
|
||||
if ($current_smt == 'del_d30' || $current_smt == 'del_all')
|
||||
{
|
||||
|
||||
if(strpos($config['queue'], ':' . $current_smt . 'reports:') !== false)
|
||||
{
|
||||
kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
update_config('queue', $config['queue'] . ':' . $current_smt . 'reports:');
|
||||
kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'));
|
||||
}
|
||||
if (strpos($config['queue'], ':' . $current_smt . 'reports:') !== false)
|
||||
{
|
||||
kleeja_admin_err($lang['DELETE_PROCESS_IN_WORK'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
update_config('queue', $config['queue'] . ':' . $current_smt . 'reports:');
|
||||
kleeja_admin_info($lang['DELETE_PROCESS_QUEUED'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'));
|
||||
}
|
||||
}
|
||||
|
||||
$query = array(
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}reports r",
|
||||
'ORDER BY' => 'r.id DESC'
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}reports r",
|
||||
'ORDER BY' => 'r.id DESC'
|
||||
];
|
||||
|
||||
if($current_smt == 'show_h24')
|
||||
if ($current_smt == 'show_h24')
|
||||
{
|
||||
$query['WHERE'] = 'r.time > ' . intval(time() - 3600 * 24);
|
||||
$query['WHERE'] = 'r.time > ' . intval(time() - 3600 * 24);
|
||||
}
|
||||
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
//pagination
|
||||
$nums_rows = $SQL->num_rows($result);
|
||||
$nums_rows = $SQL->num_rows($result);
|
||||
$currentPage = ig('page') ? g('page', 'int') : 1;
|
||||
$Pager = new Pagination($perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
$Pager = new Pagination($perpage, $nums_rows, $currentPage);
|
||||
$start = $Pager->getStartRow();
|
||||
|
||||
|
||||
$no_results = false;
|
||||
$del_nums = array();
|
||||
$del_nums = [];
|
||||
|
||||
if ($nums_rows > 0)
|
||||
{
|
||||
$query['LIMIT'] = "$start, $perpage";
|
||||
$result = $SQL->build($query);
|
||||
$query['LIMIT'] = "$start, $perpage";
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//make new lovely arrays !!
|
||||
$arr[] = array(
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'mail' => $row['mail'],
|
||||
'url' => $row['url'],
|
||||
'text' => $row['text'],
|
||||
'human_time'=> kleeja_date($row['time']),
|
||||
'time' => kleeja_date($row['time'], false),
|
||||
'ip' => $row['ip'],
|
||||
'sent' => $row['id'] == $msg_sent,
|
||||
'ip_finder' => 'http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . htmlspecialchars($row['ip']) . '&do_search=Search'
|
||||
);
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
//make new lovely arrays !!
|
||||
$arr[] = [
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'mail' => $row['mail'],
|
||||
'url' => $row['url'],
|
||||
'text' => $row['text'],
|
||||
'human_time'=> kleeja_date($row['time']),
|
||||
'time' => kleeja_date($row['time'], false),
|
||||
'ip' => $row['ip'],
|
||||
'sent' => $row['id'] == $msg_sent,
|
||||
'ip_finder' => 'http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=' . htmlspecialchars($row['ip']) . '&do_search=Search'
|
||||
];
|
||||
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
$sen[$row['id']] = p('v_' . $row['id']);
|
||||
$del[$row['id']] = p('del_' . $row['id']);
|
||||
$sen[$row['id']] = p('v_' . $row['id']);
|
||||
|
||||
//when submit !!
|
||||
if (ip('submit'))
|
||||
{
|
||||
if ($del[$row['id']])
|
||||
{
|
||||
$del_nums[] = $row['id'];
|
||||
}
|
||||
}
|
||||
//when submit !!
|
||||
if (ip('submit'))
|
||||
{
|
||||
if ($del[$row['id']])
|
||||
{
|
||||
$del_nums[] = $row['id'];
|
||||
}
|
||||
}
|
||||
|
||||
if (ip('reply_submit'))
|
||||
{
|
||||
if ($sen[$row['id']])
|
||||
{
|
||||
$to = $row['mail'];
|
||||
$subject = $lang['REPLY_REPORT'] . ':' . $config['sitename'];
|
||||
$message = "\n " . $lang['WELCOME'] . " " . $row['name'] . "\r\n " . $lang['U_REPORT_ON'] . " " . $config['sitename']. "\r\n " .
|
||||
$lang['BY_EMAIL'] . " : " . $row['mail']."\r\n" . $lang['ADMIN_REPLIED'] . ": \r\n" . $sen[$row['id']] . "\r\n\r\n kleeja.com";
|
||||
if (ip('reply_submit'))
|
||||
{
|
||||
if ($sen[$row['id']])
|
||||
{
|
||||
$to = $row['mail'];
|
||||
$subject = $lang['REPLY_REPORT'] . ':' . $config['sitename'];
|
||||
$message = "\n " . $lang['WELCOME'] . ' ' . $row['name'] . "\r\n " . $lang['U_REPORT_ON'] . ' ' . $config['sitename'] . "\r\n " .
|
||||
$lang['BY_EMAIL'] . ' : ' . $row['mail'] . "\r\n" . $lang['ADMIN_REPLIED'] . ": \r\n" . $sen[$row['id']] . "\r\n\r\n kleeja.com";
|
||||
|
||||
$send = send_mail($to, $message, $subject, $config['sitemail'], $config['sitename']);
|
||||
$send = send_mail($to, $message, $subject, $config['sitemail'], $config['sitename']);
|
||||
|
||||
if ($send)
|
||||
{
|
||||
//
|
||||
//We will redirect to pages of results and show info msg there !
|
||||
//
|
||||
kleeja_admin_info($lang['IS_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERR_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
if ($send)
|
||||
{
|
||||
//
|
||||
//We will redirect to pages of results and show info msg there !
|
||||
//
|
||||
kleeja_admin_info($lang['IS_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERR_SEND_MAIL'], true, '', true, basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&page=' . (ig('page') ? g('page', 'int') : 1) . '&sent=' . $row['id']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
}
|
||||
else #num rows
|
||||
{
|
||||
$no_results = true;
|
||||
else
|
||||
{ //num rows
|
||||
$no_results = true;
|
||||
}
|
||||
|
||||
|
||||
//if deleted
|
||||
if(sizeof($del_nums))
|
||||
if (sizeof($del_nums))
|
||||
{
|
||||
$query_del = array(
|
||||
'DELETE' => "{$dbprefix}reports",
|
||||
'WHERE' => "id IN('" . implode("', '", $del_nums) . "')"
|
||||
);
|
||||
$query_del = [
|
||||
'DELETE' => "{$dbprefix}reports",
|
||||
'WHERE' => "id IN('" . implode("', '", $del_nums) . "')"
|
||||
];
|
||||
|
||||
$SQL->build($query_del);
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
|
||||
$total_pages = $Pager->getTotalPages();
|
||||
$page_nums = $Pager->print_nums(basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"');
|
||||
$page_nums = $Pager->print_nums(basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php'), 'onclick="javascript:get_kleeja_link($(this).attr(\'href\'), \'#content\'); return false;"');
|
||||
|
||||
//after submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
$text = ($SQL->affected() ? $lang['REPORTS_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $action . '\'); check_msg_and_reports();", 2000);</script>' . "\n";
|
||||
kleeja_admin_info($text, true, '', true, $action);
|
||||
$text = ($SQL->affected() ? $lang['REPORTS_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . $action . '\'); check_msg_and_reports();", 2000);</script>' . "\n";
|
||||
kleeja_admin_info($text, true, '', true, $action);
|
||||
}
|
||||
|
||||
|
||||
//secondary menu
|
||||
$go_menu = array(
|
||||
'general' => array('name'=>$lang['R_REPORTS'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'),
|
||||
'show_h24' => array('name'=>$lang['SHOW_FROM_24H'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=show_h24', 'goto'=>'show_h24', 'current'=> $current_smt == 'show_h24'),
|
||||
#TODO : CHECK IF IT'S ALREADY DONE ?
|
||||
'del_d30' => array('name'=>$lang['DELETE_EARLIER_30DAYS'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=del_d30', 'goto'=>'del_d30', 'current'=> $current_smt == 'del_d30', 'confirm'=>true),
|
||||
'del_all' => array('name'=>$lang['DELETE_ALL'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=del_all', 'goto'=>'del_all', 'current'=> $current_smt == 'del_all', 'confirm'=>true),
|
||||
);
|
||||
$go_menu = [
|
||||
'general' => ['name'=>$lang['R_REPORTS'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'],
|
||||
'show_h24' => ['name'=>$lang['SHOW_FROM_24H'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=show_h24', 'goto'=>'show_h24', 'current'=> $current_smt == 'show_h24'],
|
||||
//TODO : CHECK IF IT'S ALREADY DONE ?
|
||||
'del_d30' => ['name'=>$lang['DELETE_EARLIER_30DAYS'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=del_d30', 'goto'=>'del_d30', 'current'=> $current_smt == 'del_d30', 'confirm'=>true],
|
||||
'del_all' => ['name'=>$lang['DELETE_ALL'], 'link'=> basename(ADMIN_PATH) . '?cp=f_reports&smt=del_all', 'goto'=>'del_all', 'current'=> $current_smt == 'del_all', 'confirm'=>true],
|
||||
];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,159 +9,162 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_search";
|
||||
$stylee = 'admin_search';
|
||||
//search files
|
||||
$action = basename(ADMIN_PATH) . "?cp=h_search";
|
||||
$action = basename(ADMIN_PATH) . '?cp=h_search';
|
||||
|
||||
//wut the default user system
|
||||
$default_user_system = (int) $config['user_system'] == 1 ? true : false;
|
||||
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_files_search');
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_files_search');
|
||||
$H_FORM_KEYS2 = kleeja_add_form_key('adm_users_search');
|
||||
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'files'));
|
||||
|
||||
#filling the inputs automatically via GET
|
||||
//filling the inputs automatically via GET
|
||||
$filled_ip = $filled_username = '';
|
||||
if(ig('s_input'))
|
||||
|
||||
if (ig('s_input'))
|
||||
{
|
||||
if(g('s_input', 'int') == 2)
|
||||
{
|
||||
$filled_username = g('s_value');
|
||||
}
|
||||
elseif(g('s_input', 'int') == 1)
|
||||
{
|
||||
$filled_ip = g('s_value');
|
||||
}
|
||||
if (g('s_input', 'int') == 2)
|
||||
{
|
||||
$filled_username = g('s_value');
|
||||
}
|
||||
elseif (g('s_input', 'int') == 1)
|
||||
{
|
||||
$filled_ip = g('s_value');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ip('search_file'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_files_search'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search', 1);
|
||||
}
|
||||
|
||||
#delete all searches greater than 10
|
||||
$s_del = array(
|
||||
'SELECT' => "filter_id",
|
||||
'FROM' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_type='file_search' AND filter_user=" . $userinfo['id'],
|
||||
'ORDER BY' => "filter_id DESC",
|
||||
'LIMIT' => '5, 18446744073709551615'
|
||||
);
|
||||
if (! kleeja_check_form_key('adm_files_search'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search', 1);
|
||||
}
|
||||
|
||||
$result = $SQL->build($s_del);
|
||||
$ids = array();
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$ids[] = $row['filter_id'];
|
||||
}
|
||||
//delete all searches greater than 10
|
||||
$s_del = [
|
||||
'SELECT' => 'filter_id',
|
||||
'FROM' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_type='file_search' AND filter_user=" . $userinfo['id'],
|
||||
'ORDER BY' => 'filter_id DESC',
|
||||
'LIMIT' => '5, 18446744073709551615'
|
||||
];
|
||||
|
||||
$SQL->free($result);
|
||||
$result = $SQL->build($s_del);
|
||||
$ids = [];
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$ids[] = $row['filter_id'];
|
||||
}
|
||||
|
||||
if($ids != '')
|
||||
{
|
||||
$query_del = array(
|
||||
'DELETE' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_id IN('" . implode("', '", $ids) . "')"
|
||||
);
|
||||
$SQL->free($result);
|
||||
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
if ($ids != '')
|
||||
{
|
||||
$query_del = [
|
||||
'DELETE' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_id IN('" . implode("', '", $ids) . "')"
|
||||
];
|
||||
|
||||
#add as a file_search filter
|
||||
$s = array_map('htmlspecialchars', $_POST);
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
|
||||
#reduce number of array keys
|
||||
unset($s['search_file'], $s['k_form_key'], $s['k_form_time']);
|
||||
foreach ($s as $key => $v)
|
||||
{
|
||||
if ($s[$key] == '')
|
||||
{
|
||||
unset($s[$key]);
|
||||
}
|
||||
}
|
||||
//add as a file_search filter
|
||||
$s = array_map('htmlspecialchars', $_POST);
|
||||
|
||||
$d = serialize($s);
|
||||
//reduce number of array keys
|
||||
unset($s['search_file'], $s['k_form_key'], $s['k_form_time']);
|
||||
|
||||
if(($search_id = insert_filter('file_search', $d)))
|
||||
{
|
||||
foreach ($s as $key => $v)
|
||||
{
|
||||
if ($s[$key] == '')
|
||||
{
|
||||
unset($s[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$d = serialize($s);
|
||||
|
||||
if (($search_id = insert_filter('file_search', $d)))
|
||||
{
|
||||
$filter = get_filter($search_id, 'file_search');
|
||||
redirect(basename(ADMIN_PATH) . "?cp=c_files&search_id=" . $filter['filter_uid'], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERROR_TRY_AGAIN'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search', 1);
|
||||
}
|
||||
redirect(basename(ADMIN_PATH) . '?cp=c_files&search_id=' . $filter['filter_uid'], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERROR_TRY_AGAIN'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search', 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (ip('search_user'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_users_search'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search&smt=users', 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_users_search'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search&smt=users', 1);
|
||||
}
|
||||
|
||||
#delete all searches greater than 10
|
||||
$s_del = array(
|
||||
'SELECT' => "filter_id",
|
||||
'FROM' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_type='user_search' AND filter_user=" . $userinfo['id'],
|
||||
'ORDER BY' => "filter_id DESC",
|
||||
'LIMIT' => '5, 18446744073709551615'
|
||||
);
|
||||
//delete all searches greater than 10
|
||||
$s_del = [
|
||||
'SELECT' => 'filter_id',
|
||||
'FROM' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_type='user_search' AND filter_user=" . $userinfo['id'],
|
||||
'ORDER BY' => 'filter_id DESC',
|
||||
'LIMIT' => '5, 18446744073709551615'
|
||||
];
|
||||
|
||||
$result = $SQL->build($s_del);
|
||||
$ids = array();
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$ids[] = $row['filter_id'];
|
||||
}
|
||||
$SQL->free($result);
|
||||
$result = $SQL->build($s_del);
|
||||
$ids = [];
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$ids[] = $row['filter_id'];
|
||||
}
|
||||
$SQL->free($result);
|
||||
|
||||
if($ids != '')
|
||||
{
|
||||
$query_del = array(
|
||||
'DELETE' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_id IN('" . implode("', '", $ids) . "')"
|
||||
);
|
||||
if ($ids != '')
|
||||
{
|
||||
$query_del = [
|
||||
'DELETE' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_id IN('" . implode("', '", $ids) . "')"
|
||||
];
|
||||
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
|
||||
#add as a user_search filter
|
||||
$s = $_POST;
|
||||
unset($s['search_user'], $s['k_form_key'], $s['k_form_time']);
|
||||
$d = serialize($s);
|
||||
if(($search_id = insert_filter('user_search', $d)))
|
||||
{
|
||||
//add as a user_search filter
|
||||
$s = $_POST;
|
||||
unset($s['search_user'], $s['k_form_key'], $s['k_form_time']);
|
||||
$d = serialize($s);
|
||||
|
||||
if (($search_id = insert_filter('user_search', $d)))
|
||||
{
|
||||
$filter = get_filter($search_id, 'user_search');
|
||||
redirect(basename(ADMIN_PATH) . "?cp=g_users&smt=show_su&search_id=" . $filter['filter_uid'], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERROR_TRY_AGAIN'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search&smt=users', 1);
|
||||
}
|
||||
redirect(basename(ADMIN_PATH) . '?cp=g_users&smt=show_su&search_id=' . $filter['filter_uid'], false);
|
||||
}
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['ERROR_TRY_AGAIN'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=h_search&smt=users', 1);
|
||||
}
|
||||
}
|
||||
|
||||
//secondary menu
|
||||
$go_menu = array(
|
||||
'files' => array('name'=>$lang['SEARCH_FILES'], 'link'=> basename(ADMIN_PATH) . '?cp=h_search&smt=files', 'goto'=>'files', 'current'=> $current_smt == 'files'),
|
||||
#'sep1' => array('class'=>'separator'),
|
||||
'users' => array('name'=>$lang['SEARCH_USERS'], 'link'=> basename(ADMIN_PATH) . '?cp=h_search&smt=users', 'goto'=>'users', 'current'=> $current_smt == 'users'),
|
||||
#'sep2' => array('class'=>'separator'),
|
||||
);
|
||||
|
||||
if(!$default_user_system)
|
||||
$go_menu = [
|
||||
'files' => ['name'=>$lang['SEARCH_FILES'], 'link'=> basename(ADMIN_PATH) . '?cp=h_search&smt=files', 'goto'=>'files', 'current'=> $current_smt == 'files'],
|
||||
//'sep1' => array('class'=>'separator'),
|
||||
'users' => ['name'=>$lang['SEARCH_USERS'], 'link'=> basename(ADMIN_PATH) . '?cp=h_search&smt=users', 'goto'=>'users', 'current'=> $current_smt == 'users'],
|
||||
//'sep2' => array('class'=>'separator'),
|
||||
];
|
||||
|
||||
if (! $default_user_system)
|
||||
{
|
||||
unset($go_menu['users']);
|
||||
unset($go_menu['users']);
|
||||
}
|
||||
|
||||
@@ -9,49 +9,51 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
#turn time-limit off
|
||||
//turn time-limit off
|
||||
@set_time_limit(0);
|
||||
|
||||
|
||||
#get current case
|
||||
//get current case
|
||||
$case = g('case', 'str', 'installed');
|
||||
|
||||
#set _get form key
|
||||
//set _get form key
|
||||
$GET_FORM_KEY = kleeja_add_form_key_get('PLUGINS_FORM_KEY');
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_plugins');
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_plugins');
|
||||
|
||||
$action = ADMIN_PATH . '?cp=' . basename(__file__, '.php');
|
||||
|
||||
$plugin_install_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=install&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_install_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=install&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_uninstall_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=uninstall&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_enable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=enable&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_disable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=disable&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_download_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=download&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_update_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=update&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_enable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=enable&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_disable_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=disable&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_download_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=download&' . $GET_FORM_KEY . '&plg=';
|
||||
$plugin_update_link = ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '&case=update&' . $GET_FORM_KEY . '&plg=';
|
||||
|
||||
|
||||
//check _GET Csrf token
|
||||
if (!empty($case) && in_array($case, array('install', 'uninstall', 'enable', 'disable' , 'download' , 'update')))
|
||||
if (! empty($case) && in_array($case, ['install', 'uninstall', 'enable', 'disable' , 'download' , 'update']))
|
||||
{
|
||||
if (!kleeja_check_form_key_get('PLUGINS_FORM_KEY'))
|
||||
if (! kleeja_check_form_key_get('PLUGINS_FORM_KEY'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_GET_KEY'], $action);
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(ip('newplugin'))
|
||||
if (ip('newplugin'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_plugins'))
|
||||
if (! kleeja_check_form_key('adm_plugins'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -65,43 +67,42 @@ switch ($case):
|
||||
case 'store':
|
||||
case 'check':
|
||||
|
||||
# Get installed plugins
|
||||
$query = array(
|
||||
'SELECT' => "plg_id, plg_name, plg_ver, plg_disabled, plg_author, plg_dsc",
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
'ORDER BY' => "plg_id ASC",
|
||||
);
|
||||
// Get installed plugins
|
||||
$query = [
|
||||
'SELECT' => 'plg_id, plg_name, plg_ver, plg_disabled, plg_author, plg_dsc',
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
'ORDER BY' => 'plg_id ASC',
|
||||
];
|
||||
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$installed_plugins = array();
|
||||
$installed_plugins = [];
|
||||
|
||||
while ($row = $SQL->fetch($result))
|
||||
{
|
||||
|
||||
$installed_plugins[$row['plg_name']] = $row;
|
||||
|
||||
$installed_plugins[$row['plg_name']]['extra_info'] = Plugins::getInstance()->installed_plugin_info($row['plg_name']);
|
||||
|
||||
|
||||
$installed_plugins[$row['plg_name']]['icon'] = file_exists(
|
||||
PATH . KLEEJA_PLUGINS_FOLDER . '/' . $row['plg_name'] . "/icon.png"
|
||||
PATH . KLEEJA_PLUGINS_FOLDER . '/' . $row['plg_name'] . '/icon.png'
|
||||
)
|
||||
? PATH . KLEEJA_PLUGINS_FOLDER . '/' . $row['plg_name'] . "/icon.png"
|
||||
? PATH . KLEEJA_PLUGINS_FOLDER . '/' . $row['plg_name'] . '/icon.png'
|
||||
: $STYLE_PATH_ADMIN . 'images/plugin.png';
|
||||
|
||||
|
||||
foreach (array('plugin_title', 'plugin_description') as $localizedInfo)
|
||||
foreach (['plugin_title', 'plugin_description'] as $localizedInfo)
|
||||
{
|
||||
if (is_array($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]))
|
||||
{
|
||||
if (!empty($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][$config['language']]))
|
||||
if (! empty($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][$config['language']]))
|
||||
{
|
||||
$installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo] =
|
||||
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo][$config['language']], 100);
|
||||
}
|
||||
else if (!empty($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]['en']))
|
||||
elseif (! empty($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]['en']))
|
||||
{
|
||||
$installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo] =
|
||||
shorten_text($installed_plugins[$row['plg_name']]['extra_info'][$localizedInfo]['en'], 100);
|
||||
@@ -117,23 +118,23 @@ switch ($case):
|
||||
$SQL->free($result);
|
||||
|
||||
|
||||
#get available plugins
|
||||
$dh = opendir(PATH . KLEEJA_PLUGINS_FOLDER);
|
||||
$available_plugins = array();
|
||||
//get available plugins
|
||||
$dh = opendir(PATH . KLEEJA_PLUGINS_FOLDER);
|
||||
$available_plugins = [];
|
||||
while (false !== ($folder_name = readdir($dh)))
|
||||
{
|
||||
if (is_dir(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $folder_name) && preg_match('/[a-z0-9_.]{3,}/', $folder_name))
|
||||
if (is_dir(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $folder_name) && preg_match('/[a-z0-9_.]{3,}/', $folder_name))
|
||||
{
|
||||
if (empty($installed_plugins[$folder_name]))
|
||||
{
|
||||
array_push($available_plugins,
|
||||
array(
|
||||
[
|
||||
'name' => $folder_name,
|
||||
'icon' => file_exists(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $folder_name . "/icon.png")
|
||||
? PATH . KLEEJA_PLUGINS_FOLDER . '/' . $folder_name . "/icon.png"
|
||||
'icon' => file_exists(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $folder_name . '/icon.png')
|
||||
? PATH . KLEEJA_PLUGINS_FOLDER . '/' . $folder_name . '/icon.png'
|
||||
: $STYLE_PATH_ADMIN . 'images/plugin.png',
|
||||
|
||||
)
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -142,23 +143,23 @@ switch ($case):
|
||||
|
||||
$no_plugins = sizeof($available_plugins) == 0 && sizeof($installed_plugins) == 0;
|
||||
|
||||
$stylee = "admin_plugins";
|
||||
$stylee = 'admin_plugins';
|
||||
|
||||
//do not proceed if not store case
|
||||
if(! in_array($case, ['store', 'check']))
|
||||
if (! in_array($case, ['store', 'check']))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
// plugins avilable in kleeja remote catalog
|
||||
if (!($catalog_plugins = $cache->get('catalog_plugins')))
|
||||
if (! ($catalog_plugins = $cache->get('catalog_plugins')))
|
||||
{
|
||||
$store_link = 'https://raw.githubusercontent.com/kleeja-official/store-catalog/master/catalog.json';
|
||||
|
||||
$catalog_plugins = fetch_remote_file($store_link);
|
||||
$catalog_plugins = json_decode($catalog_plugins , true);
|
||||
$catalog_plugins = json_decode($catalog_plugins, true);
|
||||
|
||||
if(json_last_error() == JSON_ERROR_NONE)
|
||||
if (json_last_error() == JSON_ERROR_NONE)
|
||||
{
|
||||
$cache->save('catalog_plugins', $catalog_plugins);
|
||||
}
|
||||
@@ -166,14 +167,14 @@ switch ($case):
|
||||
|
||||
// make an array for all plugins in kleeja remote catalog
|
||||
// that are not exsisted locally.
|
||||
$store_plugins = array();
|
||||
$store_plugins = [];
|
||||
$available_plugins_names = array_column($available_plugins, 'name');
|
||||
foreach ($catalog_plugins as $plugin_info)
|
||||
|
||||
foreach ($catalog_plugins as $plugin_info)
|
||||
{
|
||||
if ($case == 'store' && (in_array($plugin_info['name'] , $available_plugins_names) ||
|
||||
if ($case == 'store' && (in_array($plugin_info['name'], $available_plugins_names) ||
|
||||
! empty($installed_plugins[$plugin_info['name']]) )
|
||||
)
|
||||
{
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -183,25 +184,25 @@ switch ($case):
|
||||
strtolower($installed_plugins[$plugin_info['name']]['extra_info']['plugin_version']),
|
||||
strtolower($plugin_info['file']['version']),
|
||||
'>=') || empty($installed_plugins[$plugin_info['name']]))
|
||||
) {
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$store_plugins[$plugin_info['name']] = array(
|
||||
'name' => $plugin_info['name'],
|
||||
'developer' => $plugin_info['developer'],
|
||||
'version' => $plugin_info['file']['version'],
|
||||
'title' => ! empty($plugin_info['title'][$config['language']]) ? $plugin_info['title'][$config['language']] : $plugin_info['title']['en'],
|
||||
'website' => $plugin_info['website'],
|
||||
'current_version' => ! empty($installed_plugins[$plugin_info['name']]) ? strtolower($installed_plugins[$plugin_info['name']]['extra_info']['plugin_version']) : '',
|
||||
'kj_min_version' => $plugin_info['kleeja_version']['min'],
|
||||
'kj_max_version' => $plugin_info['kleeja_version']['max'],
|
||||
$store_plugins[$plugin_info['name']] = [
|
||||
'name' => $plugin_info['name'],
|
||||
'developer' => $plugin_info['developer'],
|
||||
'version' => $plugin_info['file']['version'],
|
||||
'title' => ! empty($plugin_info['title'][$config['language']]) ? $plugin_info['title'][$config['language']] : $plugin_info['title']['en'],
|
||||
'website' => $plugin_info['website'],
|
||||
'current_version' => ! empty($installed_plugins[$plugin_info['name']]) ? strtolower($installed_plugins[$plugin_info['name']]['extra_info']['plugin_version']) : '',
|
||||
'kj_min_version' => $plugin_info['kleeja_version']['min'],
|
||||
'kj_max_version' => $plugin_info['kleeja_version']['max'],
|
||||
'kj_version_cmtp' => sprintf($lang[ 'KLJ_VER_NO_PLUGIN'], $plugin_info['kleeja_version']['min'], $plugin_info['kleeja_version']['max']),
|
||||
'icon' => $plugin_info['icon'] ,
|
||||
'NotCompatible' => version_compare(strtolower($plugin_info['kleeja_version']['min']), KLEEJA_VERSION , '<=')
|
||||
&& version_compare(strtolower($plugin_info['kleeja_version']['max']), KLEEJA_VERSION , '>=')
|
||||
? false : true,
|
||||
);
|
||||
'icon' => $plugin_info['icon'] ,
|
||||
'NotCompatible' => version_compare(strtolower($plugin_info['kleeja_version']['min']), KLEEJA_VERSION, '<=')
|
||||
&& version_compare(strtolower($plugin_info['kleeja_version']['max']), KLEEJA_VERSION, '>=')
|
||||
? false : true,
|
||||
];
|
||||
}
|
||||
|
||||
$no_store_plugins = sizeof($store_plugins) == 0;
|
||||
@@ -212,28 +213,29 @@ switch ($case):
|
||||
//upload a plugin
|
||||
//
|
||||
case 'upload':
|
||||
$ERRORS = array();
|
||||
$ERRORS = [];
|
||||
|
||||
if(intval($userinfo['founder']) !== 1)
|
||||
if (intval($userinfo['founder']) !== 1)
|
||||
{
|
||||
$ERRORS[] = $lang['HV_NOT_PRVLG_ACCESS'];
|
||||
}
|
||||
|
||||
#is uploaded?
|
||||
if(empty($_FILES['plugin_file']['tmp_name']))
|
||||
//is uploaded?
|
||||
if (empty($_FILES['plugin_file']['tmp_name']))
|
||||
{
|
||||
$ERRORS[] = $lang['CHOSE_F'];
|
||||
}
|
||||
|
||||
#extract it to plugins folder
|
||||
if(!sizeof($ERRORS))
|
||||
//extract it to plugins folder
|
||||
if (! sizeof($ERRORS))
|
||||
{
|
||||
if(class_exists('ZipArchive'))
|
||||
if (class_exists('ZipArchive'))
|
||||
{
|
||||
$zip = new ZipArchive;
|
||||
|
||||
if ($zip->open($_FILES['plugin_file']['tmp_name']) === true)
|
||||
{
|
||||
if(!$zip->extractTo(PATH . KLEEJA_PLUGINS_FOLDER))
|
||||
if (! $zip->extractTo(PATH . KLEEJA_PLUGINS_FOLDER))
|
||||
{
|
||||
$ERRORS[] = sprintf($lang['EXTRACT_ZIP_FAILED'], KLEEJA_PLUGINS_FOLDER);
|
||||
}
|
||||
@@ -250,12 +252,12 @@ switch ($case):
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_FILES['plugin_file']['tmp_name']))
|
||||
if (! empty($_FILES['plugin_file']['tmp_name']))
|
||||
{
|
||||
@unlink($_FILES['plugin_file']['tmp_name']);
|
||||
}
|
||||
|
||||
if(!sizeof($ERRORS))
|
||||
if (! sizeof($ERRORS))
|
||||
{
|
||||
kleeja_admin_info($lang['NO_PROBLEM_AFTER_ZIP'], true, '', true, $action);
|
||||
}
|
||||
@@ -272,9 +274,10 @@ switch ($case):
|
||||
//
|
||||
case 'install':
|
||||
|
||||
if(intval($userinfo['founder']) !== 1)
|
||||
if (intval($userinfo['founder']) !== 1)
|
||||
{
|
||||
kleeja_admin_err($lang['HV_NOT_PRVLG_ACCESS'], ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -287,56 +290,59 @@ switch ($case):
|
||||
exit('empty($plg_name)');
|
||||
}
|
||||
//no plugin selected? back
|
||||
redirect(ADMIN_PATH . "?cp=" . basename(__file__, '.php'));
|
||||
redirect(ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!file_exists(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plg_name . '/init.php'))
|
||||
if (! file_exists(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plg_name . '/init.php'))
|
||||
{
|
||||
if (defined('DEBUG'))
|
||||
{
|
||||
exit('!file_exists($plg_name)');
|
||||
}
|
||||
|
||||
redirect(ADMIN_PATH . "?cp=" . basename(__file__, '.php'));
|
||||
redirect(ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
#if already installed, show a message
|
||||
if (!empty(Plugins::getInstance()->installed_plugin_info($plg_name)))
|
||||
//if already installed, show a message
|
||||
if (! empty(Plugins::getInstance()->installed_plugin_info($plg_name)))
|
||||
{
|
||||
kleeja_admin_info($lang['PLUGIN_EXISTS_BEFORE'], true, '', true, ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
$kleeja_plugin = array();
|
||||
$kleeja_plugin = [];
|
||||
|
||||
include PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plg_name . '/init.php';
|
||||
|
||||
$install_callback = $kleeja_plugin[$plg_name]['install'];
|
||||
$plugin_info = $kleeja_plugin[$plg_name]['information'];
|
||||
$plugin_info = $kleeja_plugin[$plg_name]['information'];
|
||||
$plugin_first_run = false;
|
||||
|
||||
if (!empty($kleeja_plugin[$plg_name]['first_run'][$config['language']]))
|
||||
if (! empty($kleeja_plugin[$plg_name]['first_run'][$config['language']]))
|
||||
{
|
||||
$plugin_first_run = $kleeja_plugin[$plg_name]['first_run'][$config['language']];
|
||||
}
|
||||
else if (!empty($kleeja_plugin[$plg_name]['first_run']['en']))
|
||||
elseif (! empty($kleeja_plugin[$plg_name]['first_run']['en']))
|
||||
{
|
||||
$plugin_first_run = $kleeja_plugin[$plg_name]['first_run']['en'];
|
||||
}
|
||||
|
||||
#check if compatible with kleeja
|
||||
#'plugin_kleeja_version_min' => '1.8',
|
||||
# Max version of Kleeja that's required to run this plugin
|
||||
#'plugin_kleeja_version_max' => '3.8',
|
||||
//check if compatible with kleeja
|
||||
//'plugin_kleeja_version_min' => '1.8',
|
||||
// Max version of Kleeja that's required to run this plugin
|
||||
//'plugin_kleeja_version_max' => '3.8',
|
||||
|
||||
if (version_compare(KLEEJA_VERSION, $plugin_info['plugin_kleeja_version_min'], '<'))
|
||||
{
|
||||
kleeja_admin_info(
|
||||
$lang['PLUGIN_N_CMPT_KLJ'] . '<br>k:' . KLEEJA_VERSION . '|<|p.min:' . $plugin_info['plugin_kleeja_version_min'],
|
||||
$lang['PLUGIN_N_CMPT_KLJ'] . '<br>k:' . KLEEJA_VERSION . '|<|p.min:' . $plugin_info['plugin_kleeja_version_min'],
|
||||
true, '', true, ADMIN_PATH . '?cp=' . basename(__file__, '.php')
|
||||
);
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -345,9 +351,10 @@ switch ($case):
|
||||
if (version_compare(KLEEJA_VERSION, $plugin_info['plugin_kleeja_version_max'], '>'))
|
||||
{
|
||||
kleeja_admin_info(
|
||||
$lang['PLUGIN_N_CMPT_KLJ'] . '<br>k:' . KLEEJA_VERSION . '|>|p.max:' . $plugin_info['plugin_kleeja_version_max'],
|
||||
$lang['PLUGIN_N_CMPT_KLJ'] . '<br>k:' . KLEEJA_VERSION . '|>|p.max:' . $plugin_info['plugin_kleeja_version_max'],
|
||||
true, '', true, ADMIN_PATH . '?cp=' . basename(__file__, '.php')
|
||||
);
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@@ -356,26 +363,27 @@ switch ($case):
|
||||
|
||||
if (is_array($plugin_info['plugin_description']))
|
||||
{
|
||||
$plugin_info['plugin_description'] = !empty($plugin_info['plugin_description']['en']) ? $plugin_info['plugin_description']['en'] : $plugin_info['plugin_description'][0];
|
||||
$plugin_info['plugin_description'] = ! empty($plugin_info['plugin_description']['en']) ? $plugin_info['plugin_description']['en'] : $plugin_info['plugin_description'][0];
|
||||
}
|
||||
|
||||
#add to database
|
||||
$insert_query = array(
|
||||
//add to database
|
||||
$insert_query = [
|
||||
'INSERT' => '`plg_name` ,`plg_ver`, `plg_author`, `plg_dsc`, `plg_icon`, `plg_uninstall`, `plg_instructions`, `plg_store`, `plg_files`',
|
||||
'INTO' => "{$dbprefix}plugins",
|
||||
'INTO' => "{$dbprefix}plugins",
|
||||
'VALUES' => "'" . $SQL->escape($plg_name) . "','" . $SQL->escape($plugin_info['plugin_version']) . "', '" . $SQL->escape($plugin_info['plugin_developer']) . "','" . $SQL->escape($plugin_info['plugin_description']) . "', '', '', '', '', ''",
|
||||
);
|
||||
];
|
||||
|
||||
$SQL->build($insert_query);
|
||||
|
||||
#may God protect you brother.
|
||||
if(is_callable($install_callback))
|
||||
//may God protect you brother.
|
||||
if (is_callable($install_callback))
|
||||
{
|
||||
$install_callback($SQL->insert_id());
|
||||
}
|
||||
|
||||
#show done, msg
|
||||
//show done, msg
|
||||
$text = '<h3>' . $lang['NEW_PLUGIN_ADDED'] . '</h3>';
|
||||
|
||||
if ($plugin_first_run)
|
||||
{
|
||||
$text .= $plugin_first_run;
|
||||
@@ -397,9 +405,10 @@ switch ($case):
|
||||
//
|
||||
case 'uninstall':
|
||||
|
||||
if(intval($userinfo['founder']) !== 1)
|
||||
if (intval($userinfo['founder']) !== 1)
|
||||
{
|
||||
kleeja_admin_err($lang['HV_NOT_PRVLG_ACCESS'], ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -413,58 +422,60 @@ switch ($case):
|
||||
}
|
||||
|
||||
//no plugin selected? back
|
||||
redirect(ADMIN_PATH . "?cp=" . basename(__file__, '.php'));
|
||||
redirect(ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!file_exists(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plg_name . '/init.php'))
|
||||
if (! file_exists(PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plg_name . '/init.php'))
|
||||
{
|
||||
if (defined('DEV_STAGE'))
|
||||
{
|
||||
exit('!file_exists($plg_name)');
|
||||
}
|
||||
|
||||
redirect(ADMIN_PATH . "?cp=" . basename(__file__, '.php'));
|
||||
redirect(ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
$kleeja_plugin = array();
|
||||
$kleeja_plugin = [];
|
||||
|
||||
include PATH . KLEEJA_PLUGINS_FOLDER . '/' . $plg_name . '/init.php';
|
||||
|
||||
$uninstall_callback = $kleeja_plugin[$plg_name]['uninstall'];
|
||||
|
||||
if (!is_callable($uninstall_callback))
|
||||
if (! is_callable($uninstall_callback))
|
||||
{
|
||||
redirect(ADMIN_PATH . "?cp=" . basename(__file__, '.php'));
|
||||
redirect(ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$query = array(
|
||||
'SELECT' => "plg_id",
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plg_name) . "'"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'plg_id',
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plg_name) . "'"
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$pluginDatabaseInfo = $SQL->fetch($result);
|
||||
|
||||
#sad to see you go, brother
|
||||
$uninstall_callback(!empty($pluginDatabaseInfo) ? $pluginDatabaseInfo['plg_id'] : 0);
|
||||
//sad to see you go, brother
|
||||
$uninstall_callback(! empty($pluginDatabaseInfo) ? $pluginDatabaseInfo['plg_id'] : 0);
|
||||
|
||||
delete_cache('', true);
|
||||
|
||||
#remove from database
|
||||
$query_del = array(
|
||||
//remove from database
|
||||
$query_del = [
|
||||
'DELETE' => "`{$dbprefix}plugins`",
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plg_name) . "'"
|
||||
);
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plg_name) . "'"
|
||||
];
|
||||
|
||||
$SQL->build($query_del);
|
||||
|
||||
#show done, msg
|
||||
//show done, msg
|
||||
$text = '<h3>' . $lang['PLUGIN_DELETED'] . '</h3>';
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '\');", 2000);</script>' . "\n";
|
||||
|
||||
@@ -480,9 +491,10 @@ switch ($case):
|
||||
case 'disable':
|
||||
case 'enable':
|
||||
|
||||
if(intval($userinfo['founder']) !== 1)
|
||||
if (intval($userinfo['founder']) !== 1)
|
||||
{
|
||||
kleeja_admin_err($lang['HV_NOT_PRVLG_ACCESS'], ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -495,23 +507,23 @@ switch ($case):
|
||||
exit('empty($plg_name)');
|
||||
}
|
||||
//no plugin selected? back
|
||||
redirect(ADMIN_PATH . "?cp=" . basename(__file__, '.php'));
|
||||
redirect(ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
}
|
||||
else
|
||||
{
|
||||
#update database
|
||||
$update_query = array(
|
||||
//update database
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}plugins",
|
||||
'SET' => "plg_disabled=" . ($case == 'disable' ? 1 : 0),
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plg_name) . "'"
|
||||
);
|
||||
'SET' => 'plg_disabled=' . ($case == 'disable' ? 1 : 0),
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plg_name) . "'"
|
||||
];
|
||||
|
||||
|
||||
$SQL->build($update_query);
|
||||
|
||||
delete_cache('', true);
|
||||
|
||||
#show done, msg
|
||||
//show done, msg
|
||||
$text = '<h3>' . $lang['PLGUIN_DISABLED_ENABLED'] . '</h3>';
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . ADMIN_PATH . '?cp=' . basename(__file__, '.php') . '\');", 2000);</script>' . "\n";
|
||||
|
||||
@@ -523,18 +535,20 @@ switch ($case):
|
||||
|
||||
case 'download':
|
||||
|
||||
if(intval($userinfo['founder']) !== 1)
|
||||
if (intval($userinfo['founder']) !== 1)
|
||||
{
|
||||
kleeja_admin_err($lang['HV_NOT_PRVLG_ACCESS'], ADMIN_PATH . '?cp=' . basename(__file__, '.php'));
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
$download_plugin = g('plg');
|
||||
|
||||
// update it , rename function doesn't move the folder , if the folder is exists on the new dir
|
||||
if( file_exists( PATH . KLEEJA_PLUGINS_FOLDER. '/' . $download_plugin . '/init.php' ) )
|
||||
if ( file_exists( PATH . KLEEJA_PLUGINS_FOLDER . '/' . $download_plugin . '/init.php' ) )
|
||||
{
|
||||
redirect( $plugin_update_link . $download_plugin );
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -543,22 +557,22 @@ switch ($case):
|
||||
|
||||
$catalog_plugins = fetch_remote_file($store_link);
|
||||
|
||||
if ($catalog_plugins)
|
||||
if ($catalog_plugins)
|
||||
{
|
||||
$catalog_plugins = json_decode($catalog_plugins , true);
|
||||
$catalog_plugins = json_decode($catalog_plugins, true);
|
||||
|
||||
$store_plugins = [];
|
||||
|
||||
$store_plugins = array();
|
||||
|
||||
// make an arry for all plugins in kleeja store that not included in our server
|
||||
foreach ($catalog_plugins as $plugin_info)
|
||||
foreach ($catalog_plugins as $plugin_info)
|
||||
{
|
||||
$store_plugins[$plugin_info['name']] = array(
|
||||
'name' => $plugin_info['name'] ,
|
||||
'plg_version' => $plugin_info['file']['version'] ,
|
||||
'url' => $plugin_info['file']['url'] ,
|
||||
$store_plugins[$plugin_info['name']] = [
|
||||
'name' => $plugin_info['name'] ,
|
||||
'plg_version' => $plugin_info['file']['version'] ,
|
||||
'url' => $plugin_info['file']['url'] ,
|
||||
'kj_min_version' => $plugin_info['kleeja_version']['min'] ,
|
||||
'kj_max_version' => $plugin_info['kleeja_version']['max'] ,
|
||||
);
|
||||
];
|
||||
}
|
||||
|
||||
// // => this plugin is hosted in our store
|
||||
@@ -566,22 +580,22 @@ switch ($case):
|
||||
{
|
||||
// check if the version of the plugin is compatible with our kleeja version or not
|
||||
if (
|
||||
version_compare(strtolower($store_plugins[$download_plugin]['kj_min_version']), KLEEJA_VERSION , '<=')
|
||||
&& version_compare(strtolower($store_plugins[$download_plugin]['kj_max_version']), KLEEJA_VERSION , '>=')
|
||||
)
|
||||
{
|
||||
version_compare(strtolower($store_plugins[$download_plugin]['kj_min_version']), KLEEJA_VERSION, '<=')
|
||||
&& version_compare(strtolower($store_plugins[$download_plugin]['kj_max_version']), KLEEJA_VERSION, '>=')
|
||||
) {
|
||||
$download_plugin_link = $store_plugins[$download_plugin]['url'];
|
||||
|
||||
$downloaded_plugin_zip = fetch_remote_file($download_plugin_link, PATH . 'cache/' . $download_plugin . '.zip', 60, false, 10, true);
|
||||
|
||||
if ($downloaded_plugin_zip)
|
||||
if ($downloaded_plugin_zip)
|
||||
{
|
||||
if (file_exists(PATH . 'cache/' . $download_plugin . '.zip' ) )
|
||||
if (file_exists(PATH . 'cache/' . $download_plugin . '.zip' ) )
|
||||
{
|
||||
$zip = new ZipArchive();
|
||||
|
||||
if ($zip->open(PATH . 'cache/' . $download_plugin . '.zip' ) === true)
|
||||
{
|
||||
if( $zip->extractTo(PATH . KLEEJA_PLUGINS_FOLDER))
|
||||
if ( $zip->extractTo(PATH . KLEEJA_PLUGINS_FOLDER))
|
||||
{
|
||||
$zip->close();
|
||||
// we dont need the zip file anymore
|
||||
@@ -590,18 +604,18 @@ switch ($case):
|
||||
// for example :: When we extract zip file , the name will be ( advanced-extras-1.0 )
|
||||
// so we need to remove the version from folder name and replace ( - ) with ( _ )
|
||||
// and done
|
||||
$plugin_folder_name = PATH . KLEEJA_PLUGINS_FOLDER. '/' . str_replace('_' , '-' , $download_plugin) . '-' . $store_plugins[$download_plugin]['plg_version'];
|
||||
rename($plugin_folder_name , PATH . KLEEJA_PLUGINS_FOLDER. '/' . $download_plugin);
|
||||
$plugin_folder_name = PATH . KLEEJA_PLUGINS_FOLDER . '/' . str_replace('_', '-', $download_plugin) . '-' . $store_plugins[$download_plugin]['plg_version'];
|
||||
rename($plugin_folder_name, PATH . KLEEJA_PLUGINS_FOLDER . '/' . $download_plugin);
|
||||
|
||||
// download or update msg
|
||||
kleeja_admin_info(
|
||||
sprintf($lang[ig('update') ? 'PLUGIN_UPDATED' : 'PLUGIN_DOWNLOADED'], $download_plugin),
|
||||
sprintf($lang[ig('update') ? 'PLUGIN_UPDATED' : 'PLUGIN_DOWNLOADED'], $download_plugin),
|
||||
ADMIN_PATH . '?cp=' . basename(__file__, '.php')
|
||||
);
|
||||
|
||||
|
||||
exit;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['EXTRACT_ZIP_FAILED']);
|
||||
}
|
||||
@@ -612,7 +626,7 @@ switch ($case):
|
||||
kleeja_admin_err($lang['PLUGIN_FILE_NOT_FOUND']);
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
kleeja_admin_err($lang['PLUGINS_SERVER_ERROR']);
|
||||
}
|
||||
@@ -622,7 +636,7 @@ switch ($case):
|
||||
kleeja_admin_err($lang['PLUGIN_N_CMPT_KLJ']);
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
kleeja_admin_err(sprintf($lang['PLUGIN_REMOTE_FILE_MISSING'], $download_plugin));
|
||||
}
|
||||
@@ -640,12 +654,13 @@ switch ($case):
|
||||
|
||||
$plugin_folder_name = PATH . KLEEJA_PLUGINS_FOLDER . '/' . $update_plugin;
|
||||
|
||||
if (is_dir($plugin_folder_name))
|
||||
if (is_dir($plugin_folder_name))
|
||||
{
|
||||
delete_plugin_folder($plugin_folder_name);
|
||||
}
|
||||
|
||||
redirect($plugin_download_link . $update_plugin . '&update' );
|
||||
|
||||
break;
|
||||
|
||||
endswitch;
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_ban";
|
||||
$stylee = 'admin_ban';
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php');
|
||||
|
||||
$affected = false;
|
||||
$affected = false;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_ban');
|
||||
|
||||
//
|
||||
@@ -26,17 +26,17 @@ $H_FORM_KEYS = kleeja_add_form_key('adm_ban');
|
||||
//
|
||||
if (ip('submit'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_ban'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_ban'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'ban',
|
||||
'FROM' => "{$dbprefix}stats"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'ban',
|
||||
'FROM' => "{$dbprefix}stats"
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
@@ -48,13 +48,14 @@ $ban = p('ban_text', 'str', $current_ban_data['ban']);
|
||||
if (ip('submit'))
|
||||
{
|
||||
//update
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "ban='" . $SQL->escape($ban) . "'"
|
||||
);
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "ban='" . $SQL->escape($ban) . "'"
|
||||
];
|
||||
|
||||
$SQL->build($update_query);
|
||||
if($SQL->affected())
|
||||
|
||||
if ($SQL->affected())
|
||||
{
|
||||
$affected = true;
|
||||
delete_cache('data_ban');
|
||||
@@ -67,7 +68,7 @@ $SQL->freeresult($result);
|
||||
//after submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
$text = ($affected ? $lang['BAN_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '\');", 2000);</script>' . "\n";
|
||||
$stylee = "admin_info";
|
||||
$text = ($affected ? $lang['BAN_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '\');", 2000);</script>' . "\n";
|
||||
$stylee = 'admin_info';
|
||||
}
|
||||
|
||||
@@ -9,16 +9,16 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_rules";
|
||||
$stylee = 'admin_rules';
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php');
|
||||
|
||||
$affected = false;
|
||||
$affected = false;
|
||||
$H_FORM_KEYS = kleeja_add_form_key('adm_rules');
|
||||
|
||||
//
|
||||
@@ -26,40 +26,41 @@ $H_FORM_KEYS = kleeja_add_form_key('adm_rules');
|
||||
//
|
||||
if (ip('submit'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_rules'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_rules'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'rules',
|
||||
'FROM' => "{$dbprefix}stats"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'rules',
|
||||
'FROM' => "{$dbprefix}stats"
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$rules = p('rules_text', 'str', $row['rules']);
|
||||
|
||||
//when submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
//update
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "rules = '" . $SQL->real_escape(htmlspecialchars_decode($rules)) . "'"
|
||||
);
|
||||
$rules = p('rules_text', 'str', $row['rules']);
|
||||
|
||||
$SQL->build($update_query);
|
||||
if($SQL->affected())
|
||||
{
|
||||
$affected = true;
|
||||
delete_cache('data_rules');
|
||||
}
|
||||
}
|
||||
//when submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
//update
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "rules = '" . $SQL->real_escape(htmlspecialchars_decode($rules)) . "'"
|
||||
];
|
||||
|
||||
$SQL->build($update_query);
|
||||
|
||||
if ($SQL->affected())
|
||||
{
|
||||
$affected = true;
|
||||
delete_cache('data_rules');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
@@ -68,7 +69,7 @@ $SQL->freeresult($result);
|
||||
//after submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
$text = ($affected ? $lang['RULES_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '\');", 2000);</script>' . "\n";
|
||||
$stylee = "admin_info";
|
||||
$text = ($affected ? $lang['RULES_UPDATED'] : $lang['NO_UP_CHANGE_S']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '\');", 2000);</script>' . "\n";
|
||||
$stylee = 'admin_info';
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
*/
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
#current secondary menu action
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i','', g('smt', 'str', 'general'));
|
||||
//current secondary menu action
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
|
||||
$action = ADMIN_PATH . '?cp=' . basename(__file__, '.php');
|
||||
|
||||
@@ -23,7 +23,7 @@ $H_FORM_KEYS = kleeja_add_form_key('adm_styles');
|
||||
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_styles";
|
||||
$stylee = 'admin_styles';
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ if (ip('style_choose') || ig('style_choose'))
|
||||
// make style as default
|
||||
|
||||
//check _GET Csrf token
|
||||
if (isset($_REQUEST['home']) && !kleeja_check_form_key_get('adm_start_actions'))
|
||||
if (isset($_REQUEST['home']) && ! kleeja_check_form_key_get('adm_start_actions'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH) . '?cp=start', 2);
|
||||
}
|
||||
@@ -55,7 +55,7 @@ if (ip('style_choose') || ig('style_choose'))
|
||||
//
|
||||
if (($style_info = kleeja_style_info($style_id)) != false)
|
||||
{
|
||||
if (isset($style_info['depend_on']) && !file_exists(PATH . 'styles/' . $style_info['depend_on']))
|
||||
if (isset($style_info['depend_on']) && ! file_exists(PATH . 'styles/' . $style_info['depend_on']))
|
||||
{
|
||||
kleeja_admin_err(sprintf($lang['DEPEND_ON_NO_STYLE_ERR'], $style_info['depend_on']));
|
||||
}
|
||||
@@ -71,10 +71,10 @@ if (ip('style_choose') || ig('style_choose'))
|
||||
$plugins_required = explode(',', $style_info['plugins_required']);
|
||||
$plugins_required = array_map('trim', $plugins_required);
|
||||
|
||||
$query = array(
|
||||
$query = [
|
||||
'SELECT' => 'plg_name, plg_disabled',
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
);
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
@@ -93,6 +93,7 @@ if (ip('style_choose') || ig('style_choose'))
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$plugins_required = array_flip($plugins_required);
|
||||
|
||||
if (sizeof($plugins_required))
|
||||
{
|
||||
kleeja_admin_err(sprintf($lang['PLUGINS_REQ_NO_STYLE_ERR'], implode(', ', $plugins_required)));
|
||||
@@ -110,42 +111,41 @@ if (ip('style_choose') || ig('style_choose'))
|
||||
|
||||
//show msg
|
||||
kleeja_admin_info(sprintf($lang['STYLE_NOW_IS_DEFAULT'], htmlspecialchars($style_id)), true, '', true, basename(ADMIN_PATH) . '?cp=' . (isset($_REQUEST['home']) ? 'start' : basename(__file__, '.php')));
|
||||
|
||||
}
|
||||
else if (ip('newstyle'))
|
||||
elseif (ip('newstyle'))
|
||||
{
|
||||
|
||||
if(intval($userinfo['founder']) !== 1)
|
||||
if (intval($userinfo['founder']) !== 1)
|
||||
{
|
||||
$ERRORS[] = $lang['HV_NOT_PRVLG_ACCESS'];
|
||||
}
|
||||
|
||||
|
||||
if(!kleeja_check_form_key('adm_styles'))
|
||||
if (! kleeja_check_form_key('adm_styles'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action);
|
||||
}
|
||||
|
||||
|
||||
$ERRORS = array();
|
||||
$ERRORS = [];
|
||||
|
||||
#is uploaded?
|
||||
if(empty($_FILES['style_file']['tmp_name']))
|
||||
//is uploaded?
|
||||
if (empty($_FILES['style_file']['tmp_name']))
|
||||
{
|
||||
$ERRORS[] = $lang['CHOSE_F'];
|
||||
}
|
||||
|
||||
|
||||
|
||||
#extract it to plugins folder
|
||||
if(!sizeof($ERRORS))
|
||||
//extract it to plugins folder
|
||||
if (! sizeof($ERRORS))
|
||||
{
|
||||
if(class_exists('ZipArchive'))
|
||||
if (class_exists('ZipArchive'))
|
||||
{
|
||||
$zip = new ZipArchive;
|
||||
|
||||
if ($zip->open($_FILES['style_file']['tmp_name']) === true)
|
||||
{
|
||||
if(!$zip->extractTo(PATH . 'styles'))
|
||||
if (! $zip->extractTo(PATH . 'styles'))
|
||||
{
|
||||
$ERRORS[] = sprintf($lang['EXTRACT_ZIP_FAILED'], 'styles');
|
||||
}
|
||||
@@ -162,13 +162,13 @@ else if (ip('newstyle'))
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($_FILES['style_file']['tmp_name']))
|
||||
if (! empty($_FILES['style_file']['tmp_name']))
|
||||
{
|
||||
@unlink($_FILES['style_file']['tmp_name']);
|
||||
}
|
||||
|
||||
|
||||
if(!sizeof($ERRORS))
|
||||
if (! sizeof($ERRORS))
|
||||
{
|
||||
kleeja_admin_info($lang['NO_PROBLEM_AFTER_ZIP'], true, '', true, $action);
|
||||
}
|
||||
@@ -180,33 +180,34 @@ else if (ip('newstyle'))
|
||||
|
||||
|
||||
//get styles
|
||||
$arr = array();
|
||||
$arr = [];
|
||||
|
||||
if ($dh = @opendir(PATH . 'styles'))
|
||||
{
|
||||
while (false !== ($folder_name = readdir($dh)))
|
||||
{
|
||||
if (is_dir(PATH . 'styles/' . $folder_name) && preg_match('/[a-z0-9_.]{3,}/', $folder_name))
|
||||
if (is_dir(PATH . 'styles/' . $folder_name) && preg_match('/[a-z0-9_.]{3,}/', $folder_name))
|
||||
{
|
||||
|
||||
#info
|
||||
$style_info_arr = array
|
||||
(
|
||||
'name' => $folder_name,
|
||||
'desc' => '',
|
||||
//info
|
||||
$style_info_arr =
|
||||
[
|
||||
'name' => $folder_name,
|
||||
'desc' => '',
|
||||
'copyright'=> '',
|
||||
'version'=> ''
|
||||
);
|
||||
'version' => ''
|
||||
];
|
||||
|
||||
|
||||
if(($style_info = kleeja_style_info($folder_name)) != false)
|
||||
if (($style_info = kleeja_style_info($folder_name)) != false)
|
||||
{
|
||||
foreach (array('name', 'desc', 'copyright', 'version') as $InfoKey)
|
||||
foreach (['name', 'desc', 'copyright', 'version'] as $InfoKey)
|
||||
{
|
||||
if (array_key_exists($InfoKey, $style_info))
|
||||
{
|
||||
if(is_array($style_info[$InfoKey]))
|
||||
if (is_array($style_info[$InfoKey]))
|
||||
{
|
||||
$style_info_arr[$InfoKey] = !empty($style_info[$InfoKey][$config['language']])
|
||||
$style_info_arr[$InfoKey] = ! empty($style_info[$InfoKey][$config['language']])
|
||||
? htmlspecialchars($style_info[$InfoKey][$config['language']])
|
||||
: htmlspecialchars($style_info[$InfoKey]['en']);
|
||||
}
|
||||
@@ -218,16 +219,16 @@ if ($dh = @opendir(PATH . 'styles'))
|
||||
}
|
||||
}
|
||||
|
||||
$arr[] = array
|
||||
(
|
||||
'style_name' => $folder_name,
|
||||
'is_default' => $config['style'] == $folder_name ? true : false,
|
||||
$arr[] =
|
||||
[
|
||||
'style_name' => $folder_name,
|
||||
'is_default' => $config['style'] == $folder_name ? true : false,
|
||||
'link_mk_default' => basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&style_choose=' . $folder_name,
|
||||
'icon' => file_exists(PATH . 'styles/' . $folder_name . "/screenshot.png")
|
||||
? PATH . 'styles/' . $folder_name . "/screenshot.png"
|
||||
'icon' => file_exists(PATH . 'styles/' . $folder_name . '/screenshot.png')
|
||||
? PATH . 'styles/' . $folder_name . '/screenshot.png'
|
||||
: $STYLE_PATH_ADMIN . 'images/style.png',
|
||||
'info' => $style_info_arr
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//for style ..
|
||||
$stylee = "admin_extra";
|
||||
$stylee = 'admin_extra';
|
||||
$current_smt= preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'he'));
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&smt=' . $current_smt;
|
||||
$action = basename(ADMIN_PATH) . '?cp=' . basename(__file__, '.php') . '&smt=' . $current_smt;
|
||||
$H_FORM_KEYS= kleeja_add_form_key('adm_extra');
|
||||
|
||||
//
|
||||
@@ -26,19 +26,19 @@ $H_FORM_KEYS= kleeja_add_form_key('adm_extra');
|
||||
//
|
||||
if (ip('submit'))
|
||||
{
|
||||
if(!kleeja_check_form_key('adm_extra'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
if (! kleeja_check_form_key('adm_extra'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_FORM_KEY'], true, $lang['ERROR'], true, $action, 1);
|
||||
}
|
||||
}
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'ex_header,ex_footer',
|
||||
'FROM' => "{$dbprefix}stats"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'ex_header,ex_footer',
|
||||
'FROM' => "{$dbprefix}stats"
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
|
||||
//is there any change !
|
||||
$affected = false;
|
||||
|
||||
@@ -51,28 +51,28 @@ if (ip('submit'))
|
||||
$update_sql = '';
|
||||
|
||||
|
||||
if(g('smt') == 'fe')
|
||||
if (g('smt') == 'fe')
|
||||
{
|
||||
$ex_footer = p('ex_footer', 'str');
|
||||
$ex_footer = p('ex_footer', 'str');
|
||||
$update_sql = "ex_footer = '" . $SQL->real_escape(htmlspecialchars_decode($ex_footer)) . "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ex_header = p('ex_header', 'str');
|
||||
$ex_header = p('ex_header', 'str');
|
||||
$update_sql = "ex_header = '" . $SQL->real_escape(htmlspecialchars_decode($ex_header)) . "'";
|
||||
}
|
||||
|
||||
|
||||
|
||||
//update
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => $update_sql
|
||||
);
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => $update_sql
|
||||
];
|
||||
|
||||
$SQL->build($update_query);
|
||||
|
||||
if($SQL->affected())
|
||||
if ($SQL->affected())
|
||||
{
|
||||
$affected = true;
|
||||
//delete cache ..
|
||||
@@ -95,12 +95,12 @@ $SQL->freeresult($result);
|
||||
//after submit
|
||||
if (ip('submit'))
|
||||
{
|
||||
kleeja_admin_info(($affected ? $lang['EXTRA_UPDATED'] : $lang['NO_UP_CHANGE_S']), true, '', true, $action);
|
||||
kleeja_admin_info(($affected ? $lang['EXTRA_UPDATED'] : $lang['NO_UP_CHANGE_S']), true, '', true, $action);
|
||||
}
|
||||
|
||||
|
||||
//secondary menu
|
||||
$go_menu = array(
|
||||
'he' => array('name'=>$lang['ADD_HEADER_EXTRA'], 'link'=> basename(ADMIN_PATH) . '?cp=n_extra&smt=he', 'goto'=>'he', 'current'=> $current_smt == 'he'),
|
||||
'fe' => array('name'=>$lang['ADD_FOOTER_EXTRA'], 'link'=> basename(ADMIN_PATH) . '?cp=n_extra&smt=fe', 'goto'=>'fe', 'current'=> $current_smt == 'fe'),
|
||||
);
|
||||
$go_menu = [
|
||||
'he' => ['name'=>$lang['ADD_HEADER_EXTRA'], 'link'=> basename(ADMIN_PATH) . '?cp=n_extra&smt=he', 'goto'=>'he', 'current'=> $current_smt == 'he'],
|
||||
'fe' => ['name'=>$lang['ADD_FOOTER_EXTRA'], 'link'=> basename(ADMIN_PATH) . '?cp=n_extra&smt=fe', 'goto'=>'fe', 'current'=> $current_smt == 'fe'],
|
||||
];
|
||||
|
||||
@@ -8,95 +8,95 @@
|
||||
*/
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
$stylee = "admin_check_update";
|
||||
$stylee = 'admin_check_update';
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
$update_link = $config['siteurl'] . 'install/update.php?lang=' . $config['language'];
|
||||
|
||||
#to prevent getting the url data for all cats
|
||||
if($current_smt == 'check'):
|
||||
//to prevent getting the url data for all cats
|
||||
if ($current_smt == 'check'):
|
||||
|
||||
//get data from kleeja github repo
|
||||
if (! ($version_data = $cache->get('kleeja_repo_version')))
|
||||
{
|
||||
$github_data = fetch_remote_file('https://raw.githubusercontent.com/awssat/kleeja/master/includes/version.php', false, 6);
|
||||
//get data from kleeja github repo
|
||||
if (! ($version_data = $cache->get('kleeja_repo_version')))
|
||||
{
|
||||
$github_data = fetch_remote_file('https://raw.githubusercontent.com/awssat/kleeja/master/includes/version.php', false, 6);
|
||||
|
||||
if (! empty($github_data))
|
||||
{
|
||||
preg_match_all('/define\(\'KLEEJA_VERSION\',\s{1,4}\'([^\']+)\'\);/', $github_data, $matches, PREG_SET_ORDER, 0);
|
||||
$version_data = trim(htmlspecialchars($matches[0][1]));
|
||||
$cache->save('kleeja_repo_version', $version_data, 3600 * 2);
|
||||
}
|
||||
}
|
||||
if (! empty($github_data))
|
||||
{
|
||||
preg_match_all('/define\(\'KLEEJA_VERSION\',\s{1,4}\'([^\']+)\'\);/', $github_data, $matches, PREG_SET_ORDER, 0);
|
||||
$version_data = trim(htmlspecialchars($matches[0][1]));
|
||||
$cache->save('kleeja_repo_version', $version_data, 3600 * 2);
|
||||
}
|
||||
}
|
||||
|
||||
$error = 0;
|
||||
$error = 0;
|
||||
|
||||
if(empty($version_data))
|
||||
{
|
||||
$text = $lang['ERROR_CHECK_VER'];
|
||||
$error = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '<'))
|
||||
{
|
||||
$text = sprintf($lang['UPDATE_NOW_S'] , KLEEJA_VERSION, strtolower($version_data)) . '<br /><br />' . $lang['UPDATE_KLJ_NOW'];
|
||||
$error = 1;
|
||||
}
|
||||
else if (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '='))
|
||||
{
|
||||
$text = $lang['U_LAST_VER_KLJ'];
|
||||
}
|
||||
else if (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '>'))
|
||||
{
|
||||
$text = $lang['U_USE_PRE_RE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $lang['ERROR_CHECK_VER'] . ' [code: ' . htmlspecialchars($version_data) .']';
|
||||
}
|
||||
}
|
||||
if (empty($version_data))
|
||||
{
|
||||
$text = $lang['ERROR_CHECK_VER'];
|
||||
$error = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '<'))
|
||||
{
|
||||
$text = sprintf($lang['UPDATE_NOW_S'], KLEEJA_VERSION, strtolower($version_data)) . '<br /><br />' . $lang['UPDATE_KLJ_NOW'];
|
||||
$error = 1;
|
||||
}
|
||||
elseif (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '='))
|
||||
{
|
||||
$text = $lang['U_LAST_VER_KLJ'];
|
||||
}
|
||||
elseif (version_compare(strtolower(KLEEJA_VERSION), strtolower($version_data), '>'))
|
||||
{
|
||||
$text = $lang['U_USE_PRE_RE'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$text = $lang['ERROR_CHECK_VER'] . ' [code: ' . htmlspecialchars($version_data) . ']';
|
||||
}
|
||||
}
|
||||
|
||||
$data = array(
|
||||
'version_number' => $version_data,
|
||||
'last_check' => time()
|
||||
);
|
||||
$data = [
|
||||
'version_number' => $version_data,
|
||||
'last_check' => time()
|
||||
];
|
||||
|
||||
$data = serialize($data);
|
||||
|
||||
update_config('new_version', $SQL->real_escape($data), false);
|
||||
delete_cache('data_config');
|
||||
|
||||
$adminAjaxContent = $error . ':::' . $text;
|
||||
$adminAjaxContent = $error . ':::' . $text;
|
||||
|
||||
elseif($current_smt == 'general'):
|
||||
elseif ($current_smt == 'general'):
|
||||
|
||||
// if(!$error)
|
||||
// {
|
||||
|
||||
|
||||
|
||||
//To prevent expected error [ infinit loop ]
|
||||
if(ig('show_msg'))
|
||||
{
|
||||
$query_get = array(
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}config",
|
||||
'WHERE' => "name = 'new_version'"
|
||||
);
|
||||
//To prevent expected error [ infinit loop ]
|
||||
if (ig('show_msg'))
|
||||
{
|
||||
$query_get = [
|
||||
'SELECT' => '*',
|
||||
'FROM' => "{$dbprefix}config",
|
||||
'WHERE' => "name = 'new_version'"
|
||||
];
|
||||
|
||||
$result_get = $SQL->build($query_get);
|
||||
$result_get = $SQL->build($query_get);
|
||||
|
||||
if(!$SQL->num_rows($result_get))
|
||||
{
|
||||
//add new config value
|
||||
add_config('new_version', '');
|
||||
}
|
||||
}
|
||||
if (! $SQL->num_rows($result_get))
|
||||
{
|
||||
//add new config value
|
||||
add_config('new_version', '');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// }
|
||||
@@ -104,12 +104,12 @@ elseif($current_smt == 'general'):
|
||||
$showMessage = ig('show_msg');
|
||||
|
||||
|
||||
#end current_smt == general
|
||||
//end current_smt == general
|
||||
endif;
|
||||
|
||||
//secondary menu
|
||||
$go_menu = array(
|
||||
'general' => array('name'=>$lang['R_CHECK_UPDATE'], 'link'=> basename(ADMIN_PATH) . '?cp=p_check_update&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'),
|
||||
'howto' => array('name'=>$lang['HOW_UPDATE_KLEEJA'], 'link'=> basename(ADMIN_PATH) . '?cp=p_check_update&smt=howto', 'goto'=>'howto', 'current'=> $current_smt == 'howto'),
|
||||
'site' => array('name'=>'Kleeja.com', 'link'=> 'http://www.kleeja.com', 'goto'=>'site', 'current'=> $current_smt == 'site'),
|
||||
);
|
||||
$go_menu = [
|
||||
'general' => ['name'=>$lang['R_CHECK_UPDATE'], 'link'=> basename(ADMIN_PATH) . '?cp=p_check_update&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'],
|
||||
'howto' => ['name'=>$lang['HOW_UPDATE_KLEEJA'], 'link'=> basename(ADMIN_PATH) . '?cp=p_check_update&smt=howto', 'goto'=>'howto', 'current'=> $current_smt == 'howto'],
|
||||
'site' => ['name'=>'Kleeja.com', 'link'=> 'http://www.kleeja.com', 'goto'=>'site', 'current'=> $current_smt == 'site'],
|
||||
];
|
||||
|
||||
@@ -9,58 +9,59 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
#turn time-limit off
|
||||
//turn time-limit off
|
||||
@set_time_limit(0);
|
||||
|
||||
#get current case
|
||||
//get current case
|
||||
$case = false;
|
||||
if(ig('case'))
|
||||
|
||||
if (ig('case'))
|
||||
{
|
||||
$case = g('case');
|
||||
$case = g('case');
|
||||
}
|
||||
|
||||
|
||||
#set form ket
|
||||
//set form ket
|
||||
$GET_FORM_KEY = kleeja_add_form_key_get('REPAIR_FORM_KEY');
|
||||
|
||||
|
||||
//check _GET Csrf token
|
||||
if($case && in_array($case, array('clearc', 'sync_files', 'sync_images', 'sync_users', 'tables', 'sync_sizes', 'status_file')))
|
||||
if ($case && in_array($case, ['clearc', 'sync_files', 'sync_images', 'sync_users', 'tables', 'sync_sizes', 'status_file']))
|
||||
{
|
||||
if(!kleeja_check_form_key_get('REPAIR_FORM_KEY'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH), 2);
|
||||
}
|
||||
if (! kleeja_check_form_key_get('REPAIR_FORM_KEY'))
|
||||
{
|
||||
kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, basename(ADMIN_PATH), 2);
|
||||
}
|
||||
}
|
||||
|
||||
switch($case):
|
||||
switch ($case):
|
||||
|
||||
default:
|
||||
|
||||
# Get real number from database right now
|
||||
$all_files = get_actual_stats('files');
|
||||
// Get real number from database right now
|
||||
$all_files = get_actual_stats('files');
|
||||
$all_images = get_actual_stats('imgs');
|
||||
$all_users = get_actual_stats('users');
|
||||
$all_sizes = readable_size(get_actual_stats('sizes'));
|
||||
$all_users = get_actual_stats('users');
|
||||
$all_sizes = readable_size(get_actual_stats('sizes'));
|
||||
|
||||
|
||||
#links
|
||||
$del_cache_link = basename(ADMIN_PATH) . '?cp=r_repair&case=clearc&' . $GET_FORM_KEY;
|
||||
$resync_files_link = $config['siteurl'] . 'go.php?go=resync&case=sync_files';
|
||||
//links
|
||||
$del_cache_link = basename(ADMIN_PATH) . '?cp=r_repair&case=clearc&' . $GET_FORM_KEY;
|
||||
$resync_files_link = $config['siteurl'] . 'go.php?go=resync&case=sync_files';
|
||||
$resync_images_link = $config['siteurl'] . 'go.php?go=resync&case=sync_images';
|
||||
$resync_users_link = basename(ADMIN_PATH) . '?cp=r_repair&case=sync_users&' . $GET_FORM_KEY;
|
||||
$resync_sizes_link = basename(ADMIN_PATH) . '?cp=r_repair&case=sync_sizes&' . $GET_FORM_KEY;
|
||||
$resync_users_link = basename(ADMIN_PATH) . '?cp=r_repair&case=sync_users&' . $GET_FORM_KEY;
|
||||
$resync_sizes_link = basename(ADMIN_PATH) . '?cp=r_repair&case=sync_sizes&' . $GET_FORM_KEY;
|
||||
$repair_tables_link = basename(ADMIN_PATH) . '?cp=r_repair&case=tables&' . $GET_FORM_KEY;
|
||||
|
||||
$queue_cron_job_url = $config['siteurl'] . 'go.php?go=queue';
|
||||
|
||||
$stylee = "admin_repair";
|
||||
$stylee = 'admin_repair';
|
||||
|
||||
break;
|
||||
|
||||
@@ -70,23 +71,24 @@ break;
|
||||
//
|
||||
case 'tables':
|
||||
|
||||
$query = "SHOW TABLE STATUS";
|
||||
$query = 'SHOW TABLE STATUS';
|
||||
$result = $SQL->query($query);
|
||||
$text = '';
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
$text = '';
|
||||
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$queryf = "REPAIR TABLE `" . $row['Name'] . "`";
|
||||
$resultf = $SQL->query($queryf);
|
||||
if ($resultf)
|
||||
{
|
||||
$text .= '<li>' . $lang['REPAIRE_TABLE'] . $row['Name'] . '</li>';
|
||||
}
|
||||
$queryf = 'REPAIR TABLE `' . $row['Name'] . '`';
|
||||
$resultf = $SQL->query($queryf);
|
||||
|
||||
if ($resultf)
|
||||
{
|
||||
$text .= '<li>' . $lang['REPAIRE_TABLE'] . $row['Name'] . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=r_repair' . '\');", 2000);</script>' . "\n";
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=r_repair' . '\');", 2000);</script>' . "\n";
|
||||
$stylee = 'admin_info';
|
||||
|
||||
|
||||
@@ -98,31 +100,31 @@ break;
|
||||
case 'sync_sizes':
|
||||
|
||||
|
||||
$query_s = array(
|
||||
'SELECT' => 'size',
|
||||
'FROM' => "{$dbprefix}files"
|
||||
);
|
||||
$query_s = [
|
||||
'SELECT' => 'size',
|
||||
'FROM' => "{$dbprefix}files"
|
||||
];
|
||||
|
||||
$result_s = $SQL->build($query_s);
|
||||
|
||||
$files_number = $files_sizes = 0;
|
||||
|
||||
while($row=$SQL->fetch_array($result_s))
|
||||
while ($row=$SQL->fetch_array($result_s))
|
||||
{
|
||||
$files_number++;
|
||||
$files_sizes = $files_sizes+$row['size'];
|
||||
$files_number++;
|
||||
$files_sizes = $files_sizes+$row['size'];
|
||||
}
|
||||
|
||||
$SQL->freeresult($result_s);
|
||||
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "files=" . $files_number . ", sizes=" . $files_sizes
|
||||
);
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => 'files=' . $files_number . ', sizes=' . $files_sizes
|
||||
];
|
||||
|
||||
if ($SQL->build($update_query))
|
||||
{
|
||||
$text .= '<li>' . $lang['REPAIRE_F_STAT'] . '</li>';
|
||||
$text .= '<li>' . $lang['REPAIRE_F_STAT'] . '</li>';
|
||||
}
|
||||
|
||||
delete_cache('data_stats');
|
||||
@@ -137,31 +139,31 @@ break;
|
||||
//
|
||||
case 'sync_users':
|
||||
|
||||
$query_w = array(
|
||||
'SELECT' => 'name',
|
||||
'FROM' => "{$dbprefix}users"
|
||||
);
|
||||
$query_w = [
|
||||
'SELECT' => 'name',
|
||||
'FROM' => "{$dbprefix}users"
|
||||
];
|
||||
|
||||
$result_w = $SQL->build($query_w);
|
||||
|
||||
|
||||
$user_number = 0;
|
||||
while($row=$SQL->fetch_array($result_w))
|
||||
while ($row=$SQL->fetch_array($result_w))
|
||||
{
|
||||
$user_number++;
|
||||
$user_number++;
|
||||
}
|
||||
|
||||
|
||||
$SQL->freeresult($result_w);
|
||||
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => "users=" . $user_number
|
||||
);
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => 'users=' . $user_number
|
||||
];
|
||||
|
||||
$result = $SQL->build($update_query);
|
||||
|
||||
delete_cache('data_stats');
|
||||
$text = sprintf($lang['SYNCING'], $lang['USERS_ST']);
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=r_repair' . '\');", 2000);</script>' . "\n";
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=r_repair' . '\');", 2000);</script>' . "\n";
|
||||
|
||||
$stylee = 'admin_info';
|
||||
|
||||
@@ -174,12 +176,12 @@ break;
|
||||
//
|
||||
case 'clearc':
|
||||
|
||||
#clear cache
|
||||
//clear cache
|
||||
delete_cache('', true);
|
||||
|
||||
#show done, msg
|
||||
//show done, msg
|
||||
$text .= '<li>' . $lang['REPAIRE_CACHE'] . '</li>';
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=r_repair' . '\');", 2000);</script>' . "\n";
|
||||
$text .= '<script type="text/javascript"> setTimeout("get_kleeja_link(\'' . basename(ADMIN_PATH) . '?cp=r_repair' . '\');", 2000);</script>' . "\n";
|
||||
|
||||
$stylee = 'admin_info';
|
||||
|
||||
@@ -188,41 +190,37 @@ break;
|
||||
//toggle admin start boxes
|
||||
case 'toggle_start_box':
|
||||
|
||||
if(! kleeja_check_form_key_get('adm_start_actions', 3600))
|
||||
{
|
||||
header('HTTP/1.1 405 Method Not Allowed');
|
||||
$adminAjaxContent = $lang['INVALID_FORM_KEY'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$items = explode(':', $config['hidden_start_boxes']);
|
||||
$items = array_filter($items);
|
||||
if (! kleeja_check_form_key_get('adm_start_actions', 3600))
|
||||
{
|
||||
header('HTTP/1.1 405 Method Not Allowed');
|
||||
$adminAjaxContent = $lang['INVALID_FORM_KEY'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$items = explode(':', $config['hidden_start_boxes']);
|
||||
$items = array_filter($items);
|
||||
|
||||
$name = g('name');
|
||||
$hide = g('toggle', 'int') == 1;
|
||||
|
||||
if(in_array($name, $items) && ! $hide)
|
||||
{
|
||||
$new_items = array_diff($items, [$name]);
|
||||
}
|
||||
else if($hide)
|
||||
{
|
||||
$new_items = $items;
|
||||
$new_items[] = $name;
|
||||
}
|
||||
$name = g('name');
|
||||
$hide = g('toggle', 'int') == 1;
|
||||
|
||||
if (in_array($name, $items) && ! $hide)
|
||||
{
|
||||
$new_items = array_diff($items, [$name]);
|
||||
}
|
||||
elseif ($hide)
|
||||
{
|
||||
$new_items = $items;
|
||||
$new_items[] = $name;
|
||||
}
|
||||
|
||||
if ($new_items != $items)
|
||||
{
|
||||
update_config('hidden_start_boxes', implode(':', $new_items));
|
||||
}
|
||||
|
||||
$adminAjaxContent = $lang['CONFIGS_UPDATED'];
|
||||
}
|
||||
|
||||
if($new_items != $items)
|
||||
{
|
||||
update_config('hidden_start_boxes', implode(':', $new_items));
|
||||
}
|
||||
|
||||
$adminAjaxContent = $lang['CONFIGS_UPDATED'];
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
endswitch;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -9,51 +9,51 @@
|
||||
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_ADMIN'))
|
||||
if (! defined('IN_ADMIN'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//style of
|
||||
$stylee = "admin_start";
|
||||
$h_lst_files = basename(ADMIN_PATH) . '?cp=c_files&last_visit=';
|
||||
$h_lst_imgs = basename(ADMIN_PATH) . '?cp=d_img_ctrl&last_visit=';
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
$stylee = 'admin_start';
|
||||
$h_lst_files = basename(ADMIN_PATH) . '?cp=c_files&last_visit=';
|
||||
$h_lst_imgs = basename(ADMIN_PATH) . '?cp=d_img_ctrl&last_visit=';
|
||||
$current_smt = preg_replace('/[^a-z0-9_]/i', '', g('smt', 'str', 'general'));
|
||||
$GET_FORM_KEY = kleeja_add_form_key_get('adm_start_actions');
|
||||
|
||||
//data
|
||||
$lst_reg = empty($stat_last_user) ? $lang['UNKNOWN'] : $stat_last_user;
|
||||
$files_number = $stat_files + $stat_imgs;
|
||||
$files_sizes = readable_size($stat_sizes);
|
||||
$users_number = $stat_users;
|
||||
$last_del_fles = (int) $config['del_f_day'] <= 0 ? $lang['CLOSED_FEATURE'] : kleeja_date($stat_last_f_del);
|
||||
$php_version = isset($NO_PHPINFO) || !function_exists('phpinfo') ? phpversion() : 'PHP ' . phpversion();
|
||||
$mysql_version = 'MySQL ' . $SQL->mysql_version();
|
||||
$lst_reg = empty($stat_last_user) ? $lang['UNKNOWN'] : $stat_last_user;
|
||||
$files_number = $stat_files + $stat_imgs;
|
||||
$files_sizes = readable_size($stat_sizes);
|
||||
$users_number = $stat_users;
|
||||
$last_del_fles = (int) $config['del_f_day'] <= 0 ? $lang['CLOSED_FEATURE'] : kleeja_date($stat_last_f_del);
|
||||
$php_version = isset($NO_PHPINFO) || ! function_exists('phpinfo') ? phpversion() : 'PHP ' . phpversion();
|
||||
$mysql_version = 'MySQL ' . $SQL->mysql_version();
|
||||
$max_execution_time = function_exists('ini_get') ? @ini_get('max_execution_time') : @get_cfg_var('max_execution_time');
|
||||
$upload_max_filesize= function_exists('ini_get') ? @ini_get('upload_max_filesize') : @get_cfg_var('upload_max_filesize');
|
||||
$post_max_size = function_exists('ini_get') ? @ini_get('post_max_size') : @get_cfg_var('post_max_size');
|
||||
$memory_limit = function_exists('ini_get') ? @ini_get('memory_limit') : @get_cfg_var('memory_limit');
|
||||
$s_last_google = $stat_last_google == 0 ? '[ ? ]' : kleeja_date($stat_last_google);
|
||||
$s_google_num = $stat_google_num;
|
||||
$s_last_bing = $stat_last_bing == 0 ? '[ ? ]' : kleeja_date($stat_last_bing);
|
||||
$s_bing_num = $stat_bing_num;
|
||||
$usernamelang = sprintf($lang['KLEEJA_CP_W'], $username);
|
||||
$current_year = date('Y');
|
||||
$post_max_size = function_exists('ini_get') ? @ini_get('post_max_size') : @get_cfg_var('post_max_size');
|
||||
$memory_limit = function_exists('ini_get') ? @ini_get('memory_limit') : @get_cfg_var('memory_limit');
|
||||
$s_last_google = $stat_last_google == 0 ? '[ ? ]' : kleeja_date($stat_last_google);
|
||||
$s_google_num = $stat_google_num;
|
||||
$s_last_bing = $stat_last_bing == 0 ? '[ ? ]' : kleeja_date($stat_last_bing);
|
||||
$s_bing_num = $stat_bing_num;
|
||||
$usernamelang = sprintf($lang['KLEEJA_CP_W'], $username);
|
||||
$current_year = date('Y');
|
||||
|
||||
$startBoxes = array(
|
||||
'notifications' => array('title' => $lang['NOTIFICATIONS'], 'hidden' => (int) adm_is_start_box_hidden('notifications')),
|
||||
'statsBoxes' => array('title' => $lang['STATS_BOXES'], 'hidden' => (int) adm_is_start_box_hidden('statsBoxes')),
|
||||
'lastVisitActions' => array('title' => $lang['LAST_VISIT'], 'hidden' => (int) adm_is_start_box_hidden('lastVisitActions')),
|
||||
'statsChart' => array('title' => $lang['STATS'], 'hidden' => (int) adm_is_start_box_hidden('statsChart')),
|
||||
'hurryActions' => array('title' => $lang['HURRY_HURRY'], 'hidden' => (int) adm_is_start_box_hidden('hurryActions')),
|
||||
'extraStats' => array('title' => $lang['OTHER_INFO'], 'hidden' => (int) adm_is_start_box_hidden('extraStats')),
|
||||
);
|
||||
$startBoxes = [
|
||||
'notifications' => ['title' => $lang['NOTIFICATIONS'], 'hidden' => (int) adm_is_start_box_hidden('notifications')],
|
||||
'statsBoxes' => ['title' => $lang['STATS_BOXES'], 'hidden' => (int) adm_is_start_box_hidden('statsBoxes')],
|
||||
'lastVisitActions' => ['title' => $lang['LAST_VISIT'], 'hidden' => (int) adm_is_start_box_hidden('lastVisitActions')],
|
||||
'statsChart' => ['title' => $lang['STATS'], 'hidden' => (int) adm_is_start_box_hidden('statsChart')],
|
||||
'hurryActions' => ['title' => $lang['HURRY_HURRY'], 'hidden' => (int) adm_is_start_box_hidden('hurryActions')],
|
||||
'extraStats' => ['title' => $lang['OTHER_INFO'], 'hidden' => (int) adm_is_start_box_hidden('extraStats')],
|
||||
];
|
||||
|
||||
$extra_adm_start_html = '';
|
||||
|
||||
//size board by percent
|
||||
$per = $stat_sizes / ($config['total_size'] * 1048576);
|
||||
$per = $stat_sizes / ($config['total_size'] * 1048576);
|
||||
$per1 = round($per*100, 2);
|
||||
$per1 = $per1 >= 100 ? 100 : $per1;
|
||||
|
||||
@@ -61,38 +61,40 @@ $per1 = $per1 >= 100 ? 100 : $per1;
|
||||
$kleeja_version = '<a href="' . basename(ADMIN_PATH) . '?cp=p_check_update" onclick="javascript:get_kleeja_link(this.href, \'#content\'); return false;" title="' . $lang['R_CHECK_UPDATE'] . '">' . KLEEJA_VERSION . '</a>';
|
||||
|
||||
//admin messages system
|
||||
$ADM_NOTIFICATIONS = array();
|
||||
$ADM_NOTIFICATIONS = [];
|
||||
|
||||
//useing IE6 ! and he is admin ? omg !
|
||||
$u_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? htmlspecialchars((string) strtolower($_SERVER['HTTP_USER_AGENT'])) : (function_exists('getenv') ? getenv('HTTP_USER_AGENT') : '');
|
||||
if(is_browser('ie6, ie8, ie7'))
|
||||
$u_agent = ! empty($_SERVER['HTTP_USER_AGENT']) ? htmlspecialchars((string) strtolower($_SERVER['HTTP_USER_AGENT'])) : (function_exists('getenv') ? getenv('HTTP_USER_AGENT') : '');
|
||||
|
||||
if (is_browser('ie6, ie8, ie7'))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['IE6'] = array('id' => 'IE6', 'msg_type'=> 'error', 'title'=> $lang['NOTE'], 'msg'=> $lang['ADMIN_USING_IE6']);
|
||||
$ADM_NOTIFICATIONS['IE6'] = ['id' => 'IE6', 'msg_type'=> 'error', 'title'=> $lang['NOTE'], 'msg'=> $lang['ADMIN_USING_IE6']];
|
||||
}
|
||||
|
||||
//if upgrading from 1rc6 to 1.0, some files must be deleted !
|
||||
if(file_exists(PATH . 'includes/adm/files.php') || file_exists(PATH . 'admin.php'))
|
||||
if (file_exists(PATH . 'includes/adm/files.php') || file_exists(PATH . 'admin.php'))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['old_files'] = array('id' => 'old_files', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['ADM_UNWANTED_FILES']);
|
||||
$ADM_NOTIFICATIONS['old_files'] = ['id' => 'old_files', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['ADM_UNWANTED_FILES']];
|
||||
}
|
||||
|
||||
//if html url is enabled but .htaccess is not available in the root dir !
|
||||
if(!file_exists(PATH . '.htaccess') && (int) $config['mod_writer'] == 1)
|
||||
if (! file_exists(PATH . '.htaccess') && (int) $config['mod_writer'] == 1)
|
||||
{
|
||||
$ADM_NOTIFICATIONS['htmlurlshtaccess'] = array('id' => 'htmlurlshtaccess', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['HTML_URLS_ENABLED_NO_HTCC']);
|
||||
$ADM_NOTIFICATIONS['htmlurlshtaccess'] = ['id' => 'htmlurlshtaccess', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['HTML_URLS_ENABLED_NO_HTCC']];
|
||||
}
|
||||
|
||||
//updating
|
||||
$v = @unserialize($config['new_version']);
|
||||
if(version_compare(strtolower(KLEEJA_VERSION), strtolower($v['version_number']), '<'))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['up_ver_klj'] = array(
|
||||
'id' => 'up_ver_klj',//this not so important row
|
||||
'msg_type'=> 'error', 'title'=> $lang['R_CHECK_UPDATE'],
|
||||
'msg'=> sprintf($lang['UPDATE_NOW_S'] , KLEEJA_VERSION, $v['version_number']) . '<br />' . '<a href="http://www.kleeja.com/">www.kleeja.com</a>'
|
||||
);
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('admin_update_now', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
if (version_compare(strtolower(KLEEJA_VERSION), strtolower($v['version_number']), '<'))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['up_ver_klj'] = [
|
||||
'id' => 'up_ver_klj',//this not so important row
|
||||
'msg_type'=> 'error', 'title'=> $lang['R_CHECK_UPDATE'],
|
||||
'msg' => sprintf($lang['UPDATE_NOW_S'], KLEEJA_VERSION, $v['version_number']) . '<br />' . '<a href="http://www.kleeja.com/">www.kleeja.com</a>'
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('admin_update_now', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
}
|
||||
|
||||
|
||||
@@ -101,18 +103,18 @@ is_array($plugin_run_result = Plugins::getInstance()->run('default_admin_page',
|
||||
|
||||
|
||||
//check upload_max_filesize
|
||||
if(!empty($d_groups) && is_array($d_groups))
|
||||
if (! empty($d_groups) && is_array($d_groups))
|
||||
{
|
||||
$biggest_size = 0;
|
||||
|
||||
foreach($d_groups as $gid => $gdata)
|
||||
foreach ($d_groups as $gid => $gdata)
|
||||
{
|
||||
if(!empty($d_groups[$gid]['exts']) && is_array($d_groups[$gid]['exts']))
|
||||
if (! empty($d_groups[$gid]['exts']) && is_array($d_groups[$gid]['exts']))
|
||||
{
|
||||
$u_e_s = $d_groups[$gid]['exts'];
|
||||
arsort($u_e_s);
|
||||
|
||||
if(!empty($u_e_s))
|
||||
if (! empty($u_e_s))
|
||||
{
|
||||
$current_size = array_shift($u_e_s);
|
||||
$biggest_size = $current_size > $biggest_size ? $current_size : $biggest_size;
|
||||
@@ -121,50 +123,53 @@ if(!empty($d_groups) && is_array($d_groups))
|
||||
}
|
||||
|
||||
|
||||
if(strpos($upload_max_filesize, 'M') !== false)
|
||||
{
|
||||
$upload_max_filesize_s = ((int) trim(str_replace('M', '', $upload_max_filesize))) * 1048576;
|
||||
}
|
||||
else if(strpos($upload_max_filesize, 'G') !== false)
|
||||
{
|
||||
$upload_max_filesize_s = ((int) trim(str_replace('G', '', $upload_max_filesize))) * 1073741824;
|
||||
}else{
|
||||
if (strpos($upload_max_filesize, 'M') !== false)
|
||||
{
|
||||
$upload_max_filesize_s = ((int) trim(str_replace('M', '', $upload_max_filesize))) * 1048576;
|
||||
}
|
||||
elseif (strpos($upload_max_filesize, 'G') !== false)
|
||||
{
|
||||
$upload_max_filesize_s = ((int) trim(str_replace('G', '', $upload_max_filesize))) * 1073741824;
|
||||
}
|
||||
else
|
||||
{
|
||||
$upload_max_filesize_s = $upload_max_filesize;
|
||||
}
|
||||
|
||||
|
||||
if(!empty($upload_max_filesize) && $upload_max_filesize_s < $biggest_size)
|
||||
{
|
||||
$ADM_NOTIFICATIONS['file_size_ini_low'] = array(
|
||||
'id' => 'file_size_ini_low',
|
||||
'msg_type'=> 'info', 'title'=> $lang['NOTE'],
|
||||
'msg'=> sprintf($lang['PHPINI_FILESIZE_SMALL'] , readable_size($biggest_size), readable_size($upload_max_filesize_s))
|
||||
);
|
||||
}
|
||||
if (! empty($upload_max_filesize) && $upload_max_filesize_s < $biggest_size)
|
||||
{
|
||||
$ADM_NOTIFICATIONS['file_size_ini_low'] = [
|
||||
'id' => 'file_size_ini_low',
|
||||
'msg_type'=> 'info', 'title'=> $lang['NOTE'],
|
||||
'msg' => sprintf($lang['PHPINI_FILESIZE_SMALL'], readable_size($biggest_size), readable_size($upload_max_filesize_s))
|
||||
];
|
||||
}
|
||||
|
||||
//check post_max_size
|
||||
if(strpos($post_max_size, 'M') !== false)
|
||||
{
|
||||
$post_max_size_s = ((int) trim(str_replace('M', '', $post_max_size))) * 1048576;
|
||||
}
|
||||
else if(strpos($post_max_size, 'G') !== false)
|
||||
{
|
||||
$post_max_size_s = ((int) trim(str_replace('G', '', $post_max_size))) * 1073741824;
|
||||
}else
|
||||
//check post_max_size
|
||||
if (strpos($post_max_size, 'M') !== false)
|
||||
{
|
||||
$post_max_size_s = ((int) trim(str_replace('M', '', $post_max_size))) * 1048576;
|
||||
}
|
||||
elseif (strpos($post_max_size, 'G') !== false)
|
||||
{
|
||||
$post_max_size_s = ((int) trim(str_replace('G', '', $post_max_size))) * 1073741824;
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_max_size_s = $post_max_size;
|
||||
}
|
||||
|
||||
$post_max_size_s_must_be = ($config['filesnum'] * $biggest_size) + 5242880;//+ 5 mega to make sure it's ok
|
||||
$post_max_size_s_must_be = ($config['filesnum'] * $biggest_size) + 5242880;//+ 5 mega to make sure it's ok
|
||||
|
||||
if(!empty($post_max_size) && $post_max_size_s < $post_max_size_s_must_be)
|
||||
{
|
||||
$ADM_NOTIFICATIONS['post_m_size_ini_low'] = array(
|
||||
'id' => 'post_m_size_ini_low',
|
||||
'msg_type'=> 'info', 'title'=> $lang['NOTE'],
|
||||
'msg'=> sprintf($lang['PHPINI_MPOSTSIZE_SMALL'] , $config['filesnum'], readable_size($post_max_size_s_must_be))
|
||||
);
|
||||
}
|
||||
if (! empty($post_max_size) && $post_max_size_s < $post_max_size_s_must_be)
|
||||
{
|
||||
$ADM_NOTIFICATIONS['post_m_size_ini_low'] = [
|
||||
'id' => 'post_m_size_ini_low',
|
||||
'msg_type'=> 'info', 'title'=> $lang['NOTE'],
|
||||
'msg' => sprintf($lang['PHPINI_MPOSTSIZE_SMALL'], $config['filesnum'], readable_size($post_max_size_s_must_be))
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -172,44 +177,46 @@ if(!empty($d_groups) && is_array($d_groups))
|
||||
// rev: let's say cache is not refreshed, so we will redirect alots of time,
|
||||
// so update_done will be good solution
|
||||
//
|
||||
if (empty($v['last_check']) || ((time() - $v['last_check']) > 3600 * 24 * 10 && $_SERVER['SERVER_NAME'] != 'localhost' && !ig('update_done')))
|
||||
if (empty($v['last_check']) || ((time() - $v['last_check']) > 3600 * 24 * 10 && $_SERVER['SERVER_NAME'] != 'localhost' && ! ig('update_done')))
|
||||
{
|
||||
redirect(basename(ADMIN_PATH) . '?cp=p_check_update&show_msg=1');
|
||||
$SQL->close();
|
||||
exit;
|
||||
redirect(basename(ADMIN_PATH) . '?cp=p_check_update&show_msg=1');
|
||||
$SQL->close();
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
//if config not safe
|
||||
if(function_exists('fileperms') && !defined('KLEEJA_NO_CONFIG_CHECK') && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' && !@ini_get('safe_mode'))
|
||||
if (function_exists('fileperms') && ! defined('KLEEJA_NO_CONFIG_CHECK') && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN' && ! @ini_get('safe_mode'))
|
||||
{
|
||||
if((bool) (@fileperms(PATH . KLEEJA_CONFIG_FILE) & 0x0002))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['config_perm'] = array('id' => 'config_perm', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['CONFIG_WRITEABLE']);
|
||||
}
|
||||
if ((bool) (@fileperms(PATH . KLEEJA_CONFIG_FILE) & 0x0002))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['config_perm'] = ['id' => 'config_perm', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['CONFIG_WRITEABLE']];
|
||||
}
|
||||
}
|
||||
|
||||
//no htaccess
|
||||
if(!file_exists(PATH . $config['foldername'] . '/.htaccess'))
|
||||
if (! file_exists(PATH . $config['foldername'] . '/.htaccess'))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['htaccess_u'] = array('id' => 'htaccess_u', 'msg_type'=> 'error', 'title'=> $lang['WARN'], 'msg'=> sprintf($lang['NO_HTACCESS_DIR_UP'], $config['foldername']));
|
||||
$ADM_NOTIFICATIONS['htaccess_u'] = ['id' => 'htaccess_u', 'msg_type'=> 'error', 'title'=> $lang['WARN'], 'msg'=> sprintf($lang['NO_HTACCESS_DIR_UP'], $config['foldername'])];
|
||||
}
|
||||
if(!file_exists(PATH . $config['foldername'] . '/thumbs/.htaccess'))
|
||||
|
||||
if (! file_exists(PATH . $config['foldername'] . '/thumbs/.htaccess'))
|
||||
{
|
||||
$ADM_NOTIFICATIONS['htaccess_t'] = array('id' => 'htaccess_t', 'msg_type'=> 'error', 'title'=> $lang['WARN'], 'msg'=> sprintf($lang['NO_HTACCESS_DIR_UP_THUMB'], $config['foldername'] . '/thumbs'));
|
||||
$ADM_NOTIFICATIONS['htaccess_t'] = ['id' => 'htaccess_t', 'msg_type'=> 'error', 'title'=> $lang['WARN'], 'msg'=> sprintf($lang['NO_HTACCESS_DIR_UP_THUMB'], $config['foldername'] . '/thumbs')];
|
||||
}
|
||||
|
||||
|
||||
//there is cleaning files process now
|
||||
if((int)$config['klj_clean_files_from'] > 0)
|
||||
if ((int) $config['klj_clean_files_from'] > 0)
|
||||
{
|
||||
$ADM_NOTIFICATIONS['klj_clean_files'] = array('id' => 'klj_clean_files', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['T_CLEANING_FILES_NOW']);
|
||||
$ADM_NOTIFICATIONS['klj_clean_files'] = ['id' => 'klj_clean_files', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> $lang['T_CLEANING_FILES_NOW']];
|
||||
}
|
||||
|
||||
//if there is no thumbs folder
|
||||
if(!file_exists(PATH . $config['foldername'] . '/thumbs') && (int) $config['thumbs_imgs'] != 0)
|
||||
if (! file_exists(PATH . $config['foldername'] . '/thumbs') && (int) $config['thumbs_imgs'] != 0)
|
||||
{
|
||||
$ADM_NOTIFICATIONS['no_thumbs'] = array('id' => 'no_thumbs', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> sprintf($lang['NO_THUMB_FOLDER'], PATH . $config['foldername'] . '/thumbs'));
|
||||
$ADM_NOTIFICATIONS['no_thumbs'] = ['id' => 'no_thumbs', 'msg_type'=> 'info', 'title'=> $lang['NOTE'], 'msg'=> sprintf($lang['NO_THUMB_FOLDER'], PATH . $config['foldername'] . '/thumbs')];
|
||||
}
|
||||
|
||||
|
||||
@@ -220,15 +227,15 @@ $translator_copyrights = isset($lang['S_TRANSLATED_BY']) ? $lang['S_TRANSLATED_
|
||||
|
||||
|
||||
//secondary menu
|
||||
$go_menu = array(
|
||||
'general' => array('name'=>$lang['GENERAL_STAT'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'),
|
||||
'other' => array('name'=>$lang['OTHER_INFO'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=other', 'goto'=>'other', 'current'=> $current_smt == 'other'),
|
||||
'team' => array('name'=>$lang['KLEEJA_TEAM'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=team', 'goto'=>'team', 'current'=> $current_smt == 'team'),
|
||||
'kj_news' => array('name'=> $lang['KJ_TWEETS'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=kj_tweets', 'goto'=>'kj_tweets', 'current'=> $current_smt == 'kj_tweets'),
|
||||
);
|
||||
$go_menu = [
|
||||
'general' => ['name'=>$lang['GENERAL_STAT'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=general', 'goto'=>'general', 'current'=> $current_smt == 'general'],
|
||||
'other' => ['name'=>$lang['OTHER_INFO'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=other', 'goto'=>'other', 'current'=> $current_smt == 'other'],
|
||||
'team' => ['name'=>$lang['KLEEJA_TEAM'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=team', 'goto'=>'team', 'current'=> $current_smt == 'team'],
|
||||
'kj_news' => ['name'=> $lang['KJ_TWEETS'], 'link'=> basename(ADMIN_PATH) . '?cp=start&smt=kj_tweets', 'goto'=>'kj_tweets', 'current'=> $current_smt == 'kj_tweets'],
|
||||
];
|
||||
|
||||
|
||||
# is there a last visit of images and files ?
|
||||
// is there a last visit of images and files ?
|
||||
$files_last_visit = filter_exists('f_lastvisit', 'filter_uid', 'lastvisit', $userinfo['id'])
|
||||
? get_filter('f_lastvisit', 'lastvisit', true, 'filter_uid', $userinfo['id']) : false;
|
||||
$image_last_visit = filter_exists('i_lastvisit', 'filter_uid', 'lastvisit', $userinfo['id'])
|
||||
@@ -236,127 +243,130 @@ $image_last_visit = filter_exists('i_lastvisit', 'filter_uid', 'lastvisit', $use
|
||||
|
||||
|
||||
|
||||
#hurry, hurry section, get styles
|
||||
$hurry_style_link = basename(ADMIN_PATH) . '?cp=m_styles&sty_t=st&method=2&home=1&smt=curstyle&' . $GET_FORM_KEY . '&style_choose=';
|
||||
//hurry, hurry section, get styles
|
||||
$hurry_style_link = basename(ADMIN_PATH) . '?cp=m_styles&sty_t=st&method=2&home=1&smt=curstyle&' . $GET_FORM_KEY . '&style_choose=';
|
||||
$hurry_styles_list = '';
|
||||
|
||||
if ($dh = @opendir(PATH . 'styles'))
|
||||
{
|
||||
while (($file = @readdir($dh)) !== false)
|
||||
{
|
||||
if(strpos($file, '.') === false && $file != '..' && $file != '.')
|
||||
{
|
||||
$hurry_styles_list .= '<option value="' . htmlspecialchars($file) . '"' . ($config['style'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>';
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
while (($file = @readdir($dh)) !== false)
|
||||
{
|
||||
if (strpos($file, '.') === false && $file != '..' && $file != '.')
|
||||
{
|
||||
$hurry_styles_list .= '<option value="' . htmlspecialchars($file) . '"' . ($config['style'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>';
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
|
||||
#hurry, hurry section, get languages
|
||||
$hurry_lang_link = basename(ADMIN_PATH) . '?cp=g_users&smt=general&smt=group_data&' . $GET_FORM_KEY . '&lang_change=';
|
||||
//hurry, hurry section, get languages
|
||||
$hurry_lang_link = basename(ADMIN_PATH) . '?cp=g_users&smt=general&smt=group_data&' . $GET_FORM_KEY . '&lang_change=';
|
||||
$hurry_langs_list = '';
|
||||
|
||||
if ($dh = @opendir(PATH . 'lang'))
|
||||
{
|
||||
while (($file = @readdir($dh)) !== false)
|
||||
{
|
||||
if(strpos($file, '.') === false && $file != '..' && $file != '.')
|
||||
{
|
||||
$hurry_langs_list .= '<option value="' . htmlspecialchars($file) . '"' . ($d_groups[$config['default_group']]['configs']['language'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>';
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
while (($file = @readdir($dh)) !== false)
|
||||
{
|
||||
if (strpos($file, '.') === false && $file != '..' && $file != '.')
|
||||
{
|
||||
$hurry_langs_list .= '<option value="' . htmlspecialchars($file) . '"' . ($d_groups[$config['default_group']]['configs']['language'] == $file ? ' selected="selected"' : '') . '>' . $file . '</option>';
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
|
||||
$hurry_groups_list = '<option value="-1" selected="selected">' . $lang['ALL'] . '</option>';
|
||||
$hurry_groups_list .= '<option value="' . $config['default_group'] . '">' . $lang['DEFAULT_GROUP'] . '</option>';
|
||||
foreach($d_groups as $id=>$ddt)
|
||||
|
||||
foreach ($d_groups as $id=>$ddt)
|
||||
{
|
||||
$hurry_groups_list .= '<option value="' . $id . '">' .
|
||||
str_replace(array('{lang.ADMINS}', '{lang.USERS}', '{lang.GUESTS}'),
|
||||
array($lang['ADMINS'], $lang['USERS'], $lang['GUESTS']),
|
||||
$d_groups[$id]['data']['group_name']) .
|
||||
'</option>';
|
||||
$hurry_groups_list .= '<option value="' . $id . '">' .
|
||||
str_replace(['{lang.ADMINS}', '{lang.USERS}', '{lang.GUESTS}'],
|
||||
[$lang['ADMINS'], $lang['USERS'], $lang['GUESTS']],
|
||||
$d_groups[$id]['data']['group_name']) .
|
||||
'</option>';
|
||||
}
|
||||
|
||||
#hurry, hurry section, links
|
||||
//hurry, hurry section, links
|
||||
$del_cache_link = basename(ADMIN_PATH) . '?cp=r_repair&case=clearc&' . kleeja_add_form_key_get('REPAIR_FORM_KEY');
|
||||
|
||||
|
||||
# get stats filter so we can draw a chart for the user
|
||||
// get stats filter so we can draw a chart for the user
|
||||
$stats_chart = false;
|
||||
|
||||
$cf_query = array(
|
||||
'SELECT' => 'f.filter_uid, f.filter_value, f.filter_time',
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => "f.filter_type = 'stats_for_acp'",
|
||||
'ORDER BY' => 'f.filter_time DESC',
|
||||
);
|
||||
$cf_query = [
|
||||
'SELECT' => 'f.filter_uid, f.filter_value, f.filter_time',
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => "f.filter_type = 'stats_for_acp'",
|
||||
'ORDER BY' => 'f.filter_time DESC',
|
||||
];
|
||||
|
||||
$cf_result = $SQL->build($cf_query);
|
||||
$cf_num = $SQL->num_rows($cf_result);
|
||||
if($cf_num > 3)
|
||||
$cf_num = $SQL->num_rows($cf_result);
|
||||
|
||||
if ($cf_num > 3)
|
||||
{
|
||||
$stats_chart = 'arrayOfDataMulti = new Array(';
|
||||
$stats_chart = 'arrayOfDataMulti = new Array(';
|
||||
|
||||
$comma = false;
|
||||
#get currently right now stats
|
||||
$prv_files = get_actual_stats('files');
|
||||
$prev_imgs = get_actual_stats('imgs');
|
||||
$prev_date = date('d-n-Y');
|
||||
$todayIsGone = false;
|
||||
$comma = false;
|
||||
//get currently right now stats
|
||||
$prv_files = get_actual_stats('files');
|
||||
$prev_imgs = get_actual_stats('imgs');
|
||||
$prev_date = date('d-n-Y');
|
||||
$todayIsGone = false;
|
||||
|
||||
while($row=$SQL->fetch_array($cf_result))
|
||||
{
|
||||
#jump today
|
||||
if($prev_date == $row['filter_uid'])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
while ($row=$SQL->fetch_array($cf_result))
|
||||
{
|
||||
//jump today
|
||||
if ($prev_date == $row['filter_uid'])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
#get this row data
|
||||
list($s_files, $s_imgs, $s_sizes) = explode(':', $row['filter_value']);
|
||||
|
||||
$t_files = $prv_files - $s_files;
|
||||
$t_imgs = $prev_imgs - $s_imgs;
|
||||
//get this row data
|
||||
list($s_files, $s_imgs, $s_sizes) = explode(':', $row['filter_value']);
|
||||
|
||||
if(date('d-n-Y') == $prev_date)
|
||||
{
|
||||
$day = $lang['TODAY'] . ' ~ ' . $lang['NOW'];
|
||||
$t_files = $prv_files - $s_files;
|
||||
$t_imgs = $prev_imgs - $s_imgs;
|
||||
|
||||
if($todayIsGone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (date('d-n-Y') == $prev_date)
|
||||
{
|
||||
$day = $lang['TODAY'] . ' ~ ' . $lang['NOW'];
|
||||
|
||||
$todayIsGone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$day = $prev_date;
|
||||
}
|
||||
if ($todayIsGone)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$stats_chart .= ($comma ? ',': '') . "[[$t_files,$t_imgs],'" . ($cf_num > 6 ? str_replace(date('-Y'), '', $day) : $day) . "']";
|
||||
$todayIsGone = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$day = $prev_date;
|
||||
}
|
||||
|
||||
$comma = true;
|
||||
$prv_files = $s_files;
|
||||
$prev_imgs = $s_imgs;
|
||||
$prev_date = $row['filter_uid'];
|
||||
}
|
||||
$stats_chart .= ($comma ? ',': '') . "[[$t_files,$t_imgs],'" . ($cf_num > 6 ? str_replace(date('-Y'), '', $day) : $day) . "']";
|
||||
|
||||
$stats_chart .= ');';
|
||||
$comma = true;
|
||||
$prv_files = $s_files;
|
||||
$prev_imgs = $s_imgs;
|
||||
$prev_date = $row['filter_uid'];
|
||||
}
|
||||
|
||||
$stats_chart .= ');';
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('stats_start_admin', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
$SQL->freeresult($cf_result);
|
||||
|
||||
#clean old chart stats
|
||||
if($cf_num > 10)
|
||||
{
|
||||
$query_del = array(
|
||||
'DELETE' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_type = 'stats_for_acp' AND filter_time < " . (time() - (3600 * 24 * 10))
|
||||
);
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
//clean old chart stats
|
||||
if ($cf_num > 10)
|
||||
{
|
||||
$query_del = [
|
||||
'DELETE' => "{$dbprefix}filters",
|
||||
'WHERE' => "filter_type = 'stats_for_acp' AND filter_time < " . (time() - (3600 * 24 * 10))
|
||||
];
|
||||
$SQL->build($query_del);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,101 +9,99 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
function kleeja_auth_login ($name, $pass, $hashed = false, $expire, $loginadm = false, $return_username = false)
|
||||
{
|
||||
global $lang, $config, $usrcp, $userinfo;
|
||||
global $script_path, $script_api_key, $script_cp1256;
|
||||
global $lang, $config, $usrcp, $userinfo;
|
||||
global $script_path, $script_api_key, $script_cp1256;
|
||||
|
||||
//URL must be begin with http://
|
||||
if(empty($script_path) || $script_path[0] != 'h')
|
||||
{
|
||||
big_error('Forum URL must be begin with http://', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'API'));
|
||||
}
|
||||
//URL must be begin with http://
|
||||
if (empty($script_path) || $script_path[0] != 'h')
|
||||
{
|
||||
big_error('Forum URL must be begin with http://', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'API'));
|
||||
}
|
||||
|
||||
//api key is the key to make the query between the remote script and kleeja more secure !
|
||||
//this must be changed in the real use
|
||||
if(empty($script_api_key))
|
||||
{
|
||||
big_error('api key', 'To connect to the remote script you have to write the API key ...');
|
||||
}
|
||||
//api key is the key to make the query between the remote script and kleeja more secure !
|
||||
//this must be changed in the real use
|
||||
if (empty($script_api_key))
|
||||
{
|
||||
big_error('api key', 'To connect to the remote script you have to write the API key ...');
|
||||
}
|
||||
|
||||
$pass = empty($script_cp1256) || !$script_cp1256 ? $pass : $usrcp->kleeja_utf8($pass, false);
|
||||
$name = empty($script_cp1256) || !$script_cp1256 || $hashed ? $name : $usrcp->kleeja_utf8($name, false);
|
||||
$pass = empty($script_cp1256) || ! $script_cp1256 ? $pass : $usrcp->kleeja_utf8($pass, false);
|
||||
$name = empty($script_cp1256) || ! $script_cp1256 || $hashed ? $name : $usrcp->kleeja_utf8($name, false);
|
||||
|
||||
/*
|
||||
@see file : docs/kleeja_(vb,mysmartbb,phpbb)_api.txt
|
||||
*/
|
||||
// @see file : docs/kleeja_(vb,mysmartbb,phpbb)_api.txt
|
||||
|
||||
$api_http_query = 'api_key=' . kleeja_base64_encode($script_api_key) . '&' . ($hashed ? 'userid' : 'username') . '=' . urlencode($name) . '&pass=' . kleeja_base64_encode($pass);
|
||||
//if only username, let tell him in the query
|
||||
$api_http_query .= $return_username ? '&return_username=1' : '';
|
||||
$api_http_query = 'api_key=' . kleeja_base64_encode($script_api_key) . '&' . ($hashed ? 'userid' : 'username') . '=' . urlencode($name) . '&pass=' . kleeja_base64_encode($pass);
|
||||
//if only username, let tell him in the query
|
||||
$api_http_query .= $return_username ? '&return_username=1' : '';
|
||||
|
||||
|
||||
//get it
|
||||
$remote_data = fetch_remote_file($script_path . '?' . $api_http_query);
|
||||
//get it
|
||||
$remote_data = fetch_remote_file($script_path . '?' . $api_http_query);
|
||||
|
||||
//no responde
|
||||
//empty or can not connect
|
||||
if ($remote_data == false || empty($remote_data))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//no responde
|
||||
//empty or can not connect
|
||||
if ($remote_data == false || empty($remote_data))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//see kleeja_api.php file
|
||||
//split the data , the first one is always 0 or 1
|
||||
//0 : error
|
||||
//1: ok
|
||||
$user_info = explode('%|%', kleeja_base64_decode($remote_data));
|
||||
//see kleeja_api.php file
|
||||
//split the data , the first one is always 0 or 1
|
||||
//0 : error
|
||||
//1: ok
|
||||
$user_info = explode('%|%', kleeja_base64_decode($remote_data));
|
||||
|
||||
//omg, it's 0 , 0 : error, lets die here
|
||||
if((int)$user_info[0] == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//omg, it's 0 , 0 : error, lets die here
|
||||
if ((int) $user_info[0] == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
//if we want username only we have to return it quickly and die here
|
||||
//
|
||||
if($return_username)
|
||||
{
|
||||
return empty($script_cp1256) || !$script_cp1256 ? $user_info[1] : $usrcp->kleeja_utf8($user_info[1]);
|
||||
}
|
||||
//
|
||||
//if we want username only we have to return it quickly and die here
|
||||
//
|
||||
if ($return_username)
|
||||
{
|
||||
return empty($script_cp1256) || ! $script_cp1256 ? $user_info[1] : $usrcp->kleeja_utf8($user_info[1]);
|
||||
}
|
||||
|
||||
//
|
||||
//when loggin to admin, we just want a check, no data setup ..
|
||||
//
|
||||
if(!$loginadm)
|
||||
{
|
||||
define('USER_ID', $user_info[1]);
|
||||
define('GROUP_ID', 3);
|
||||
define('USER_NAME', empty($script_cp1256) || !$script_cp1256 ? $user_info[2] : $usrcp->kleeja_utf8($user_info[2]));
|
||||
define('USER_MAIL', $user_info[3]);
|
||||
define('USER_ADMIN', ((int) $user_info[5] == 1) ? 1 : 0);
|
||||
}
|
||||
//
|
||||
//when loggin to admin, we just want a check, no data setup ..
|
||||
//
|
||||
if (! $loginadm)
|
||||
{
|
||||
define('USER_ID', $user_info[1]);
|
||||
define('GROUP_ID', 3);
|
||||
define('USER_NAME', empty($script_cp1256) || ! $script_cp1256 ? $user_info[2] : $usrcp->kleeja_utf8($user_info[2]));
|
||||
define('USER_MAIL', $user_info[3]);
|
||||
define('USER_ADMIN', ((int) $user_info[5] == 1) ? 1 : 0);
|
||||
}
|
||||
|
||||
//user ifo
|
||||
//and this must be filled with user data comming from url
|
||||
$userinfo = array();
|
||||
$userinfo['group_id'] = GROUP_ID;
|
||||
$user_y = kleeja_base64_encode(serialize(array('id'=>USER_ID, 'name'=>USER_NAME, 'mail'=>USER_MAIL, 'last_visit'=>time())));
|
||||
//user ifo
|
||||
//and this must be filled with user data comming from url
|
||||
$userinfo = [];
|
||||
$userinfo['group_id'] = GROUP_ID;
|
||||
$user_y = kleeja_base64_encode(serialize(['id'=>USER_ID, 'name'=>USER_NAME, 'mail'=>USER_MAIL, 'last_visit'=>time()]));
|
||||
|
||||
|
||||
//add cookies
|
||||
if(!$loginadm)
|
||||
{
|
||||
$usrcp->kleeja_set_cookie('ulogu', $usrcp->en_de_crypt($user_info[1] . '|' . $user_info[4] . '|' . $expire . '|' . sha1(md5($config['h_key'] . $user_info[4]) . $expire) . '|' . GROUP_ID . '|' . $user_y), $expire);
|
||||
}
|
||||
//add cookies
|
||||
if (! $loginadm)
|
||||
{
|
||||
$usrcp->kleeja_set_cookie('ulogu', $usrcp->en_de_crypt($user_info[1] . '|' . $user_info[4] . '|' . $expire . '|' . sha1(md5($config['h_key'] . $user_info[4]) . $expire) . '|' . GROUP_ID . '|' . $user_y), $expire);
|
||||
}
|
||||
|
||||
//no need after now
|
||||
unset($pass);
|
||||
//no need after now
|
||||
unset($pass);
|
||||
|
||||
//yes ! he is a real user
|
||||
return true;
|
||||
//yes ! he is a real user
|
||||
return true;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -111,7 +109,7 @@ function kleeja_auth_login ($name, $pass, $hashed = false, $expire, $loginadm =
|
||||
//
|
||||
function kleeja_auth_username ($user_id)
|
||||
{
|
||||
return kleeja_auth_login($user_id, false, false, false, false, true);
|
||||
return kleeja_auth_login($user_id, false, false, false, false, true);
|
||||
}
|
||||
|
||||
//<-- EOF
|
||||
|
||||
@@ -9,209 +9,206 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//Path of config file in phpBB3
|
||||
//
|
||||
if(!defined('SCRIPT_CONFIG_PATH'))
|
||||
if (! defined('SCRIPT_CONFIG_PATH'))
|
||||
{
|
||||
define('SCRIPT_CONFIG_PATH', '/config.php');
|
||||
define('SCRIPT_CONFIG_PATH', '/config.php');
|
||||
}
|
||||
|
||||
function kleeja_auth_login ($name, $pass, $hashed = false, $expire, $loginadm = false, $return_name = false)
|
||||
{
|
||||
global $lang, $config, $usrcp, $userinfo;
|
||||
global $script_path, $script_encoding, $script_srv, $script_db, $script_user, $script_pass, $script_prefix;
|
||||
|
||||
//check for last slash /
|
||||
if(isset($script_path))
|
||||
{
|
||||
if(isset($script_path[strlen($script_path)]) && $script_path[strlen($script_path)] == '/')
|
||||
{
|
||||
$script_path = substr($script_path, 0, strlen($script_path));
|
||||
}
|
||||
global $lang, $config, $usrcp, $userinfo;
|
||||
global $script_path, $script_encoding, $script_srv, $script_db, $script_user, $script_pass, $script_prefix;
|
||||
|
||||
//get some useful data from phbb config file
|
||||
if(file_exists(PATH . $script_path . SCRIPT_CONFIG_PATH))
|
||||
{
|
||||
include (PATH . $script_path . SCRIPT_CONFIG_PATH);
|
||||
//check for last slash /
|
||||
if (isset($script_path))
|
||||
{
|
||||
if (isset($script_path[strlen($script_path)]) && $script_path[strlen($script_path)] == '/')
|
||||
{
|
||||
$script_path = substr($script_path, 0, strlen($script_path));
|
||||
}
|
||||
|
||||
$forum_srv = $dbhost;
|
||||
$forum_db = $dbname;
|
||||
$forum_user = $dbuser;
|
||||
$forum_pass = $dbpasswd;
|
||||
$forum_prefix = $table_prefix;
|
||||
//get some useful data from phbb config file
|
||||
if (file_exists(PATH . $script_path . SCRIPT_CONFIG_PATH))
|
||||
{
|
||||
include PATH . $script_path . SCRIPT_CONFIG_PATH;
|
||||
|
||||
if(empty($dbhost))
|
||||
{
|
||||
$forum_srv = 'localhost';
|
||||
}
|
||||
$forum_srv = $dbhost;
|
||||
$forum_db = $dbname;
|
||||
$forum_user = $dbuser;
|
||||
$forum_pass = $dbpasswd;
|
||||
$forum_prefix = $table_prefix;
|
||||
|
||||
if(!empty($dbport))
|
||||
{
|
||||
$forum_srv .= ':' . $dbport;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'phpBB3'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_srv = $script_srv;
|
||||
$forum_db = $script_db;
|
||||
$forum_user = $script_user;
|
||||
$forum_pass = $script_pass;
|
||||
$forum_prefix = $script_prefix;
|
||||
}
|
||||
if (empty($dbhost))
|
||||
{
|
||||
$forum_srv = 'localhost';
|
||||
}
|
||||
|
||||
//if no variables of db
|
||||
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (! empty($dbport))
|
||||
{
|
||||
$forum_srv .= ':' . $dbport;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'phpBB3'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$forum_srv = $script_srv;
|
||||
$forum_db = $script_db;
|
||||
$forum_user = $script_user;
|
||||
$forum_pass = $script_pass;
|
||||
$forum_prefix = $script_prefix;
|
||||
}
|
||||
|
||||
//conecting ...
|
||||
//if no variables of db
|
||||
if (empty($forum_srv) || empty($forum_user) || empty($forum_db))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//conecting ...
|
||||
$SQLBB = new KleejaDatabase($forum_srv, $forum_user, $forum_pass, $forum_db, true);
|
||||
|
||||
$SQLBB->set_names('utf8');
|
||||
$SQLBB->set_names('utf8');
|
||||
|
||||
unset($forum_pass); // We do not need this any longer
|
||||
unset($forum_pass); // We do not need this any longer
|
||||
|
||||
//get utf tools
|
||||
global $phpbb_root_path, $phpEx;
|
||||
$phpbb_root_path = PATH . $script_path . '/';
|
||||
$phpEx = 'php';
|
||||
define('IN_PHPBB', true);
|
||||
include_once (PATH . $script_path . '/includes/utf/utf_tools.' . $phpEx);
|
||||
//get utf tools
|
||||
global $phpbb_root_path, $phpEx;
|
||||
$phpbb_root_path = PATH . $script_path . '/';
|
||||
$phpEx = 'php';
|
||||
define('IN_PHPBB', true);
|
||||
include_once PATH . $script_path . '/includes/utf/utf_tools.' . $phpEx;
|
||||
|
||||
$row_leve = 'user_type';
|
||||
$admin_level = 3;
|
||||
$query2 = array(
|
||||
'SELECT' => '*',
|
||||
'FROM' => "`{$forum_prefix}users`",
|
||||
);
|
||||
$row_leve = 'user_type';
|
||||
$admin_level = 3;
|
||||
$query2 = [
|
||||
'SELECT' => '*',
|
||||
'FROM' => "`{$forum_prefix}users`",
|
||||
];
|
||||
|
||||
$query2['WHERE'] = $hashed ? "user_id=" . intval($name) . " AND user_password='" . $SQLBB->real_escape($pass) . "' " : "username_clean='" . $SQLBB->real_escape(utf8_clean_string($name)) . "'";
|
||||
|
||||
if($return_name)
|
||||
{
|
||||
$query2['SELECT'] = "username";
|
||||
$query2['WHERE'] = "user_id=" . intval($name);
|
||||
}
|
||||
|
||||
$query = '';
|
||||
$query2['WHERE'] = $hashed ? 'user_id=' . intval($name) . " AND user_password='" . $SQLBB->real_escape($pass) . "' " : "username_clean='" . $SQLBB->real_escape(utf8_clean_string($name)) . "'";
|
||||
|
||||
if(!$hashed)
|
||||
{
|
||||
$result2 = $SQLBB->build($query2);
|
||||
while($row=$SQLBB->fetch_array($result2))
|
||||
{
|
||||
$SQLBB->freeresult($result2);
|
||||
if ($return_name)
|
||||
{
|
||||
$query2['SELECT'] = 'username';
|
||||
$query2['WHERE'] = 'user_id=' . intval($name);
|
||||
}
|
||||
|
||||
if($return_name)
|
||||
{
|
||||
return $row['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(phpbb_check_hash($pass, $row['user_password']))
|
||||
{
|
||||
$query = $query2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = $query2;
|
||||
}
|
||||
$query = '';
|
||||
|
||||
if(empty($query))
|
||||
{
|
||||
$SQLBB->close();
|
||||
return false;
|
||||
}
|
||||
if (! $hashed)
|
||||
{
|
||||
$result2 = $SQLBB->build($query2);
|
||||
while ($row=$SQLBB->fetch_array($result2))
|
||||
{
|
||||
$SQLBB->freeresult($result2);
|
||||
|
||||
if ($return_name)
|
||||
{
|
||||
return $row['username'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (phpbb_check_hash($pass, $row['user_password']))
|
||||
{
|
||||
$query = $query2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$query = $query2;
|
||||
}
|
||||
|
||||
if (empty($query))
|
||||
{
|
||||
$SQLBB->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_usrdata_phpbb_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQLBB->build($query);
|
||||
$result = $SQLBB->build($query);
|
||||
|
||||
|
||||
if ($SQLBB->num_rows($result) != 0)
|
||||
{
|
||||
while($row=$SQLBB->fetch_array($result))
|
||||
{
|
||||
if($SQLBB->num_rows($SQLBB->query("SELECT ban_userid FROM `{$forum_prefix}banlist` WHERE ban_userid=" . intval($row['user_id']))) == 0)
|
||||
{
|
||||
if(!$loginadm)
|
||||
{
|
||||
define('USER_ID', $row['user_id']);
|
||||
define('GROUP_ID', ($row[$row_leve] == $admin_level ? '1' : '3'));
|
||||
define('USER_NAME', $row['username']);
|
||||
define('USER_MAIL',$row['user_email']);
|
||||
if($row[$row_leve] == $admin_level)
|
||||
{
|
||||
define('USER_ADMIN', true);
|
||||
}
|
||||
}
|
||||
if ($SQLBB->num_rows($result) != 0)
|
||||
{
|
||||
while ($row=$SQLBB->fetch_array($result))
|
||||
{
|
||||
if ($SQLBB->num_rows($SQLBB->query("SELECT ban_userid FROM `{$forum_prefix}banlist` WHERE ban_userid=" . intval($row['user_id']))) == 0)
|
||||
{
|
||||
if (! $loginadm)
|
||||
{
|
||||
define('USER_ID', $row['user_id']);
|
||||
define('GROUP_ID', ($row[$row_leve] == $admin_level ? '1' : '3'));
|
||||
define('USER_NAME', $row['username']);
|
||||
define('USER_MAIL', $row['user_email']);
|
||||
|
||||
$userinfo = $row;
|
||||
$userinfo['group_id'] = ($row[$row_leve] == $admin_level ? '1' : '3');
|
||||
if ($row[$row_leve] == $admin_level)
|
||||
{
|
||||
define('USER_ADMIN', true);
|
||||
}
|
||||
}
|
||||
|
||||
$user_y = kleeja_base64_encode(serialize(array('id'=>$row['user_id'], 'name'=>$row['username'], 'mail'=>$row['user_email'], 'last_visit'=>time())));
|
||||
$userinfo = $row;
|
||||
$userinfo['group_id'] = ($row[$row_leve] == $admin_level ? '1' : '3');
|
||||
|
||||
if(!$hashed && !$loginadm)
|
||||
{
|
||||
$usrcp->kleeja_set_cookie('ulogu', $usrcp->en_de_crypt(
|
||||
$row['user_id'] . '|' .
|
||||
$row['user_password'] . '|' .
|
||||
$expire . '|' .
|
||||
sha1(md5($config['h_key'] . $row['user_password']) . $expire) . '|' .
|
||||
($row[$row_leve] == $admin_level ? '1' : '3') . '|' .
|
||||
$user_y
|
||||
), $expire);
|
||||
}
|
||||
$user_y = kleeja_base64_encode(serialize(['id'=>$row['user_id'], 'name'=>$row['username'], 'mail'=>$row['user_email'], 'last_visit'=>time()]));
|
||||
|
||||
if (! $hashed && ! $loginadm)
|
||||
{
|
||||
$usrcp->kleeja_set_cookie('ulogu', $usrcp->en_de_crypt(
|
||||
$row['user_id'] . '|' .
|
||||
$row['user_password'] . '|' .
|
||||
$expire . '|' .
|
||||
sha1(md5($config['h_key'] . $row['user_password']) . $expire) . '|' .
|
||||
($row[$row_leve] == $admin_level ? '1' : '3') . '|' .
|
||||
$user_y
|
||||
), $expire);
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_while_usrdata_phpbb_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
}
|
||||
else
|
||||
{
|
||||
//he is banned from phpBB
|
||||
$SQLBB->freeresult($result);
|
||||
unset($pass);
|
||||
$SQLBB->close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//he is banned from phpBB
|
||||
$SQLBB->freeresult($result);
|
||||
unset($pass);
|
||||
$SQLBB->close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$SQLBB->freeresult($result);
|
||||
unset($pass);
|
||||
$SQLBB->close();
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQLBB->freeresult($result);
|
||||
$SQLBB->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
$SQLBB->freeresult($result);
|
||||
unset($pass);
|
||||
$SQLBB->close();
|
||||
return true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQLBB->freeresult($result);
|
||||
$SQLBB->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
//dont know why they come here !
|
||||
return false;
|
||||
//dont know why they come here !
|
||||
return false;
|
||||
}
|
||||
|
||||
function kleeja_auth_username ($user_id)
|
||||
{
|
||||
return kleeja_auth_login ($user_id, false, false, 0, false, true);
|
||||
return kleeja_auth_login ($user_id, false, false, 0, false, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -220,13 +217,14 @@ function kleeja_auth_username ($user_id)
|
||||
*/
|
||||
function phpbb_check_hash($password, $hash)
|
||||
{
|
||||
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
if (strlen($hash) == 34)
|
||||
{
|
||||
return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;
|
||||
}
|
||||
$itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
return (md5($password) === $hash) ? true : false;
|
||||
if (strlen($hash) == 34)
|
||||
{
|
||||
return (_hash_crypt_private($password, $hash, $itoa64) === $hash) ? true : false;
|
||||
}
|
||||
|
||||
return (md5($password) === $hash) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,16 +232,16 @@ function phpbb_check_hash($password, $hash)
|
||||
*/
|
||||
function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6)
|
||||
{
|
||||
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
|
||||
{
|
||||
$iteration_count_log2 = 8;
|
||||
}
|
||||
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
|
||||
{
|
||||
$iteration_count_log2 = 8;
|
||||
}
|
||||
|
||||
$output = '$H$';
|
||||
$output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)];
|
||||
$output .= _hash_encode64($input, 6, $itoa64);
|
||||
$output = '$H$';
|
||||
$output .= $itoa64[min($iteration_count_log2 + ((PHP_VERSION >= 5) ? 5 : 3), 30)];
|
||||
$output .= _hash_encode64($input, 6, $itoa64);
|
||||
|
||||
return $output;
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -251,43 +249,42 @@ function _hash_gensalt_private($input, &$itoa64, $iteration_count_log2 = 6)
|
||||
*/
|
||||
function _hash_encode64($input, $count, &$itoa64)
|
||||
{
|
||||
$output = '';
|
||||
$i = 0;
|
||||
$output = '';
|
||||
$i = 0;
|
||||
|
||||
do
|
||||
{
|
||||
$value = ord($input[$i++]);
|
||||
$output .= $itoa64[$value & 0x3f];
|
||||
do
|
||||
{
|
||||
$value = ord($input[$i++]);
|
||||
$output .= $itoa64[$value & 0x3f];
|
||||
|
||||
if ($i < $count)
|
||||
{
|
||||
$value |= ord($input[$i]) << 8;
|
||||
}
|
||||
if ($i < $count)
|
||||
{
|
||||
$value |= ord($input[$i]) << 8;
|
||||
}
|
||||
|
||||
$output .= $itoa64[($value >> 6) & 0x3f];
|
||||
$output .= $itoa64[($value >> 6) & 0x3f];
|
||||
|
||||
if ($i++ >= $count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if ($i++ >= $count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if ($i < $count)
|
||||
{
|
||||
$value |= ord($input[$i]) << 16;
|
||||
}
|
||||
if ($i < $count)
|
||||
{
|
||||
$value |= ord($input[$i]) << 16;
|
||||
}
|
||||
|
||||
$output .= $itoa64[($value >> 12) & 0x3f];
|
||||
$output .= $itoa64[($value >> 12) & 0x3f];
|
||||
|
||||
if ($i++ >= $count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if ($i++ >= $count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
$output .= $itoa64[($value >> 18) & 0x3f];
|
||||
}
|
||||
while ($i < $count);
|
||||
$output .= $itoa64[($value >> 18) & 0x3f];
|
||||
} while ($i < $count);
|
||||
|
||||
return $output;
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -295,58 +292,56 @@ function _hash_encode64($input, $count, &$itoa64)
|
||||
*/
|
||||
function _hash_crypt_private($password, $setting, &$itoa64)
|
||||
{
|
||||
$output = '*';
|
||||
$output = '*';
|
||||
|
||||
// Check for correct hash
|
||||
if (substr($setting, 0, 3) != '$H$')
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
// Check for correct hash
|
||||
if (substr($setting, 0, 3) != '$H$')
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$count_log2 = strpos($itoa64, $setting[3]);
|
||||
$count_log2 = strpos($itoa64, $setting[3]);
|
||||
|
||||
if ($count_log2 < 7 || $count_log2 > 30)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
if ($count_log2 < 7 || $count_log2 > 30)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$count = 1 << $count_log2;
|
||||
$salt = substr($setting, 4, 8);
|
||||
$count = 1 << $count_log2;
|
||||
$salt = substr($setting, 4, 8);
|
||||
|
||||
if (strlen($salt) != 8)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
if (strlen($salt) != 8)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
/**
|
||||
* We're kind of forced to use MD5 here since it's the only
|
||||
* cryptographic primitive available in all versions of PHP
|
||||
* currently in use. To implement our own low-level crypto
|
||||
* in PHP would result in much worse performance and
|
||||
* consequently in lower iteration counts and hashes that are
|
||||
* quicker to crack (by non-PHP code).
|
||||
*/
|
||||
if (PHP_VERSION >= 5)
|
||||
{
|
||||
$hash = md5($salt . $password, true);
|
||||
do
|
||||
{
|
||||
$hash = md5($hash . $password, true);
|
||||
}
|
||||
while (--$count);
|
||||
}
|
||||
else
|
||||
{
|
||||
$hash = pack('H*', md5($salt . $password));
|
||||
do
|
||||
{
|
||||
$hash = pack('H*', md5($hash . $password));
|
||||
}
|
||||
while (--$count);
|
||||
}
|
||||
/**
|
||||
* We're kind of forced to use MD5 here since it's the only
|
||||
* cryptographic primitive available in all versions of PHP
|
||||
* currently in use. To implement our own low-level crypto
|
||||
* in PHP would result in much worse performance and
|
||||
* consequently in lower iteration counts and hashes that are
|
||||
* quicker to crack (by non-PHP code).
|
||||
*/
|
||||
if (PHP_VERSION >= 5)
|
||||
{
|
||||
$hash = md5($salt . $password, true);
|
||||
do
|
||||
{
|
||||
$hash = md5($hash . $password, true);
|
||||
} while (--$count);
|
||||
}
|
||||
else
|
||||
{
|
||||
$hash = pack('H*', md5($salt . $password));
|
||||
do
|
||||
{
|
||||
$hash = pack('H*', md5($hash . $password));
|
||||
} while (--$count);
|
||||
}
|
||||
|
||||
$output = substr($setting, 0, 12);
|
||||
$output .= _hash_encode64($hash, 16, $itoa64);
|
||||
$output = substr($setting, 0, 12);
|
||||
$output .= _hash_encode64($hash, 16, $itoa64);
|
||||
|
||||
return $output;
|
||||
return $output;
|
||||
}
|
||||
|
||||
@@ -8,229 +8,230 @@
|
||||
*/
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
//
|
||||
//Path of config file in vb
|
||||
//
|
||||
if(! defined('SCRIPT_CONFIG_PATH'))
|
||||
if (! defined('SCRIPT_CONFIG_PATH'))
|
||||
{
|
||||
define('SCRIPT_CONFIG_PATH', '/includes/config.php');
|
||||
define('SCRIPT_CONFIG_PATH', '/includes/config.php');
|
||||
}
|
||||
|
||||
function kleeja_auth_login ($name, $pass, $hashed = false, $expire, $loginadm = false, $return_name = false)
|
||||
{
|
||||
global $lang, $config, $usrcp, $userinfo;
|
||||
global $script_path, $script_cp1256, $script_srv, $script_db, $script_user, $script_pass, $script_prefix, $script_db_charset;
|
||||
global $lang, $config, $usrcp, $userinfo;
|
||||
global $script_path, $script_cp1256, $script_srv, $script_db, $script_user, $script_pass, $script_prefix, $script_db_charset;
|
||||
|
||||
if(isset($script_path))
|
||||
{
|
||||
//check for last slash
|
||||
if(isset($script_path[strlen($script_path)]) && $script_path[strlen($script_path)] == '/')
|
||||
{
|
||||
$script_path = substr($script_path, 0, strlen($script_path));
|
||||
}
|
||||
if (isset($script_path))
|
||||
{
|
||||
//check for last slash
|
||||
if (isset($script_path[strlen($script_path)]) && $script_path[strlen($script_path)] == '/')
|
||||
{
|
||||
$script_path = substr($script_path, 0, strlen($script_path));
|
||||
}
|
||||
|
||||
$configExists = false;
|
||||
|
||||
if(file_exists(PATH . $script_path . SCRIPT_CONFIG_PATH))
|
||||
{
|
||||
$configPath = PATH . $script_path . SCRIPT_CONFIG_PATH;
|
||||
$configExists = true;
|
||||
}
|
||||
else if(file_exists(PATH . $script_path . '/core/includes/config.php'))
|
||||
{
|
||||
$configPath = PATH . $script_path . '/core/includes/config.php';
|
||||
$configExists = true;
|
||||
$isVB5 = true;
|
||||
}
|
||||
$configExists = false;
|
||||
|
||||
//get some useful data from vb config file
|
||||
if($configExists)
|
||||
{
|
||||
require_once $configPath;
|
||||
if (file_exists(PATH . $script_path . SCRIPT_CONFIG_PATH))
|
||||
{
|
||||
$configPath = PATH . $script_path . SCRIPT_CONFIG_PATH;
|
||||
$configExists = true;
|
||||
}
|
||||
elseif (file_exists(PATH . $script_path . '/core/includes/config.php'))
|
||||
{
|
||||
$configPath = PATH . $script_path . '/core/includes/config.php';
|
||||
$configExists = true;
|
||||
$isVB5 = true;
|
||||
}
|
||||
|
||||
//
|
||||
//get config from config file
|
||||
//
|
||||
$forum_srv = $config['MasterServer']['servername'];
|
||||
$forum_db = $config['Database']['dbname'];
|
||||
$forum_user = $config['MasterServer']['username'];
|
||||
$forum_pass = $config['MasterServer']['password'];
|
||||
$forum_prefix= $config['Database']['tableprefix'];
|
||||
if($config['MasterServer']['port'] != 3306)
|
||||
{
|
||||
$forum_srv .= ':' . $config['MasterServer']['port'];
|
||||
}
|
||||
//get some useful data from vb config file
|
||||
if ($configExists)
|
||||
{
|
||||
require_once $configPath;
|
||||
|
||||
//some people change their db charset
|
||||
if(isset($config['Mysqli']['charset']))
|
||||
{
|
||||
$forum_db_charset = $config['Mysqli']['charset'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'Vbulletin'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
//custom config data
|
||||
//
|
||||
$forum_srv = $script_srv;
|
||||
$forum_db = $script_db;
|
||||
$forum_user = $script_user;
|
||||
$forum_pass = $script_pass;
|
||||
$forum_prefix = $script_prefix;
|
||||
//
|
||||
//get config from config file
|
||||
//
|
||||
$forum_srv = $config['MasterServer']['servername'];
|
||||
$forum_db = $config['Database']['dbname'];
|
||||
$forum_user = $config['MasterServer']['username'];
|
||||
$forum_pass = $config['MasterServer']['password'];
|
||||
$forum_prefix= $config['Database']['tableprefix'];
|
||||
|
||||
//some people change their db charset
|
||||
if(isset($script_db_charset))
|
||||
{
|
||||
$forum_db_charset = $script_db_charset;
|
||||
}
|
||||
}
|
||||
if ($config['MasterServer']['port'] != 3306)
|
||||
{
|
||||
$forum_srv .= ':' . $config['MasterServer']['port'];
|
||||
}
|
||||
|
||||
if(empty($forum_srv) || empty($forum_user) || empty($forum_db))
|
||||
{
|
||||
return;
|
||||
}
|
||||
//some people change their db charset
|
||||
if (isset($config['Mysqli']['charset']))
|
||||
{
|
||||
$forum_db_charset = $config['Mysqli']['charset'];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
big_error('Forum path is not correct', sprintf($lang['SCRIPT_AUTH_PATH_WRONG'], 'Vbulletin'));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
//custom config data
|
||||
//
|
||||
$forum_srv = $script_srv;
|
||||
$forum_db = $script_db;
|
||||
$forum_user = $script_user;
|
||||
$forum_pass = $script_pass;
|
||||
$forum_prefix = $script_prefix;
|
||||
|
||||
//some people change their db charset
|
||||
if (isset($script_db_charset))
|
||||
{
|
||||
$forum_db_charset = $script_db_charset;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($forum_srv) || empty($forum_user) || empty($forum_db))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$SQLVB = new KleejaDatabase($forum_srv, $forum_user, $forum_pass, $forum_db, true);
|
||||
|
||||
|
||||
if(isset($forum_db_charset))
|
||||
{ //config
|
||||
$SQLVB->set_names($forum_db_charset);
|
||||
}
|
||||
else //auto
|
||||
{
|
||||
$SQLVB->set_names('latin1');
|
||||
}
|
||||
if (isset($forum_db_charset))
|
||||
{ //config
|
||||
$SQLVB->set_names($forum_db_charset);
|
||||
}
|
||||
else
|
||||
{ //auto
|
||||
$SQLVB->set_names('latin1');
|
||||
}
|
||||
|
||||
|
||||
unset($forum_pass); // We do not need this any longer
|
||||
unset($forum_pass); // We do not need this any longer
|
||||
|
||||
$pass = empty($script_cp1256) || !$script_cp1256 ? $pass : $usrcp->kleeja_utf8($pass, false);
|
||||
$name = empty($script_cp1256) || !$script_cp1256 || $hashed ? $name : $usrcp->kleeja_utf8($name, false);
|
||||
$pass = empty($script_cp1256) || ! $script_cp1256 ? $pass : $usrcp->kleeja_utf8($pass, false);
|
||||
$name = empty($script_cp1256) || ! $script_cp1256 || $hashed ? $name : $usrcp->kleeja_utf8($name, false);
|
||||
|
||||
$query_salt = array(
|
||||
'SELECT' => $hashed ? '*' : ($isVB5 ? 'token' : 'salt'),
|
||||
'FROM' => "`{$forum_prefix}user`",
|
||||
);
|
||||
$query_salt = [
|
||||
'SELECT' => $hashed ? '*' : ($isVB5 ? 'token' : 'salt'),
|
||||
'FROM' => "`{$forum_prefix}user`",
|
||||
];
|
||||
|
||||
$query_salt['WHERE'] = $hashed ? "userid=" . intval($name) . " AND ". ($isVB5 ? 'token' : 'password') ."='" . $SQLVB->real_escape($pass) . "' AND usergroupid != '8'" : "username='" . $SQLVB->real_escape($name) . "' AND usergroupid != '8'";
|
||||
|
||||
//if return only name let's ignore the above
|
||||
if($return_name)
|
||||
{
|
||||
$query_salt['SELECT'] = "username";
|
||||
$query_salt['WHERE'] = "userid=" . intval($name);
|
||||
}
|
||||
$query_salt['WHERE'] = $hashed ? 'userid=' . intval($name) . ' AND ' . ($isVB5 ? 'token' : 'password') . "='" . $SQLVB->real_escape($pass) . "' AND usergroupid != '8'" : "username='" . $SQLVB->real_escape($name) . "' AND usergroupid != '8'";
|
||||
|
||||
//if return only name let's ignore the above
|
||||
if ($return_name)
|
||||
{
|
||||
$query_salt['SELECT'] = 'username';
|
||||
$query_salt['WHERE'] = 'userid=' . intval($name);
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_usrdata_vb_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result_salt = $SQLVB->build($query_salt);
|
||||
$result_salt = $SQLVB->build($query_salt);
|
||||
|
||||
if ($SQLVB->num_rows($result_salt) > 0)
|
||||
{
|
||||
while($row1=$SQLVB->fetch_array($result_salt))
|
||||
{
|
||||
if($return_name)
|
||||
{
|
||||
return empty($script_cp1256) || !$script_cp1256 ? $row1['username'] : $usrcp->kleeja_utf8($row1['username']);
|
||||
}
|
||||
if ($SQLVB->num_rows($result_salt) > 0)
|
||||
{
|
||||
while ($row1=$SQLVB->fetch_array($result_salt))
|
||||
{
|
||||
if ($return_name)
|
||||
{
|
||||
return empty($script_cp1256) || ! $script_cp1256 ? $row1['username'] : $usrcp->kleeja_utf8($row1['username']);
|
||||
}
|
||||
|
||||
if(!$hashed)
|
||||
{
|
||||
$pass = ! $isVB5
|
||||
? md5(md5($pass) . $row1['salt']) // without normal md5
|
||||
: crypt(md5($pass), $row1['token']);
|
||||
if (! $hashed)
|
||||
{
|
||||
$pass = ! $isVB5
|
||||
? md5(md5($pass) . $row1['salt']) // without normal md5
|
||||
: crypt(md5($pass), $row1['token']);
|
||||
|
||||
$query = array(
|
||||
'SELECT' => '*',
|
||||
'FROM' => "`{$forum_prefix}user`",
|
||||
'WHERE' => "username='" . $SQLVB->real_escape($name) . "' AND ".($isVB5 ? 'token' : 'password')."='" . $SQLVB->real_escape($pass) . "' AND usergroupid != '8'"
|
||||
);
|
||||
|
||||
$result = $SQLVB->build($query);
|
||||
$query = [
|
||||
'SELECT' => '*',
|
||||
'FROM' => "`{$forum_prefix}user`",
|
||||
'WHERE' => "username='" . $SQLVB->real_escape($name) . "' AND " . ($isVB5 ? 'token' : 'password') . "='" . $SQLVB->real_escape($pass) . "' AND usergroupid != '8'"
|
||||
];
|
||||
|
||||
if ($SQLVB->num_rows($result) != 0)
|
||||
{
|
||||
while($row=$SQLVB->fetch_array($result))
|
||||
{
|
||||
if(!$loginadm)
|
||||
{
|
||||
define('USER_ID', $row['userid']);
|
||||
define('GROUP_ID', ($row['usergroupid'] == 6 ? 1 : 3));
|
||||
define('USER_NAME', empty($script_cp1256) || !$script_cp1256 ? $row['username'] : $usrcp->kleeja_utf8($row['username']));
|
||||
define('USER_MAIL', $row['email']);
|
||||
define('USER_ADMIN', ($row['usergroupid'] == 6 ? 1 : 0));
|
||||
}
|
||||
$result = $SQLVB->build($query);
|
||||
|
||||
//define('LAST_VISIT',$row['last_visit']);
|
||||
if ($SQLVB->num_rows($result) != 0)
|
||||
{
|
||||
while ($row=$SQLVB->fetch_array($result))
|
||||
{
|
||||
if (! $loginadm)
|
||||
{
|
||||
define('USER_ID', $row['userid']);
|
||||
define('GROUP_ID', ($row['usergroupid'] == 6 ? 1 : 3));
|
||||
define('USER_NAME', empty($script_cp1256) || ! $script_cp1256 ? $row['username'] : $usrcp->kleeja_utf8($row['username']));
|
||||
define('USER_MAIL', $row['email']);
|
||||
define('USER_ADMIN', ($row['usergroupid'] == 6 ? 1 : 0));
|
||||
}
|
||||
|
||||
$userinfo = $row;
|
||||
$userinfo['group_id'] = ($row['usergroupid'] == 6 ? 1 : 3);
|
||||
$user_y = kleeja_base64_encode(serialize(array('id'=>$row['userid'], 'name'=>USER_NAME, 'mail'=>$row['email'], 'last_visit'=>time())));
|
||||
|
||||
$hash_key_expire = sha1(md5($config['h_key'] . ($isVB5 ? $row['token'] : $row['password'])) . $expire);
|
||||
//define('LAST_VISIT',$row['last_visit']);
|
||||
|
||||
if(!$loginadm)
|
||||
{
|
||||
$usrcp->kleeja_set_cookie('ulogu', $usrcp->en_de_crypt(
|
||||
$row['userid'] . '|' .
|
||||
($isVB5 ? $row['token'] : $row['password']) . '|' .
|
||||
$expire . '|' .
|
||||
$hash_key_expire . '|' .
|
||||
($row['usergroupid'] == 6 ? 1 : 3) . '|' .
|
||||
$user_y
|
||||
), $expire);
|
||||
}
|
||||
$userinfo = $row;
|
||||
$userinfo['group_id'] = ($row['usergroupid'] == 6 ? 1 : 3);
|
||||
$user_y = kleeja_base64_encode(serialize(['id'=>$row['userid'], 'name'=>USER_NAME, 'mail'=>$row['email'], 'last_visit'=>time()]));
|
||||
|
||||
$hash_key_expire = sha1(md5($config['h_key'] . ($isVB5 ? $row['token'] : $row['password'])) . $expire);
|
||||
|
||||
if (! $loginadm)
|
||||
{
|
||||
$usrcp->kleeja_set_cookie('ulogu', $usrcp->en_de_crypt(
|
||||
$row['userid'] . '|' .
|
||||
($isVB5 ? $row['token'] : $row['password']) . '|' .
|
||||
$expire . '|' .
|
||||
$hash_key_expire . '|' .
|
||||
($row['usergroupid'] == 6 ? 1 : 3) . '|' .
|
||||
$user_y
|
||||
), $expire);
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_while_usrdata_vb_usr_class', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
}
|
||||
$SQLVB->freeresult($result);
|
||||
}#nums_sql2
|
||||
else
|
||||
{
|
||||
$SQLVB->close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!$loginadm)
|
||||
{
|
||||
define('USER_ID', $row1['userid']);
|
||||
define('USER_NAME', empty($script_cp1256) || !$script_cp1256 ? $row1['username'] : $usrcp->kleeja_utf8($row1['username']));
|
||||
define('USER_MAIL',$row1['email']);
|
||||
define('USER_ADMIN',($row1['usergroupid'] == 6) ? 1 : 0);
|
||||
define('GROUP_ID',($row1['usergroupid'] == 6) ? 1 : 3);
|
||||
$userinfo = $row1;
|
||||
$userinfo['group_id'] = ($row1['usergroupid'] == 6 ? 1 : 3);
|
||||
}
|
||||
}
|
||||
}#whil1
|
||||
}
|
||||
$SQLVB->freeresult($result);
|
||||
}//nums_sql2
|
||||
else
|
||||
{
|
||||
$SQLVB->close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! $loginadm)
|
||||
{
|
||||
define('USER_ID', $row1['userid']);
|
||||
define('USER_NAME', empty($script_cp1256) || ! $script_cp1256 ? $row1['username'] : $usrcp->kleeja_utf8($row1['username']));
|
||||
define('USER_MAIL', $row1['email']);
|
||||
define('USER_ADMIN', ($row1['usergroupid'] == 6) ? 1 : 0);
|
||||
define('GROUP_ID', ($row1['usergroupid'] == 6) ? 1 : 3);
|
||||
$userinfo = $row1;
|
||||
$userinfo['group_id'] = ($row1['usergroupid'] == 6 ? 1 : 3);
|
||||
}
|
||||
}
|
||||
}//whil1
|
||||
|
||||
$SQLVB->freeresult($result_salt);
|
||||
$SQLVB->freeresult($result_salt);
|
||||
|
||||
unset($pass);
|
||||
$SQLVB->close();
|
||||
unset($pass);
|
||||
$SQLVB->close();
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQLVB->close();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$SQLVB->close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function kleeja_auth_username ($user_id)
|
||||
{
|
||||
return kleeja_auth_login ($user_id, false, true, 0, false, true);
|
||||
return kleeja_auth_login ($user_id, false, true, 0, false, true);
|
||||
}
|
||||
|
||||
@@ -9,9 +9,9 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
//we are in cache now ..
|
||||
@@ -28,81 +28,80 @@ $SQL->set_utf8();
|
||||
//
|
||||
class cache
|
||||
{
|
||||
function get($name)
|
||||
{
|
||||
if(defined('DEV_STAGE'))
|
||||
{
|
||||
return false;
|
||||
public function get($name)
|
||||
{
|
||||
if (defined('DEV_STAGE'))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$name = preg_replace('![^a-z0-9_]!', '_', $name);
|
||||
|
||||
if (file_exists(PATH . 'cache/' . $name . '.php'))
|
||||
{
|
||||
include PATH . 'cache/' . $name . '.php';
|
||||
return empty($data) ? false : $data;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function exists($name)
|
||||
{
|
||||
$name = preg_replace('![^a-z0-9_]!', '_', $name);
|
||||
|
||||
if (file_exists(PATH . 'cache/' . $name . '.php'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function save($name, $data, $time = 86400)
|
||||
{
|
||||
//
|
||||
//We have problems if APC is enabled, so we disable our cache
|
||||
//system if it's lodoed to prevent those problems, but we will
|
||||
//try to fix it in the near future .. I hope that.
|
||||
//
|
||||
if(defined('APC_CACHE'))
|
||||
{
|
||||
//return;
|
||||
}
|
||||
|
||||
$name = preg_replace('![^a-z0-9_]!i', '_', $name);
|
||||
$data_for_save = '<?' . 'php' . "\n";
|
||||
$data_for_save .= '//Cache file, generated for Kleeja at ' . gmdate('d-m-Y h:i A') . "\n\n";
|
||||
$data_for_save .= '//No direct opening' . "\n";
|
||||
$data_for_save .= '(!defined("IN_COMMON") ? exit("hacking attemp!") : null);' . "\n\n";
|
||||
$data_for_save .= '//return false after x time' . "\n";
|
||||
$data_for_save .= 'if(time() > ' . (time() + $time) . ') return false;' . "\n\n";
|
||||
$data_for_save .= '$data = ' . var_export($data, true) . ";\n\n//end of cache";
|
||||
$name = preg_replace('![^a-z0-9_]!', '_', $name);
|
||||
|
||||
if($fd = @fopen(PATH . 'cache/' . $name . '.php', 'w'))
|
||||
{
|
||||
@flock($fd, LOCK_EX); // exlusive look
|
||||
@fwrite($fd, $data_for_save);
|
||||
@flock($fd, LOCK_UN);
|
||||
@fclose($fd);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (file_exists(PATH . 'cache/' . $name . '.php'))
|
||||
{
|
||||
include PATH . 'cache/' . $name . '.php';
|
||||
return empty($data) ? false : $data;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function clean($name)
|
||||
{
|
||||
if(is_array($name))
|
||||
{
|
||||
foreach($name as $n)
|
||||
{
|
||||
$this->clean($n);
|
||||
}
|
||||
return;
|
||||
}
|
||||
public function exists($name)
|
||||
{
|
||||
$name = preg_replace('![^a-z0-9_]!', '_', $name);
|
||||
|
||||
$name = preg_replace('![^a-z0-9_]!i', '_', $name);
|
||||
kleeja_unlink(PATH . 'cache/' . $name . '.php');
|
||||
}
|
||||
if (file_exists(PATH . 'cache/' . $name . '.php'))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function save($name, $data, $time = 86400)
|
||||
{
|
||||
//
|
||||
//We have problems if APC is enabled, so we disable our cache
|
||||
//system if it's lodoed to prevent those problems, but we will
|
||||
//try to fix it in the near future .. I hope that.
|
||||
//
|
||||
if (defined('APC_CACHE'))
|
||||
{
|
||||
//return;
|
||||
}
|
||||
|
||||
$name = preg_replace('![^a-z0-9_]!i', '_', $name);
|
||||
$data_for_save = '<?' . 'php' . "\n";
|
||||
$data_for_save .= '//Cache file, generated for Kleeja at ' . gmdate('d-m-Y h:i A') . "\n\n";
|
||||
$data_for_save .= '//No direct opening' . "\n";
|
||||
$data_for_save .= '(!defined("IN_COMMON") ? exit("hacking attemp!") : null);' . "\n\n";
|
||||
$data_for_save .= '//return false after x time' . "\n";
|
||||
$data_for_save .= 'if(time() > ' . (time() + $time) . ') return false;' . "\n\n";
|
||||
$data_for_save .= '$data = ' . var_export($data, true) . ";\n\n//end of cache";
|
||||
|
||||
if ($fd = @fopen(PATH . 'cache/' . $name . '.php', 'w'))
|
||||
{
|
||||
@flock($fd, LOCK_EX); // exlusive look
|
||||
@fwrite($fd, $data_for_save);
|
||||
@flock($fd, LOCK_UN);
|
||||
@fclose($fd);
|
||||
}
|
||||
}
|
||||
|
||||
public function clean($name)
|
||||
{
|
||||
if (is_array($name))
|
||||
{
|
||||
foreach ($name as $n)
|
||||
{
|
||||
$this->clean($n);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
$name = preg_replace('![^a-z0-9_]!i', '_', $name);
|
||||
kleeja_unlink(PATH . 'cache/' . $name . '.php');
|
||||
}
|
||||
}
|
||||
|
||||
$cache = new cache;
|
||||
@@ -113,50 +112,50 @@ $cache = new cache;
|
||||
//
|
||||
//get config data from config table ...
|
||||
//
|
||||
if (!($config = $cache->get('data_config')))
|
||||
if (! ($config = $cache->get('data_config')))
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 'c.name, c.value',
|
||||
'FROM' => "{$dbprefix}config c",
|
||||
'WHERE' => 'c.dynamic = 0',
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'c.name, c.value',
|
||||
'FROM' => "{$dbprefix}config c",
|
||||
'WHERE' => 'c.dynamic = 0',
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_config_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$config[$row['name']] = $row['value'];
|
||||
}
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$SQL->freeresult($result);
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$config[$row['name']] = $row['value'];
|
||||
}
|
||||
|
||||
$cache->save('data_config', $config);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$cache->save('data_config', $config);
|
||||
}
|
||||
|
||||
//
|
||||
//get language terms from lang table ...
|
||||
//
|
||||
|
||||
if (!($olang = $cache->get('data_lang' . $config['language']))) {
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'l.word, l.trans',
|
||||
'FROM' => "{$dbprefix}lang l",
|
||||
'WHERE' => "l.lang_id='" . $SQL->escape($config['language']) . "'",
|
||||
);
|
||||
if (! ($olang = $cache->get('data_lang' . $config['language'])))
|
||||
{
|
||||
$query = [
|
||||
'SELECT' => 'l.word, l.trans',
|
||||
'FROM' => "{$dbprefix}lang l",
|
||||
'WHERE' => "l.lang_id='" . $SQL->escape($config['language']) . "'",
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_lang_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$olang[$row['word']] = $row['trans'];
|
||||
}
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$olang[$row['word']] = $row['trans'];
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$cache->save('data_lang' . $config['language'], $olang);
|
||||
}
|
||||
@@ -165,70 +164,70 @@ if (!($olang = $cache->get('data_lang' . $config['language']))) {
|
||||
//
|
||||
//stats to cache
|
||||
//
|
||||
if (!($stats = $cache->get('data_stats')))
|
||||
if (! ($stats = $cache->get('data_stats')))
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 's.files, s.imgs, s.sizes, s.users, s.last_file, s.last_f_del, s.last_google' .
|
||||
', s.last_bing, s.google_num, s.bing_num, s.lastuser',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 's.files, s.imgs, s.sizes, s.users, s.last_file, s.last_f_del, s.last_google' .
|
||||
', s.last_bing, s.google_num, s.bing_num, s.lastuser',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_stats_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$stats = array(
|
||||
'stat_files' => $row['files'],
|
||||
'stat_imgs' => $row['imgs'],
|
||||
'stat_sizes' => $row['sizes'],
|
||||
'stat_users' => $row['users'],
|
||||
'stat_last_file' => $row['last_file'],
|
||||
'stat_last_f_del' => $row['last_f_del'],
|
||||
'stat_last_google' => $row['last_google'],
|
||||
'stat_last_bing' => $row['last_bing'],
|
||||
'stat_google_num' => $row['google_num'],
|
||||
'stat_bing_num' => $row['bing_num'],
|
||||
'stat_last_user' => $row['lastuser']
|
||||
);
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$stats = [
|
||||
'stat_files' => $row['files'],
|
||||
'stat_imgs' => $row['imgs'],
|
||||
'stat_sizes' => $row['sizes'],
|
||||
'stat_users' => $row['users'],
|
||||
'stat_last_file' => $row['last_file'],
|
||||
'stat_last_f_del' => $row['last_f_del'],
|
||||
'stat_last_google' => $row['last_google'],
|
||||
'stat_last_bing' => $row['last_bing'],
|
||||
'stat_google_num' => $row['google_num'],
|
||||
'stat_bing_num' => $row['bing_num'],
|
||||
'stat_last_user' => $row['lastuser']
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('while_fetch_stats_in_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
}
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
#save the stats for hour and then refresh them
|
||||
$cache->save('data_stats', $stats, 3600);
|
||||
//save the stats for hour and then refresh them
|
||||
$cache->save('data_stats', $stats, 3600);
|
||||
|
||||
#also, save the data for the charts later
|
||||
$query = array(
|
||||
'SELECT' => 'f.filter_uid',
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => "f.filter_type='stats_for_acp' AND f.filter_uid = '" . date('d-n-Y') . "'"
|
||||
);
|
||||
//also, save the data for the charts later
|
||||
$query = [
|
||||
'SELECT' => 'f.filter_uid',
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => "f.filter_type='stats_for_acp' AND f.filter_uid = '" . date('d-n-Y') . "'"
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
#if already there is stats for this day, just update it, if not insert a new one
|
||||
if($SQL->num_rows($result))
|
||||
{
|
||||
$f_query = array(
|
||||
'UPDATE' => "{$dbprefix}filters",
|
||||
'SET' => "filter_value='" . implode(':', array($stats['stat_files'], $stats['stat_imgs'], $stats['stat_sizes'])) . "'",
|
||||
'WHERE' => "filter_type='stats_for_acp' AND filter_uid = '" . date('d-n-Y') . "'"
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$f_query = array(
|
||||
'INSERT' => 'filter_uid, filter_type ,filter_value ,filter_time',
|
||||
'INTO' => "{$dbprefix}filters",
|
||||
'VALUES' => "'" . date('d-n-Y') . "', 'stats_for_acp', '" . implode(':', array($stats['stat_files'], $stats['stat_imgs'], $stats['stat_sizes'])) . "', " . time()
|
||||
);
|
||||
}
|
||||
//if already there is stats for this day, just update it, if not insert a new one
|
||||
if ($SQL->num_rows($result))
|
||||
{
|
||||
$f_query = [
|
||||
'UPDATE' => "{$dbprefix}filters",
|
||||
'SET' => "filter_value='" . implode(':', [$stats['stat_files'], $stats['stat_imgs'], $stats['stat_sizes']]) . "'",
|
||||
'WHERE' => "filter_type='stats_for_acp' AND filter_uid = '" . date('d-n-Y') . "'"
|
||||
];
|
||||
}
|
||||
else
|
||||
{
|
||||
$f_query = [
|
||||
'INSERT' => 'filter_uid, filter_type ,filter_value ,filter_time',
|
||||
'INTO' => "{$dbprefix}filters",
|
||||
'VALUES' => "'" . date('d-n-Y') . "', 'stats_for_acp', '" . implode(':', [$stats['stat_files'], $stats['stat_imgs'], $stats['stat_sizes']]) . "', " . time()
|
||||
];
|
||||
}
|
||||
|
||||
$SQL->build($f_query);
|
||||
$SQL->build($f_query);
|
||||
}
|
||||
|
||||
|
||||
@@ -239,167 +238,167 @@ unset($stats);
|
||||
//
|
||||
//get banned ips data from stats table ...
|
||||
//
|
||||
if (!($banss = $cache->get('data_ban')))
|
||||
if (! ($banss = $cache->get('data_ban')))
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 's.ban',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 's.ban',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_ban_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$row = $SQL->fetch_array($result);
|
||||
$ban1 = $row['ban'];
|
||||
$SQL->freeresult($result);
|
||||
$row = $SQL->fetch_array($result);
|
||||
$ban1 = $row['ban'];
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$banss = array();
|
||||
$banss = [];
|
||||
|
||||
if (!empty($ban1) || $ban1 != ' '|| $ban1 != ' ')
|
||||
{
|
||||
//seperate ips ..
|
||||
$ban2 = explode('|', $ban1);
|
||||
for ($i=0; $i<sizeof($ban2); $i++)
|
||||
{
|
||||
$banss[$i] = $ban2[$i];
|
||||
}
|
||||
}
|
||||
if (! empty($ban1) || $ban1 != ' '|| $ban1 != ' ')
|
||||
{
|
||||
//seperate ips ..
|
||||
$ban2 = explode('|', $ban1);
|
||||
|
||||
for ($i=0; $i<sizeof($ban2); $i++)
|
||||
{
|
||||
$banss[$i] = $ban2[$i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
unset($ban1, $ban2, $gt);
|
||||
unset($ban1, $ban2, $gt);
|
||||
|
||||
$cache->save('data_ban', $banss);
|
||||
$cache->save('data_ban', $banss);
|
||||
}
|
||||
|
||||
//
|
||||
//get rules data from stats table ...
|
||||
//
|
||||
if (!($ruless = $cache->get('data_rules')))
|
||||
if (! ($ruless = $cache->get('data_rules')))
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 's.rules',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 's.rules',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_rules_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$row = $SQL->fetch_array($result);
|
||||
$ruless = $row['rules'];
|
||||
$SQL->freeresult($result);
|
||||
$row = $SQL->fetch_array($result);
|
||||
$ruless = $row['rules'];
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$cache->save('data_rules', $ruless);
|
||||
$cache->save('data_rules', $ruless);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//get ex-header-footer data from stats table …
|
||||
//
|
||||
if (!($extras = $cache->get('data_extra')))
|
||||
if (! ($extras = $cache->get('data_extra')))
|
||||
{
|
||||
$query = array(
|
||||
'SELECT' => 's.ex_header, s.ex_footer',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 's.ex_header, s.ex_footer',
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_extra_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
$row = $SQL->fetch_array($result);
|
||||
|
||||
$extras = array(
|
||||
'header' => $row['ex_header'],
|
||||
'footer' => $row['ex_footer']
|
||||
);
|
||||
$row = $SQL->fetch_array($result);
|
||||
|
||||
$SQL->freeresult($result);
|
||||
$extras = [
|
||||
'header' => $row['ex_header'],
|
||||
'footer' => $row['ex_footer']
|
||||
];
|
||||
|
||||
$cache->save('data_extra', $extras);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
$cache->save('data_extra', $extras);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
//Get groups data
|
||||
//
|
||||
if (!($d_groups = $cache->get('data_groups')))
|
||||
if (! ($d_groups = $cache->get('data_groups')))
|
||||
{
|
||||
$d_groups = array();
|
||||
|
||||
#data
|
||||
$query = array(
|
||||
'SELECT' => 'g.*',
|
||||
'FROM' => "{$dbprefix}groups g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
);
|
||||
$d_groups = [];
|
||||
|
||||
//data
|
||||
$query = [
|
||||
'SELECT' => 'g.*',
|
||||
'FROM' => "{$dbprefix}groups g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_groups_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQL->build($query);
|
||||
|
||||
#Initiating
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$d_groups[$row['group_id']]['data'] = $row;
|
||||
$d_groups[$row['group_id']]['configs'] = array();
|
||||
$d_groups[$row['group_id']]['acls'] = array();
|
||||
$d_groups[$row['group_id']]['exts'] = array();
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
#configs
|
||||
$query = array(
|
||||
'SELECT' => 'g.group_id, g.name, g.value',
|
||||
'FROM' => "{$dbprefix}groups_data g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
);
|
||||
//Initiating
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$d_groups[$row['group_id']]['data'] = $row;
|
||||
$d_groups[$row['group_id']]['configs'] = [];
|
||||
$d_groups[$row['group_id']]['acls'] = [];
|
||||
$d_groups[$row['group_id']]['exts'] = [];
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
|
||||
//configs
|
||||
$query = [
|
||||
'SELECT' => 'g.group_id, g.name, g.value',
|
||||
'FROM' => "{$dbprefix}groups_data g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_groups_data_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$d_groups[$row['group_id']]['configs'][$row['name']] = $row['value'];
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$d_groups[$row['group_id']]['configs'][$row['name']] = $row['value'];
|
||||
}
|
||||
$SQL->freeresult($result);
|
||||
|
||||
#acl
|
||||
$query2 = array(
|
||||
'SELECT' => 'g.group_id, g.acl_name, g.acl_can',
|
||||
'FROM' => "{$dbprefix}groups_acl g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
);
|
||||
//acl
|
||||
$query2 = [
|
||||
'SELECT' => 'g.group_id, g.acl_name, g.acl_can',
|
||||
'FROM' => "{$dbprefix}groups_acl g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_groups_acls_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result2 = $SQL->build($query2);
|
||||
$result2 = $SQL->build($query2);
|
||||
|
||||
while($row=$SQL->fetch_array($result2))
|
||||
{
|
||||
$d_groups[$row['group_id']]['acls'][$row['acl_name']] = (int) $row['acl_can'];
|
||||
}
|
||||
$SQL->freeresult($result2);
|
||||
while ($row=$SQL->fetch_array($result2))
|
||||
{
|
||||
$d_groups[$row['group_id']]['acls'][$row['acl_name']] = (int) $row['acl_can'];
|
||||
}
|
||||
$SQL->freeresult($result2);
|
||||
|
||||
#exts
|
||||
$query3 = array(
|
||||
'SELECT' => 'g.group_id, g.ext, g.size',
|
||||
'FROM' => "{$dbprefix}groups_exts g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
);
|
||||
//exts
|
||||
$query3 = [
|
||||
'SELECT' => 'g.group_id, g.ext, g.size',
|
||||
'FROM' => "{$dbprefix}groups_exts g",
|
||||
'ORDER_BY' => 'g.group_id ASC',
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_groups_exts_cache', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
$result3 = $SQL->build($query3);
|
||||
$result3 = $SQL->build($query3);
|
||||
|
||||
while($row=$SQL->fetch_array($result3))
|
||||
{
|
||||
$d_groups[$row['group_id']]['exts'][$row['ext']] = (int) $row['size'];
|
||||
}
|
||||
$SQL->freeresult($result3);
|
||||
while ($row=$SQL->fetch_array($result3))
|
||||
{
|
||||
$d_groups[$row['group_id']]['exts'][$row['ext']] = (int) $row['size'];
|
||||
}
|
||||
$SQL->freeresult($result3);
|
||||
|
||||
unset($query, $query2, $query3, $result, $result2, $result3);
|
||||
unset($query, $query2, $query3, $result, $result2, $result3);
|
||||
|
||||
$cache->save('data_groups', $d_groups);
|
||||
$cache->save('data_groups', $d_groups);
|
||||
}
|
||||
|
||||
|
||||
// ummm, does this useful here
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('in_cache_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
@@ -7,23 +7,20 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Fix bug with path of font When using versions of the GD library lower than 2.0.18
|
||||
*/
|
||||
if(function_exists('putenv'))
|
||||
// Fix bug with path of font When using versions of the GD library lower than 2.0.18
|
||||
if (function_exists('putenv'))
|
||||
{
|
||||
@putenv('GDFONTPATH=' . realpath('.'));
|
||||
@putenv('GDFONTPATH=' . realpath('.'));
|
||||
}
|
||||
else if(function_exists('ini_set'))
|
||||
elseif (function_exists('ini_set'))
|
||||
{
|
||||
@ini_set('GDFONTPATH', realpath('.'));
|
||||
@ini_set('GDFONTPATH', realpath('.'));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* When any body request this file , he will see an image ..
|
||||
*/
|
||||
// When any body request this file , he will see an image ..
|
||||
kleeja_cpatcha_image();
|
||||
|
||||
exit();
|
||||
|
||||
//
|
||||
@@ -32,68 +29,68 @@ exit();
|
||||
//
|
||||
function kleeja_cpatcha_image()
|
||||
{
|
||||
//Let's generate a totally random string using md5
|
||||
$md5_hash = md5(rand(0,999));
|
||||
//Let's generate a totally random string using md5
|
||||
$md5_hash = md5(rand(0, 999));
|
||||
|
||||
//I think the bad things in captcha is two things, O and 0 , so let's remove zero.
|
||||
$security_code = str_replace('0', '', $md5_hash);
|
||||
//I think the bad things in captcha is two things, O and 0 , so let's remove zero.
|
||||
$security_code = str_replace('0', '', $md5_hash);
|
||||
|
||||
//We don't need a 32 character long string so we trim it down to 5
|
||||
$security_code = substr($security_code, 15, 4);
|
||||
//We don't need a 32 character long string so we trim it down to 5
|
||||
$security_code = substr($security_code, 15, 4);
|
||||
|
||||
//Set the session to store the security code
|
||||
$_SESSION["klj_sec_code"] = $security_code;
|
||||
//Set the session to store the security code
|
||||
$_SESSION['klj_sec_code'] = $security_code;
|
||||
|
||||
//Set the image width and height
|
||||
$width = 150;
|
||||
$height = 25;
|
||||
//Set the image width and height
|
||||
$width = 150;
|
||||
$height = 25;
|
||||
|
||||
//Create the image resource
|
||||
$image = ImageCreate($width, $height);
|
||||
//Create the image resource
|
||||
$image = imagecreate($width, $height);
|
||||
|
||||
//We are making three colors, white, black and gray
|
||||
$white = ImageColorAllocate($image, 255, 255, 255);
|
||||
$black = ImageColorAllocate($image, rand(0, 100), 0, rand(0, 50));
|
||||
$grey = ImageColorAllocate($image, 204, 204, 204);
|
||||
//We are making three colors, white, black and gray
|
||||
$white = imagecolorallocate($image, 255, 255, 255);
|
||||
$black = imagecolorallocate($image, rand(0, 100), 0, rand(0, 50));
|
||||
$grey = imagecolorallocate($image, 204, 204, 204);
|
||||
|
||||
//Make the background black
|
||||
ImageFill($image, 0, 0, $black);
|
||||
|
||||
//options
|
||||
$x = 10;
|
||||
$y = 14;
|
||||
$angle = rand(-7, -10);
|
||||
//Make the background black
|
||||
imagefill($image, 0, 0, $black);
|
||||
|
||||
//Add randomly generated string in white to the image
|
||||
if(function_exists('imagettftext'))
|
||||
{
|
||||
//
|
||||
// We figure a bug that happens when you add font name without './' before it ..
|
||||
// he search in the Linux fonts cache , but when you add './' he will know it's our font.
|
||||
//
|
||||
imagettftext ($image, 16,$angle , rand(50, $x), $y+rand(1,3), $white, dirname(__FILE__) . '/arial.ttf', $security_code);
|
||||
#imagettftext ($image, 7, 0, $width-30, $height-4, $white,'./arial.ttf', 'Kleeja');
|
||||
}
|
||||
else
|
||||
{
|
||||
imagestring ($image, imageloadfont(dirname(__FILE__) . '/arial.gdf'), $x+rand(10,15), $y-rand(10,15), $security_code, $white);
|
||||
#imagestring ($image, 1, $width-35, $height-10, 'Kleeja', ImageColorAllocate($image, 200, 200, 200));
|
||||
}
|
||||
//options
|
||||
$x = 10;
|
||||
$y = 14;
|
||||
$angle = rand(-7, -10);
|
||||
|
||||
//Throw in some lines to make it a little bit harder for any bots to break
|
||||
ImageRectangle($image,0,0,$width-1,$height-1,$grey);
|
||||
imageline($image, 0, $height/2, $width, $height/2, $grey);
|
||||
imageline($image, $width/2, 0, $width/2, $height, $grey);
|
||||
|
||||
|
||||
//Tell the browser what kind of file is come in
|
||||
header("Content-Type: image/png");
|
||||
//Add randomly generated string in white to the image
|
||||
if (function_exists('imagettftext'))
|
||||
{
|
||||
//
|
||||
// We figure a bug that happens when you add font name without './' before it ..
|
||||
// he search in the Linux fonts cache , but when you add './' he will know it's our font.
|
||||
//
|
||||
imagettftext ($image, 16, $angle, rand(50, $x), $y+rand(1, 3), $white, dirname(__FILE__) . '/arial.ttf', $security_code);
|
||||
//imagettftext ($image, 7, 0, $width-30, $height-4, $white,'./arial.ttf', 'Kleeja');
|
||||
}
|
||||
else
|
||||
{
|
||||
imagestring ($image, imageloadfont(dirname(__FILE__) . '/arial.gdf'), $x+rand(10, 15), $y-rand(10, 15), $security_code, $white);
|
||||
//imagestring ($image, 1, $width-35, $height-10, 'Kleeja', ImageColorAllocate($image, 200, 200, 200));
|
||||
}
|
||||
|
||||
//Output the newly created image in jpeg format
|
||||
ImagePng($image);
|
||||
|
||||
//Free up resources
|
||||
ImageDestroy($image);
|
||||
//Throw in some lines to make it a little bit harder for any bots to break
|
||||
imagerectangle($image, 0, 0, $width-1, $height-1, $grey);
|
||||
imageline($image, 0, $height/2, $width, $height/2, $grey);
|
||||
imageline($image, $width/2, 0, $width/2, $height, $grey);
|
||||
|
||||
|
||||
//Tell the browser what kind of file is come in
|
||||
header('Content-Type: image/png');
|
||||
|
||||
//Output the newly created image in jpeg format
|
||||
imagepng($image);
|
||||
|
||||
//Free up resources
|
||||
imagedestroy($image);
|
||||
}
|
||||
|
||||
//<--- EOF
|
||||
|
||||
@@ -7,55 +7,56 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#not for directly open
|
||||
if (!defined('IN_KLEEJA'))
|
||||
//not for directly open
|
||||
if (! defined('IN_KLEEJA'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
#we are in the common file
|
||||
//we are in the common file
|
||||
define('IN_COMMON', true);
|
||||
|
||||
|
||||
#filename of config.php
|
||||
//filename of config.php
|
||||
define('KLEEJA_CONFIG_FILE', 'config.php');
|
||||
|
||||
#plugins folder
|
||||
//plugins folder
|
||||
define('KLEEJA_PLUGINS_FOLDER', 'plugins');
|
||||
|
||||
|
||||
|
||||
if(@extension_loaded('apc'))
|
||||
if (@extension_loaded('apc'))
|
||||
{
|
||||
define('APC_CACHE', true);
|
||||
define('APC_CACHE', true);
|
||||
}
|
||||
|
||||
#path
|
||||
if(!defined('PATH'))
|
||||
//path
|
||||
if (! defined('PATH'))
|
||||
{
|
||||
if(!defined('__DIR__'))
|
||||
if (! defined('__DIR__'))
|
||||
{
|
||||
define('__DIR__', dirname(__FILE__));
|
||||
}
|
||||
define('PATH', str_replace(DIRECTORY_SEPARATOR . 'includes', '', __DIR__) . DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
#no config
|
||||
if (!file_exists(PATH . KLEEJA_CONFIG_FILE))
|
||||
//no config
|
||||
if (! file_exists(PATH . KLEEJA_CONFIG_FILE))
|
||||
{
|
||||
header('Location: ./install/index.php');
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
#there is a config
|
||||
//there is a config
|
||||
require_once PATH . KLEEJA_CONFIG_FILE;
|
||||
|
||||
|
||||
#admin files path
|
||||
//admin files path
|
||||
define('ADM_FILES_PATH', PATH . 'includes/adm');
|
||||
|
||||
#Report all errors, except notices
|
||||
//Report all errors, except notices
|
||||
error_reporting( defined('DEV_STAGE') ? E_ALL : E_ALL ^ E_NOTICE);
|
||||
|
||||
|
||||
@@ -64,50 +65,55 @@ error_reporting( defined('DEV_STAGE') ? E_ALL : E_ALL ^ E_NOTICE);
|
||||
*/
|
||||
function kleeja_show_error($error_number, $error_string = '', $error_file = '', $error_line = '')
|
||||
{
|
||||
switch ($error_number)
|
||||
{
|
||||
case E_NOTICE: case E_WARNING: case E_USER_WARNING: case E_USER_NOTICE: case E_STRICT: break;
|
||||
default:
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">' . "\n<head>\n";
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' . "\n";
|
||||
echo '<title>Kleeja Error</title>' . "\n" . '<style type="text/css">' . "\n\t";
|
||||
echo '.error {color: #333;background:#ffebe8;float:left;width:73%;text-align:left;margin-top:10px;border: 1px solid #dd3c10; padding: 10px;font-family:tahoma,arial;font-size: 12px;}' . "\n";
|
||||
echo "</style>\n</head>\n<body>\n\t" . '<div class="error">' . "\n\n\t\t<h2>Kleeja error : </h2><br />" . "\n";
|
||||
echo "\n\t\t<strong> [ " . $error_number . ':' . basename($error_file) . ':' . $error_line . ' ] </strong><br /><br />' . "\n\t\t" . $error_string . "\n\t";
|
||||
echo "\n\t\t" . '<br /><br /><small>Visit <a href="http://www.kleeja.com/" title="kleeja">Kleeja</a> Website for more details.</small>' . "\n\t";
|
||||
echo "</div>\n</body>\n</html>";
|
||||
global $SQL;
|
||||
if(isset($SQL))
|
||||
{
|
||||
@$SQL->close();
|
||||
}
|
||||
exit;
|
||||
break;
|
||||
switch ($error_number)
|
||||
{
|
||||
case E_NOTICE: case E_WARNING: case E_USER_WARNING: case E_USER_NOTICE: case E_STRICT: break;
|
||||
|
||||
default:
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">' . "\n<head>\n";
|
||||
echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />' . "\n";
|
||||
echo '<title>Kleeja Error</title>' . "\n" . '<style type="text/css">' . "\n\t";
|
||||
echo '.error {color: #333;background:#ffebe8;float:left;width:73%;text-align:left;margin-top:10px;border: 1px solid #dd3c10; padding: 10px;font-family:tahoma,arial;font-size: 12px;}' . "\n";
|
||||
echo "</style>\n</head>\n<body>\n\t" . '<div class="error">' . "\n\n\t\t<h2>Kleeja error : </h2><br />" . "\n";
|
||||
echo "\n\t\t<strong> [ " . $error_number . ':' . basename($error_file) . ':' . $error_line . ' ] </strong><br /><br />' . "\n\t\t" . $error_string . "\n\t";
|
||||
echo "\n\t\t" . '<br /><br /><small>Visit <a href="http://www.kleeja.com/" title="kleeja">Kleeja</a> Website for more details.</small>' . "\n\t";
|
||||
echo "</div>\n</body>\n</html>";
|
||||
global $SQL;
|
||||
|
||||
if (isset($SQL))
|
||||
{
|
||||
@$SQL->close();
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
set_error_handler('kleeja_show_error');
|
||||
|
||||
#time of start and end and whatever
|
||||
//time of start and end and whatever
|
||||
function get_microtime()
|
||||
{
|
||||
list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec);
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
return ((float) $usec + (float) $sec);
|
||||
}
|
||||
|
||||
//is bot ?
|
||||
function is_bot($bots = array('googlebot', 'bing' ,'msnbot'))
|
||||
function is_bot($bots = ['googlebot', 'bing' ,'msnbot'])
|
||||
{
|
||||
if(isset($_SERVER['HTTP_USER_AGENT']))
|
||||
{
|
||||
return preg_match('/(' . implode('|', $bots) . ')/i', ($_SERVER['HTTP_USER_AGENT'] ? $_SERVER['HTTP_USER_AGENT'] : @getenv('HTTP_USER_AGENT'))) ? true : false;
|
||||
}
|
||||
return false;
|
||||
if (isset($_SERVER['HTTP_USER_AGENT']))
|
||||
{
|
||||
return preg_match('/(' . implode('|', $bots) . ')/i', ($_SERVER['HTTP_USER_AGENT'] ? $_SERVER['HTTP_USER_AGENT'] : @getenv('HTTP_USER_AGENT'))) ? true : false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
$starttm = get_microtime();
|
||||
|
||||
|
||||
if (!is_bot() && !isset($_SESSION))
|
||||
if (! is_bot() && ! isset($_SESSION))
|
||||
{
|
||||
session_start();
|
||||
}
|
||||
@@ -115,14 +121,15 @@ if (!is_bot() && !isset($_SESSION))
|
||||
|
||||
|
||||
|
||||
#no enough data
|
||||
//no enough data
|
||||
if (empty($dbname) || empty($dbuser))
|
||||
{
|
||||
header('Location: ./install/index.php');
|
||||
exit;
|
||||
header('Location: ./install/index.php');
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
#include files .. & classes ..
|
||||
//include files .. & classes ..
|
||||
$root_path = PATH;
|
||||
// $db_type = isset($db_type) ? $db_type : 'mysqli';
|
||||
|
||||
@@ -137,82 +144,82 @@ include PATH . 'includes/functions_display.php';
|
||||
include PATH . 'includes/plugins.php';
|
||||
|
||||
|
||||
if(defined('IN_ADMIN'))
|
||||
if (defined('IN_ADMIN'))
|
||||
{
|
||||
include PATH . 'includes/functions_adm.php';
|
||||
include PATH . 'includes/functions_adm.php';
|
||||
}
|
||||
|
||||
|
||||
#fix integration problems
|
||||
if(empty($script_encoding))
|
||||
//fix integration problems
|
||||
if (empty($script_encoding))
|
||||
{
|
||||
$script_encoding = 'utf-8';
|
||||
$script_encoding = 'utf-8';
|
||||
}
|
||||
|
||||
#start classes ..
|
||||
//start classes ..
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
#no need after now
|
||||
//no need after now
|
||||
unset($dbpass);
|
||||
|
||||
|
||||
|
||||
$tpl = new kleeja_style;
|
||||
$tpl = new kleeja_style;
|
||||
$usrcp = new usrcp;
|
||||
|
||||
//then get caches
|
||||
include PATH . 'includes/cache.php';
|
||||
|
||||
#getting dynamic configs
|
||||
$query = array(
|
||||
'SELECT' => 'c.name, c.value',
|
||||
'FROM' => "{$dbprefix}config c",
|
||||
'WHERE' => 'c.dynamic = 1',
|
||||
);
|
||||
//getting dynamic configs
|
||||
$query = [
|
||||
'SELECT' => 'c.name, c.value',
|
||||
'FROM' => "{$dbprefix}config c",
|
||||
'WHERE' => 'c.dynamic = 1',
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
$config[$row['name']] = $row['value'];
|
||||
$config[$row['name']] = $row['value'];
|
||||
}
|
||||
|
||||
$SQL->freeresult($result);
|
||||
|
||||
#check user or guest
|
||||
//check user or guest
|
||||
$usrcp->kleeja_check_user();
|
||||
|
||||
#+ configs of the current group
|
||||
//+ configs of the current group
|
||||
$config = array_merge($config, (array) $d_groups[$usrcp->group_id()]['configs']);
|
||||
|
||||
|
||||
#admin path
|
||||
//admin path
|
||||
define('ADMIN_PATH', rtrim($config['siteurl'], '/') . '/admin/index.php');
|
||||
|
||||
|
||||
//no tpl caching in dev stage
|
||||
if(defined('DEV_STAGE'))
|
||||
if (defined('DEV_STAGE'))
|
||||
{
|
||||
$tpl->caching = false;
|
||||
$tpl->caching = false;
|
||||
}
|
||||
|
||||
|
||||
if(isset($config['foldername']))
|
||||
if (isset($config['foldername']))
|
||||
{
|
||||
$config['foldername'] = str_replace(
|
||||
array(
|
||||
[
|
||||
'{year}',
|
||||
'{month}',
|
||||
'{week}',
|
||||
'{day}',
|
||||
'{username}',
|
||||
),
|
||||
array(
|
||||
],
|
||||
[
|
||||
date('Y'),
|
||||
date('m'),
|
||||
date('W'),
|
||||
date('d'),
|
||||
$usrcp->name() ? preg_replace('/[^a-z0-9\._-]/', '', strtolower($usrcp->name())) : 'guest'
|
||||
),
|
||||
],
|
||||
$config['foldername']
|
||||
);
|
||||
}
|
||||
@@ -234,145 +241,145 @@ $klj_session = $SQL->escape(session_id());
|
||||
|
||||
|
||||
//site url must end with /
|
||||
if($config['siteurl'])
|
||||
if ($config['siteurl'])
|
||||
{
|
||||
$config['siteurl'] = $config['siteurl'][strlen($config['siteurl'])-1] != '/'
|
||||
$config['siteurl'] = $config['siteurl'][strlen($config['siteurl'])-1] != '/'
|
||||
? $config['siteurl'] . '/'
|
||||
: $config['siteurl'];
|
||||
}
|
||||
|
||||
|
||||
#check lang
|
||||
if(!$config['language'] || empty($config['language']))
|
||||
//check lang
|
||||
if (! $config['language'] || empty($config['language']))
|
||||
{
|
||||
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) > 2)
|
||||
{
|
||||
$config['language'] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) && strlen($_SERVER['HTTP_ACCEPT_LANGUAGE']) > 2)
|
||||
{
|
||||
$config['language'] = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
|
||||
|
||||
if(!file_exists(PATH . 'lang/' . $config['language'] . '/common.php'))
|
||||
{
|
||||
$config['language'] = 'en';
|
||||
}
|
||||
}
|
||||
if (! file_exists(PATH . 'lang/' . $config['language'] . '/common.php'))
|
||||
{
|
||||
$config['language'] = 'en';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#check style
|
||||
if(is_null($config['style']) || empty($config['style']))
|
||||
//check style
|
||||
if (is_null($config['style']) || empty($config['style']))
|
||||
{
|
||||
$config['style'] = 'default';
|
||||
$config['style'] = 'default';
|
||||
}
|
||||
|
||||
#check h_kay, important for kleeja
|
||||
if(empty($config['h_key']))
|
||||
//check h_kay, important for kleeja
|
||||
if (empty($config['h_key']))
|
||||
{
|
||||
$h_k = sha1(microtime() . rand(0, 100));
|
||||
$h_k = sha1(microtime() . rand(0, 100));
|
||||
|
||||
if(!update_config('h_key', $h_k))
|
||||
{
|
||||
add_config('h_key', $h_k);
|
||||
}
|
||||
if (! update_config('h_key', $h_k))
|
||||
{
|
||||
add_config('h_key', $h_k);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#current Kleeja admin style
|
||||
//current Kleeja admin style
|
||||
define('ACP_STYLE_NAME', 'Masmak');
|
||||
|
||||
#path variables for Kleeja
|
||||
$STYLE_PATH = $config['siteurl'] . 'styles/' . (trim($config['style_depend_on']) == '' ? $config['style'] : $config['style_depend_on']) . '/';
|
||||
$THIS_STYLE_PATH = $config['siteurl'] . 'styles/' . $config['style'] . '/';
|
||||
$THIS_STYLE_PATH_ABS = PATH . 'styles/' . $config['style'] . '/';
|
||||
$STYLE_PATH_ADMIN = $config['siteurl'] . 'admin/'. (is_browser('mobile') || defined('IN_MOBILE') ? ACP_STYLE_NAME : ACP_STYLE_NAME) . '/';
|
||||
$STYLE_PATH_ADMIN_ABS = PATH . 'admin/'. (is_browser('mobile') || defined('IN_MOBILE') ? ACP_STYLE_NAME . '/' : ACP_STYLE_NAME . '/');
|
||||
//path variables for Kleeja
|
||||
$STYLE_PATH = $config['siteurl'] . 'styles/' . (trim($config['style_depend_on']) == '' ? $config['style'] : $config['style_depend_on']) . '/';
|
||||
$THIS_STYLE_PATH = $config['siteurl'] . 'styles/' . $config['style'] . '/';
|
||||
$THIS_STYLE_PATH_ABS = PATH . 'styles/' . $config['style'] . '/';
|
||||
$STYLE_PATH_ADMIN = $config['siteurl'] . 'admin/' . (is_browser('mobile') || defined('IN_MOBILE') ? ACP_STYLE_NAME : ACP_STYLE_NAME) . '/';
|
||||
$STYLE_PATH_ADMIN_ABS = PATH . 'admin/' . (is_browser('mobile') || defined('IN_MOBILE') ? ACP_STYLE_NAME . '/' : ACP_STYLE_NAME . '/');
|
||||
$DEFAULT_PATH_ADMIN_ABS = PATH . 'admin/' . ACP_STYLE_NAME . '/';
|
||||
$DEFAULT_PATH_ADMIN = $config['siteurl'] . 'admin/'. ACP_STYLE_NAME . '/';
|
||||
$DEFAULT_PATH_ADMIN = $config['siteurl'] . 'admin/' . ACP_STYLE_NAME . '/';
|
||||
|
||||
|
||||
#get languge of common
|
||||
//get languge of common
|
||||
get_lang('common');
|
||||
|
||||
#run ban system
|
||||
//run ban system
|
||||
get_ban();
|
||||
|
||||
if(isset($_GET['go']) && $_GET['go'] == 'login')
|
||||
if (isset($_GET['go']) && $_GET['go'] == 'login')
|
||||
{
|
||||
define('IN_LOGIN', true);
|
||||
define('IN_LOGIN', true);
|
||||
}
|
||||
|
||||
#install.php exists
|
||||
//install.php exists
|
||||
if (
|
||||
file_exists(PATH . 'install') &&
|
||||
!defined('IN_ADMIN') &&
|
||||
!defined('IN_LOGIN') &&
|
||||
!defined('DEV_STAGE') &&
|
||||
!(defined('IN_GO') && in_array(g('go'), array('queue'))) &&
|
||||
!(defined('IN_UCP') && in_array(g('go'), array('captcha', 'login')))
|
||||
)
|
||||
{
|
||||
#Different message for admins! delete install folder
|
||||
kleeja_info((user_can('enter_acp') ? $lang['DELETE_INSTALL_FOLDER'] : $lang['WE_UPDATING_KLEEJA_NOW']), $lang['SITE_CLOSED']);
|
||||
file_exists(PATH . 'install') &&
|
||||
! defined('IN_ADMIN') &&
|
||||
! defined('IN_LOGIN') &&
|
||||
! defined('DEV_STAGE') &&
|
||||
! (defined('IN_GO') && in_array(g('go'), ['queue'])) &&
|
||||
! (defined('IN_UCP') && in_array(g('go'), ['captcha', 'login']))
|
||||
) {
|
||||
//Different message for admins! delete install folder
|
||||
kleeja_info((user_can('enter_acp') ? $lang['DELETE_INSTALL_FOLDER'] : $lang['WE_UPDATING_KLEEJA_NOW']), $lang['SITE_CLOSED']);
|
||||
}
|
||||
|
||||
|
||||
#is site close
|
||||
//is site close
|
||||
$login_page = '';
|
||||
|
||||
if (
|
||||
$config['siteclose'] == '1' &&
|
||||
!user_can('enter_acp') &&
|
||||
!defined('IN_LOGIN') &&
|
||||
!defined('IN_ADMIN') &&
|
||||
!(defined('IN_GO') && in_array(g('go'), array('queue'))) &&
|
||||
!(defined('IN_UCP') && in_array(g('go'), array('captcha', 'login', 'register', 'logout')))
|
||||
)
|
||||
{
|
||||
//if download, images ?
|
||||
if(
|
||||
( defined('IN_DOWNLOAD') && (ig('img') || ig('thmb') || ig('thmbf') || ig('imgf')) )
|
||||
$config['siteclose'] == '1' &&
|
||||
! user_can('enter_acp') &&
|
||||
! defined('IN_LOGIN') &&
|
||||
! defined('IN_ADMIN') &&
|
||||
! (defined('IN_GO') && in_array(g('go'), ['queue'])) &&
|
||||
! (defined('IN_UCP') && in_array(g('go'), ['captcha', 'login', 'register', 'logout']))
|
||||
) {
|
||||
//if download, images ?
|
||||
if (
|
||||
( defined('IN_DOWNLOAD') && (ig('img') || ig('thmb') || ig('thmbf') || ig('imgf')) )
|
||||
|| g('go', 'str', '') == 'queue'
|
||||
)
|
||||
{
|
||||
@$SQL->close();
|
||||
$fullname = "images/site_closed.jpg";
|
||||
$filesize = filesize($fullname);
|
||||
header("Content-length: $filesize");
|
||||
header("Content-type: image/jpg");
|
||||
readfile($fullname);
|
||||
exit;
|
||||
}
|
||||
) {
|
||||
@$SQL->close();
|
||||
$fullname = 'images/site_closed.jpg';
|
||||
$filesize = filesize($fullname);
|
||||
header("Content-length: $filesize");
|
||||
header('Content-type: image/jpg');
|
||||
readfile($fullname);
|
||||
|
||||
// Send a 503 HTTP response code to prevent search bots from indexing the maintenace message
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
kleeja_info($config['closemsg'], $lang['SITE_CLOSED']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Send a 503 HTTP response code to prevent search bots from indexing the maintenace message
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
kleeja_info($config['closemsg'], $lang['SITE_CLOSED']);
|
||||
}
|
||||
|
||||
#exceed total size
|
||||
if (($stat_sizes >= ($config['total_size'] *(1048576))) && !defined('IN_LOGIN') && !defined('IN_ADMIN'))// convert megabytes to bytes
|
||||
{
|
||||
// Send a 503 HTTP response code to prevent search bots from indexing the maintenace message
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
kleeja_info($lang['SIZES_EXCCEDED'], $lang['STOP_FOR_SIZE']);
|
||||
//exceed total size
|
||||
if (($stat_sizes >= ($config['total_size'] *(1048576))) && ! defined('IN_LOGIN') && ! defined('IN_ADMIN'))
|
||||
{// convert megabytes to bytes
|
||||
// Send a 503 HTTP response code to prevent search bots from indexing the maintenace message
|
||||
header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
kleeja_info($lang['SIZES_EXCCEDED'], $lang['STOP_FOR_SIZE']);
|
||||
}
|
||||
|
||||
#detect bots and save stats
|
||||
//detect bots and save stats
|
||||
kleeja_detecting_bots();
|
||||
|
||||
#check for page number
|
||||
if(empty($perpage) || intval($perpage) == 0)
|
||||
//check for page number
|
||||
if (empty($perpage) || intval($perpage) == 0)
|
||||
{
|
||||
$perpage = 14;
|
||||
$perpage = 14;
|
||||
}
|
||||
|
||||
|
||||
#captcha file
|
||||
//captcha file
|
||||
$captcha_file_path = $config['siteurl'] . 'ucp.php?go=captcha';
|
||||
if(defined('STOP_CAPTCHA'))
|
||||
|
||||
if (defined('STOP_CAPTCHA'))
|
||||
{
|
||||
$config['enable_captcha'] = 0;
|
||||
$config['enable_captcha'] = 0;
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('end_common', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
if(function_exists('session_register_shutdown'))
|
||||
if (function_exists('session_register_shutdown'))
|
||||
{
|
||||
session_register_shutdown();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,9 +9,9 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -21,42 +21,44 @@ if (!defined('IN_COMMON'))
|
||||
*/
|
||||
function kleeja_admin_err($msg, $navigation = true, $title='', $exit = true, $redirect = false, $rs = 3, $style = 'admin_err')
|
||||
{
|
||||
global $text, $tpl, $SHOW_LIST, $adm_extensions, $adm_extensions_menu;
|
||||
global $STYLE_PATH_ADMIN, $lang, $olang, $SQL, $MINI_MENU;
|
||||
global $text, $tpl, $SHOW_LIST, $adm_extensions, $adm_extensions_menu;
|
||||
global $STYLE_PATH_ADMIN, $lang, $olang, $SQL, $MINI_MENU;
|
||||
|
||||
|
||||
if(is_string($navigation))
|
||||
if (is_string($navigation))
|
||||
{
|
||||
$redirect = $navigation;
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('kleeja_admin_err_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
#Exception for ajax
|
||||
if(ig('_ajax_'))
|
||||
{
|
||||
//Exception for ajax
|
||||
if (ig('_ajax_'))
|
||||
{
|
||||
$text = $msg . ($redirect ? "\n" . '<script type="text/javascript">setTimeout("get_kleeja_link(\'' . str_replace('&', '&', $redirect) . '\');", ' . ($rs * 1000) . ');</script>' : '');
|
||||
echo_ajax(1, $tpl->display($style));
|
||||
$SQL->close();
|
||||
exit();
|
||||
}
|
||||
echo_ajax(1, $tpl->display($style));
|
||||
$SQL->close();
|
||||
|
||||
// assign {text} in err template
|
||||
$text = $msg . ($redirect != false ? redirect($redirect, false, false, $rs, true) : '');
|
||||
$SHOW_LIST = $navigation;
|
||||
exit();
|
||||
}
|
||||
|
||||
//header
|
||||
echo $tpl->display("admin_header");
|
||||
//show tpl
|
||||
echo $tpl->display($style);
|
||||
//footer
|
||||
echo $tpl->display("admin_footer");
|
||||
|
||||
if($exit)
|
||||
{
|
||||
$SQL->close();
|
||||
exit();
|
||||
}
|
||||
// assign {text} in err template
|
||||
$text = $msg . ($redirect != false ? redirect($redirect, false, false, $rs, true) : '');
|
||||
$SHOW_LIST = $navigation;
|
||||
|
||||
//header
|
||||
echo $tpl->display('admin_header');
|
||||
//show tpl
|
||||
echo $tpl->display($style);
|
||||
//footer
|
||||
echo $tpl->display('admin_footer');
|
||||
|
||||
if ($exit)
|
||||
{
|
||||
$SQL->close();
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,12 +66,12 @@ function kleeja_admin_err($msg, $navigation = true, $title='', $exit = true, $re
|
||||
* Print information message on admin panel
|
||||
*
|
||||
* @adm
|
||||
* @param string $msg information message
|
||||
* @param bool $navigation show navigation menu or not
|
||||
* @param string $title information heading title
|
||||
* @param bool $exit if true, then halt after message
|
||||
* @param bool $redirect redirect after showing the message
|
||||
* @param int $rs delay the redirect in seconds
|
||||
* @param string $msg information message
|
||||
* @param bool $navigation show navigation menu or not
|
||||
* @param string $title information heading title
|
||||
* @param bool $exit if true, then halt after message
|
||||
* @param bool $redirect redirect after showing the message
|
||||
* @param int $rs delay the redirect in seconds
|
||||
*/
|
||||
function kleeja_admin_info($msg, $navigation=true, $title='', $exit=true, $redirect = false, $rs = 2)
|
||||
{
|
||||
@@ -81,62 +83,63 @@ function kleeja_admin_info($msg, $navigation=true, $title='', $exit=true, $redir
|
||||
/**
|
||||
* generate a filter..
|
||||
* @adm
|
||||
* @param string|integer $type filter_id or filter_uid
|
||||
* @param string $value filter value
|
||||
* @param bool $time filter time
|
||||
* @param bool $user user Id
|
||||
* @param string $status filter status
|
||||
* @param bool $uid filter unique id
|
||||
* @param string|integer $type filter_id or filter_uid
|
||||
* @param string $value filter value
|
||||
* @param bool $time filter time
|
||||
* @param bool $user user Id
|
||||
* @param string $status filter status
|
||||
* @param bool $uid filter unique id
|
||||
* @return bool|int|string
|
||||
*/
|
||||
function insert_filter($type, $value, $time = false, $user = false, $status = '', $uid = false)
|
||||
{
|
||||
global $SQL, $dbprefix, $userinfo;
|
||||
global $SQL, $dbprefix, $userinfo;
|
||||
|
||||
$user = !$user ? $userinfo['id'] : $user;
|
||||
$time = !$time ? time() : $time;
|
||||
$uid = $uid ? $uid : uniqid();
|
||||
$user = ! $user ? $userinfo['id'] : $user;
|
||||
$time = ! $time ? time() : $time;
|
||||
$uid = $uid ? $uid : uniqid();
|
||||
|
||||
$insert_query = array(
|
||||
'INSERT' => 'filter_uid, filter_type ,filter_value ,filter_time ,filter_user, filter_status',
|
||||
'INTO' => "{$dbprefix}filters",
|
||||
'VALUES' => "'" .$uid . "', '" . $SQL->escape($type) . "','" . $SQL->escape($value) . "', " . intval($time) . "," . intval($user) . ",'" . $SQL->escape($status) . "'"
|
||||
);
|
||||
$insert_query = [
|
||||
'INSERT' => 'filter_uid, filter_type ,filter_value ,filter_time ,filter_user, filter_status',
|
||||
'INTO' => "{$dbprefix}filters",
|
||||
'VALUES' => "'" . $uid . "', '" . $SQL->escape($type) . "','" . $SQL->escape($value) . "', " . intval($time) . ',' . intval($user) . ",'" . $SQL->escape($status) . "'"
|
||||
];
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('insert_sql_insert_filter_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$SQL->build($insert_query);
|
||||
$SQL->build($insert_query);
|
||||
|
||||
return $SQL->insert_id() ? $uid : false;
|
||||
return $SQL->insert_id() ? $uid : false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update filter value..
|
||||
*
|
||||
* @param int|string $id_or_uid Number of filter_id or the unique id string of filter_uid
|
||||
* @param string $value The modified value of filter
|
||||
* @param string $filter_type if given, use it with sql where
|
||||
* @param bool|string $filter_status if given, update the filter status
|
||||
* @param bool $user_id
|
||||
* @param int|string $id_or_uid Number of filter_id or the unique id string of filter_uid
|
||||
* @param string $value The modified value of filter
|
||||
* @param string $filter_type if given, use it with sql where
|
||||
* @param bool|string $filter_status if given, update the filter status
|
||||
* @param bool $user_id
|
||||
* @return bool
|
||||
*/
|
||||
function update_filter($id_or_uid, $value, $filter_type = 'general', $filter_status = false, $user_id = false)
|
||||
{
|
||||
global $SQL, $dbprefix;
|
||||
|
||||
$update_query = array(
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}filters",
|
||||
'SET' => "filter_value='" . $SQL->escape($value) . "'" . ($filter_status ? ", filter_status='" . $SQL->escape($filter_status) . "'" : ''),
|
||||
'WHERE' => (strval(intval($id_or_uid)) == strval($id_or_uid) ? 'filter_id=' . intval($id_or_uid) : "filter_uid='" . $SQL->escape($id_or_uid) . "'")
|
||||
'SET' => "filter_value='" . $SQL->escape($value) . "'" . ($filter_status ? ", filter_status='" . $SQL->escape($filter_status) . "'" : ''),
|
||||
'WHERE' => (strval(intval($id_or_uid)) == strval($id_or_uid) ? 'filter_id=' . intval($id_or_uid) : "filter_uid='" . $SQL->escape($id_or_uid) . "'")
|
||||
. ($filter_type ? " AND filter_type='" . $SQL->escape($filter_type) . "'" : '')
|
||||
. ($user_id ? " AND filter_user=" . intval($user_id) . "" : '')
|
||||
);
|
||||
. ($user_id ? ' AND filter_user=' . intval($user_id) . '' : '')
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('update_filter_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$SQL->build($update_query);
|
||||
if ($SQL->affected())
|
||||
{
|
||||
|
||||
if ($SQL->affected())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -147,41 +150,42 @@ function update_filter($id_or_uid, $value, $filter_type = 'general', $filter_sta
|
||||
/**
|
||||
* Get filter from db..
|
||||
*
|
||||
* @param string|int $item The value of $get_by, to get the filter depend on it
|
||||
* @param bool|string $filter_type if given, use it with sql where
|
||||
* @param bool $just_value If true the return value should be just filter_value otherwise all filter rows
|
||||
* @param string $get_by The name of filter column we want to get the filter value from
|
||||
* @param bool $user_id
|
||||
* @param string|int $item The value of $get_by, to get the filter depend on it
|
||||
* @param bool|string $filter_type if given, use it with sql where
|
||||
* @param bool $just_value If true the return value should be just filter_value otherwise all filter rows
|
||||
* @param string $get_by The name of filter column we want to get the filter value from
|
||||
* @param bool $user_id
|
||||
* @return mixed
|
||||
*/
|
||||
function get_filter($item, $filter_type = false, $just_value = false, $get_by = 'filter_uid', $user_id = false)
|
||||
{
|
||||
global $dbprefix, $SQL;
|
||||
|
||||
$valid_filter_columns = array('filter_id', 'filter_uid', 'filter_user', 'filter_status');
|
||||
$valid_filter_columns = ['filter_id', 'filter_uid', 'filter_user', 'filter_status'];
|
||||
|
||||
if (!in_array($get_by, $valid_filter_columns))
|
||||
{
|
||||
if (! in_array($get_by, $valid_filter_columns))
|
||||
{
|
||||
$get_by = 'filter_uid';
|
||||
}
|
||||
|
||||
$query = array(
|
||||
$query = [
|
||||
'SELECT' => $just_value ? 'f.filter_value' : 'f.*',
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => "f." . $get_by . " = " . ($get_by == 'filter_id' ? intval($item) : "'" . $SQL->escape($item) . "'")
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => 'f.' . $get_by . ' = ' . ($get_by == 'filter_id' ? intval($item) : "'" . $SQL->escape($item) . "'")
|
||||
. ($filter_type ? " AND f.filter_type='" . $SQL->escape($filter_type) . "'" : '')
|
||||
. ($user_id ? " AND f.filter_user=" . intval($user_id) . "" : '')
|
||||
);
|
||||
. ($user_id ? ' AND f.filter_user=' . intval($user_id) . '' : '')
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('get_filter_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$v = $SQL->fetch($result);
|
||||
$v = $SQL->fetch($result);
|
||||
|
||||
$SQL->free($result);
|
||||
if ($just_value)
|
||||
{
|
||||
|
||||
if ($just_value)
|
||||
{
|
||||
return $v['filter_value'];
|
||||
}
|
||||
|
||||
@@ -191,24 +195,24 @@ function get_filter($item, $filter_type = false, $just_value = false, $get_by =
|
||||
/**
|
||||
* check if filter exists or not
|
||||
*
|
||||
* @param string|int $item The value of $get_by, to find the filter depend on it
|
||||
* @param string $get_by The name of filter column we want to get the filter from
|
||||
* @param bool $filter_type
|
||||
* @param bool $user_id
|
||||
* @param string|int $item The value of $get_by, to find the filter depend on it
|
||||
* @param string $get_by The name of filter column we want to get the filter from
|
||||
* @param bool $filter_type
|
||||
* @param bool $user_id
|
||||
* @return bool|int
|
||||
*/
|
||||
function filter_exists($item, $get_by = 'filter_id', $filter_type = false, $user_id = false)
|
||||
{
|
||||
global $dbprefix, $SQL;
|
||||
|
||||
$query = array(
|
||||
$query = [
|
||||
'SELECT' => 'f.filter_id',
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => "f." . $get_by . " = " . ($get_by == 'filter_id' ? intval($item) : "'" . $SQL->escape($item) . "'")
|
||||
'FROM' => "{$dbprefix}filters f",
|
||||
'WHERE' => 'f.' . $get_by . ' = ' . ($get_by == 'filter_id' ? intval($item) : "'" . $SQL->escape($item) . "'")
|
||||
. ($filter_type ? " AND f.filter_type='" . $SQL->escape($filter_type) . "'" : '')
|
||||
. ($user_id ? " AND f.filter_user=" . intval($user_id) . "" : '')
|
||||
. ($user_id ? ' AND f.filter_user=' . intval($user_id) . '' : '')
|
||||
|
||||
);
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('filter_exists_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
@@ -221,190 +225,192 @@ function filter_exists($item, $get_by = 'filter_id', $filter_type = false, $user
|
||||
/**
|
||||
* costruct a query for the searches..
|
||||
* @adm
|
||||
* @param array $search Search options
|
||||
* @param array $search Search options
|
||||
* @return string
|
||||
*/
|
||||
function build_search_query($search)
|
||||
{
|
||||
if(!is_array($search))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
if (! is_array($search))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
global $SQL;
|
||||
global $SQL;
|
||||
|
||||
$search['filename'] = !isset($search['filename']) ? '' : $search['filename'];
|
||||
$search['username'] = !isset($search['username']) ? '' : $search['username'];
|
||||
$search['than'] = !isset($search['than']) ? '' : $search['than'];
|
||||
$search['size'] = !isset($search['size']) ? '' : $search['size'];
|
||||
$search['ups'] = !isset($search['ups']) ? '' : $search['ups'];
|
||||
$search['uthan'] = !isset($search['uthan']) ? '' : $search['uthan'];
|
||||
$search['rep'] = !isset($search['rep']) ? '' : $search['rep'];
|
||||
$search['rthan'] = !isset($search['rthan']) ? '' : $search['rthan'];
|
||||
$search['lastdown'] = !isset($search['lastdown']) ? '' : $search['lastdown'];
|
||||
$search['ext'] = !isset($search['ext']) ? '' : $search['ext'];
|
||||
$search['user_ip'] = !isset($search['user_ip']) ? '' : $search['user_ip'];
|
||||
$search['filename'] = ! isset($search['filename']) ? '' : $search['filename'];
|
||||
$search['username'] = ! isset($search['username']) ? '' : $search['username'];
|
||||
$search['than'] = ! isset($search['than']) ? '' : $search['than'];
|
||||
$search['size'] = ! isset($search['size']) ? '' : $search['size'];
|
||||
$search['ups'] = ! isset($search['ups']) ? '' : $search['ups'];
|
||||
$search['uthan'] = ! isset($search['uthan']) ? '' : $search['uthan'];
|
||||
$search['rep'] = ! isset($search['rep']) ? '' : $search['rep'];
|
||||
$search['rthan'] = ! isset($search['rthan']) ? '' : $search['rthan'];
|
||||
$search['lastdown'] = ! isset($search['lastdown']) ? '' : $search['lastdown'];
|
||||
$search['ext'] = ! isset($search['ext']) ? '' : $search['ext'];
|
||||
$search['user_ip'] = ! isset($search['user_ip']) ? '' : $search['user_ip'];
|
||||
|
||||
$file_namee = $search['filename'] != '' ? 'AND (f.real_filename LIKE \'%' . $SQL->escape($search['filename']) . '%\' OR f.name LIKE \'%' . $SQL->escape($search['filename']) . '%\')' : '';
|
||||
$usernamee = $search['username'] != '' ? 'AND u.name LIKE \'%' . $SQL->escape($search['username']) . '%\'' : '';
|
||||
$size_than = ' f.size ' . ($search['than']!=1 ? '<=' : '>=') . (intval($search['size']) * 1024) . ' ';
|
||||
$ups_than = $search['ups'] != '' ? 'AND f.uploads ' . ($search['uthan']!=1 ? '<' : '>') . intval($search['ups']) . ' ' : '';
|
||||
$rep_than = $search['rep'] != '' ? 'AND f.report ' . ($search['rthan']!=1 ? '<' : '>') . intval($search['rep']) . ' ' : '';
|
||||
$lstd_than = $search['lastdown'] != '' ? 'AND f.last_down =' . (time()-(intval($search['lastdown']) * (24 * 60 * 60))) . ' ' : '';
|
||||
$exte = $search['ext'] != '' ? "AND f.type IN ('" . implode("', '", @explode(",", $SQL->escape($search['ext']))) . "')" : '';
|
||||
$ipp = $search['user_ip'] != '' ? 'AND f.user_ip LIKE \'%' . $SQL->escape($search['user_ip']) . '%\' ' : '';
|
||||
$file_namee = $search['filename'] != '' ? 'AND (f.real_filename LIKE \'%' . $SQL->escape($search['filename']) . '%\' OR f.name LIKE \'%' . $SQL->escape($search['filename']) . '%\')' : '';
|
||||
$usernamee = $search['username'] != '' ? 'AND u.name LIKE \'%' . $SQL->escape($search['username']) . '%\'' : '';
|
||||
$size_than = ' f.size ' . ($search['than']!=1 ? '<=' : '>=') . (intval($search['size']) * 1024) . ' ';
|
||||
$ups_than = $search['ups'] != '' ? 'AND f.uploads ' . ($search['uthan']!=1 ? '<' : '>') . intval($search['ups']) . ' ' : '';
|
||||
$rep_than = $search['rep'] != '' ? 'AND f.report ' . ($search['rthan']!=1 ? '<' : '>') . intval($search['rep']) . ' ' : '';
|
||||
$lstd_than = $search['lastdown'] != '' ? 'AND f.last_down =' . (time()-(intval($search['lastdown']) * (24 * 60 * 60))) . ' ' : '';
|
||||
$exte = $search['ext'] != '' ? "AND f.type IN ('" . implode("', '", @explode(',', $SQL->escape($search['ext']))) . "')" : '';
|
||||
$ipp = $search['user_ip'] != '' ? 'AND f.user_ip LIKE \'%' . $SQL->escape($search['user_ip']) . '%\' ' : '';
|
||||
|
||||
return "$size_than $file_namee $ups_than $exte $rep_than $usernamee $lstd_than $exte $ipp";
|
||||
return "$size_than $file_namee $ups_than $exte $rep_than $usernamee $lstd_than $exte $ipp";
|
||||
}
|
||||
|
||||
/**
|
||||
* To re-count the total files, without making the server goes down haha
|
||||
* @param bool $files
|
||||
* @param bool $start
|
||||
* @param bool $files
|
||||
* @param bool $start
|
||||
* @return bool|int
|
||||
*/
|
||||
function sync_total_files($files = true, $start = false)
|
||||
{
|
||||
global $SQL, $dbprefix;
|
||||
global $SQL, $dbprefix;
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'MIN(f.id) as min_file_id, MAX(f.id) as max_file_id',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'MIN(f.id) as min_file_id, MAX(f.id) as max_file_id',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
];
|
||||
|
||||
#!files == images
|
||||
$img_types = array('gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG');
|
||||
$query['WHERE'] = "f.type" . ($files ? ' NOT' : '') ." IN ('" . implode("', '", $img_types) . "')";
|
||||
//!files == images
|
||||
$img_types = ['gif','jpg','png','bmp','jpeg','GIF','JPG','PNG','BMP','JPEG'];
|
||||
$query['WHERE'] = 'f.type' . ($files ? ' NOT' : '') . " IN ('" . implode("', '", $img_types) . "')";
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$v = $SQL->fetch($result);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
#if no data, turn them to number
|
||||
$min_id = (int) $v['min_file_id'];
|
||||
// $max_id = (int) $v['max_file_id'];
|
||||
$result = $SQL->build($query);
|
||||
$v = $SQL->fetch($result);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
#every time batch
|
||||
$batch_size = 1500;
|
||||
//if no data, turn them to number
|
||||
$min_id = (int) $v['min_file_id'];
|
||||
// $max_id = (int) $v['max_file_id'];
|
||||
|
||||
#no start? start = min
|
||||
$first_loop = !$start ? true : false;
|
||||
$start = !$start ? $min_id : $start;
|
||||
$end = $start + $batch_size;
|
||||
//every time batch
|
||||
$batch_size = 1500;
|
||||
|
||||
#now lets get this step's files number
|
||||
unset($v, $result);
|
||||
//no start? start = min
|
||||
$first_loop = ! $start ? true : false;
|
||||
$start = ! $start ? $min_id : $start;
|
||||
$end = $start + $batch_size;
|
||||
|
||||
$query['SELECT'] = 'COUNT(f.id) as num_files';
|
||||
$query['WHERE'] .= ' AND f.id BETWEEN ' . $start . ' AND ' . $end;
|
||||
//now lets get this step's files number
|
||||
unset($v, $result);
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$v = $SQL->fetch($result);
|
||||
$SQL->freeresult($result);
|
||||
$query['SELECT'] = 'COUNT(f.id) as num_files';
|
||||
$query['WHERE'] .= ' AND f.id BETWEEN ' . $start . ' AND ' . $end;
|
||||
|
||||
$this_step_count = $v['num_files'];
|
||||
if($this_step_count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
$result = $SQL->build($query);
|
||||
$v = $SQL->fetch($result);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
#update stats table
|
||||
$this_step_count = $v['num_files'];
|
||||
|
||||
$update_query = array(
|
||||
'UPDATE' => "{$dbprefix}stats"
|
||||
);
|
||||
if ($this_step_count == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
#make it zero, firstly
|
||||
if($first_loop)
|
||||
{
|
||||
$update_query['SET'] = ($files ? 'files' : 'imgs') . "= 0";
|
||||
$SQL->build($update_query);
|
||||
}
|
||||
|
||||
$update_query['SET'] = ($files ? 'files' : 'imgs') . "=" . ($files ? 'files' : 'imgs') . '+' . $this_step_count;
|
||||
$SQL->build($update_query);
|
||||
//update stats table
|
||||
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats"
|
||||
];
|
||||
|
||||
//make it zero, firstly
|
||||
if ($first_loop)
|
||||
{
|
||||
$update_query['SET'] = ($files ? 'files' : 'imgs') . '= 0';
|
||||
$SQL->build($update_query);
|
||||
}
|
||||
|
||||
$update_query['SET'] = ($files ? 'files' : 'imgs') . '=' . ($files ? 'files' : 'imgs') . '+' . $this_step_count;
|
||||
$SQL->build($update_query);
|
||||
|
||||
|
||||
return $end;
|
||||
return $end;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the *right* now number of the given stat fro stats table
|
||||
* @param string $name Stat name
|
||||
* @param string $name Stat name
|
||||
* @return int
|
||||
*/
|
||||
function get_actual_stats($name)
|
||||
{
|
||||
global $dbprefix, $SQL;
|
||||
global $dbprefix, $SQL;
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 's.' . $name,
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 's.' . $name,
|
||||
'FROM' => "{$dbprefix}stats s"
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$v = $SQL->fetch($result);
|
||||
$result = $SQL->build($query);
|
||||
$v = $SQL->fetch($result);
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('get_actual_stats_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$SQL->freeresult($result);
|
||||
|
||||
return $v[$name];
|
||||
$SQL->freeresult($result);
|
||||
|
||||
return $v[$name];
|
||||
}
|
||||
|
||||
/**
|
||||
* check wether a start box is hidden or not
|
||||
* @param string $name box name
|
||||
* @param string $name box name
|
||||
* @return bool
|
||||
*/
|
||||
function adm_is_start_box_hidden($name)
|
||||
{
|
||||
global $config;
|
||||
global $config;
|
||||
|
||||
if(! isset($config['hidden_start_boxes']))
|
||||
{
|
||||
add_config('hidden_start_boxes', '');
|
||||
if (! isset($config['hidden_start_boxes']))
|
||||
{
|
||||
add_config('hidden_start_boxes', '');
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static $boxes;
|
||||
|
||||
if(empty($boxes))
|
||||
{
|
||||
$boxes = explode(':', $config['hidden_start_boxes']);
|
||||
$boxes = array_filter($boxes);
|
||||
}
|
||||
static $boxes;
|
||||
|
||||
if (empty($boxes))
|
||||
{
|
||||
$boxes = explode(':', $config['hidden_start_boxes']);
|
||||
$boxes = array_filter($boxes);
|
||||
}
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('adm_start_boxes_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('adm_start_boxes_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
return in_array($name, $boxes);
|
||||
return in_array($name, $boxes);
|
||||
}
|
||||
|
||||
/**
|
||||
* delete plugin folder
|
||||
* @param string $dir plugin folder path
|
||||
* @param string $dir plugin folder path
|
||||
* @return void
|
||||
*/
|
||||
function delete_plugin_folder($dir)
|
||||
{
|
||||
$it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if ($file->isLink())
|
||||
{
|
||||
unlink($file->getPathname());
|
||||
}
|
||||
else if ($file->isDir())
|
||||
{
|
||||
rmdir($file->getPathname());
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($file->getPathname());
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
}
|
||||
$it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS);
|
||||
$files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if ($file->isLink())
|
||||
{
|
||||
unlink($file->getPathname());
|
||||
}
|
||||
elseif ($file->isDir())
|
||||
{
|
||||
rmdir($file->getPathname());
|
||||
}
|
||||
else
|
||||
{
|
||||
unlink($file->getPathname());
|
||||
}
|
||||
}
|
||||
rmdir($dir);
|
||||
}
|
||||
|
||||
@@ -16,172 +16,212 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists('htmlspecialchars_decode'))
|
||||
if (! function_exists('htmlspecialchars_decode'))
|
||||
{
|
||||
function htmlspecialchars_decode($string, $style=ENT_COMPAT)
|
||||
{
|
||||
$translation = array_flip(get_html_translation_table(HTML_SPECIALCHARS, $style));
|
||||
if($style === ENT_QUOTES)
|
||||
{
|
||||
$translation['''] = '\'';
|
||||
}
|
||||
return strtr($string, $translation);
|
||||
}
|
||||
function htmlspecialchars_decode($string, $style=ENT_COMPAT)
|
||||
{
|
||||
$translation = array_flip(get_html_translation_table(HTML_SPECIALCHARS, $style));
|
||||
|
||||
if ($style === ENT_QUOTES)
|
||||
{
|
||||
$translation['''] = '\'';
|
||||
}
|
||||
return strtr($string, $translation);
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//http://us2.php.net/manual/en/function.str-split.php#84891
|
||||
if(!function_exists('str_split'))
|
||||
if (! function_exists('str_split'))
|
||||
{
|
||||
function str_split($string, $string_length=1)
|
||||
{
|
||||
if(strlen($string) > $string_length || !$string_length)
|
||||
{
|
||||
do
|
||||
{
|
||||
$c = strlen($string);
|
||||
$parts[] = substr($string, 0, $string_length);
|
||||
$string = substr($string, $string_length);
|
||||
}
|
||||
while($string !== false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parts = array($string);
|
||||
}
|
||||
return $parts;
|
||||
{
|
||||
if (strlen($string) > $string_length || ! $string_length)
|
||||
{
|
||||
do
|
||||
{
|
||||
$c = strlen($string);
|
||||
$parts[] = substr($string, 0, $string_length);
|
||||
$string = substr($string, $string_length);
|
||||
} while ($string !== false);
|
||||
}
|
||||
else
|
||||
{
|
||||
$parts = [$string];
|
||||
}
|
||||
return $parts;
|
||||
}
|
||||
}
|
||||
|
||||
//Custom base64_* functions
|
||||
function kleeja_base64_encode($str = ''){ return function_exists('base64_encode') ? base64_encode($str) : base64encode($str); }
|
||||
function kleeja_base64_decode($str = ''){ return function_exists('base64_decode') ? base64_decode($str) : base64decode($str); }
|
||||
function kleeja_base64_encode($str = '')
|
||||
{
|
||||
return function_exists('base64_encode') ? base64_encode($str) : base64encode($str);
|
||||
}
|
||||
function kleeja_base64_decode($str = '')
|
||||
{
|
||||
return function_exists('base64_decode') ? base64_decode($str) : base64decode($str);
|
||||
}
|
||||
|
||||
//http://www.php.net/manual/en/function.base64-encode.php#63270
|
||||
function base64encode($string = '')
|
||||
{
|
||||
if(!function_exists('convert_binary_str'))
|
||||
{
|
||||
function convert_binary_str($string)
|
||||
{
|
||||
if (strlen($string) <= 0)
|
||||
return;
|
||||
if (! function_exists('convert_binary_str'))
|
||||
{
|
||||
function convert_binary_str($string)
|
||||
{
|
||||
if (strlen($string) <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$tmp = decbin(ord($string[0]));
|
||||
$tmp = str_repeat('0', 8-strlen($tmp)) . $tmp;
|
||||
return $tmp . convert_binary_str(substr($string,1));
|
||||
}
|
||||
}
|
||||
$tmp = decbin(ord($string[0]));
|
||||
$tmp = str_repeat('0', 8-strlen($tmp)) . $tmp;
|
||||
return $tmp . convert_binary_str(substr($string, 1));
|
||||
}
|
||||
}
|
||||
|
||||
$binval = convert_binary_str($string);
|
||||
$final = '';
|
||||
$start = 0;
|
||||
$binval = convert_binary_str($string);
|
||||
$final = '';
|
||||
$start = 0;
|
||||
|
||||
while ($start < strlen($binval))
|
||||
{
|
||||
if (strlen(substr($binval,$start)) < 6)
|
||||
$binval .= str_repeat("0", 6-strlen(substr($binval,$start)));
|
||||
$tmp = bindec(substr($binval, $start,6));
|
||||
if ($tmp < 26)
|
||||
$final .= chr($tmp+65);
|
||||
elseif ($tmp > 25 && $tmp < 52)
|
||||
$final .= chr($tmp+71);
|
||||
elseif ($tmp == 62)
|
||||
$final .= "+";
|
||||
elseif ($tmp == 63)
|
||||
$final .= "/";
|
||||
elseif (!$tmp)
|
||||
$final .= "A";
|
||||
else
|
||||
$final .= chr($tmp-4);
|
||||
$start += 6;
|
||||
}
|
||||
if (strlen($final)%4>0)
|
||||
$final .= str_repeat('=', 4-strlen($final)%4);
|
||||
return $final;
|
||||
while ($start < strlen($binval))
|
||||
{
|
||||
if (strlen(substr($binval, $start)) < 6)
|
||||
{
|
||||
$binval .= str_repeat('0', 6-strlen(substr($binval, $start)));
|
||||
}
|
||||
$tmp = bindec(substr($binval, $start, 6));
|
||||
|
||||
if ($tmp < 26)
|
||||
{
|
||||
$final .= chr($tmp+65);
|
||||
}
|
||||
elseif ($tmp > 25 && $tmp < 52)
|
||||
{
|
||||
$final .= chr($tmp+71);
|
||||
}
|
||||
elseif ($tmp == 62)
|
||||
{
|
||||
$final .= '+';
|
||||
}
|
||||
elseif ($tmp == 63)
|
||||
{
|
||||
$final .= '/';
|
||||
}
|
||||
elseif (! $tmp)
|
||||
{
|
||||
$final .= 'A';
|
||||
}
|
||||
else
|
||||
{
|
||||
$final .= chr($tmp-4);
|
||||
}
|
||||
$start += 6;
|
||||
}
|
||||
|
||||
if (strlen($final)%4>0)
|
||||
{
|
||||
$final .= str_repeat('=', 4-strlen($final)%4);
|
||||
}
|
||||
return $final;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function base64decode($str)
|
||||
{
|
||||
$len = strlen($str);
|
||||
$ret = '';
|
||||
$b64 = array();
|
||||
$base64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
$len_base64 = strlen($base64);
|
||||
|
||||
for ($i = 0; $i < 256; $i++)
|
||||
$b64[$i] = 0;
|
||||
for ($i = 0; $i < $len_base64 ; $i++)
|
||||
$b64[ord($base64[$i])] = $i;
|
||||
$len = strlen($str);
|
||||
$ret = '';
|
||||
$b64 = [];
|
||||
$base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
||||
$len_base64 = strlen($base64);
|
||||
|
||||
for($j=0;$j<$len;$j+=4)
|
||||
{
|
||||
for ($i = 0; $i < 4; $i++)
|
||||
{
|
||||
$c = ord($str[$j+$i]);
|
||||
$a[$i] = $c;
|
||||
$b[$i] = $b64[$c];
|
||||
}
|
||||
for ($i = 0; $i < 256; $i++)
|
||||
{
|
||||
$b64[$i] = 0;
|
||||
}
|
||||
|
||||
$o[0] = ($b[0] << 2) | ($b[1] >> 4);
|
||||
$o[1] = ($b[1] << 4) | ($b[2] >> 2);
|
||||
$o[2] = ($b[2] << 6) | $b[3];
|
||||
if ($a[2] == ord('='))
|
||||
$i = 1;
|
||||
else if ($a[3] == ord('='))
|
||||
$i = 2;
|
||||
else
|
||||
$i = 3;
|
||||
for ($i = 0; $i < $len_base64; $i++)
|
||||
{
|
||||
$b64[ord($base64[$i])] = $i;
|
||||
}
|
||||
|
||||
for($k=0;$k<$i;$k++)
|
||||
$ret .= chr((int) $o[$k] & 255);
|
||||
for ($j=0;$j<$len;$j+=4)
|
||||
{
|
||||
for ($i = 0; $i < 4; $i++)
|
||||
{
|
||||
$c = ord($str[$j+$i]);
|
||||
$a[$i] = $c;
|
||||
$b[$i] = $b64[$c];
|
||||
}
|
||||
|
||||
if ($i < 3)
|
||||
break;
|
||||
}
|
||||
$o[0] = ($b[0] << 2) | ($b[1] >> 4);
|
||||
$o[1] = ($b[1] << 4) | ($b[2] >> 2);
|
||||
$o[2] = ($b[2] << 6) | $b[3];
|
||||
|
||||
return $ret;
|
||||
if ($a[2] == ord('='))
|
||||
{
|
||||
$i = 1;
|
||||
}
|
||||
elseif ($a[3] == ord('='))
|
||||
{
|
||||
$i = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$i = 3;
|
||||
}
|
||||
|
||||
for ($k=0;$k<$i;$k++)
|
||||
{
|
||||
$ret .= chr((int) $o[$k] & 255);
|
||||
}
|
||||
|
||||
if ($i < 3)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
if(!function_exists('filesize'))
|
||||
if (! function_exists('filesize'))
|
||||
{
|
||||
function kleeja_filesize($filename)
|
||||
{
|
||||
$a = fopen($filename, 'r');
|
||||
fseek($a, 0, SEEK_END);
|
||||
$filesize = ftell($a);
|
||||
fclose($a);
|
||||
return $filesize;
|
||||
}
|
||||
function kleeja_filesize($filename)
|
||||
{
|
||||
$a = fopen($filename, 'r');
|
||||
fseek($a, 0, SEEK_END);
|
||||
$filesize = ftell($a);
|
||||
fclose($a);
|
||||
return $filesize;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
function kleeja_filesize($filename)
|
||||
{
|
||||
return filesize($filename);
|
||||
}
|
||||
function kleeja_filesize($filename)
|
||||
{
|
||||
return filesize($filename);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!function_exists("array_column"))
|
||||
if (! function_exists('array_column'))
|
||||
{
|
||||
function array_column($array, $column_name)
|
||||
{
|
||||
return array_map(
|
||||
function($element) use($column_name)
|
||||
{
|
||||
return $element[$column_name];
|
||||
},
|
||||
array_values($array)
|
||||
);
|
||||
function($element) use ($column_name) {
|
||||
return $element[$column_name];
|
||||
},
|
||||
array_values($array)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -9,483 +9,490 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if(!defined("SQL_LAYER")):
|
||||
|
||||
define("SQL_LAYER","mysql4");
|
||||
if (! defined('SQL_LAYER')):
|
||||
|
||||
class SSQL
|
||||
define('SQL_LAYER', 'mysql4');
|
||||
|
||||
class SSQL
|
||||
{
|
||||
|
||||
var $connect_id = null;
|
||||
var $result;
|
||||
var $query_num = 0;
|
||||
var $in_transaction = 0;
|
||||
var $debugr = false;
|
||||
var $show_errors = true;
|
||||
public $connect_id = null;
|
||||
public $result;
|
||||
public $query_num = 0;
|
||||
public $in_transaction = 0;
|
||||
public $debugr = false;
|
||||
public $show_errors = true;
|
||||
|
||||
|
||||
/*
|
||||
* initiate the class
|
||||
* wirth basic data
|
||||
*/
|
||||
function __construct($host, $db_username, $db_password, $db_name, $new_link=false)
|
||||
{
|
||||
global $script_encoding;
|
||||
|
||||
$this->host= $host;
|
||||
$this->db_username = $db_username;
|
||||
$this->db_name = $db_name;
|
||||
$this->db_password = 'hidden';
|
||||
|
||||
//no error
|
||||
if(defined('MYSQL_NO_ERRORS'))
|
||||
{
|
||||
$this->show_errors = false;
|
||||
}
|
||||
/*
|
||||
* initiate the class
|
||||
* wirth basic data
|
||||
*/
|
||||
public function __construct($host, $db_username, $db_password, $db_name, $new_link=false)
|
||||
{
|
||||
global $script_encoding;
|
||||
|
||||
$this->connect_id = @mysql_connect($this->host, $this->db_username, $db_password, $new_link) or die($this->error_msg("we can not connect to the server ..."));
|
||||
$this->host = $host;
|
||||
$this->db_username = $db_username;
|
||||
$this->db_name = $db_name;
|
||||
$this->db_password = 'hidden';
|
||||
|
||||
if($this->connect_id)
|
||||
{
|
||||
#loggin -> connecting
|
||||
kleeja_log('[Connected] : ' . kleeja_get_page());
|
||||
//no error
|
||||
if (defined('MYSQL_NO_ERRORS'))
|
||||
{
|
||||
$this->show_errors = false;
|
||||
}
|
||||
|
||||
if(!empty($db_name))
|
||||
{
|
||||
$dbselect = @mysql_select_db($this->db_name) or die($this->error_msg("we can not select database"));
|
||||
|
||||
if ($dbselect)
|
||||
{
|
||||
#login -> selecting database
|
||||
kleeja_log('[Selected Database] :' . $this->connect_id);
|
||||
$this->connect_id = @mysql_connect($this->host, $this->db_username, $db_password, $new_link) or die($this->error_msg('we can not connect to the server ...'));
|
||||
|
||||
if ((!preg_match('/utf/i', strtolower($script_encoding)) && !defined('IN_LOGINPAGE') && !defined('IN_ADMIN_LOGIN') && !defined('DISABLE_INTR')) || ((empty($script_encoding) || preg_match('/utf/i', strtolower($script_encoding)) || defined('DISABLE_INTR'))))
|
||||
{
|
||||
if(mysql_query("SET NAMES 'utf8'"))
|
||||
{
|
||||
#loggin -> set utf8
|
||||
kleeja_log('[Set to UTF8] :' . $this->connect_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(!$dbselect)
|
||||
{
|
||||
#loggin -> no database -> close connection
|
||||
$this->close($this->connect_id);
|
||||
$this->connect_id = $dbselect;
|
||||
}
|
||||
}
|
||||
if ($this->connect_id)
|
||||
{
|
||||
//loggin -> connecting
|
||||
kleeja_log('[Connected] : ' . kleeja_get_page());
|
||||
|
||||
return $this->connect_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (! empty($db_name))
|
||||
{
|
||||
$dbselect = @mysql_select_db($this->db_name) or die($this->error_msg('we can not select database'));
|
||||
|
||||
/*
|
||||
* close the connection
|
||||
*/
|
||||
function close()
|
||||
{
|
||||
if( $this->connect_id )
|
||||
{
|
||||
// Commit any remaining transactions
|
||||
if( $this->in_transaction )
|
||||
{
|
||||
mysql_query("COMMIT", $this->connect_id);
|
||||
}
|
||||
if ($dbselect)
|
||||
{
|
||||
//login -> selecting database
|
||||
kleeja_log('[Selected Database] :' . $this->connect_id);
|
||||
|
||||
#loggin -> close connection
|
||||
kleeja_log('[Closing connection] :' . kleeja_get_page());
|
||||
if ((! preg_match('/utf/i', strtolower($script_encoding)) && ! defined('IN_LOGINPAGE') && ! defined('IN_ADMIN_LOGIN') && ! defined('DISABLE_INTR')) || ((empty($script_encoding) || preg_match('/utf/i', strtolower($script_encoding)) || defined('DISABLE_INTR'))))
|
||||
{
|
||||
if (mysql_query("SET NAMES 'utf8'"))
|
||||
{
|
||||
//loggin -> set utf8
|
||||
kleeja_log('[Set to UTF8] :' . $this->connect_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (! $dbselect)
|
||||
{
|
||||
//loggin -> no database -> close connection
|
||||
$this->close($this->connect_id);
|
||||
$this->connect_id = $dbselect;
|
||||
}
|
||||
}
|
||||
|
||||
return @mysql_close($this->connect_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return $this->connect_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* encoding functions
|
||||
*/
|
||||
function set_utf8()
|
||||
{
|
||||
return $this->set_names('utf8');
|
||||
}
|
||||
|
||||
function set_names($charset)
|
||||
{
|
||||
@mysql_query("SET NAMES '" . $charset . "'", $this->connect_id);
|
||||
}
|
||||
|
||||
function client_encoding()
|
||||
{
|
||||
return mysql_client_encoding($this->connect_id);
|
||||
}
|
||||
// close the connection
|
||||
public function close()
|
||||
{
|
||||
if ( $this->connect_id )
|
||||
{
|
||||
// Commit any remaining transactions
|
||||
if ( $this->in_transaction )
|
||||
{
|
||||
mysql_query('COMMIT', $this->connect_id);
|
||||
}
|
||||
|
||||
function mysql_version()
|
||||
{
|
||||
//version of mysql
|
||||
$vr = $this->query('SELECT VERSION() AS v');
|
||||
$vs = $this->fetch_array($vr);
|
||||
$vs = $vs['v'];
|
||||
return preg_replace('/^([^-]+).*$/', '\\1', $vs);
|
||||
}
|
||||
//loggin -> close connection
|
||||
kleeja_log('[Closing connection] :' . kleeja_get_page());
|
||||
|
||||
/*
|
||||
the query func . its so important to do
|
||||
the quries and give results
|
||||
*/
|
||||
function query($query, $transaction = FALSE)
|
||||
{
|
||||
//no connection
|
||||
if(!$this->connect_id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// Remove any pre-existing queries
|
||||
//
|
||||
unset($this->result);
|
||||
return @mysql_close($this->connect_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($query))
|
||||
{
|
||||
//debug .. //////////////
|
||||
$srartum_sql = get_microtime();
|
||||
////////////////
|
||||
// encoding functions
|
||||
public function set_utf8()
|
||||
{
|
||||
return $this->set_names('utf8');
|
||||
}
|
||||
|
||||
if( $transaction == 1 && !$this->in_transaction )
|
||||
{
|
||||
$result = mysql_query("BEGIN", $this->connect_id);
|
||||
if(!$result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->in_transaction = TRUE;
|
||||
}
|
||||
public function set_names($charset)
|
||||
{
|
||||
@mysql_query("SET NAMES '" . $charset . "'", $this->connect_id);
|
||||
}
|
||||
|
||||
$this->result = mysql_query($query, $this->connect_id);
|
||||
public function client_encoding()
|
||||
{
|
||||
return mysql_client_encoding($this->connect_id);
|
||||
}
|
||||
|
||||
//debug .. //////////////
|
||||
$this->debugr[$this->query_num+1] = array($query, sprintf('%.5f', get_microtime() - $srartum_sql));
|
||||
////////////////
|
||||
public function mysql_version()
|
||||
{
|
||||
//version of mysql
|
||||
$vr = $this->query('SELECT VERSION() AS v');
|
||||
$vs = $this->fetch_array($vr);
|
||||
$vs = $vs['v'];
|
||||
return preg_replace('/^([^-]+).*$/', '\\1', $vs);
|
||||
}
|
||||
|
||||
if(!$this->result)
|
||||
{
|
||||
$this->error_msg('Error In query');
|
||||
}
|
||||
else
|
||||
{
|
||||
//let's debug it
|
||||
kleeja_log('[Query] : --> ' . $query);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( $transaction == 2 && $this->in_transaction )
|
||||
{
|
||||
$this->result = mysql_query("COMMIT", $this->connect_id);
|
||||
}
|
||||
}
|
||||
/*
|
||||
the query func . its so important to do
|
||||
the quries and give results
|
||||
*/
|
||||
public function query($query, $transaction = false)
|
||||
{
|
||||
//no connection
|
||||
if (! $this->connect_id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//is there any result
|
||||
if($this->result)
|
||||
{
|
||||
if($transaction == 2 && $this->in_transaction)
|
||||
{
|
||||
$this->in_transaction = FALSE;
|
||||
//
|
||||
// Remove any pre-existing queries
|
||||
//
|
||||
unset($this->result);
|
||||
|
||||
if (!mysql_query("COMMIT", $this->connect_id))
|
||||
{
|
||||
mysql_query("ROLLBACK", $this->connect_id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (! empty($query))
|
||||
{
|
||||
//debug .. //////////////
|
||||
$srartum_sql = get_microtime();
|
||||
////////////////
|
||||
|
||||
$this->query_num++;
|
||||
if ( $transaction == 1 && ! $this->in_transaction )
|
||||
{
|
||||
$result = mysql_query('BEGIN', $this->connect_id);
|
||||
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( $this->in_transaction )
|
||||
{
|
||||
mysql_query("ROLLBACK", $this->connect_id);
|
||||
$this->in_transaction = FALSE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (! $result)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* query build
|
||||
*/
|
||||
function build($query)
|
||||
{
|
||||
$sql = '';
|
||||
$this->in_transaction = true;
|
||||
}
|
||||
|
||||
if (isset($query['SELECT']))
|
||||
{
|
||||
$sql = 'SELECT '.$query['SELECT'].' FROM '.$query['FROM'];
|
||||
$this->result = mysql_query($query, $this->connect_id);
|
||||
|
||||
if (isset($query['JOINS']))
|
||||
{
|
||||
foreach ($query['JOINS'] as $cur_join)
|
||||
$sql .= ' '.key($cur_join).' '. @current($cur_join).' ON '.$cur_join['ON'];
|
||||
}
|
||||
//debug .. //////////////
|
||||
$this->debugr[$this->query_num+1] = [$query, sprintf('%.5f', get_microtime() - $srartum_sql)];
|
||||
////////////////
|
||||
|
||||
if (!empty($query['WHERE']))
|
||||
$sql .= ' WHERE '.$query['WHERE'];
|
||||
if (!empty($query['GROUP BY']))
|
||||
$sql .= ' GROUP BY '.$query['GROUP BY'];
|
||||
if (!empty($query['HAVING']))
|
||||
$sql .= ' HAVING '.$query['HAVING'];
|
||||
if (!empty($query['ORDER BY']))
|
||||
$sql .= ' ORDER BY '.$query['ORDER BY'];
|
||||
if (!empty($query['LIMIT']))
|
||||
$sql .= ' LIMIT '.$query['LIMIT'];
|
||||
}
|
||||
else if (isset($query['INSERT']))
|
||||
{
|
||||
$sql = 'INSERT INTO '.$query['INTO'];
|
||||
if (! $this->result)
|
||||
{
|
||||
$this->error_msg('Error In query');
|
||||
}
|
||||
else
|
||||
{
|
||||
//let's debug it
|
||||
kleeja_log('[Query] : --> ' . $query);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $transaction == 2 && $this->in_transaction )
|
||||
{
|
||||
$this->result = mysql_query('COMMIT', $this->connect_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($query['INSERT']))
|
||||
$sql .= ' ('.$query['INSERT'].')';
|
||||
//is there any result
|
||||
if ($this->result)
|
||||
{
|
||||
if ($transaction == 2 && $this->in_transaction)
|
||||
{
|
||||
$this->in_transaction = false;
|
||||
|
||||
$sql .= ' VALUES('.$query['VALUES'].')';
|
||||
}
|
||||
else if (isset($query['UPDATE']))
|
||||
{
|
||||
$query['UPDATE'] = $query['UPDATE'];
|
||||
if (! mysql_query('COMMIT', $this->connect_id))
|
||||
{
|
||||
mysql_query('ROLLBACK', $this->connect_id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($query['PARAMS']['LOW_PRIORITY']))
|
||||
$query['UPDATE'] = 'LOW_PRIORITY '.$query['UPDATE'];
|
||||
$this->query_num++;
|
||||
|
||||
$sql = 'UPDATE '.$query['UPDATE'].' SET '.$query['SET'];
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $this->in_transaction )
|
||||
{
|
||||
mysql_query('ROLLBACK', $this->connect_id);
|
||||
$this->in_transaction = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($query['WHERE']))
|
||||
$sql .= ' WHERE '.$query['WHERE'];
|
||||
}
|
||||
else if (isset($query['DELETE']))
|
||||
{
|
||||
$sql = 'DELETE FROM '.$query['DELETE'];
|
||||
// query build
|
||||
public function build($query)
|
||||
{
|
||||
$sql = '';
|
||||
|
||||
if (!empty($query['WHERE']))
|
||||
$sql .= ' WHERE '.$query['WHERE'];
|
||||
}
|
||||
else if (isset($query['REPLACE']))
|
||||
{
|
||||
$sql = 'REPLACE INTO '.$query['INTO'];
|
||||
if (isset($query['SELECT']))
|
||||
{
|
||||
$sql = 'SELECT ' . $query['SELECT'] . ' FROM ' . $query['FROM'];
|
||||
|
||||
if (!empty($query['REPLACE']))
|
||||
$sql .= ' ('.$query['REPLACE'].')';
|
||||
if (isset($query['JOINS']))
|
||||
{
|
||||
foreach ($query['JOINS'] as $cur_join)
|
||||
{
|
||||
$sql .= ' ' . key($cur_join) . ' ' . @current($cur_join) . ' ON ' . $cur_join['ON'];
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= ' VALUES('.$query['VALUES'].')';
|
||||
}
|
||||
if (! empty($query['WHERE']))
|
||||
{
|
||||
$sql .= ' WHERE ' . $query['WHERE'];
|
||||
}
|
||||
|
||||
return $this->query($sql);
|
||||
}
|
||||
if (! empty($query['GROUP BY']))
|
||||
{
|
||||
$sql .= ' GROUP BY ' . $query['GROUP BY'];
|
||||
}
|
||||
|
||||
/*
|
||||
* free the memmory from the last results
|
||||
*/
|
||||
function free($query_id = 0)
|
||||
{
|
||||
return $this->freeresult($query_id);
|
||||
}
|
||||
if (! empty($query['HAVING']))
|
||||
{
|
||||
$sql .= ' HAVING ' . $query['HAVING'];
|
||||
}
|
||||
|
||||
function freeresult($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
if (! empty($query['ORDER BY']))
|
||||
{
|
||||
$sql .= ' ORDER BY ' . $query['ORDER BY'];
|
||||
}
|
||||
|
||||
if ($query_id)
|
||||
{
|
||||
mysql_free_result($query_id);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (! empty($query['LIMIT']))
|
||||
{
|
||||
$sql .= ' LIMIT ' . $query['LIMIT'];
|
||||
}
|
||||
}
|
||||
elseif (isset($query['INSERT']))
|
||||
{
|
||||
$sql = 'INSERT INTO ' . $query['INTO'];
|
||||
|
||||
/*
|
||||
* if the result is an arry ,
|
||||
* this func is so important to order them as a array
|
||||
*/
|
||||
function fetch($query_id = 0)
|
||||
{
|
||||
return $this->fetch_array($query_id);
|
||||
}
|
||||
if (! empty($query['INSERT']))
|
||||
{
|
||||
$sql .= ' (' . $query['INSERT'] . ')';
|
||||
}
|
||||
|
||||
function fetch_array($query_id = 0)
|
||||
{
|
||||
if( !$query_id )
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
$sql .= ' VALUES(' . $query['VALUES'] . ')';
|
||||
}
|
||||
elseif (isset($query['UPDATE']))
|
||||
{
|
||||
$query['UPDATE'] = $query['UPDATE'];
|
||||
|
||||
return $query_id ? mysql_fetch_array($query_id, MYSQL_ASSOC) : false;
|
||||
}
|
||||
if (isset($query['PARAMS']['LOW_PRIORITY']))
|
||||
{
|
||||
$query['UPDATE'] = 'LOW_PRIORITY ' . $query['UPDATE'];
|
||||
}
|
||||
|
||||
/*
|
||||
* if we have a result and we have to know
|
||||
* the number of it , this is a func ..
|
||||
*/
|
||||
function num_rows($query_id = 0)
|
||||
{
|
||||
if( !$query_id )
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
$sql = 'UPDATE ' . $query['UPDATE'] . ' SET ' . $query['SET'];
|
||||
|
||||
return $query_id ? mysql_num_rows($query_id) : false;
|
||||
}
|
||||
if (! empty($query['WHERE']))
|
||||
{
|
||||
$sql .= ' WHERE ' . $query['WHERE'];
|
||||
}
|
||||
}
|
||||
elseif (isset($query['DELETE']))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . $query['DELETE'];
|
||||
|
||||
|
||||
/*
|
||||
* last id inserted in sql
|
||||
*/
|
||||
function insert_id()
|
||||
{
|
||||
return ($this->connect_id) ? mysql_insert_id($this->connect_id) : false;
|
||||
}
|
||||
if (! empty($query['WHERE']))
|
||||
{
|
||||
$sql .= ' WHERE ' . $query['WHERE'];
|
||||
}
|
||||
}
|
||||
elseif (isset($query['REPLACE']))
|
||||
{
|
||||
$sql = 'REPLACE INTO ' . $query['INTO'];
|
||||
|
||||
/*
|
||||
* clean the qurery before insert it
|
||||
*/
|
||||
function escape($msg)
|
||||
{
|
||||
$msg = htmlspecialchars($msg , ENT_QUOTES);
|
||||
#$msg = (!get_magic_quotes_gpc()) ? addslashes ($msg) : $msg;
|
||||
$msg = $this->real_escape($msg);
|
||||
return $msg;
|
||||
}
|
||||
if (! empty($query['REPLACE']))
|
||||
{
|
||||
$sql .= ' (' . $query['REPLACE'] . ')';
|
||||
}
|
||||
|
||||
/*
|
||||
* real escape ..
|
||||
*/
|
||||
function real_escape($msg)
|
||||
{
|
||||
if (is_array($msg))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
else if (function_exists('mysql_real_escape_string'))
|
||||
{
|
||||
if(!$this-connect_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return mysql_real_escape_string($msg, $this->connect_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// because mysql_escape_string doesnt escape % & _[php.net/mysql_escape_string]
|
||||
//return addcslashes(mysql_escape_string($msg),'%_');
|
||||
return mysql_escape_string($msg);
|
||||
}
|
||||
}
|
||||
$sql .= ' VALUES(' . $query['VALUES'] . ')';
|
||||
}
|
||||
|
||||
/*
|
||||
* get affected records
|
||||
*/
|
||||
function affected()
|
||||
{
|
||||
return ( $this->connect_id ) ? mysql_affected_rows($this->connect_id) : false;
|
||||
}
|
||||
return $this->query($sql);
|
||||
}
|
||||
|
||||
/*
|
||||
* get the information of mysql server
|
||||
*/
|
||||
function server_info()
|
||||
{
|
||||
return 'MySQL ' . $this->mysql_version;
|
||||
}
|
||||
// free the memmory from the last results
|
||||
public function free($query_id = 0)
|
||||
{
|
||||
return $this->freeresult($query_id);
|
||||
}
|
||||
|
||||
/*
|
||||
error message func
|
||||
*/
|
||||
function error_msg($msg)
|
||||
{
|
||||
global $dbprefix;
|
||||
|
||||
if(!$this->show_errors)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public function freeresult($query_id = 0)
|
||||
{
|
||||
if (! $query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
|
||||
$error_no = mysql_errno();
|
||||
$error_msg = mysql_error();
|
||||
$error_sql = @current($this->debugr[$this->query_num+1]);
|
||||
|
||||
//some ppl want hide their table names, not in develoment stage
|
||||
if(!defined('DEV_STAGE'))
|
||||
{
|
||||
$error_sql = preg_replace("#\s{1,3}`*{$dbprefix}([a-z0-9]+)`*\s{1,3}#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#{$this->db_name}.{$dbprefix}([a-z0-9]+)#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_msg);
|
||||
$error_sql = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_msg);
|
||||
$error_msg = preg_replace("#\s'([^']+)'@'([^']+)'#ie", "' <span style=\"color:blue\">hidden</span>@$2 '", $error_msg);
|
||||
$error_sql = preg_replace("#password\s*=\s*'[^']+'#i", "password='<span style=\"color:blue\">hidden</span>'", $error_sql);
|
||||
}
|
||||
if ($query_id)
|
||||
{
|
||||
mysql_free_result($query_id);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#is this error related to updating?
|
||||
$updating_related = false;
|
||||
if(strpos($error_msg, 'Unknown column') !== false)
|
||||
{
|
||||
$updating_related = true;
|
||||
}
|
||||
/*
|
||||
* if the result is an arry ,
|
||||
* this func is so important to order them as a array
|
||||
*/
|
||||
public function fetch($query_id = 0)
|
||||
{
|
||||
return $this->fetch_array($query_id);
|
||||
}
|
||||
|
||||
echo "<html><head><title>ERROR IM MYSQL</title>";
|
||||
echo "<style>BODY{FONT-FAMILY:tahoma;FONT-SIZE:12px;}.error {}</style></head><body>";
|
||||
echo '<br />';
|
||||
echo '<div class="error">';
|
||||
echo " <a href='#' onclick='window.location.reload( false );'>click to Refresh this page ...</a><br />";
|
||||
echo "<h2>Sorry , There is an error in mysql " . ($msg !='' ? ", error : $msg" : "") ."</h2>";
|
||||
if($error_sql != '')
|
||||
{
|
||||
echo "<br />--[query]-------------------------- <br />$error_sql<br />---------------------------------<br /><br />";
|
||||
}
|
||||
echo "[$error_no : $error_msg] <br />";
|
||||
if($updating_related)
|
||||
{
|
||||
global $config;
|
||||
echo "<br /><strong>Your Kleeja database seems to be old, try to update it now from: " . $config['siteurl'] . "install/</strong>";
|
||||
}
|
||||
echo "<br /><br /><strong>Script: Kleeja <br /><a href='http://www.kleeja.com'>Kleeja Website</a></strong>";
|
||||
echo '</b></div>';
|
||||
echo '</body></html>';
|
||||
|
||||
#loggin -> error
|
||||
kleeja_log('[SQL ERROR] : "' . $error_no . ' : ' . $error_msg . '" ' . $this->connect_id);
|
||||
|
||||
@$this->close();
|
||||
exit();
|
||||
}
|
||||
public function fetch_array($query_id = 0)
|
||||
{
|
||||
if ( ! $query_id )
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
|
||||
/*
|
||||
* return last error
|
||||
*/
|
||||
function get_error()
|
||||
{
|
||||
return array(mysql_errno(), mysql_error());
|
||||
}
|
||||
return $query_id ? mysql_fetch_array($query_id, MYSQL_ASSOC) : false;
|
||||
}
|
||||
|
||||
}#end of class
|
||||
/*
|
||||
* if we have a result and we have to know
|
||||
* the number of it , this is a func ..
|
||||
*/
|
||||
public function num_rows($query_id = 0)
|
||||
{
|
||||
if ( ! $query_id )
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
|
||||
return $query_id ? mysql_num_rows($query_id) : false;
|
||||
}
|
||||
|
||||
|
||||
// last id inserted in sql
|
||||
public function insert_id()
|
||||
{
|
||||
return ($this->connect_id) ? mysql_insert_id($this->connect_id) : false;
|
||||
}
|
||||
|
||||
// clean the qurery before insert it
|
||||
public function escape($msg)
|
||||
{
|
||||
$msg = htmlspecialchars($msg, ENT_QUOTES);
|
||||
//$msg = (!get_magic_quotes_gpc()) ? addslashes ($msg) : $msg;
|
||||
$msg = $this->real_escape($msg);
|
||||
return $msg;
|
||||
}
|
||||
|
||||
// real escape ..
|
||||
public function real_escape($msg)
|
||||
{
|
||||
if (is_array($msg))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
elseif (function_exists('mysql_real_escape_string'))
|
||||
{
|
||||
if (! $this-connect_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return mysql_real_escape_string($msg, $this->connect_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// because mysql_escape_string doesnt escape % & _[php.net/mysql_escape_string]
|
||||
//return addcslashes(mysql_escape_string($msg),'%_');
|
||||
return mysql_escape_string($msg);
|
||||
}
|
||||
}
|
||||
|
||||
// get affected records
|
||||
public function affected()
|
||||
{
|
||||
return ( $this->connect_id ) ? mysql_affected_rows($this->connect_id) : false;
|
||||
}
|
||||
|
||||
// get the information of mysql server
|
||||
public function server_info()
|
||||
{
|
||||
return 'MySQL ' . $this->mysql_version;
|
||||
}
|
||||
|
||||
// error message func
|
||||
public function error_msg($msg)
|
||||
{
|
||||
global $dbprefix;
|
||||
|
||||
if (! $this->show_errors)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$error_no = mysql_errno();
|
||||
$error_msg = mysql_error();
|
||||
$error_sql = @current($this->debugr[$this->query_num+1]);
|
||||
|
||||
//some ppl want hide their table names, not in develoment stage
|
||||
if (! defined('DEV_STAGE'))
|
||||
{
|
||||
$error_sql = preg_replace("#\s{1,3}`*{$dbprefix}([a-z0-9]+)`*\s{1,3}#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#{$this->db_name}.{$dbprefix}([a-z0-9]+)#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_msg);
|
||||
$error_sql = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_msg);
|
||||
$error_msg = preg_replace("#\s'([^']+)'@'([^']+)'#ie", "' <span style=\"color:blue\">hidden</span>@$2 '", $error_msg);
|
||||
$error_sql = preg_replace("#password\s*=\s*'[^']+'#i", "password='<span style=\"color:blue\">hidden</span>'", $error_sql);
|
||||
}
|
||||
|
||||
//is this error related to updating?
|
||||
$updating_related = false;
|
||||
|
||||
if (strpos($error_msg, 'Unknown column') !== false)
|
||||
{
|
||||
$updating_related = true;
|
||||
}
|
||||
|
||||
echo '<html><head><title>ERROR IM MYSQL</title>';
|
||||
echo '<style>BODY{FONT-FAMILY:tahoma;FONT-SIZE:12px;}.error {}</style></head><body>';
|
||||
echo '<br />';
|
||||
echo '<div class="error">';
|
||||
echo " <a href='#' onclick='window.location.reload( false );'>click to Refresh this page ...</a><br />";
|
||||
echo '<h2>Sorry , There is an error in mysql ' . ($msg !='' ? ", error : $msg" : '') . '</h2>';
|
||||
|
||||
if ($error_sql != '')
|
||||
{
|
||||
echo "<br />--[query]-------------------------- <br />$error_sql<br />---------------------------------<br /><br />";
|
||||
}
|
||||
echo "[$error_no : $error_msg] <br />";
|
||||
|
||||
if ($updating_related)
|
||||
{
|
||||
global $config;
|
||||
echo '<br /><strong>Your Kleeja database seems to be old, try to update it now from: ' . $config['siteurl'] . 'install/</strong>';
|
||||
}
|
||||
echo "<br /><br /><strong>Script: Kleeja <br /><a href='http://www.kleeja.com'>Kleeja Website</a></strong>";
|
||||
echo '</b></div>';
|
||||
echo '</body></html>';
|
||||
|
||||
//loggin -> error
|
||||
kleeja_log('[SQL ERROR] : "' . $error_no . ' : ' . $error_msg . '" ' . $this->connect_id);
|
||||
|
||||
@$this->close();
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
// return last error
|
||||
public function get_error()
|
||||
{
|
||||
return [mysql_errno(), mysql_error()];
|
||||
}
|
||||
}//end of class
|
||||
|
||||
endif;
|
||||
|
||||
@@ -9,483 +9,488 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
if(!defined("SQL_LAYER")):
|
||||
if (! defined('SQL_LAYER')):
|
||||
|
||||
define("SQL_LAYER","mysqli");
|
||||
define('SQL_LAYER', 'mysqli');
|
||||
|
||||
class KleejaDatabase
|
||||
{
|
||||
var $connect_id = null;
|
||||
var $result;
|
||||
var $query_num = 0;
|
||||
var $in_transaction = 0;
|
||||
var $debugr = false;
|
||||
var $show_errors = true;
|
||||
public $connect_id = null;
|
||||
public $result;
|
||||
public $query_num = 0;
|
||||
public $in_transaction = 0;
|
||||
public $debugr = false;
|
||||
public $show_errors = true;
|
||||
|
||||
|
||||
/*
|
||||
* initiate the class
|
||||
* with basic data
|
||||
*/
|
||||
function __construct($host, $db_username, $db_password, $db_name, $new_link = false)
|
||||
{
|
||||
global $script_encoding;
|
||||
|
||||
$host .= strpos($host, ':') !== false ? '' : ':';
|
||||
$this->host = substr($host, 0, strpos($host, ':'));
|
||||
$this->port = (int) substr($host, strpos($host, ':')+1);
|
||||
$this->db_username = $db_username;
|
||||
$this->db_name = $db_name;
|
||||
$this->db_password = 'hidden';
|
||||
|
||||
$this->connect_id = @mysqli_connect($this->host, $this->db_username, $db_password, $this->db_name, (!$this->port ? 3306 : $this->port ));
|
||||
|
||||
//no error
|
||||
if(defined('MYSQL_NO_ERRORS'))
|
||||
{
|
||||
$this->show_errors = false;
|
||||
}
|
||||
|
||||
|
||||
if(!$this->connect_id)
|
||||
{
|
||||
#loggin -> no database -> close connection
|
||||
$this->close();
|
||||
$this->error_msg("we can not connect to the server ...");
|
||||
return false;
|
||||
}
|
||||
|
||||
#loggin -> connecting
|
||||
kleeja_log('[Connected] : ' . kleeja_get_page());
|
||||
|
||||
|
||||
if ((!preg_match('/utf/i', strtolower($script_encoding)) && !defined('IN_LOGINPAGE') && !defined('IN_ADMIN_LOGIN') && !defined('DISABLE_INTR')) || (empty($script_encoding) || preg_match('/utf/i', strtolower($script_encoding)) || defined('DISABLE_INTR')))
|
||||
{
|
||||
if(mysqli_set_charset($this->connect_id, 'utf8'))
|
||||
{
|
||||
#loggin -> set utf8
|
||||
kleeja_log('[Set to UTF8] : --> ');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->connect_id;
|
||||
}
|
||||
|
||||
function is_connected()
|
||||
/*
|
||||
* initiate the class
|
||||
* with basic data
|
||||
*/
|
||||
public function __construct($host, $db_username, $db_password, $db_name, $new_link = false)
|
||||
{
|
||||
return !(is_null($this->connect_id) || empty($this->connect_id));
|
||||
global $script_encoding;
|
||||
|
||||
$host .= strpos($host, ':') !== false ? '' : ':';
|
||||
$this->host = substr($host, 0, strpos($host, ':'));
|
||||
$this->port = (int) substr($host, strpos($host, ':')+1);
|
||||
$this->db_username = $db_username;
|
||||
$this->db_name = $db_name;
|
||||
$this->db_password = 'hidden';
|
||||
|
||||
$this->connect_id = @mysqli_connect($this->host, $this->db_username, $db_password, $this->db_name, (! $this->port ? 3306 : $this->port ));
|
||||
|
||||
//no error
|
||||
if (defined('MYSQL_NO_ERRORS'))
|
||||
{
|
||||
$this->show_errors = false;
|
||||
}
|
||||
|
||||
|
||||
if (! $this->connect_id)
|
||||
{
|
||||
//loggin -> no database -> close connection
|
||||
$this->close();
|
||||
$this->error_msg('we can not connect to the server ...');
|
||||
return false;
|
||||
}
|
||||
|
||||
//loggin -> connecting
|
||||
kleeja_log('[Connected] : ' . kleeja_get_page());
|
||||
|
||||
|
||||
if ((! preg_match('/utf/i', strtolower($script_encoding)) && ! defined('IN_LOGINPAGE') && ! defined('IN_ADMIN_LOGIN') && ! defined('DISABLE_INTR')) || (empty($script_encoding) || preg_match('/utf/i', strtolower($script_encoding)) || defined('DISABLE_INTR')))
|
||||
{
|
||||
if (mysqli_set_charset($this->connect_id, 'utf8'))
|
||||
{
|
||||
//loggin -> set utf8
|
||||
kleeja_log('[Set to UTF8] : --> ');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->connect_id;
|
||||
}
|
||||
|
||||
/*
|
||||
* close the connection
|
||||
*/
|
||||
function close()
|
||||
{
|
||||
if($this->connect_id)
|
||||
{
|
||||
// Commit any remaining transactions
|
||||
if($this->in_transaction)
|
||||
{
|
||||
mysqli_commit($this->connect_id);
|
||||
}
|
||||
public function is_connected()
|
||||
{
|
||||
return ! (is_null($this->connect_id) || empty($this->connect_id));
|
||||
}
|
||||
|
||||
#loggin -> close connection
|
||||
kleeja_log('[Closing connection] : ' . kleeja_get_page());
|
||||
// close the connection
|
||||
public function close()
|
||||
{
|
||||
if ($this->connect_id)
|
||||
{
|
||||
// Commit any remaining transactions
|
||||
if ($this->in_transaction)
|
||||
{
|
||||
mysqli_commit($this->connect_id);
|
||||
}
|
||||
|
||||
return @mysqli_close($this->connect_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* encoding functions
|
||||
*/
|
||||
function set_utf8()
|
||||
{
|
||||
//loggin -> close connection
|
||||
kleeja_log('[Closing connection] : ' . kleeja_get_page());
|
||||
|
||||
return @mysqli_close($this->connect_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// encoding functions
|
||||
public function set_utf8()
|
||||
{
|
||||
$this->set_names('utf8');
|
||||
}
|
||||
|
||||
function set_names($charset)
|
||||
{
|
||||
@mysqli_set_charset($this->connect_id, $charset);
|
||||
}
|
||||
|
||||
function client_encoding()
|
||||
{
|
||||
}
|
||||
|
||||
public function set_names($charset)
|
||||
{
|
||||
@mysqli_set_charset($this->connect_id, $charset);
|
||||
}
|
||||
|
||||
public function client_encoding()
|
||||
{
|
||||
return mysqli_character_set_name($this->connect_id);
|
||||
}
|
||||
|
||||
function mysql_version()
|
||||
{
|
||||
$vr = $this->query('SELECT VERSION() AS v');
|
||||
$vs = $this->fetch_array($vr);
|
||||
$vs = $vs['v'];
|
||||
return preg_replace('/^([^-]+).*$/', '\\1', $vs);
|
||||
}
|
||||
|
||||
/*
|
||||
* the query func . its so important to do
|
||||
* the quries and give results
|
||||
*/
|
||||
function query($query, $transaction = false)
|
||||
{
|
||||
//no connection
|
||||
if(!$this->connect_id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Remove any pre-existing queries
|
||||
//
|
||||
unset($this->result);
|
||||
|
||||
if(!empty($query))
|
||||
{
|
||||
//debug .. //////////////
|
||||
$srartum_sql = get_microtime();
|
||||
////////////////
|
||||
public function mysql_version()
|
||||
{
|
||||
$vr = $this->query('SELECT VERSION() AS v');
|
||||
$vs = $this->fetch_array($vr);
|
||||
$vs = $vs['v'];
|
||||
return preg_replace('/^([^-]+).*$/', '\\1', $vs);
|
||||
}
|
||||
|
||||
if($transaction == 1 && !$this->in_transaction)
|
||||
{
|
||||
if(!mysqli_autocommit($this->connect_id, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->in_transaction = TRUE;
|
||||
}
|
||||
/*
|
||||
* the query func . its so important to do
|
||||
* the quries and give results
|
||||
*/
|
||||
public function query($query, $transaction = false)
|
||||
{
|
||||
//no connection
|
||||
if (! $this->connect_id)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->result = mysqli_query($this->connect_id, $query);
|
||||
//
|
||||
// Remove any pre-existing queries
|
||||
//
|
||||
unset($this->result);
|
||||
|
||||
//debug .. //////////////
|
||||
$this->debugr[$this->query_num+1] = array($query, sprintf('%.5f', get_microtime() - $srartum_sql));
|
||||
////////////////
|
||||
if (! empty($query))
|
||||
{
|
||||
//debug .. //////////////
|
||||
$srartum_sql = get_microtime();
|
||||
////////////////
|
||||
|
||||
if(!$this->result)
|
||||
{
|
||||
$this->error_msg('Error In query');
|
||||
}
|
||||
else
|
||||
{
|
||||
//let's debug it
|
||||
kleeja_log('[Query] : --> ' . $query);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( $transaction == 2 && $this->in_transaction )
|
||||
{
|
||||
$this->result = mysqli_commit($this->connect_id);
|
||||
}
|
||||
}
|
||||
|
||||
//is there any result
|
||||
if($this->result)
|
||||
{
|
||||
if($transaction == 2 && $this->in_transaction)
|
||||
{
|
||||
$this->in_transaction = false;
|
||||
if ($transaction == 1 && ! $this->in_transaction)
|
||||
{
|
||||
if (! mysqli_autocommit($this->connect_id, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!mysqli_commit($this->connect_id))
|
||||
{
|
||||
mysqli_rollback($this->connect_id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$this->in_transaction = true;
|
||||
}
|
||||
|
||||
$this->query_num++;
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->in_transaction)
|
||||
{
|
||||
mysqli_rollback($this->connect_id);
|
||||
$this->in_transaction = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* query build
|
||||
*/
|
||||
function build($query)
|
||||
{
|
||||
$sql = '';
|
||||
$this->result = mysqli_query($this->connect_id, $query);
|
||||
|
||||
if (isset($query['SELECT']))
|
||||
{
|
||||
$sql = 'SELECT '.$query['SELECT'].' FROM '.$query['FROM'];
|
||||
//debug .. //////////////
|
||||
$this->debugr[$this->query_num+1] = [$query, sprintf('%.5f', get_microtime() - $srartum_sql)];
|
||||
////////////////
|
||||
|
||||
if (isset($query['JOINS']))
|
||||
{
|
||||
foreach ($query['JOINS'] as $cur_join)
|
||||
$sql .= ' '.key($cur_join).' '. @current($cur_join).' ON '.$cur_join['ON'];
|
||||
}
|
||||
if (! $this->result)
|
||||
{
|
||||
$this->error_msg('Error In query');
|
||||
}
|
||||
else
|
||||
{
|
||||
//let's debug it
|
||||
kleeja_log('[Query] : --> ' . $query);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( $transaction == 2 && $this->in_transaction )
|
||||
{
|
||||
$this->result = mysqli_commit($this->connect_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($query['WHERE']))
|
||||
$sql .= ' WHERE '.$query['WHERE'];
|
||||
if (!empty($query['GROUP BY']))
|
||||
$sql .= ' GROUP BY '.$query['GROUP BY'];
|
||||
if (!empty($query['HAVING']))
|
||||
$sql .= ' HAVING '.$query['HAVING'];
|
||||
if (!empty($query['ORDER BY']))
|
||||
$sql .= ' ORDER BY '.$query['ORDER BY'];
|
||||
if (!empty($query['LIMIT']))
|
||||
$sql .= ' LIMIT '.$query['LIMIT'];
|
||||
}
|
||||
else if (isset($query['INSERT']))
|
||||
{
|
||||
$sql = 'INSERT INTO '.$query['INTO'];
|
||||
//is there any result
|
||||
if ($this->result)
|
||||
{
|
||||
if ($transaction == 2 && $this->in_transaction)
|
||||
{
|
||||
$this->in_transaction = false;
|
||||
|
||||
if (!empty($query['INSERT']))
|
||||
$sql .= ' ('.$query['INSERT'].')';
|
||||
if (! mysqli_commit($this->connect_id))
|
||||
{
|
||||
mysqli_rollback($this->connect_id);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$sql .= ' VALUES('.$query['VALUES'].')';
|
||||
}
|
||||
else if (isset($query['UPDATE']))
|
||||
{
|
||||
if (isset($query['PARAMS']['LOW_PRIORITY']))
|
||||
$query['UPDATE'] = 'LOW_PRIORITY '.$query['UPDATE'];
|
||||
$this->query_num++;
|
||||
return $this->result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->in_transaction)
|
||||
{
|
||||
mysqli_rollback($this->connect_id);
|
||||
$this->in_transaction = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.$query['UPDATE'].' SET '.$query['SET'];
|
||||
// query build
|
||||
public function build($query)
|
||||
{
|
||||
$sql = '';
|
||||
|
||||
if (!empty($query['WHERE']))
|
||||
$sql .= ' WHERE '.$query['WHERE'];
|
||||
}
|
||||
else if (isset($query['DELETE']))
|
||||
{
|
||||
$sql = 'DELETE FROM '.$query['DELETE'];
|
||||
if (isset($query['SELECT']))
|
||||
{
|
||||
$sql = 'SELECT ' . $query['SELECT'] . ' FROM ' . $query['FROM'];
|
||||
|
||||
if (!empty($query['WHERE']))
|
||||
$sql .= ' WHERE '.$query['WHERE'];
|
||||
}
|
||||
else if (isset($query['REPLACE']))
|
||||
{
|
||||
$sql = 'REPLACE INTO '.$query['INTO'];
|
||||
if (isset($query['JOINS']))
|
||||
{
|
||||
foreach ($query['JOINS'] as $cur_join)
|
||||
{
|
||||
$sql .= ' ' . key($cur_join) . ' ' . @current($cur_join) . ' ON ' . $cur_join['ON'];
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($query['REPLACE']))
|
||||
$sql .= ' ('.$query['REPLACE'].')';
|
||||
if (! empty($query['WHERE']))
|
||||
{
|
||||
$sql .= ' WHERE ' . $query['WHERE'];
|
||||
}
|
||||
|
||||
$sql .= ' VALUES('.$query['VALUES'].')';
|
||||
}
|
||||
if (! empty($query['GROUP BY']))
|
||||
{
|
||||
$sql .= ' GROUP BY ' . $query['GROUP BY'];
|
||||
}
|
||||
|
||||
return $this->query($sql);
|
||||
}
|
||||
if (! empty($query['HAVING']))
|
||||
{
|
||||
$sql .= ' HAVING ' . $query['HAVING'];
|
||||
}
|
||||
|
||||
/*
|
||||
* free the memmory from the last results
|
||||
*/
|
||||
function free($query_id = 0)
|
||||
{
|
||||
return $this->freeresult($query_id);
|
||||
}
|
||||
|
||||
function freeresult($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
if (! empty($query['ORDER BY']))
|
||||
{
|
||||
$sql .= ' ORDER BY ' . $query['ORDER BY'];
|
||||
}
|
||||
|
||||
if ($query_id)
|
||||
{
|
||||
mysqli_free_result($query_id);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (! empty($query['LIMIT']))
|
||||
{
|
||||
$sql .= ' LIMIT ' . $query['LIMIT'];
|
||||
}
|
||||
}
|
||||
elseif (isset($query['INSERT']))
|
||||
{
|
||||
$sql = 'INSERT INTO ' . $query['INTO'];
|
||||
|
||||
/*
|
||||
* if the result is an arry ,
|
||||
* this func is so important to order them as a array
|
||||
*/
|
||||
function fetch($query_id = 0)
|
||||
{
|
||||
return $this->fetch_array($query_id);
|
||||
}
|
||||
|
||||
function fetch_array($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
|
||||
return $query_id ? mysqli_fetch_array($query_id, MYSQLI_ASSOC) : false;
|
||||
}
|
||||
if (! empty($query['INSERT']))
|
||||
{
|
||||
$sql .= ' (' . $query['INSERT'] . ')';
|
||||
}
|
||||
|
||||
/*
|
||||
* if we have a result and we have to know
|
||||
* the number of it , this is a func ..
|
||||
*/
|
||||
function num_rows($query_id = 0)
|
||||
{
|
||||
if(!$query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
$sql .= ' VALUES(' . $query['VALUES'] . ')';
|
||||
}
|
||||
elseif (isset($query['UPDATE']))
|
||||
{
|
||||
if (isset($query['PARAMS']['LOW_PRIORITY']))
|
||||
{
|
||||
$query['UPDATE'] = 'LOW_PRIORITY ' . $query['UPDATE'];
|
||||
}
|
||||
|
||||
return $query_id ? mysqli_num_rows($query_id) : false;
|
||||
}
|
||||
$sql = 'UPDATE ' . $query['UPDATE'] . ' SET ' . $query['SET'];
|
||||
|
||||
|
||||
/*
|
||||
* last id inserted in sql
|
||||
*/
|
||||
function insert_id()
|
||||
{
|
||||
return $this->connect_id ? mysqli_insert_id($this->connect_id) : false;
|
||||
}
|
||||
if (! empty($query['WHERE']))
|
||||
{
|
||||
$sql .= ' WHERE ' . $query['WHERE'];
|
||||
}
|
||||
}
|
||||
elseif (isset($query['DELETE']))
|
||||
{
|
||||
$sql = 'DELETE FROM ' . $query['DELETE'];
|
||||
|
||||
/*
|
||||
* clean the qurery before insert it
|
||||
*/
|
||||
function escape($msg)
|
||||
{
|
||||
$msg = htmlspecialchars($msg , ENT_QUOTES);
|
||||
#$msg = (!get_magic_quotes_gpc()) ? addslashes ($msg) : $msg;
|
||||
$msg = $this->real_escape($msg);
|
||||
return $msg;
|
||||
}
|
||||
if (! empty($query['WHERE']))
|
||||
{
|
||||
$sql .= ' WHERE ' . $query['WHERE'];
|
||||
}
|
||||
}
|
||||
elseif (isset($query['REPLACE']))
|
||||
{
|
||||
$sql = 'REPLACE INTO ' . $query['INTO'];
|
||||
|
||||
/*
|
||||
* real escape ..
|
||||
*/
|
||||
/**
|
||||
* @param string|array $msg
|
||||
* @return int|string
|
||||
*/
|
||||
function real_escape($msg)
|
||||
{
|
||||
if (is_array($msg) && !$this->connect_id)
|
||||
{
|
||||
return $msg;
|
||||
}
|
||||
if (! empty($query['REPLACE']))
|
||||
{
|
||||
$sql .= ' (' . $query['REPLACE'] . ')';
|
||||
}
|
||||
|
||||
if(!$this->connect_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
$sql .= ' VALUES(' . $query['VALUES'] . ')';
|
||||
}
|
||||
|
||||
//escaping _ made alot of problems
|
||||
//return addcslashes(mysqli_real_escape_string($this->connect_id, $msg), '%_');
|
||||
return mysqli_real_escape_string($this->connect_id, $msg);
|
||||
}
|
||||
return $this->query($sql);
|
||||
}
|
||||
|
||||
/*
|
||||
* get affected records
|
||||
*/
|
||||
function affected()
|
||||
{
|
||||
return $this->connect_id ? mysqli_affected_rows($this->connect_id) : false;
|
||||
}
|
||||
// free the memmory from the last results
|
||||
public function free($query_id = 0)
|
||||
{
|
||||
return $this->freeresult($query_id);
|
||||
}
|
||||
|
||||
/*
|
||||
* get the information of mysql server
|
||||
*/
|
||||
function server_info()
|
||||
{
|
||||
return 'MySQLi ' . $this->mysql_version;
|
||||
}
|
||||
public function freeresult($query_id = 0)
|
||||
{
|
||||
if (! $query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
|
||||
/*
|
||||
* error message func
|
||||
*/
|
||||
function error_msg($msg)
|
||||
{
|
||||
global $dbprefix;
|
||||
if ($query_id)
|
||||
{
|
||||
mysqli_free_result($query_id);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(!$this->show_errors)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
* if the result is an arry ,
|
||||
* this func is so important to order them as a array
|
||||
*/
|
||||
public function fetch($query_id = 0)
|
||||
{
|
||||
return $this->fetch_array($query_id);
|
||||
}
|
||||
|
||||
$error_no = $this->connect_id ? @mysqli_errno($this->connect_id) : @mysqli_connect_errno();
|
||||
$error_msg = $this->connect_id ? @mysqli_error($this->connect_id) : @mysqli_connect_error();
|
||||
$error_sql = @current($this->debugr[$this->query_num+1]);
|
||||
public function fetch_array($query_id = 0)
|
||||
{
|
||||
if (! $query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
|
||||
//some ppl want hide their table names
|
||||
if(!defined('DEV_STAGE'))
|
||||
{
|
||||
$error_sql = preg_replace("#\s{1,3}`*{$dbprefix}([a-z0-9]+)`*\s{1,3}#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#{$this->db_name}.{$dbprefix}([a-z0-9]+)#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_msg);
|
||||
$error_sql = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_msg);
|
||||
$error_msg = preg_replace("#\s'([^']+)'@'([^']+)'#ie", "' <span style=\"color:blue\">hidden</span>@$2 '", $error_msg);
|
||||
$error_sql = preg_replace("#password\s*=\s*'[^']+'#i", "password='<span style=\"color:blue\">hidden</span>'", $error_sql);
|
||||
}
|
||||
return $query_id ? mysqli_fetch_array($query_id, MYSQLI_ASSOC) : false;
|
||||
}
|
||||
|
||||
#is this error related to updating?
|
||||
$updating_related = false;
|
||||
if(strpos($error_msg, 'Unknown column') !== false)
|
||||
{
|
||||
$updating_related = true;
|
||||
}
|
||||
/*
|
||||
* if we have a result and we have to know
|
||||
* the number of it , this is a func ..
|
||||
*/
|
||||
public function num_rows($query_id = 0)
|
||||
{
|
||||
if (! $query_id)
|
||||
{
|
||||
$query_id = $this->result;
|
||||
}
|
||||
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
$error_message = "<html><head><title>ERROR IM MYSQL</title>";
|
||||
return $query_id ? mysqli_num_rows($query_id) : false;
|
||||
}
|
||||
|
||||
|
||||
// last id inserted in sql
|
||||
public function insert_id()
|
||||
{
|
||||
return $this->connect_id ? mysqli_insert_id($this->connect_id) : false;
|
||||
}
|
||||
|
||||
// clean the qurery before insert it
|
||||
public function escape($msg)
|
||||
{
|
||||
$msg = htmlspecialchars($msg, ENT_QUOTES);
|
||||
//$msg = (!get_magic_quotes_gpc()) ? addslashes ($msg) : $msg;
|
||||
$msg = $this->real_escape($msg);
|
||||
return $msg;
|
||||
}
|
||||
|
||||
// real escape ..
|
||||
/**
|
||||
* @param string|array $msg
|
||||
* @return int|string
|
||||
*/
|
||||
public function real_escape($msg)
|
||||
{
|
||||
if (is_array($msg) && ! $this->connect_id)
|
||||
{
|
||||
return $msg;
|
||||
}
|
||||
|
||||
if (! $this->connect_id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//escaping _ made alot of problems
|
||||
//return addcslashes(mysqli_real_escape_string($this->connect_id, $msg), '%_');
|
||||
return mysqli_real_escape_string($this->connect_id, $msg);
|
||||
}
|
||||
|
||||
// get affected records
|
||||
public function affected()
|
||||
{
|
||||
return $this->connect_id ? mysqli_affected_rows($this->connect_id) : false;
|
||||
}
|
||||
|
||||
// get the information of mysql server
|
||||
public function server_info()
|
||||
{
|
||||
return 'MySQLi ' . $this->mysql_version;
|
||||
}
|
||||
|
||||
// error message func
|
||||
public function error_msg($msg)
|
||||
{
|
||||
global $dbprefix;
|
||||
|
||||
if (! $this->show_errors)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$error_no = $this->connect_id ? @mysqli_errno($this->connect_id) : @mysqli_connect_errno();
|
||||
$error_msg = $this->connect_id ? @mysqli_error($this->connect_id) : @mysqli_connect_error();
|
||||
$error_sql = @current($this->debugr[$this->query_num+1]);
|
||||
|
||||
//some ppl want hide their table names
|
||||
if (! defined('DEV_STAGE'))
|
||||
{
|
||||
$error_sql = preg_replace("#\s{1,3}`*{$dbprefix}([a-z0-9]+)`*\s{1,3}#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#{$this->db_name}.{$dbprefix}([a-z0-9]+)#e", "' <span style=\"color:blue\">' . substr('$1', 0, 1) . '</span> '", $error_msg);
|
||||
$error_sql = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_sql);
|
||||
$error_msg = preg_replace("#\s{1,3}(from|update|into)\s{1,3}([a-z0-9]+)\s{1,3}#ie", "' $1 <span style=\"color:blue\">' . substr('$2', 0, 1) . '</span> '", $error_msg);
|
||||
$error_msg = preg_replace("#\s'([^']+)'@'([^']+)'#ie", "' <span style=\"color:blue\">hidden</span>@$2 '", $error_msg);
|
||||
$error_sql = preg_replace("#password\s*=\s*'[^']+'#i", "password='<span style=\"color:blue\">hidden</span>'", $error_sql);
|
||||
}
|
||||
|
||||
//is this error related to updating?
|
||||
$updating_related = false;
|
||||
|
||||
if (strpos($error_msg, 'Unknown column') !== false)
|
||||
{
|
||||
$updating_related = true;
|
||||
}
|
||||
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
$error_message = '<html><head><title>ERROR IM MYSQL</title>';
|
||||
$error_message .= "<style>BODY{font-family:'Tahoma',serif;font-size:12px;}.error {}</style></head><body>";
|
||||
$error_message .= '<br />';
|
||||
$error_message .= '<div class="error">';
|
||||
$error_message .= " <a href='#' onclick='window.location.reload( false );'>click to Refresh this page ...</a><br />";
|
||||
$error_message .= "<h2>Sorry , There is an error in mysql " . ($msg !='' ? ", error : $msg" : "") ."</h2>";
|
||||
if($error_sql != '')
|
||||
{
|
||||
$error_message .= "<br />--[query]-------------------------- <br />$error_sql<br />---------------------------------<br /><br />";
|
||||
}
|
||||
$error_message .= "[$error_no : $error_msg] <br />";
|
||||
if($updating_related)
|
||||
{
|
||||
global $config;
|
||||
$error_message .= "<br /><strong>Your Kleeja database might be old, try to update it now from: " . rtrim($config['siteurl'], '/') . "/install</strong>";
|
||||
$error_message .= '<br />';
|
||||
$error_message .= '<div class="error">';
|
||||
$error_message .= " <a href='#' onclick='window.location.reload( false );'>click to Refresh this page ...</a><br />";
|
||||
$error_message .= '<h2>Sorry , There is an error in mysql ' . ($msg !='' ? ", error : $msg" : '') . '</h2>';
|
||||
|
||||
if ($error_sql != '')
|
||||
{
|
||||
$error_message .= "<br />--[query]-------------------------- <br />$error_sql<br />---------------------------------<br /><br />";
|
||||
}
|
||||
$error_message .= "[$error_no : $error_msg] <br />";
|
||||
|
||||
if ($updating_related)
|
||||
{
|
||||
global $config;
|
||||
$error_message .= '<br /><strong>Your Kleeja database might be old, try to update it now from: ' . rtrim($config['siteurl'], '/') . '/install</strong>';
|
||||
$error_message .= "<br /><br><strong>If this error happened after installing a plugin, add <span style=\"background-color:#ccc; padding:2px\">define('STOP_PLUGINS', true);</span> to end of config.php file.</strong>";
|
||||
}
|
||||
$error_message .= "<br /><br /><strong>Script: Kleeja <br /><a href='http://www.kleeja.com'>Kleeja Website</a></strong>";
|
||||
$error_message .= '</b></div>';
|
||||
$error_message .= '</body></html>';
|
||||
}
|
||||
$error_message .= "<br /><br /><strong>Script: Kleeja <br /><a href='http://www.kleeja.com'>Kleeja Website</a></strong>";
|
||||
$error_message .= '</b></div>';
|
||||
$error_message .= '</body></html>';
|
||||
|
||||
|
||||
print $error_message;
|
||||
|
||||
|
||||
#loggin -> error
|
||||
kleeja_log('[SQL ERROR] : "' . $error_no . ' : ' . $error_msg . '" -->');
|
||||
|
||||
@$this->close();
|
||||
exit();
|
||||
}
|
||||
//loggin -> error
|
||||
kleeja_log('[SQL ERROR] : "' . $error_no . ' : ' . $error_msg . '" -->');
|
||||
|
||||
/*
|
||||
* return last error
|
||||
*/
|
||||
function get_error()
|
||||
{
|
||||
if($this->connect_id)
|
||||
{
|
||||
return array(@mysqli_errno($this->connect_id), @mysqli_error($this->connect_id));
|
||||
}
|
||||
else
|
||||
{
|
||||
return array(@mysqli_connect_errno(), @mysqli_connect_error());
|
||||
}
|
||||
}
|
||||
@$this->close();
|
||||
|
||||
}#end of class
|
||||
exit();
|
||||
}
|
||||
|
||||
// return last error
|
||||
public function get_error()
|
||||
{
|
||||
if ($this->connect_id)
|
||||
{
|
||||
return [@mysqli_errno($this->connect_id), @mysqli_error($this->connect_id)];
|
||||
}
|
||||
else
|
||||
{
|
||||
return [@mysqli_connect_errno(), @mysqli_connect_error()];
|
||||
}
|
||||
}
|
||||
}//end of class
|
||||
|
||||
endif;
|
||||
|
||||
|
||||
|
||||
@@ -9,44 +9,44 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
class Pagination
|
||||
{
|
||||
protected $totalPages, $startRow , $currentPage;
|
||||
protected $totalPages, $startRow , $currentPage;
|
||||
|
||||
/**
|
||||
* @param $rowsPerPage
|
||||
* @param $numRows
|
||||
* @param int $currentPage
|
||||
*/
|
||||
public function __construct($rowsPerPage, $numRows, $currentPage = 1)
|
||||
{
|
||||
// Calculate the total number of pages
|
||||
$this->setTotalPages(ceil($numRows/$rowsPerPage));
|
||||
public function __construct($rowsPerPage, $numRows, $currentPage = 1)
|
||||
{
|
||||
// Calculate the total number of pages
|
||||
$this->setTotalPages(ceil($numRows/$rowsPerPage));
|
||||
|
||||
// Check that a valid page has been provided
|
||||
$this->currentPage = $currentPage < 1 ? 1 : ($currentPage > $this->totalPages ? $this->totalPages : $currentPage);
|
||||
// Check that a valid page has been provided
|
||||
$this->currentPage = $currentPage < 1 ? 1 : ($currentPage > $this->totalPages ? $this->totalPages : $currentPage);
|
||||
|
||||
// Calculate the row to start the select with
|
||||
$this->startRow = ($this->currentPage - 1) * $rowsPerPage;
|
||||
}
|
||||
// Calculate the row to start the select with
|
||||
$this->startRow = ($this->currentPage - 1) * $rowsPerPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total pages
|
||||
* @return float
|
||||
*/
|
||||
public function getTotalPages()
|
||||
{
|
||||
return $this->totalPages;
|
||||
}
|
||||
{
|
||||
return $this->totalPages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the total pages
|
||||
* @param int $totalPages
|
||||
* @param int $totalPages
|
||||
* @return int
|
||||
*/
|
||||
public function setTotalPages($totalPages = 0)
|
||||
@@ -76,9 +76,9 @@ class Pagination
|
||||
* @return int
|
||||
*/
|
||||
public function getStartRow()
|
||||
{
|
||||
return $this->startRow;
|
||||
}
|
||||
{
|
||||
return $this->startRow;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
@@ -92,94 +92,92 @@ class Pagination
|
||||
|
||||
/**
|
||||
* @param $link
|
||||
* @param string $link_plus
|
||||
* @param string $link_plus
|
||||
* @return string
|
||||
*/
|
||||
public function print_nums($link, $link_plus = '')
|
||||
{
|
||||
global $lang, $config;
|
||||
{
|
||||
global $lang, $config;
|
||||
|
||||
//if no page
|
||||
if($this->totalPages <= 1)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
//if no page
|
||||
if ($this->totalPages <= 1)
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
$link_plus .= $link_plus != '' ? ' ' : '';
|
||||
$link_plus .= $link_plus != '' ? ' ' : '';
|
||||
|
||||
$re = '<nav aria-label="Page navigation example">';
|
||||
$re = '<ul id="pagination" class="pagination">';
|
||||
$re = '<nav aria-label="Page navigation example">';
|
||||
$re = '<ul id="pagination" class="pagination">';
|
||||
|
||||
// Add a previous page link
|
||||
if ($this->totalPages > 1 && $this->currentPage > 1)
|
||||
{
|
||||
$re .= '<li class="page-item">';
|
||||
$re .= $config['mod_writer'] && !defined('IN_ADMIN')
|
||||
// Add a previous page link
|
||||
if ($this->totalPages > 1 && $this->currentPage > 1)
|
||||
{
|
||||
$re .= '<li class="page-item">';
|
||||
$re .= $config['mod_writer'] && ! defined('IN_ADMIN')
|
||||
? '<a class="paginate phover page-link" href="' . $link . '-' . ($this->currentPage-1) . '.html"' . $link_plus . '><span>' . $lang['PREV'] . '</span></a>'
|
||||
: '<a class="paginate phover page-link" href="' . $link . '&page=' . ($this->currentPage-1) . '"' . $link_plus . '><span>' . $lang['PREV'] . '</span></a>';
|
||||
$re .= '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->currentPage > 3)
|
||||
{
|
||||
if ($this->currentPage > 3)
|
||||
{
|
||||
$re .= '<li class="page-item">';
|
||||
$re .= $config['mod_writer'] && !defined('IN_ADMIN')
|
||||
$re .= $config['mod_writer'] && ! defined('IN_ADMIN')
|
||||
? '<a class="paginate page-link" href="' . $link . '-1.html"' . $link_plus . '><span>1</span></a>' . ($this->currentPage > 5 ? '<a class="paginate dots"><span>...</span></a>' : '')
|
||||
: '<a class="paginate page-link" href="' . $link . '&page=1"' . $link_plus . '><span>1</span></a>' . ($this->currentPage > 5 ? '<a class="paginate dots"><span>...</span></a>' : '');
|
||||
$re .= '</li>';
|
||||
}
|
||||
|
||||
for ($current = ($this->currentPage == 5) ? $this->currentPage - 3 : $this->currentPage - 2, $stop = ($this->currentPage + 4 == $this->totalPages) ? $this->currentPage + 4 : $this->currentPage + 3; $current < $stop; ++$current)
|
||||
{
|
||||
if ($current < 1 || $current > $this->totalPages)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if ($current != $this->currentPage)
|
||||
{
|
||||
}
|
||||
|
||||
for ($current = ($this->currentPage == 5) ? $this->currentPage - 3 : $this->currentPage - 2, $stop = ($this->currentPage + 4 == $this->totalPages) ? $this->currentPage + 4 : $this->currentPage + 3; $current < $stop; ++$current)
|
||||
{
|
||||
if ($current < 1 || $current > $this->totalPages)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
elseif ($current != $this->currentPage)
|
||||
{
|
||||
$re .= '<li class="page-item">';
|
||||
$re .= $config['mod_writer'] && !defined('IN_ADMIN')
|
||||
$re .= $config['mod_writer'] && ! defined('IN_ADMIN')
|
||||
? '<a class="paginate page-link" href="' . $link . '-' . $current . '.html"' . $link_plus . '><span>' . $current . '</span></a>'
|
||||
: '<a class="paginate page-link" href="' . $link . '&page=' . $current . '"' . $link_plus . '><span>' . $current . '</span></a>';
|
||||
$re .= '</li>';
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
else
|
||||
{
|
||||
$re .= '<li class="page-item">';
|
||||
$re .= '<a class="paginate page-link current"><span>' . $current . '</span></a>';
|
||||
$re .= '<a class="paginate page-link current"><span>' . $current . '</span></a>';
|
||||
$re .= '</li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->currentPage <= ($this->totalPages-3))
|
||||
{
|
||||
if ($this->currentPage != ($this->totalPages-3) && $this->currentPage != ($this->totalPages-4))
|
||||
{
|
||||
$re .= '<li class="page-item"><a class="paginate page-link dots"><span>...</span></a></li>';
|
||||
}
|
||||
if ($this->currentPage <= ($this->totalPages-3))
|
||||
{
|
||||
if ($this->currentPage != ($this->totalPages-3) && $this->currentPage != ($this->totalPages-4))
|
||||
{
|
||||
$re .= '<li class="page-item"><a class="paginate page-link dots"><span>...</span></a></li>';
|
||||
}
|
||||
|
||||
$re .= '<li class="page-item">';
|
||||
$re .= $config['mod_writer'] && !defined('IN_ADMIN')
|
||||
$re .= $config['mod_writer'] && ! defined('IN_ADMIN')
|
||||
? '<a class="paginate page-link" href="' . $link . '-' . $this->totalPages . '.html"' . $link_plus . '><span>' . $this->totalPages . '</span></a>'
|
||||
: '<a class="paginate page-link" href="' . $link . '&page=' . $this->totalPages . '"' . $link_plus . '><span>' . $this->totalPages . '</span></a>';
|
||||
$re .= '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
// Add a next page link
|
||||
if ($this->totalPages > 1 && $this->currentPage < $this->totalPages)
|
||||
{
|
||||
// Add a next page link
|
||||
if ($this->totalPages > 1 && $this->currentPage < $this->totalPages)
|
||||
{
|
||||
$re .= '<li class="page-item">';
|
||||
$re .= $config['mod_writer'] && !defined('IN_ADMIN')
|
||||
$re .= $config['mod_writer'] && ! defined('IN_ADMIN')
|
||||
? '<a class="paginate page-link phover" href="' . $link . '-' . ($this->currentPage+1) . '.html"' . $link_plus . '><span>' . $lang['NEXT'] . '</span></a>'
|
||||
: '<a class="paginate phover page-link" href="' . $link . '&page=' . ($this->currentPage+1) . '"' . $link_plus . '><span>' . $lang['NEXT'] . '</span></a>';
|
||||
$re .= '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
$re .= '</ul>';
|
||||
$re .= '</nav>';
|
||||
$re .= '</ul>';
|
||||
$re .= '</nav>';
|
||||
|
||||
return $re;
|
||||
}
|
||||
return $re;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,265 +1,309 @@
|
||||
<?php
|
||||
#
|
||||
# Portable PHP password hashing framework.
|
||||
#
|
||||
# Version 0.1 / genuine.
|
||||
#
|
||||
# Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
|
||||
# the public domain.
|
||||
#
|
||||
# There's absolutely no warranty.
|
||||
#
|
||||
# The homepage URL for this framework is:
|
||||
#
|
||||
# http://www.openwall.com/phpass/
|
||||
#
|
||||
# Please be sure to update the Version line if you edit this file in any way.
|
||||
# It is suggested that you leave the main version number intact, but indicate
|
||||
# your project name (after the slash) and add your own revision information.
|
||||
#
|
||||
# Please do not change the "private" password hashing method implemented in
|
||||
# here, thereby making your hashes incompatible. However, if you must, please
|
||||
# change the hash type identifier (the "$P$") to something different.
|
||||
#
|
||||
# Obviously, since this code is in the public domain, the above are not
|
||||
# requirements (there can be none), but merely suggestions.
|
||||
#
|
||||
# @version $Id: phpass.php 1551 2010-07-25 22:09:47Z saanina $
|
||||
//
|
||||
// Portable PHP password hashing framework.
|
||||
//
|
||||
// Version 0.1 / genuine.
|
||||
//
|
||||
// Written by Solar Designer <solar at openwall.com> in 2004-2006 and placed in
|
||||
// the public domain.
|
||||
//
|
||||
// There's absolutely no warranty.
|
||||
//
|
||||
// The homepage URL for this framework is:
|
||||
//
|
||||
// http://www.openwall.com/phpass/
|
||||
//
|
||||
// Please be sure to update the Version line if you edit this file in any way.
|
||||
// It is suggested that you leave the main version number intact, but indicate
|
||||
// your project name (after the slash) and add your own revision information.
|
||||
//
|
||||
// Please do not change the "private" password hashing method implemented in
|
||||
// here, thereby making your hashes incompatible. However, if you must, please
|
||||
// change the hash type identifier (the "$P$") to something different.
|
||||
//
|
||||
// Obviously, since this code is in the public domain, the above are not
|
||||
// requirements (there can be none), but merely suggestions.
|
||||
//
|
||||
// @version $Id: phpass.php 1551 2010-07-25 22:09:47Z saanina $
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
class PasswordHash
|
||||
{
|
||||
var $itoa64;
|
||||
var $iteration_count_log2;
|
||||
var $portable_hashes;
|
||||
var $random_state;
|
||||
public $itoa64;
|
||||
public $iteration_count_log2;
|
||||
public $portable_hashes;
|
||||
public $random_state;
|
||||
|
||||
function __construct($iteration_count_log2, $portable_hashes)
|
||||
{
|
||||
$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
public function __construct($iteration_count_log2, $portable_hashes)
|
||||
{
|
||||
$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
|
||||
$iteration_count_log2 = 8;
|
||||
$this->iteration_count_log2 = $iteration_count_log2;
|
||||
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
|
||||
{
|
||||
$iteration_count_log2 = 8;
|
||||
}
|
||||
$this->iteration_count_log2 = $iteration_count_log2;
|
||||
|
||||
$this->portable_hashes = $portable_hashes;
|
||||
$this->portable_hashes = $portable_hashes;
|
||||
|
||||
$this->random_state = microtime() . getmypid();
|
||||
}
|
||||
$this->random_state = microtime() . getmypid();
|
||||
}
|
||||
|
||||
function get_random_bytes($count)
|
||||
{
|
||||
$output = '';
|
||||
if (($fh = @fopen('/dev/urandom', 'rb')))
|
||||
{
|
||||
$output = fread($fh, $count);
|
||||
fclose($fh);
|
||||
}
|
||||
public function get_random_bytes($count)
|
||||
{
|
||||
$output = '';
|
||||
|
||||
if (strlen($output) < $count)
|
||||
{
|
||||
$output = '';
|
||||
for ($i = 0; $i < $count; $i += 16)
|
||||
{
|
||||
$this->random_state = md5(microtime() . $this->random_state);
|
||||
$output .= pack('H*', md5($this->random_state));
|
||||
}
|
||||
|
||||
$output = substr($output, 0, $count);
|
||||
}
|
||||
if (($fh = @fopen('/dev/urandom', 'rb')))
|
||||
{
|
||||
$output = fread($fh, $count);
|
||||
fclose($fh);
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
if (strlen($output) < $count)
|
||||
{
|
||||
$output = '';
|
||||
|
||||
function encode64($input, $count)
|
||||
{
|
||||
$output = '';
|
||||
$i = 0;
|
||||
do
|
||||
{
|
||||
$value = ord($input[$i++]);
|
||||
$output .= $this->itoa64[$value & 0x3f];
|
||||
if ($i < $count)
|
||||
$value |= ord($input[$i]) << 8;
|
||||
$output .= $this->itoa64[($value >> 6) & 0x3f];
|
||||
if ($i++ >= $count)
|
||||
break;
|
||||
if ($i < $count)
|
||||
$value |= ord($input[$i]) << 16;
|
||||
$output .= $this->itoa64[($value >> 12) & 0x3f];
|
||||
if ($i++ >= $count)
|
||||
break;
|
||||
$output .= $this->itoa64[($value >> 18) & 0x3f];
|
||||
}
|
||||
while ($i < $count);
|
||||
for ($i = 0; $i < $count; $i += 16)
|
||||
{
|
||||
$this->random_state = md5(microtime() . $this->random_state);
|
||||
$output .= pack('H*', md5($this->random_state));
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
$output = substr($output, 0, $count);
|
||||
}
|
||||
|
||||
function gensalt_private($input)
|
||||
{
|
||||
$output = '$P$';
|
||||
$output .= $this->itoa64[min($this->iteration_count_log2 + ((PHP_VERSION >= '5') ? 5 : 3), 30)];
|
||||
$output .= $this->encode64($input, 6);
|
||||
return $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
public function encode64($input, $count)
|
||||
{
|
||||
$output = '';
|
||||
$i = 0;
|
||||
do
|
||||
{
|
||||
$value = ord($input[$i++]);
|
||||
$output .= $this->itoa64[$value & 0x3f];
|
||||
|
||||
function crypt_private($password, $setting)
|
||||
{
|
||||
$output = '*0';
|
||||
if (substr($setting, 0, 2) == $output)
|
||||
$output = '*1';
|
||||
if ($i < $count)
|
||||
{
|
||||
$value |= ord($input[$i]) << 8;
|
||||
}
|
||||
$output .= $this->itoa64[($value >> 6) & 0x3f];
|
||||
|
||||
if (substr($setting, 0, 3) != '$P$')
|
||||
return $output;
|
||||
if ($i++ >= $count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
$count_log2 = strpos($this->itoa64, $setting[3]);
|
||||
if ($count_log2 < 7 || $count_log2 > 30)
|
||||
return $output;
|
||||
if ($i < $count)
|
||||
{
|
||||
$value |= ord($input[$i]) << 16;
|
||||
}
|
||||
$output .= $this->itoa64[($value >> 12) & 0x3f];
|
||||
|
||||
$count = 1 << $count_log2;
|
||||
if ($i++ >= $count)
|
||||
{
|
||||
break;
|
||||
}
|
||||
$output .= $this->itoa64[($value >> 18) & 0x3f];
|
||||
} while ($i < $count);
|
||||
|
||||
$salt = substr($setting, 4, 8);
|
||||
if (strlen($salt) != 8)
|
||||
return $output;
|
||||
return $output;
|
||||
}
|
||||
|
||||
# We're kind of forced to use MD5 here since it's the only
|
||||
# cryptographic primitive available in all versions of PHP
|
||||
# currently in use. To implement our own low-level crypto
|
||||
# in PHP would result in much worse performance and
|
||||
# consequently in lower iteration counts and hashes that are
|
||||
# quicker to crack (by non-PHP code).
|
||||
if (PHP_VERSION >= '5')
|
||||
{
|
||||
$hash = md5($salt . $password, TRUE);
|
||||
do {
|
||||
$hash = md5($hash . $password, TRUE);
|
||||
} while (--$count);
|
||||
}
|
||||
else
|
||||
{
|
||||
$hash = pack('H*', md5($salt . $password));
|
||||
do
|
||||
{
|
||||
$hash = pack('H*', md5($hash . $password));
|
||||
}
|
||||
while (--$count);
|
||||
}
|
||||
public function gensalt_private($input)
|
||||
{
|
||||
$output = '$P$';
|
||||
$output .= $this->itoa64[min($this->iteration_count_log2 + ((PHP_VERSION >= '5') ? 5 : 3), 30)];
|
||||
$output .= $this->encode64($input, 6);
|
||||
|
||||
$output = substr($setting, 0, 12);
|
||||
$output .= $this->encode64($hash, 16);
|
||||
return $output;
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
public function crypt_private($password, $setting)
|
||||
{
|
||||
$output = '*0';
|
||||
|
||||
function gensalt_extended($input)
|
||||
{
|
||||
$count_log2 = min($this->iteration_count_log2 + 8, 24);
|
||||
# This should be odd to not reveal weak DES keys, and the
|
||||
# maximum valid value is (2**24 - 1) which is odd anyway.
|
||||
$count = (1 << $count_log2) - 1;
|
||||
if (substr($setting, 0, 2) == $output)
|
||||
{
|
||||
$output = '*1';
|
||||
}
|
||||
|
||||
$output = '_';
|
||||
$output .= $this->itoa64[$count & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 6) & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 12) & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 18) & 0x3f];
|
||||
if (substr($setting, 0, 3) != '$P$')
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$output .= $this->encode64($input, 3);
|
||||
$count_log2 = strpos($this->itoa64, $setting[3]);
|
||||
|
||||
return $output;
|
||||
}
|
||||
if ($count_log2 < 7 || $count_log2 > 30)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
function gensalt_blowfish($input)
|
||||
{
|
||||
# This one needs to use a different order of characters and a
|
||||
# different encoding scheme from the one in encode64() above.
|
||||
# We care because the last character in our encoded string will
|
||||
# only represent 2 bits. While two known implementations of
|
||||
# bcrypt will happily accept and correct a salt string which
|
||||
# has the 4 unused bits set to non-zero, we do not want to take
|
||||
# chances and we also do not want to waste an additional byte
|
||||
# of entropy.
|
||||
$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
$count = 1 << $count_log2;
|
||||
|
||||
$output = '$2a$';
|
||||
$output .= chr(ord('0') + $this->iteration_count_log2 / 10);
|
||||
$output .= chr(ord('0') + $this->iteration_count_log2 % 10);
|
||||
$output .= '$';
|
||||
$salt = substr($setting, 4, 8);
|
||||
|
||||
$i = 0;
|
||||
do
|
||||
{
|
||||
$c1 = ord($input[$i++]);
|
||||
$output .= $itoa64[$c1 >> 2];
|
||||
$c1 = ($c1 & 0x03) << 4;
|
||||
if ($i >= 16)
|
||||
{
|
||||
$output .= $itoa64[$c1];
|
||||
break;
|
||||
}
|
||||
if (strlen($salt) != 8)
|
||||
{
|
||||
return $output;
|
||||
}
|
||||
|
||||
$c2 = ord($input[$i++]);
|
||||
$c1 |= $c2 >> 4;
|
||||
$output .= $itoa64[$c1];
|
||||
$c1 = ($c2 & 0x0f) << 2;
|
||||
// We're kind of forced to use MD5 here since it's the only
|
||||
// cryptographic primitive available in all versions of PHP
|
||||
// currently in use. To implement our own low-level crypto
|
||||
// in PHP would result in much worse performance and
|
||||
// consequently in lower iteration counts and hashes that are
|
||||
// quicker to crack (by non-PHP code).
|
||||
if (PHP_VERSION >= '5')
|
||||
{
|
||||
$hash = md5($salt . $password, true);
|
||||
do
|
||||
{
|
||||
$hash = md5($hash . $password, true);
|
||||
} while (--$count);
|
||||
}
|
||||
else
|
||||
{
|
||||
$hash = pack('H*', md5($salt . $password));
|
||||
do
|
||||
{
|
||||
$hash = pack('H*', md5($hash . $password));
|
||||
} while (--$count);
|
||||
}
|
||||
|
||||
$c2 = ord($input[$i++]);
|
||||
$c1 |= $c2 >> 6;
|
||||
$output .= $itoa64[$c1];
|
||||
$output .= $itoa64[$c2 & 0x3f];
|
||||
}
|
||||
while (1);
|
||||
$output = substr($setting, 0, 12);
|
||||
$output .= $this->encode64($hash, 16);
|
||||
|
||||
return $output;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
function HashPassword($password)
|
||||
{
|
||||
$random = '';
|
||||
public function gensalt_extended($input)
|
||||
{
|
||||
$count_log2 = min($this->iteration_count_log2 + 8, 24);
|
||||
// This should be odd to not reveal weak DES keys, and the
|
||||
// maximum valid value is (2**24 - 1) which is odd anyway.
|
||||
$count = (1 << $count_log2) - 1;
|
||||
|
||||
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes)
|
||||
{
|
||||
$random = $this->get_random_bytes(16);
|
||||
$hash = crypt($password, $this->gensalt_blowfish($random));
|
||||
if (strlen($hash) == 60)
|
||||
return $hash;
|
||||
}
|
||||
$output = '_';
|
||||
$output .= $this->itoa64[$count & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 6) & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 12) & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 18) & 0x3f];
|
||||
|
||||
if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) {
|
||||
if (strlen($random) < 3)
|
||||
$random = $this->get_random_bytes(3);
|
||||
$hash = crypt($password, $this->gensalt_extended($random));
|
||||
if (strlen($hash) == 20)
|
||||
return $hash;
|
||||
}
|
||||
$output .= $this->encode64($input, 3);
|
||||
|
||||
if (strlen($random) < 6)
|
||||
$random = $this->get_random_bytes(6);
|
||||
$hash =
|
||||
$this->crypt_private($password,
|
||||
$this->gensalt_private($random));
|
||||
if (strlen($hash) == 34)
|
||||
return $hash;
|
||||
return $output;
|
||||
}
|
||||
|
||||
# Returning '*' on error is safe here, but would _not_ be safe
|
||||
# in a crypt(3)-like function used _both_ for generating new
|
||||
# hashes and for validating passwords against existing hashes.
|
||||
return '*';
|
||||
}
|
||||
public function gensalt_blowfish($input)
|
||||
{
|
||||
// This one needs to use a different order of characters and a
|
||||
// different encoding scheme from the one in encode64() above.
|
||||
// We care because the last character in our encoded string will
|
||||
// only represent 2 bits. While two known implementations of
|
||||
// bcrypt will happily accept and correct a salt string which
|
||||
// has the 4 unused bits set to non-zero, we do not want to take
|
||||
// chances and we also do not want to waste an additional byte
|
||||
// of entropy.
|
||||
$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
|
||||
function CheckPassword($password, $stored_hash)
|
||||
{
|
||||
$hash = $this->crypt_private($password, $stored_hash);
|
||||
if ($hash[0] == '*')
|
||||
$hash = crypt($password, $stored_hash);
|
||||
$output = '$2a$';
|
||||
$output .= chr(ord('0') + $this->iteration_count_log2 / 10);
|
||||
$output .= chr(ord('0') + $this->iteration_count_log2 % 10);
|
||||
$output .= '$';
|
||||
|
||||
return $hash == $stored_hash;
|
||||
}
|
||||
$i = 0;
|
||||
do
|
||||
{
|
||||
$c1 = ord($input[$i++]);
|
||||
$output .= $itoa64[$c1 >> 2];
|
||||
$c1 = ($c1 & 0x03) << 4;
|
||||
|
||||
if ($i >= 16)
|
||||
{
|
||||
$output .= $itoa64[$c1];
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$c2 = ord($input[$i++]);
|
||||
$c1 |= $c2 >> 4;
|
||||
$output .= $itoa64[$c1];
|
||||
$c1 = ($c2 & 0x0f) << 2;
|
||||
|
||||
$c2 = ord($input[$i++]);
|
||||
$c1 |= $c2 >> 6;
|
||||
$output .= $itoa64[$c1];
|
||||
$output .= $itoa64[$c2 & 0x3f];
|
||||
} while (1);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
public function HashPassword($password)
|
||||
{
|
||||
$random = '';
|
||||
|
||||
if (CRYPT_BLOWFISH == 1 && ! $this->portable_hashes)
|
||||
{
|
||||
$random = $this->get_random_bytes(16);
|
||||
$hash = crypt($password, $this->gensalt_blowfish($random));
|
||||
|
||||
if (strlen($hash) == 60)
|
||||
{
|
||||
return $hash;
|
||||
}
|
||||
}
|
||||
|
||||
if (CRYPT_EXT_DES == 1 && ! $this->portable_hashes)
|
||||
{
|
||||
if (strlen($random) < 3)
|
||||
{
|
||||
$random = $this->get_random_bytes(3);
|
||||
}
|
||||
$hash = crypt($password, $this->gensalt_extended($random));
|
||||
|
||||
if (strlen($hash) == 20)
|
||||
{
|
||||
return $hash;
|
||||
}
|
||||
}
|
||||
|
||||
if (strlen($random) < 6)
|
||||
{
|
||||
$random = $this->get_random_bytes(6);
|
||||
}
|
||||
$hash =
|
||||
$this->crypt_private($password,
|
||||
$this->gensalt_private($random));
|
||||
|
||||
if (strlen($hash) == 34)
|
||||
{
|
||||
return $hash;
|
||||
}
|
||||
|
||||
// Returning '*' on error is safe here, but would _not_ be safe
|
||||
// in a crypt(3)-like function used _both_ for generating new
|
||||
// hashes and for validating passwords against existing hashes.
|
||||
return '*';
|
||||
}
|
||||
|
||||
public function CheckPassword($password, $stored_hash)
|
||||
{
|
||||
$hash = $this->crypt_private($password, $stored_hash);
|
||||
|
||||
if ($hash[0] == '*')
|
||||
{
|
||||
$hash = crypt($password, $stored_hash);
|
||||
}
|
||||
|
||||
return $hash == $stored_hash;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
*
|
||||
*/
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
# We are in the plugin system, plugins files won't work outside here
|
||||
// We are in the plugin system, plugins files won't work outside here
|
||||
define('IN_PLUGINS_SYSTEM', true);
|
||||
|
||||
|
||||
@@ -26,14 +26,14 @@ class Plugins
|
||||
/**
|
||||
* List of loaded plugins
|
||||
*/
|
||||
private $plugins = array();
|
||||
private $plugins = [];
|
||||
|
||||
/**
|
||||
* All hooks from all plugins listed in this variable
|
||||
*/
|
||||
private $all_plugins_hooks = array();
|
||||
private $installed_plugins = array();
|
||||
private $installed_plugins_info = array();
|
||||
private $all_plugins_hooks = [];
|
||||
private $installed_plugins = [];
|
||||
private $installed_plugins_info = [];
|
||||
|
||||
|
||||
private $plugin_path = '';
|
||||
@@ -48,7 +48,7 @@ class Plugins
|
||||
{
|
||||
global $SQL, $dbprefix;
|
||||
|
||||
#if plugins system is turned off, then stop right now!
|
||||
//if plugins system is turned off, then stop right now!
|
||||
if (defined('STOP_PLUGINS'))
|
||||
{
|
||||
return;
|
||||
@@ -57,12 +57,12 @@ class Plugins
|
||||
|
||||
$this->plugin_path = PATH . KLEEJA_PLUGINS_FOLDER;
|
||||
|
||||
# Get installed plugins
|
||||
$query = array(
|
||||
'SELECT' => "plg_name, plg_ver",
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
'WHERE' => "plg_disabled = 0"
|
||||
);
|
||||
// Get installed plugins
|
||||
$query = [
|
||||
'SELECT' => 'plg_name, plg_ver',
|
||||
'FROM' => "{$dbprefix}plugins",
|
||||
'WHERE' => 'plg_disabled = 0'
|
||||
];
|
||||
|
||||
$result = $SQL->build($query);
|
||||
|
||||
@@ -88,8 +88,7 @@ class Plugins
|
||||
{
|
||||
if (is_dir($this->plugin_path . '/' . $folder_name) && preg_match('/[a-z0-9_.]{3,}/', $folder_name))
|
||||
{
|
||||
|
||||
if (!empty($this->installed_plugins[$folder_name]))
|
||||
if (! empty($this->installed_plugins[$folder_name]))
|
||||
{
|
||||
if ($this->fetch_plugin($folder_name))
|
||||
{
|
||||
@@ -99,18 +98,18 @@ class Plugins
|
||||
}
|
||||
}
|
||||
|
||||
#sort the plugins from high to low priority
|
||||
//sort the plugins from high to low priority
|
||||
krsort($this->plugins);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the plugin information and other things
|
||||
* @param string $plugin_name
|
||||
* @param string $plugin_name
|
||||
* @return bool
|
||||
*/
|
||||
private function fetch_plugin($plugin_name)
|
||||
{
|
||||
#load the plugin
|
||||
//load the plugin
|
||||
@include_once $this->plugin_path . '/' . $plugin_name . '/init.php';
|
||||
|
||||
if (empty($kleeja_plugin))
|
||||
@@ -118,45 +117,47 @@ class Plugins
|
||||
return false;
|
||||
}
|
||||
|
||||
$priority = $kleeja_plugin[$plugin_name]['information']['plugin_priority'];
|
||||
$priority = $kleeja_plugin[$plugin_name]['information']['plugin_priority'];
|
||||
$this->installed_plugins_info[$plugin_name] = $kleeja_plugin[$plugin_name]['information'];
|
||||
|
||||
#bring the real priority of plugin and replace current one
|
||||
//bring the real priority of plugin and replace current one
|
||||
$plugin_current_priority = array_search($plugin_name, $this->plugins);
|
||||
unset($this->plugins[$plugin_current_priority]);
|
||||
$this->plugins[$priority] = $plugin_name;
|
||||
|
||||
//update plugin if current loaded version is > than installed one
|
||||
if ($this->installed_plugins[$plugin_name])
|
||||
{
|
||||
if (version_compare($this->installed_plugins[$plugin_name], $kleeja_plugin[$plugin_name]['information']['plugin_version'], '<'))
|
||||
{
|
||||
if (is_callable($kleeja_plugin[$plugin_name]['update']))
|
||||
{
|
||||
global $SQL, $dbprefix;
|
||||
|
||||
#update plugin
|
||||
//update plugin
|
||||
$kleeja_plugin[$plugin_name]['update']($this->installed_plugins[$plugin_name], $kleeja_plugin[$plugin_name]['information']['plugin_version']);
|
||||
|
||||
#update current plugin version
|
||||
$update_query = array(
|
||||
//update current plugin version
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}plugins",
|
||||
'SET' => "plg_ver='" . $SQL->escape($kleeja_plugin[$plugin_name]['information']['plugin_version']) . "'",
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plugin_name) . "'"
|
||||
);
|
||||
'SET' => "plg_ver='" . $SQL->escape($kleeja_plugin[$plugin_name]['information']['plugin_version']) . "'",
|
||||
'WHERE' => "plg_name='" . $SQL->escape($plugin_name) . "'"
|
||||
];
|
||||
|
||||
|
||||
$SQL->build($update_query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#add plugin hooks to global hooks, depend on its priority
|
||||
if (!empty($kleeja_plugin[$plugin_name]['functions']))
|
||||
//add plugin hooks to global hooks, depend on its priority
|
||||
if (! empty($kleeja_plugin[$plugin_name]['functions']))
|
||||
{
|
||||
foreach ($kleeja_plugin[$plugin_name]['functions'] as $hook_name => $hook_value)
|
||||
{
|
||||
if (empty($this->all_plugins_hooks[$hook_name][$priority]))
|
||||
{
|
||||
$this->all_plugins_hooks[$hook_name][$priority] = array();
|
||||
$this->all_plugins_hooks[$hook_name][$priority] = [];
|
||||
}
|
||||
array_push($this->all_plugins_hooks[$hook_name][$priority], $hook_value);
|
||||
krsort($this->all_plugins_hooks[$hook_name]);
|
||||
@@ -169,12 +170,12 @@ class Plugins
|
||||
|
||||
/**
|
||||
* get an installed plugin information
|
||||
* @param string $plugin_name
|
||||
* @param string $plugin_name
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function installed_plugin_info($plugin_name)
|
||||
{
|
||||
if (!empty($this->installed_plugins_info[$plugin_name]))
|
||||
if (! empty($this->installed_plugins_info[$plugin_name]))
|
||||
{
|
||||
return $this->installed_plugins_info[$plugin_name];
|
||||
}
|
||||
@@ -186,15 +187,15 @@ class Plugins
|
||||
/**
|
||||
* Bring all codes of this hook
|
||||
* This function scattered all over kleeja files
|
||||
* @param string $hook_name
|
||||
* @param array $args
|
||||
* @param string $hook_name
|
||||
* @param array $args
|
||||
* @return array|null
|
||||
*/
|
||||
public function run($hook_name, $args = array())
|
||||
public function run($hook_name, $args = [])
|
||||
{
|
||||
$return_value = $to_be_returned = array();
|
||||
$return_value = $to_be_returned = [];
|
||||
|
||||
if (!empty($this->all_plugins_hooks[$hook_name]))
|
||||
if (! empty($this->all_plugins_hooks[$hook_name]))
|
||||
{
|
||||
foreach ($this->all_plugins_hooks[$hook_name] as $order => $functions)
|
||||
{
|
||||
@@ -204,9 +205,9 @@ class Plugins
|
||||
{
|
||||
$return_value = $function($args);
|
||||
|
||||
if(is_array($return_value))
|
||||
if (is_array($return_value))
|
||||
{
|
||||
$args = array_merge($args, $return_value);
|
||||
$args = array_merge($args, $return_value);
|
||||
$to_be_returned = array_merge($to_be_returned, $return_value);
|
||||
}
|
||||
}
|
||||
@@ -234,15 +235,16 @@ class Plugins
|
||||
* return debug info about plugins system
|
||||
* @return array
|
||||
*/
|
||||
public function getDebugInfo(){
|
||||
if(!defined('DEV_STAGE'))
|
||||
public function getDebugInfo()
|
||||
{
|
||||
if (! defined('DEV_STAGE'))
|
||||
{
|
||||
return array();
|
||||
return [];
|
||||
}
|
||||
|
||||
return array(
|
||||
return [
|
||||
'all_plugins_hooks' => $this->all_plugins_hooks,
|
||||
'installed_plugins' => $this->installed_plugins,
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,25 +8,25 @@
|
||||
*/
|
||||
|
||||
|
||||
#no direct access
|
||||
if (!defined('IN_COMMON'))
|
||||
//no direct access
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit;
|
||||
}
|
||||
|
||||
class kleeja_style
|
||||
{
|
||||
protected $vars; #Reference to $GLOBALS
|
||||
protected $loop = array();
|
||||
protected $reg = array('var' => '/([{]{1,2})+([A-Z0-9_\.]+)[}]{1,2}/i');
|
||||
public $caching = true; #save templates as caches to not compiled a lot of times
|
||||
protected $vars; //Reference to $GLOBALS
|
||||
protected $loop = [];
|
||||
protected $reg = ['var' => '/([{]{1,2})+([A-Z0-9_\.]+)[}]{1,2}/i'];
|
||||
public $caching = true; //save templates as caches to not compiled a lot of times
|
||||
|
||||
/**
|
||||
* check if caching is not enabled and empty style cache files
|
||||
*/
|
||||
public function __wakeup()
|
||||
{
|
||||
if(! $this->caching)
|
||||
if (! $this->caching)
|
||||
{
|
||||
delete_cache(null, true);
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class kleeja_style
|
||||
global $config, $THIS_STYLE_PATH_ABS, $STYLE_PATH_ADMIN_ABS, $DEFAULT_PATH_ADMIN_ABS;
|
||||
|
||||
|
||||
if (!($template_path = $this->template_exists($template_name, $style_path)))
|
||||
if (! ($template_path = $this->template_exists($template_name, $style_path)))
|
||||
{
|
||||
big_error('No Template !', 'Requested <b>"' . $template_name . '"</b> template doesnt exist!');
|
||||
}
|
||||
@@ -79,12 +79,12 @@ class kleeja_style
|
||||
//admin template always begin with admin_
|
||||
if (substr($template_name, 0, 6) == 'admin_')
|
||||
{
|
||||
$current_style_path = !empty($style_path) ? $style_path : $STYLE_PATH_ADMIN_ABS;
|
||||
$is_admin_template = true;
|
||||
$current_style_path = ! empty($style_path) ? $style_path : $STYLE_PATH_ADMIN_ABS;
|
||||
$is_admin_template = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$current_style_path = !empty($style_path) ? $style_path : $THIS_STYLE_PATH_ABS;
|
||||
$current_style_path = ! empty($style_path) ? $style_path : $THIS_STYLE_PATH_ABS;
|
||||
}
|
||||
|
||||
|
||||
@@ -95,29 +95,31 @@ class kleeja_style
|
||||
$is_tpl_exist = file_exists($template_path);
|
||||
|
||||
|
||||
if (!$is_tpl_exist)
|
||||
if (! $is_tpl_exist)
|
||||
{
|
||||
if (trim($config['style_depend_on']) != '')
|
||||
{
|
||||
$template_path_alternative = str_replace('/' . $config['style'] . '/', '/' . $config['style_depend_on'] . '/', $template_path);
|
||||
|
||||
if (file_exists($template_path_alternative))
|
||||
{
|
||||
$template_path = $template_path_alternative;
|
||||
$is_tpl_exist = true;
|
||||
$is_tpl_exist = true;
|
||||
}
|
||||
}
|
||||
else if ($is_admin_template)
|
||||
elseif ($is_admin_template)
|
||||
{
|
||||
$template_path = $DEFAULT_PATH_ADMIN_ABS . $template_name . '.html';
|
||||
$is_tpl_exist = true;
|
||||
$is_tpl_exist = true;
|
||||
}
|
||||
else if ($config['style'] != 'default' && !$is_admin_template)
|
||||
elseif ($config['style'] != 'default' && ! $is_admin_template)
|
||||
{
|
||||
$template_path_alternative = str_replace('/' . $config['style'] . '/', '/default/', $template_path);
|
||||
|
||||
if (file_exists($template_path_alternative))
|
||||
{
|
||||
$template_path = $template_path_alternative;
|
||||
$is_tpl_exist = true;
|
||||
$is_tpl_exist = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -132,26 +134,26 @@ class kleeja_style
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('style_parse_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$html = preg_replace(array('#<([\?%])=?.*?\1>#s', '#<script\s+language\s*=\s*(["\']?)php\1\s*>.*?</script\s*>#s', '#<\?php(?:\r\n?|[ \n\t]).*?\?>#s'), '', $html);
|
||||
$html = preg_replace_callback('/\(([{A-Z0-9_\.}\s!=<>]+)\?(.*):(.*)\)/iU', array('kleeja_style', '_iif_callback'), $html);
|
||||
$html = preg_replace_callback('/<(IF|ELSEIF|UNLESS) (.+)>/iU', array('kleeja_style', '_if_callback'), $html);
|
||||
$html = preg_replace_callback('/<LOOP\s+NAME\s*=\s*(\"|)+([a-z0-9_\.]{1,})+(\"|)\s*>/i', array('kleeja_style', '_loop_callback'), $html);
|
||||
$html = preg_replace_callback(kleeja_style::reg('var'), array('kleeja_style', '_vars_callback'), $html);
|
||||
$html = preg_replace(['#<([\?%])=?.*?\1>#s', '#<script\s+language\s*=\s*(["\']?)php\1\s*>.*?</script\s*>#s', '#<\?php(?:\r\n?|[ \n\t]).*?\?>#s'], '', $html);
|
||||
$html = preg_replace_callback('/\(([{A-Z0-9_\.}\s!=<>]+)\?(.*):(.*)\)/iU', ['kleeja_style', '_iif_callback'], $html);
|
||||
$html = preg_replace_callback('/<(IF|ELSEIF|UNLESS) (.+)>/iU', ['kleeja_style', '_if_callback'], $html);
|
||||
$html = preg_replace_callback('/<LOOP\s+NAME\s*=\s*(\"|)+([a-z0-9_\.]{1,})+(\"|)\s*>/i', ['kleeja_style', '_loop_callback'], $html);
|
||||
$html = preg_replace_callback(kleeja_style::reg('var'), ['kleeja_style', '_vars_callback'], $html);
|
||||
|
||||
$rep = array
|
||||
(
|
||||
'/<\/(LOOP|IF|END|IS_BROWSER|UNLESS)>/i' => "<?php } ?>",
|
||||
'/<INCLUDE(\s+NAME|)\s*=*\s*"(.+)"\s*>/iU' => '<?php echo $this->display("\\2"); ?>',
|
||||
'/<IS_BROWSER\s*=\s*"([a-z0-9,]+)"\s*>/iU' => '<?php if(is_browser("\\1")){ ?>',
|
||||
'/<IS_BROWSER\s*\!=\s*"([a-z0-9,]+)"\s*>/iU' => '<?php if(!is_browser("\\1")){ ?>',
|
||||
'/(<ELSE>|<ELSE\s?\/>)/i' => '<?php }else{ ?>',
|
||||
'/<ODD\s*=\s*"([a-zA-Z0-9_\-\+\.\/]+)"\s*>(.*?)<\/ODD\>/is' => "<?php if(intval(\$value['\\1'])%2){?> \\2 <?php } ?>",
|
||||
$rep =
|
||||
[
|
||||
'/<\/(LOOP|IF|END|IS_BROWSER|UNLESS)>/i' => '<?php } ?>',
|
||||
'/<INCLUDE(\s+NAME|)\s*=*\s*"(.+)"\s*>/iU' => '<?php echo $this->display("\\2"); ?>',
|
||||
'/<IS_BROWSER\s*=\s*"([a-z0-9,]+)"\s*>/iU' => '<?php if(is_browser("\\1")){ ?>',
|
||||
'/<IS_BROWSER\s*\!=\s*"([a-z0-9,]+)"\s*>/iU' => '<?php if(!is_browser("\\1")){ ?>',
|
||||
'/(<ELSE>|<ELSE\s?\/>)/i' => '<?php }else{ ?>',
|
||||
'/<ODD\s*=\s*"([a-zA-Z0-9_\-\+\.\/]+)"\s*>(.*?)<\/ODD\>/is' => "<?php if(intval(\$value['\\1'])%2){?> \\2 <?php } ?>",
|
||||
'/<EVEN\s*=\s*"([a-zA-Z0-9_\-\+\.\/]+)"\s*>(.*?)<\/EVEN>/is' => "<?php if(intval(\$value['\\1'])% 2 == 0){?> \\2 <?php } ?>",
|
||||
'/<RAND\s*=\s*"(.*?)\"\s*,\s*"(.*?)"\s*>/is' => "<?php \$KLEEJA_tpl_rand_is=(!isset(\$KLEEJA_tpl_rand_is) || \$KLEEJA_tpl_rand_is==0)?1:0; print((\$KLEEJA_tpl_rand_is==1) ?'\\1':'\\2'); ?>",
|
||||
'/\{%(key|value)%\}/i' => '<?php echo $\\1; ?>',
|
||||
);
|
||||
'/<RAND\s*=\s*"(.*?)\"\s*,\s*"(.*?)"\s*>/is' => "<?php \$KLEEJA_tpl_rand_is=(!isset(\$KLEEJA_tpl_rand_is) || \$KLEEJA_tpl_rand_is==0)?1:0; print((\$KLEEJA_tpl_rand_is==1) ?'\\1':'\\2'); ?>",
|
||||
'/\{%(key|value)%\}/i' => '<?php echo $\\1; ?>',
|
||||
];
|
||||
|
||||
return preg_replace(array_keys($rep), array_values($rep), $html);
|
||||
return preg_replace(array_keys($rep), array_values($rep), $html);
|
||||
}
|
||||
|
||||
|
||||
@@ -174,13 +176,14 @@ class kleeja_style
|
||||
*/
|
||||
protected function _if_callback($matches)
|
||||
{
|
||||
$atts = call_user_func(array('kleeja_style', '_get_attributes'), $matches[0]);
|
||||
$atts = call_user_func(['kleeja_style', '_get_attributes'], $matches[0]);
|
||||
$condition = '';
|
||||
foreach(['NAME' => '', 'LOOP' => '', 'AND' => ' && ', 'OR' => ' || '] as $attribute=>$separator)
|
||||
|
||||
foreach (['NAME' => '', 'LOOP' => '', 'AND' => ' && ', 'OR' => ' || '] as $attribute=>$separator)
|
||||
{
|
||||
if(! empty($atts[$attribute]))
|
||||
if (! empty($atts[$attribute]))
|
||||
{
|
||||
$condition .= $separator . $this->parse_condition($atts[$attribute], !empty($atts['LOOP']));
|
||||
$condition .= $separator . $this->parse_condition($atts[$attribute], ! empty($atts['LOOP']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,25 +205,29 @@ class kleeja_style
|
||||
|
||||
protected function parse_condition($condition, $is_loop)
|
||||
{
|
||||
$char = array(' eq ', ' lt ', ' gt ', ' lte ', ' gte ', ' neq ', '==', '!=', '>=', '<=', '<', '>');
|
||||
$reps = array('==', '<', '>', '<=', '>=', '!=', '==', '!=', '>=', '<=', '<', '>');
|
||||
$char = [' eq ', ' lt ', ' gt ', ' lte ', ' gte ', ' neq ', '==', '!=', '>=', '<=', '<', '>'];
|
||||
$reps = ['==', '<', '>', '<=', '>=', '!=', '==', '!=', '>=', '<=', '<', '>'];
|
||||
|
||||
$con = str_replace('$this->vars', '[----this-vars----]', $condition);
|
||||
|
||||
if (preg_match('/(.*)(' . implode('|', $char) . ')(.*)/i', $con, $arr)) {
|
||||
if (preg_match('/(.*)(' . implode('|', $char) . ')(.*)/i', $con, $arr))
|
||||
{
|
||||
$arr[1] = trim($arr[1]);
|
||||
$var1 = $arr[1][0] != '$' ? call_user_func(array('kleeja_style', '_var_callback'), (! $is_loop ? '{' . $arr[1] . '}' : '{{' . $arr[1] . '}}')) : $arr[1];
|
||||
$opr = str_replace($char, $reps, $arr[2]);
|
||||
$var2 = trim($arr[3]);
|
||||
$var1 = $arr[1][0] != '$' ? call_user_func(['kleeja_style', '_var_callback'], (! $is_loop ? '{' . $arr[1] . '}' : '{{' . $arr[1] . '}}')) : $arr[1];
|
||||
$opr = str_replace($char, $reps, $arr[2]);
|
||||
$var2 = trim($arr[3]);
|
||||
|
||||
#check for type
|
||||
if ($var2[0] != '$' && !preg_match('/[0-9]/', $var2)) {
|
||||
//check for type
|
||||
if ($var2[0] != '$' && ! preg_match('/[0-9]/', $var2))
|
||||
{
|
||||
$var2 = '"' . str_replace('"', '\"', $var2) . '"';
|
||||
}
|
||||
|
||||
$con = "$var1 $opr $var2";
|
||||
} elseif ($con[0] !== '$' && strpos($con, '(') === false) {
|
||||
$con = call_user_func(array('kleeja_style', '_var_callback'), (!$is_loop ? '{' . $con . '}' : '{{' . $con . '}}'));
|
||||
}
|
||||
elseif ($con[0] !== '$' && strpos($con, '(') === false)
|
||||
{
|
||||
$con = call_user_func(['kleeja_style', '_var_callback'], (! $is_loop ? '{' . $con . '}' : '{{' . $con . '}}'));
|
||||
}
|
||||
|
||||
return str_replace('[----this-vars----]', '$this->vars', $con);
|
||||
@@ -234,9 +241,9 @@ class kleeja_style
|
||||
*/
|
||||
protected function _vars_callback($matches)
|
||||
{
|
||||
$variable = call_user_func(array('kleeja_style', '_var_callback'), $matches);
|
||||
$variable = call_user_func(['kleeja_style', '_var_callback'], $matches);
|
||||
|
||||
if(strpos($matches[0], '{lang') !== false || strpos($matches[0], '{olang') !== false)
|
||||
if (strpos($matches[0], '{lang') !== false || strpos($matches[0], '{olang') !== false)
|
||||
{
|
||||
return '<?=isset(' . $variable . ') ? ' . $variable . ' : \'' . $matches[0] . '\'?>';
|
||||
}
|
||||
@@ -252,13 +259,13 @@ class kleeja_style
|
||||
*/
|
||||
protected function _var_callback($matches)
|
||||
{
|
||||
if (!is_array($matches))
|
||||
if (! is_array($matches))
|
||||
{
|
||||
preg_match(kleeja_style::reg('var'), $matches, $matches);
|
||||
}
|
||||
|
||||
$var = !empty($matches[2]) ? str_replace('.', '\'][\'', $matches[2]) : '';
|
||||
return (!empty($matches[1]) && trim($matches[1]) == '{{') ? '$value[\'' . $var . '\']' : '$this->vars[\'' . $var . '\']';
|
||||
$var = ! empty($matches[2]) ? str_replace('.', '\'][\'', $matches[2]) : '';
|
||||
return (! empty($matches[1]) && trim($matches[1]) == '{{') ? '$value[\'' . $var . '\']' : '$this->vars[\'' . $var . '\']';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -293,7 +300,7 @@ class kleeja_style
|
||||
{
|
||||
preg_match_all('/([a-z]+)="(.+)"/iU', $tag, $attribute);
|
||||
|
||||
$attributes = array();
|
||||
$attributes = [];
|
||||
|
||||
for ($i = 0; $i < count($attribute[1]); $i++)
|
||||
{
|
||||
@@ -301,11 +308,11 @@ class kleeja_style
|
||||
|
||||
if (preg_match('/NAME|LOOP/', $att))
|
||||
{
|
||||
$attributes[$att] = preg_replace_callback(kleeja_style::reg('var'), array('kleeja_style', '_var_callback'), $attribute[2][$i]);
|
||||
$attributes[$att] = preg_replace_callback(kleeja_style::reg('var'), ['kleeja_style', '_var_callback'], $attribute[2][$i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
$attributes[$att] = preg_replace_callback(kleeja_style::reg('var'), array('kleeja_style', '_var_callback_att'), $attribute[2][$i]);
|
||||
$attributes[$att] = preg_replace_callback(kleeja_style::reg('var'), ['kleeja_style', '_var_callback_att'], $attribute[2][$i]);
|
||||
}
|
||||
}
|
||||
return $attributes;
|
||||
@@ -325,7 +332,7 @@ class kleeja_style
|
||||
/**
|
||||
* load parser and return page content
|
||||
* @param $template_name
|
||||
* @param null $style_path optional, good for plugins
|
||||
* @param null $style_path optional, good for plugins
|
||||
* @return mixed|string
|
||||
*/
|
||||
public function display($template_name, $style_path = null)
|
||||
@@ -335,13 +342,13 @@ class kleeja_style
|
||||
$this->vars = &$GLOBALS;
|
||||
|
||||
//is there ?
|
||||
if (!file_exists(PATH . 'cache/tpl_' . $this->re_name_tpl($template_name, $style_path) . '.php') || !$this->caching)
|
||||
if (! file_exists(PATH . 'cache/tpl_' . $this->re_name_tpl($template_name, $style_path) . '.php') || ! $this->caching)
|
||||
{
|
||||
$this->_load_template($template_name, $style_path);
|
||||
}
|
||||
|
||||
ob_start();
|
||||
include(PATH . 'cache/tpl_' . $this->re_name_tpl($template_name, $style_path) . '.php');
|
||||
include PATH . 'cache/tpl_' . $this->re_name_tpl($template_name, $style_path) . '.php';
|
||||
$page = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
@@ -372,7 +379,7 @@ class kleeja_style
|
||||
*/
|
||||
protected function re_name_tpl($name, $style_path = null)
|
||||
{
|
||||
return preg_replace("/[^a-z0-9-_]/", "-", strtolower($name)) .
|
||||
(!empty($style_path) ? md5($style_path) : '');
|
||||
return preg_replace('/[^a-z0-9-_]/', '-', strtolower($name)) .
|
||||
(! empty($style_path) ? md5($style_path) : '');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,154 +7,156 @@
|
||||
// Version: 07.02.2010
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
class BMP
|
||||
{
|
||||
public static function imagebmp(&$img, $filename = false)
|
||||
{
|
||||
return imagebmp($img, $filename);
|
||||
}
|
||||
|
||||
public static function imagecreatefrombmp($filename)
|
||||
{
|
||||
return imagecreatefrombmp($filename);
|
||||
}
|
||||
public static function imagebmp(&$img, $filename = false)
|
||||
{
|
||||
return imagebmp($img, $filename);
|
||||
}
|
||||
|
||||
public static function imagecreatefrombmp($filename)
|
||||
{
|
||||
return imagecreatefrombmp($filename);
|
||||
}
|
||||
}
|
||||
|
||||
function imagebmp(&$img, $filename = false)
|
||||
{
|
||||
$wid = imagesx($img);
|
||||
$hei = imagesy($img);
|
||||
$wid_pad = str_pad('', $wid % 4, "\0");
|
||||
|
||||
$size = 54 + ($wid + $wid_pad) * $hei;
|
||||
|
||||
//prepare & save header
|
||||
$header['identifier'] = 'BM';
|
||||
$header['file_size'] = dword($size);
|
||||
$header['reserved'] = dword(0);
|
||||
$header['bitmap_data'] = dword(54);
|
||||
$header['header_size'] = dword(40);
|
||||
$header['width'] = dword($wid);
|
||||
$header['height'] = dword($hei);
|
||||
$header['planes'] = word(1);
|
||||
$header['bits_per_pixel'] = word(24);
|
||||
$header['compression'] = dword(0);
|
||||
$header['data_size'] = dword(0);
|
||||
$header['h_resolution'] = dword(0);
|
||||
$header['v_resolution'] = dword(0);
|
||||
$header['colors'] = dword(0);
|
||||
$header['important_colors'] = dword(0);
|
||||
$wid = imagesx($img);
|
||||
$hei = imagesy($img);
|
||||
$wid_pad = str_pad('', $wid % 4, "\0");
|
||||
|
||||
if ($filename)
|
||||
{
|
||||
$f = fopen($filename, "wb");
|
||||
foreach ($header AS $h)
|
||||
{
|
||||
fwrite($f, $h);
|
||||
}
|
||||
|
||||
//save pixels
|
||||
for ($y=$hei-1; $y>=0; $y--)
|
||||
{
|
||||
for ($x=0; $x<$wid; $x++)
|
||||
{
|
||||
$rgb = imagecolorat($img, $x, $y);
|
||||
fwrite($f, byte3($rgb));
|
||||
}
|
||||
fwrite($f, $wid_pad);
|
||||
}
|
||||
fclose($f);
|
||||
$size = 54 + ($wid + $wid_pad) * $hei;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($header AS $h)
|
||||
{
|
||||
echo $h;
|
||||
}
|
||||
|
||||
//save pixels
|
||||
for ($y=$hei-1; $y>=0; $y--)
|
||||
{
|
||||
for ($x=0; $x<$wid; $x++)
|
||||
{
|
||||
$rgb = imagecolorat($img, $x, $y);
|
||||
echo byte3($rgb);
|
||||
}
|
||||
echo $wid_pad;
|
||||
}
|
||||
//prepare & save header
|
||||
$header['identifier'] = 'BM';
|
||||
$header['file_size'] = dword($size);
|
||||
$header['reserved'] = dword(0);
|
||||
$header['bitmap_data'] = dword(54);
|
||||
$header['header_size'] = dword(40);
|
||||
$header['width'] = dword($wid);
|
||||
$header['height'] = dword($hei);
|
||||
$header['planes'] = word(1);
|
||||
$header['bits_per_pixel'] = word(24);
|
||||
$header['compression'] = dword(0);
|
||||
$header['data_size'] = dword(0);
|
||||
$header['h_resolution'] = dword(0);
|
||||
$header['v_resolution'] = dword(0);
|
||||
$header['colors'] = dword(0);
|
||||
$header['important_colors'] = dword(0);
|
||||
|
||||
return false;
|
||||
}
|
||||
if ($filename)
|
||||
{
|
||||
$f = fopen($filename, 'wb');
|
||||
|
||||
foreach ($header AS $h)
|
||||
{
|
||||
fwrite($f, $h);
|
||||
}
|
||||
|
||||
//save pixels
|
||||
for ($y=$hei-1; $y>=0; $y--)
|
||||
{
|
||||
for ($x=0; $x<$wid; $x++)
|
||||
{
|
||||
$rgb = imagecolorat($img, $x, $y);
|
||||
fwrite($f, byte3($rgb));
|
||||
}
|
||||
fwrite($f, $wid_pad);
|
||||
}
|
||||
fclose($f);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($header AS $h)
|
||||
{
|
||||
echo $h;
|
||||
}
|
||||
|
||||
//save pixels
|
||||
for ($y=$hei-1; $y>=0; $y--)
|
||||
{
|
||||
for ($x=0; $x<$wid; $x++)
|
||||
{
|
||||
$rgb = imagecolorat($img, $x, $y);
|
||||
echo byte3($rgb);
|
||||
}
|
||||
echo $wid_pad;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function imagecreatefrombmp($filename)
|
||||
{
|
||||
$f = fopen($filename, "rb");
|
||||
$f = fopen($filename, 'rb');
|
||||
|
||||
//read header
|
||||
//read header
|
||||
$header = fread($f, 54);
|
||||
$header = unpack( 'c2identifier/Vfile_size/Vreserved/Vbitmap_data/Vheader_size/' .
|
||||
'Vwidth/Vheight/vplanes/vbits_per_pixel/Vcompression/Vdata_size/'.
|
||||
'Vh_resolution/Vv_resolution/Vcolors/Vimportant_colors', $header);
|
||||
'Vwidth/Vheight/vplanes/vbits_per_pixel/Vcompression/Vdata_size/' .
|
||||
'Vh_resolution/Vv_resolution/Vcolors/Vimportant_colors', $header);
|
||||
|
||||
if ($header['identifier1'] != 66 or $header['identifier2'] != 77)
|
||||
{
|
||||
//die('Not a valid bmp file');
|
||||
return false;
|
||||
//die('Not a valid bmp file');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if ($header['bits_per_pixel'] != 24)
|
||||
{
|
||||
//die('Only 24bit BMP images are supported');
|
||||
return false;
|
||||
//die('Only 24bit BMP images are supported');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$wid2 = ceil((3*$header['width']) / 4) * 4;
|
||||
|
||||
|
||||
$wid = $header['width'];
|
||||
$hei = $header['height'];
|
||||
|
||||
$img = imagecreatetruecolor($header['width'], $header['height']);
|
||||
|
||||
//read pixels
|
||||
//read pixels
|
||||
for ($y=$hei-1; $y>=0; $y--)
|
||||
{
|
||||
$row = fread($f, $wid2);
|
||||
$pixels = str_split($row, 3);
|
||||
for ($x=0; $x<$wid; $x++)
|
||||
{
|
||||
imagesetpixel($img, $x, $y, dwordize($pixels[$x]));
|
||||
}
|
||||
$row = fread($f, $wid2);
|
||||
$pixels = str_split($row, 3);
|
||||
|
||||
for ($x=0; $x<$wid; $x++)
|
||||
{
|
||||
imagesetpixel($img, $x, $y, dwordize($pixels[$x]));
|
||||
}
|
||||
}
|
||||
fclose($f);
|
||||
|
||||
return $img;
|
||||
fclose($f);
|
||||
|
||||
return $img;
|
||||
}
|
||||
|
||||
function dwordize($str)
|
||||
{
|
||||
$a = ord($str[0]);
|
||||
$b = ord($str[1]);
|
||||
$c = ord($str[2]);
|
||||
return $c*256*256 + $b*256 + $a;
|
||||
$a = ord($str[0]);
|
||||
$b = ord($str[1]);
|
||||
$c = ord($str[2]);
|
||||
return $c*256*256 + $b*256 + $a;
|
||||
}
|
||||
|
||||
function byte3($n)
|
||||
{
|
||||
return chr($n & 255) . chr(($n >> 8) & 255) . chr(($n >> 16) & 255);
|
||||
return chr($n & 255) . chr(($n >> 8) & 255) . chr(($n >> 16) & 255);
|
||||
}
|
||||
function dword($n)
|
||||
{
|
||||
return pack("V", $n);
|
||||
return pack('V', $n);
|
||||
}
|
||||
function word($n)
|
||||
{
|
||||
return pack("v", $n);
|
||||
return pack('v', $n);
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -21,29 +21,29 @@ if (!defined('IN_COMMON'))
|
||||
*/
|
||||
function ext_check_safe($filename)
|
||||
{
|
||||
#bad files extensions
|
||||
$not_allowed = array('php', 'php3' ,'php5', 'php4', 'asp' ,'shtml' , 'html' ,'htm' ,'xhtml' ,'phtml', 'pl', 'cgi', 'htaccess', 'ini');
|
||||
|
||||
#let split the file name, suppose it filename.gif.php
|
||||
$tmp = explode(".", $filename);
|
||||
//bad files extensions
|
||||
$not_allowed = ['php', 'php3' ,'php5', 'php4', 'asp' ,'shtml' , 'html' ,'htm' ,'xhtml' ,'phtml', 'pl', 'cgi', 'htaccess', 'ini'];
|
||||
|
||||
#if it's less than 3, that its means normal
|
||||
if(sizeof($tmp) < 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
//let split the file name, suppose it filename.gif.php
|
||||
$tmp = explode('.', $filename);
|
||||
|
||||
$before_last_ext = $tmp[sizeof($tmp)-2];
|
||||
//if it's less than 3, that its means normal
|
||||
if (sizeof($tmp) < 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#in the bad extenion, return false to tell him
|
||||
if (in_array(strtolower($before_last_ext), $not_allowed))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
$before_last_ext = $tmp[sizeof($tmp)-2];
|
||||
|
||||
//in the bad extenion, return false to tell him
|
||||
if (in_array(strtolower($before_last_ext), $not_allowed))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -57,35 +57,34 @@ function generate_safety_htaccess($folder)
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('generate_safety_htaccess_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
if($return)
|
||||
if ($return)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
#data for the htaccess
|
||||
$htaccess_data = "<Files ~ \"^.*\.(php|php*|cgi|pl|phtml|shtml|sql|asp|aspx)\">\nOrder allow,deny\nDeny from all\n</Files>\n<IfModule mod_php4.c>\nphp_flag engine off\n</IfModule>\n<IfModule mod_php5.c>\nphp_flag engine off\n</IfModule>\nRemoveType .php .php* .phtml .pl .cgi .asp .aspx .sql";
|
||||
|
||||
#generate the htaccess
|
||||
$fi = @fopen($folder . "/.htaccess", "w");
|
||||
$fi2 = @fopen($folder . "/thumbs/.htaccess","w");
|
||||
@fwrite($fi, $htaccess_data);
|
||||
@fwrite($fi2, $htaccess_data);
|
||||
//data for the htaccess
|
||||
$htaccess_data = "<Files ~ \"^.*\.(php|php*|cgi|pl|phtml|shtml|sql|asp|aspx)\">\nOrder allow,deny\nDeny from all\n</Files>\n<IfModule mod_php4.c>\nphp_flag engine off\n</IfModule>\n<IfModule mod_php5.c>\nphp_flag engine off\n</IfModule>\nRemoveType .php .php* .phtml .pl .cgi .asp .aspx .sql";
|
||||
|
||||
//generate the htaccess
|
||||
$fi = @fopen($folder . '/.htaccess', 'w');
|
||||
$fi2 = @fopen($folder . '/thumbs/.htaccess', 'w');
|
||||
@fwrite($fi, $htaccess_data);
|
||||
@fwrite($fi2, $htaccess_data);
|
||||
}
|
||||
|
||||
/**
|
||||
* create an uploading folder
|
||||
* @param string $folder
|
||||
* @param string $folder
|
||||
* @return bool
|
||||
*/
|
||||
function make_folder($folder)
|
||||
{
|
||||
|
||||
$return = false;
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('make_folder_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
if($return)
|
||||
if ($return)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -95,23 +94,24 @@ function make_folder($folder)
|
||||
|
||||
|
||||
$path = '';
|
||||
|
||||
foreach ($folders as $sub_folder)
|
||||
{
|
||||
#try to make a new upload folder
|
||||
//try to make a new upload folder
|
||||
@mkdir($path . $sub_folder);
|
||||
@mkdir($path . $sub_folder . '/thumbs');
|
||||
|
||||
|
||||
#then try to chmod it to 0755
|
||||
//then try to chmod it to 0755
|
||||
@chmod($path . $sub_folder, 0755);
|
||||
@chmod($path . $sub_folder . '/thumbs/', 0755);
|
||||
|
||||
#make it safe
|
||||
//make it safe
|
||||
generate_safety_htaccess($path . $sub_folder);
|
||||
|
||||
#create empty index so nobody can see the contents
|
||||
$fo = @fopen($path . $sub_folder . "/index.html", "w");
|
||||
$fo2 = @fopen($path . $sub_folder . "/thumbs/index.html", "w");
|
||||
//create empty index so nobody can see the contents
|
||||
$fo = @fopen($path . $sub_folder . '/index.html', 'w');
|
||||
$fo2 = @fopen($path . $sub_folder . '/thumbs/index.html', 'w');
|
||||
@fwrite($fo, '<a href="http://kleeja.com"><p>KLEEJA ..</p></a>');
|
||||
@fwrite($fo2, '<a href="http://kleeja.com"><p>KLEEJA ..</p></a>');
|
||||
|
||||
@@ -128,42 +128,42 @@ function change_filename_decoding($filename, $i_loop, $ext, $decoding_type = '')
|
||||
{
|
||||
global $config;
|
||||
|
||||
$return = '';
|
||||
$return = '';
|
||||
|
||||
$decoding_type = empty($decoding_type) ? $config['decode'] : $decoding_type;
|
||||
|
||||
|
||||
#change it, time..
|
||||
if($decoding_type == "time" || $decoding_type == 1)
|
||||
{
|
||||
list($usec, $sec) = explode(" ", microtime());
|
||||
$extra = str_replace('.', '', (float)$usec + (float)$sec);
|
||||
$return = $extra . $i_loop . '.' . $ext;
|
||||
}
|
||||
# md5
|
||||
elseif($decoding_type == "md5" || $decoding_type == 2)
|
||||
{
|
||||
list($usec, $sec) = explode(" ", microtime());
|
||||
$extra = md5(((float)$usec + (float)$sec) . $filename);
|
||||
$extra = substr($extra, 0, 12);
|
||||
$return = $extra . $i_loop . "." . $ext;
|
||||
}
|
||||
# exists before, change it a little
|
||||
elseif($decoding_type == 'exists')
|
||||
{
|
||||
$return = substr($filename, 0, -(strlen($ext)+1)) . '_' . substr(md5( microtime(true) . $i_loop), rand(0, 20), 5) . '.' . $ext;
|
||||
}
|
||||
#nothing
|
||||
else
|
||||
{
|
||||
$filename = substr($filename, 0, -(strlen($ext)+1));
|
||||
$return = preg_replace('/[,.?\/*&^\\\$%#@()_!|"\~\'><=+}{; ]/', '-', $filename) . '.' . $ext;
|
||||
$return = preg_replace('/-+/', '-', $return);
|
||||
}
|
||||
//change it, time..
|
||||
if ($decoding_type == 'time' || $decoding_type == 1)
|
||||
{
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
$extra = str_replace('.', '', (float) $usec + (float) $sec);
|
||||
$return = $extra . $i_loop . '.' . $ext;
|
||||
}
|
||||
// md5
|
||||
elseif ($decoding_type == 'md5' || $decoding_type == 2)
|
||||
{
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
$extra = md5(((float) $usec + (float) $sec) . $filename);
|
||||
$extra = substr($extra, 0, 12);
|
||||
$return = $extra . $i_loop . '.' . $ext;
|
||||
}
|
||||
// exists before, change it a little
|
||||
elseif ($decoding_type == 'exists')
|
||||
{
|
||||
$return = substr($filename, 0, -(strlen($ext)+1)) . '_' . substr(md5( microtime(true) . $i_loop), rand(0, 20), 5) . '.' . $ext;
|
||||
}
|
||||
//nothing
|
||||
else
|
||||
{
|
||||
$filename = substr($filename, 0, -(strlen($ext)+1));
|
||||
$return = preg_replace('/[,.?\/*&^\\\$%#@()_!|"\~\'><=+}{; ]/', '-', $filename) . '.' . $ext;
|
||||
$return = preg_replace('/-+/', '-', $return);
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('change_filename_decoding_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
return $return;
|
||||
return $return;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -171,21 +171,21 @@ function change_filename_decoding($filename, $i_loop, $ext, $decoding_type = '')
|
||||
*/
|
||||
function change_filename_templates($filename)
|
||||
{
|
||||
#random number...
|
||||
if (preg_match("/{rand:([0-9]+)}/i", $filename, $m))
|
||||
{
|
||||
$filename = preg_replace("/{rand:([0-9]+)}/i", substr(md5(time()), 0, $m[1]), $filename);
|
||||
}
|
||||
|
||||
#current date
|
||||
if (preg_match("/{date:([a-zA-Z-_]+)}/i", $filename, $m))
|
||||
{
|
||||
$filename = preg_replace("/{date:([a-zA-Z-_]+)}/i", date($m[1]), $filename);
|
||||
}
|
||||
//random number...
|
||||
if (preg_match('/{rand:([0-9]+)}/i', $filename, $m))
|
||||
{
|
||||
$filename = preg_replace('/{rand:([0-9]+)}/i', substr(md5(time()), 0, $m[1]), $filename);
|
||||
}
|
||||
|
||||
//current date
|
||||
if (preg_match('/{date:([a-zA-Z-_]+)}/i', $filename, $m))
|
||||
{
|
||||
$filename = preg_replace('/{date:([a-zA-Z-_]+)}/i', date($m[1]), $filename);
|
||||
}
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('change_filename_templates_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
return $filename;
|
||||
return $filename;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,12 +194,11 @@ function change_filename_templates($filename)
|
||||
*/
|
||||
function check_mime_type($given_file_mime, $file_ext, $file_path)
|
||||
{
|
||||
|
||||
$return = '';
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('kleeja_check_mime_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
if($return !== '')
|
||||
if ($return !== '')
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
@@ -207,7 +206,7 @@ function check_mime_type($given_file_mime, $file_ext, $file_path)
|
||||
|
||||
$mime = '';
|
||||
|
||||
if(function_exists('finfo_open') || function_exists('mime_content_type'))
|
||||
if (function_exists('finfo_open') || function_exists('mime_content_type'))
|
||||
{
|
||||
if (function_exists('mime_content_type'))
|
||||
{
|
||||
@@ -216,19 +215,19 @@ function check_mime_type($given_file_mime, $file_ext, $file_path)
|
||||
else
|
||||
{
|
||||
$f_info = finfo_open(FILEINFO_MIME_TYPE);
|
||||
$mime = finfo_file($f_info, $file_path);
|
||||
$mime = finfo_file($f_info, $file_path);
|
||||
finfo_close($f_info);
|
||||
}
|
||||
}
|
||||
else if(!empty($given_file_mime))
|
||||
elseif (! empty($given_file_mime))
|
||||
{
|
||||
$mime = $given_file_mime;
|
||||
}
|
||||
|
||||
|
||||
if(!empty($mime))
|
||||
if (! empty($mime))
|
||||
{
|
||||
$supposed_mime = explode("/", get_mime_for_header($file_ext), 2);
|
||||
$supposed_mime = explode('/', get_mime_for_header($file_ext), 2);
|
||||
|
||||
if (is_array($supposed_mime))
|
||||
{
|
||||
@@ -247,26 +246,26 @@ function check_mime_type($given_file_mime, $file_ext, $file_path)
|
||||
|
||||
//if normal checks failed!
|
||||
|
||||
if(@kleeja_filesize($file_path) > 6*(1000*1024))
|
||||
if (@kleeja_filesize($file_path) > 6*(1000*1024))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//check for bad things inside files ...
|
||||
//<.? i cant add it here cuz alot of files contain it
|
||||
$maybe_bad_codes_are = array('<' . 'script', 'zend', 'base64_decode', '<' . '?'. 'php', '<' . '?' . '=');
|
||||
$maybe_bad_codes_are = ['<' . 'script', 'zend', 'base64_decode', '<' . '?' . 'php', '<' . '?' . '='];
|
||||
|
||||
if(!($data = @file_get_contents($file_path)))
|
||||
if (! ($data = @file_get_contents($file_path)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
foreach($maybe_bad_codes_are as $i)
|
||||
foreach ($maybe_bad_codes_are as $i)
|
||||
{
|
||||
if(strpos(strtolower($data), $i) !== false)
|
||||
if (strpos(strtolower($data), $i) !== false)
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -280,37 +279,37 @@ function check_mime_type($given_file_mime, $file_ext, $file_path)
|
||||
*/
|
||||
function user_is_flooding($user_id = '-1')
|
||||
{
|
||||
global $SQL, $dbprefix, $config;
|
||||
global $SQL, $dbprefix, $config;
|
||||
|
||||
$return = 'empty';
|
||||
$return = 'empty';
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('user_is_flooding_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run
|
||||
|
||||
if($return != 'empty')
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
if ($return != 'empty')
|
||||
{
|
||||
return $return;
|
||||
}
|
||||
|
||||
//if the value is zero (means that the function is disabled) then return false immediately
|
||||
if(($user_id == '-1' && $config['guestsectoupload'] == 0) || $user_id != '-1' && $config['usersectoupload'] == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
//if the value is zero (means that the function is disabled) then return false immediately
|
||||
if (($user_id == '-1' && $config['guestsectoupload'] == 0) || $user_id != '-1' && $config['usersectoupload'] == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//In my point of view I see 30 seconds is not bad rate to stop flooding ..
|
||||
//even though this minimum rate sometime isn't enough to protect Kleeja from flooding attacks
|
||||
$time = time() - ($user_id == '-1' ? $config['guestsectoupload'] : $config['usersectoupload']);
|
||||
//In my point of view I see 30 seconds is not bad rate to stop flooding ..
|
||||
//even though this minimum rate sometime isn't enough to protect Kleeja from flooding attacks
|
||||
$time = time() - ($user_id == '-1' ? $config['guestsectoupload'] : $config['usersectoupload']);
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'f.time',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'WHERE' => 'f.time >= ' . $time . ' AND f.user_ip = \'' . $SQL->escape(get_ip()) . '\'',
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'f.time',
|
||||
'FROM' => "{$dbprefix}files f",
|
||||
'WHERE' => 'f.time >= ' . $time . ' AND f.user_ip = \'' . $SQL->escape(get_ip()) . '\'',
|
||||
];
|
||||
|
||||
if ($SQL->num_rows($SQL->build($query)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ($SQL->num_rows($SQL->build($query)))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -8,59 +8,67 @@
|
||||
*/
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
#
|
||||
# This helper is used to help in remote uploading
|
||||
#
|
||||
//
|
||||
// This helper is used to help in remote uploading
|
||||
//
|
||||
|
||||
/**
|
||||
* bring the file size from remote file; aka url
|
||||
*/
|
||||
function get_remote_file_size($url, $method = "GET", $data = "", $redirect = 10)
|
||||
function get_remote_file_size($url, $method = 'GET', $data = '', $redirect = 10)
|
||||
{
|
||||
$url = parse_url($url);
|
||||
$fp = @fsockopen ($url['host'], (!empty($url['port']) ? (int)$url['port'] : 80), $errno, $errstr, 30);
|
||||
if ($fp)
|
||||
{
|
||||
$path = (!empty($url['path']) ? $url['path'] : "/").(!empty($url['query']) ? "?" . $url['query'] : "");
|
||||
$header = "\r\nHost: ".$url['host'];
|
||||
if("post" == strtolower($method))
|
||||
{
|
||||
$header .= "\r\nContent-Length: " . strlen($data);
|
||||
}
|
||||
|
||||
fputs ($fp, $method." ".$path." HTTP/1.0" . $header . "\r\n\r\n". ("post" == strtolower($method) ? $data : ""));
|
||||
if(!feof($fp))
|
||||
{
|
||||
$scheme = fgets($fp);
|
||||
list(, $code ) = explode(" ", $scheme);
|
||||
$headers = array("Scheme" => $scheme);
|
||||
}
|
||||
$url = parse_url($url);
|
||||
$fp = @fsockopen ($url['host'], (! empty($url['port']) ? (int) $url['port'] : 80), $errno, $errstr, 30);
|
||||
|
||||
while (!feof($fp))
|
||||
{
|
||||
$h = fgets($fp);
|
||||
if($h == "\r\n" OR $h == "\n") break;
|
||||
list($key, $value) = explode(":", $h, 2);
|
||||
$headers[$key] = trim($value);
|
||||
if($code >= 300 AND $code < 400 AND strtolower($key) == "location" AND $redirect > 0)
|
||||
{
|
||||
return get_remote_file_size($headers[$key], $method, $data, --$redirect);
|
||||
}
|
||||
}
|
||||
|
||||
$body = "";
|
||||
/*while ( !feof($fp) ) $body .= fgets($fp);*/
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (array("error" => array("errno" => $errno, "errstr" => $errstr)));
|
||||
}
|
||||
|
||||
return (string) $headers["Content-Length"];
|
||||
if ($fp)
|
||||
{
|
||||
$path = (! empty($url['path']) ? $url['path'] : '/') . (! empty($url['query']) ? '?' . $url['query'] : '');
|
||||
$header = "\r\nHost: " . $url['host'];
|
||||
|
||||
if ('post' == strtolower($method))
|
||||
{
|
||||
$header .= "\r\nContent-Length: " . strlen($data);
|
||||
}
|
||||
|
||||
fputs ($fp, $method . ' ' . $path . ' HTTP/1.0' . $header . "\r\n\r\n" . ('post' == strtolower($method) ? $data : ''));
|
||||
|
||||
if (! feof($fp))
|
||||
{
|
||||
$scheme = fgets($fp);
|
||||
list(, $code ) = explode(' ', $scheme);
|
||||
$headers = ['Scheme' => $scheme];
|
||||
}
|
||||
|
||||
while (! feof($fp))
|
||||
{
|
||||
$h = fgets($fp);
|
||||
|
||||
if ($h == "\r\n" OR $h == "\n")
|
||||
{
|
||||
break;
|
||||
}
|
||||
list($key, $value) = explode(':', $h, 2);
|
||||
$headers[$key] = trim($value);
|
||||
|
||||
if ($code >= 300 AND $code < 400 AND strtolower($key) == 'location' AND $redirect > 0)
|
||||
{
|
||||
return get_remote_file_size($headers[$key], $method, $data, --$redirect);
|
||||
}
|
||||
}
|
||||
|
||||
$body = '';
|
||||
// while ( !feof($fp) ) $body .= fgets($fp);
|
||||
fclose($fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (['error' => ['errno' => $errno, 'errstr' => $errstr]]);
|
||||
}
|
||||
|
||||
return (string) $headers['Content-Length'];
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,153 +18,170 @@ if (!defined('IN_COMMON'))
|
||||
/**
|
||||
* Creates a a thumbnail of an image
|
||||
* @example helper_thumb('pics/apple.jpg','thumbs/tn_apple.jpg',100,100);
|
||||
* @param string $source_path
|
||||
* @param string $ext
|
||||
* @param string $dest_image
|
||||
* @param int $dw
|
||||
* @param int $dh
|
||||
* @param string $source_path
|
||||
* @param string $ext
|
||||
* @param string $dest_image
|
||||
* @param int $dw
|
||||
* @param int $dh
|
||||
* @return bool|null
|
||||
*/
|
||||
function helper_thumb($source_path, $ext, $dest_image, $dw, $dh)
|
||||
{
|
||||
#no file, quit it
|
||||
if(!file_exists($source_path))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
//no file, quit it
|
||||
if (! file_exists($source_path))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
#check width, height
|
||||
if(intval($dw) == 0 || intval($dw) < 10)
|
||||
{
|
||||
$dw = 100;
|
||||
}
|
||||
//check width, height
|
||||
if (intval($dw) == 0 || intval($dw) < 10)
|
||||
{
|
||||
$dw = 100;
|
||||
}
|
||||
|
||||
if(intval($dh) == 0 || intval($dh) < 10)
|
||||
{
|
||||
$dh = $dw;
|
||||
}
|
||||
if (intval($dh) == 0 || intval($dh) < 10)
|
||||
{
|
||||
$dh = $dw;
|
||||
}
|
||||
|
||||
#if there is imagick lib, then we should use it
|
||||
if(function_exists('phpversion') && phpversion('imagick'))
|
||||
{
|
||||
helper_thumb_imagick($source_path, $ext, $dest_image, $dw, $dh);
|
||||
return null;
|
||||
}
|
||||
//if there is imagick lib, then we should use it
|
||||
if (function_exists('phpversion') && phpversion('imagick'))
|
||||
{
|
||||
helper_thumb_imagick($source_path, $ext, $dest_image, $dw, $dh);
|
||||
return null;
|
||||
}
|
||||
|
||||
//get file info
|
||||
list($source_width, $source_height, $source_type) = array(false, false, false);
|
||||
if(function_exists('getimagesize'))
|
||||
{
|
||||
list($source_width, $source_height, $source_type) = getimagesize($source_path);
|
||||
}
|
||||
|
||||
if(!function_exists('imagecreatefromjpeg'))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
//get file info
|
||||
list($source_width, $source_height, $source_type) = [false, false, false];
|
||||
|
||||
if (function_exists('getimagesize'))
|
||||
{
|
||||
list($source_width, $source_height, $source_type) = getimagesize($source_path);
|
||||
}
|
||||
|
||||
if (! function_exists('imagecreatefromjpeg'))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$source_gdim = null;
|
||||
|
||||
$ext = strtolower(trim($ext));
|
||||
$ext = strtolower(trim($ext));
|
||||
|
||||
if(empty($ext))
|
||||
if (empty($ext))
|
||||
{
|
||||
$ext = strtolower(preg_replace('/^.*\./', '', $source_path));
|
||||
}
|
||||
|
||||
switch($ext)
|
||||
{
|
||||
case 'gif':
|
||||
$source_gdim = imagecreatefromgif( $source_path );
|
||||
break;
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$source_gdim = imagecreatefromjpeg( $source_path );
|
||||
break;
|
||||
case 'png':
|
||||
$source_gdim = imagecreatefrompng( $source_path );
|
||||
break;
|
||||
case 'bmp':
|
||||
if(!defined('BMP_CLASS_INCLUDED'))
|
||||
{
|
||||
include dirname(__file__) . '/BMP.php';
|
||||
define('BMP_CLASS_INCLUDED', true);
|
||||
}
|
||||
switch ($ext)
|
||||
{
|
||||
case 'gif':
|
||||
$source_gdim = imagecreatefromgif( $source_path );
|
||||
|
||||
$source_gdim = imagecreatefrombmp( $source_path );
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
$source_width = !$source_width ? ImageSX($source_gdim) : $source_width;
|
||||
$source_height = !$source_height ? ImageSY($source_gdim) : $source_height;
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$source_gdim = imagecreatefromjpeg( $source_path );
|
||||
|
||||
$source_aspect_ratio = $source_width / $source_height;
|
||||
$desired_aspect_ratio = $dw / $dh;
|
||||
break;
|
||||
|
||||
if ($source_aspect_ratio > $desired_aspect_ratio)
|
||||
{
|
||||
// Triggered when source image is wider
|
||||
$temp_height = $dh;
|
||||
$temp_width = (int) ($dh * $source_aspect_ratio);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Triggered otherwise (i.e. source image is similar or taller)
|
||||
$temp_width = $dw;
|
||||
$temp_height = (int) ($dw / $source_aspect_ratio);
|
||||
}
|
||||
case 'png':
|
||||
$source_gdim = imagecreatefrompng( $source_path );
|
||||
|
||||
// Resize the image into a temporary GD image
|
||||
$temp_gdim = imagecreatetruecolor( $temp_width, $temp_height );
|
||||
break;
|
||||
|
||||
imagecopyresampled(
|
||||
$temp_gdim,
|
||||
$source_gdim,
|
||||
0, 0,
|
||||
0, 0,
|
||||
$temp_width, $temp_height,
|
||||
$source_width, $source_height
|
||||
);
|
||||
case 'bmp':
|
||||
if (! defined('BMP_CLASS_INCLUDED'))
|
||||
{
|
||||
include dirname(__file__) . '/BMP.php';
|
||||
define('BMP_CLASS_INCLUDED', true);
|
||||
}
|
||||
|
||||
// Copy cropped region from temporary image into the desired GD image
|
||||
$x0 = ($temp_width - $dw) / 2;
|
||||
$y0 = ($temp_height - $dh) / 2;
|
||||
$source_gdim = imagecreatefrombmp( $source_path );
|
||||
|
||||
$desired_gdim = imagecreatetruecolor($dw, $dh);
|
||||
imagecopy(
|
||||
$desired_gdim,
|
||||
$temp_gdim,
|
||||
0, 0,
|
||||
$x0, $y0,
|
||||
$dw, $dh
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
// Create thumbnail
|
||||
switch(strtolower(preg_replace('/^.*\./', '', $dest_image)))
|
||||
{
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$return = @imagejpeg($desired_gdim, $dest_image, 90);
|
||||
break;
|
||||
case 'png':
|
||||
$return = @imagepng($desired_gdim, $dest_image);
|
||||
break;
|
||||
case 'gif':
|
||||
$return = @imagegif($desired_gdim, $dest_image);
|
||||
break;
|
||||
case 'bmp':
|
||||
$return = @imagebmp($desired_gdim, $dest_image);
|
||||
break;
|
||||
default:
|
||||
// Unsupported format
|
||||
$return = false;
|
||||
break;
|
||||
}
|
||||
$source_width = ! $source_width ? imagesx($source_gdim) : $source_width;
|
||||
$source_height = ! $source_height ? imagesy($source_gdim) : $source_height;
|
||||
|
||||
@imagedestroy($desired_gdim);
|
||||
@imagedestroy($source_gdim);
|
||||
$source_aspect_ratio = $source_width / $source_height;
|
||||
$desired_aspect_ratio = $dw / $dh;
|
||||
|
||||
return $return;
|
||||
if ($source_aspect_ratio > $desired_aspect_ratio)
|
||||
{
|
||||
// Triggered when source image is wider
|
||||
$temp_height = $dh;
|
||||
$temp_width = (int) ($dh * $source_aspect_ratio);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Triggered otherwise (i.e. source image is similar or taller)
|
||||
$temp_width = $dw;
|
||||
$temp_height = (int) ($dw / $source_aspect_ratio);
|
||||
}
|
||||
|
||||
// Resize the image into a temporary GD image
|
||||
$temp_gdim = imagecreatetruecolor( $temp_width, $temp_height );
|
||||
|
||||
imagecopyresampled(
|
||||
$temp_gdim,
|
||||
$source_gdim,
|
||||
0, 0,
|
||||
0, 0,
|
||||
$temp_width, $temp_height,
|
||||
$source_width, $source_height
|
||||
);
|
||||
|
||||
// Copy cropped region from temporary image into the desired GD image
|
||||
$x0 = ($temp_width - $dw) / 2;
|
||||
$y0 = ($temp_height - $dh) / 2;
|
||||
|
||||
$desired_gdim = imagecreatetruecolor($dw, $dh);
|
||||
imagecopy(
|
||||
$desired_gdim,
|
||||
$temp_gdim,
|
||||
0, 0,
|
||||
$x0, $y0,
|
||||
$dw, $dh
|
||||
);
|
||||
|
||||
// Create thumbnail
|
||||
switch (strtolower(preg_replace('/^.*\./', '', $dest_image)))
|
||||
{
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
$return = @imagejpeg($desired_gdim, $dest_image, 90);
|
||||
|
||||
break;
|
||||
|
||||
case 'png':
|
||||
$return = @imagepng($desired_gdim, $dest_image);
|
||||
|
||||
break;
|
||||
|
||||
case 'gif':
|
||||
$return = @imagegif($desired_gdim, $dest_image);
|
||||
|
||||
break;
|
||||
|
||||
case 'bmp':
|
||||
$return = @imagebmp($desired_gdim, $dest_image);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
// Unsupported format
|
||||
$return = false;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@imagedestroy($desired_gdim);
|
||||
@imagedestroy($source_gdim);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
||||
|
||||
@@ -175,28 +192,28 @@ function helper_thumb($source_path, $ext, $dest_image, $dw, $dh)
|
||||
*/
|
||||
function scale_image_imagick($x, $y, $cx, $cy)
|
||||
{
|
||||
//Set the default NEW values to be the old, in case it doesn't even need scaling
|
||||
list($nx, $ny) = array($x, $y);
|
||||
//Set the default NEW values to be the old, in case it doesn't even need scaling
|
||||
list($nx, $ny) = [$x, $y];
|
||||
|
||||
//If image is generally smaller, don't even bother
|
||||
if ($x >= $cx || $y >= $cx)
|
||||
{
|
||||
//If image is generally smaller, don't even bother
|
||||
if ($x >= $cx || $y >= $cx)
|
||||
{
|
||||
$rx = $ry = 0;
|
||||
|
||||
//Work out ratios
|
||||
if ($x > 0)
|
||||
{
|
||||
$rx = $cx / $x;
|
||||
}
|
||||
|
||||
if ($y > 0)
|
||||
{
|
||||
$ry = $cy / $y;
|
||||
//Work out ratios
|
||||
if ($x > 0)
|
||||
{
|
||||
$rx = $cx / $x;
|
||||
}
|
||||
|
||||
//Use the lowest ratio, to ensure we don't go over the wanted image size
|
||||
if ($rx > $ry)
|
||||
{
|
||||
if ($y > 0)
|
||||
{
|
||||
$ry = $cy / $y;
|
||||
}
|
||||
|
||||
//Use the lowest ratio, to ensure we don't go over the wanted image size
|
||||
if ($rx > $ry)
|
||||
{
|
||||
$r = $ry;
|
||||
}
|
||||
else
|
||||
@@ -204,55 +221,52 @@ function scale_image_imagick($x, $y, $cx, $cy)
|
||||
$r = $rx;
|
||||
}
|
||||
|
||||
//Calculate the new size based on the chosen ratio
|
||||
$nx = intval($x * $r);
|
||||
$ny = intval($y * $r);
|
||||
}
|
||||
//Calculate the new size based on the chosen ratio
|
||||
$nx = intval($x * $r);
|
||||
$ny = intval($y * $r);
|
||||
}
|
||||
|
||||
//Return the results
|
||||
return array($nx, $ny);
|
||||
//Return the results
|
||||
return [$nx, $ny];
|
||||
}
|
||||
|
||||
function helper_thumb_imagick($name, $ext, $filename, $new_w, $new_h)
|
||||
{
|
||||
#intiating the Imagick lib
|
||||
$im = new Imagick($name);
|
||||
//intiating the Imagick lib
|
||||
$im = new Imagick($name);
|
||||
|
||||
#guess the right thumb height, weights
|
||||
list($thumb_w, $thumb_h) = scale_image_imagick(
|
||||
$im->getImageWidth(),
|
||||
$im->getImageHeight(),
|
||||
$new_w,
|
||||
$new_h);
|
||||
//guess the right thumb height, weights
|
||||
list($thumb_w, $thumb_h) = scale_image_imagick(
|
||||
$im->getImageWidth(),
|
||||
$im->getImageHeight(),
|
||||
$new_w,
|
||||
$new_h);
|
||||
|
||||
#an exception for gif image
|
||||
#generating thumb with 10 frames only, big gif is a devil
|
||||
if($ext == 'gif')
|
||||
{
|
||||
$i = 0;
|
||||
//$gif_new = new Imagick();
|
||||
foreach ($im as $frame)
|
||||
{
|
||||
$frame->thumbnailImage($thumb_w, $thumb_h);
|
||||
$frame->setImagePage($thumb_w, $thumb_h, 0, 0);
|
||||
// $gif_new->addImage($frame->getImage());
|
||||
if($i >= 10)
|
||||
{
|
||||
# more than 10 frames, quit it
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$im->writeImages($filename, true);
|
||||
return;
|
||||
}
|
||||
//an exception for gif image
|
||||
//generating thumb with 10 frames only, big gif is a devil
|
||||
if ($ext == 'gif')
|
||||
{
|
||||
$i = 0;
|
||||
//$gif_new = new Imagick();
|
||||
foreach ($im as $frame)
|
||||
{
|
||||
$frame->thumbnailImage($thumb_w, $thumb_h);
|
||||
$frame->setImagePage($thumb_w, $thumb_h, 0, 0);
|
||||
// $gif_new->addImage($frame->getImage());
|
||||
if ($i >= 10)
|
||||
{
|
||||
// more than 10 frames, quit it
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$im->writeImages($filename, true);
|
||||
return;
|
||||
}
|
||||
|
||||
#and other image extension use one way
|
||||
$im->thumbnailImage($thumb_w, $thumb_h);
|
||||
//and other image extension use one way
|
||||
$im->thumbnailImage($thumb_w, $thumb_h);
|
||||
|
||||
#right it
|
||||
$im->writeImages($filename, false);
|
||||
return;
|
||||
//right it
|
||||
$im->writeImages($filename, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -25,167 +25,168 @@ if (!defined('IN_COMMON'))
|
||||
function helper_watermark($name, $ext)
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('helper_watermark_func', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
#is this file really exsits ?
|
||||
if(!file_exists($name))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$src_logo = $logo_path = false;
|
||||
if(file_exists(dirname(__FILE__) . '/../../images/watermark.png'))
|
||||
{
|
||||
$logo_path= dirname(__FILE__) . '/../../images/watermark.png';
|
||||
$src_logo = imagecreatefrompng($logo_path);
|
||||
}
|
||||
elseif(file_exists(dirname(__FILE__) . '/../../images/watermark.gif'))
|
||||
{
|
||||
$logo_path= dirname(__FILE__) . '/../../images/watermark.gif';
|
||||
$src_logo = imagecreatefromgif($logo_path);
|
||||
}
|
||||
//is this file really exsits ?
|
||||
if (! file_exists($name))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#no watermark pic
|
||||
if(!$src_logo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
$src_logo = $logo_path = false;
|
||||
|
||||
#if there is imagick lib, then we should use it
|
||||
if(function_exists('phpversion') && phpversion('imagick'))
|
||||
{
|
||||
helper_watermark_imagick($name, $ext, $logo_path);
|
||||
return;
|
||||
}
|
||||
if (file_exists(dirname(__FILE__) . '/../../images/watermark.png'))
|
||||
{
|
||||
$logo_path= dirname(__FILE__) . '/../../images/watermark.png';
|
||||
$src_logo = imagecreatefrompng($logo_path);
|
||||
}
|
||||
elseif (file_exists(dirname(__FILE__) . '/../../images/watermark.gif'))
|
||||
{
|
||||
$logo_path= dirname(__FILE__) . '/../../images/watermark.gif';
|
||||
$src_logo = imagecreatefromgif($logo_path);
|
||||
}
|
||||
|
||||
#now, lets work and detect our image extension
|
||||
if (strpos($ext, 'jp') !== false)
|
||||
{
|
||||
$src_img = @imagecreatefromjpeg($name);
|
||||
}
|
||||
elseif (strpos($ext, 'png') !== false)
|
||||
{
|
||||
$src_img = @imagecreatefrompng($name);
|
||||
}
|
||||
elseif (strpos($ext, 'gif') !== false)
|
||||
{
|
||||
return;
|
||||
// $src_img = @imagecreatefromgif($name);
|
||||
}
|
||||
elseif(strpos($ext, 'bmp') !== false)
|
||||
{
|
||||
if(!defined('BMP_CLASS_INCLUDED'))
|
||||
{
|
||||
include dirname(__file__) . '/BMP.php';
|
||||
define('BMP_CLASS_INCLUDED', true);
|
||||
}
|
||||
//no watermark pic
|
||||
if (! $src_logo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$src_img = imagecreatefrombmp($name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
//if there is imagick lib, then we should use it
|
||||
if (function_exists('phpversion') && phpversion('imagick'))
|
||||
{
|
||||
helper_watermark_imagick($name, $ext, $logo_path);
|
||||
return;
|
||||
}
|
||||
|
||||
#detect width, height for the image
|
||||
$bwidth = @imageSX($src_img);
|
||||
$bheight = @imageSY($src_img);
|
||||
|
||||
#detect width, height for the watermark image
|
||||
$lwidth = @imageSX($src_logo);
|
||||
$lheight = @imageSY($src_logo);
|
||||
//now, lets work and detect our image extension
|
||||
if (strpos($ext, 'jp') !== false)
|
||||
{
|
||||
$src_img = @imagecreatefromjpeg($name);
|
||||
}
|
||||
elseif (strpos($ext, 'png') !== false)
|
||||
{
|
||||
$src_img = @imagecreatefrompng($name);
|
||||
}
|
||||
elseif (strpos($ext, 'gif') !== false)
|
||||
{
|
||||
return;
|
||||
// $src_img = @imagecreatefromgif($name);
|
||||
}
|
||||
elseif (strpos($ext, 'bmp') !== false)
|
||||
{
|
||||
if (! defined('BMP_CLASS_INCLUDED'))
|
||||
{
|
||||
include dirname(__file__) . '/BMP.php';
|
||||
define('BMP_CLASS_INCLUDED', true);
|
||||
}
|
||||
|
||||
$src_img = imagecreatefrombmp($name);
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//detect width, height for the image
|
||||
$bwidth = @imagesx($src_img);
|
||||
$bheight = @imagesy($src_img);
|
||||
|
||||
//detect width, height for the watermark image
|
||||
$lwidth = @imagesx($src_logo);
|
||||
$lheight = @imagesy($src_logo);
|
||||
|
||||
|
||||
if ($bwidth > $lwidth+5 && $bheight > $lheight+5)
|
||||
{
|
||||
#where exaxtly do we have to make the watermark ..
|
||||
$src_x = $bwidth - ($lwidth + 5);
|
||||
$src_y = $bheight - ($lheight + 5);
|
||||
|
||||
#make it now, watermark it
|
||||
@ImageAlphaBlending($src_img, true);
|
||||
@ImageCopy($src_img, $src_logo, $src_x, $src_y, 0, 0, $lwidth, $lheight);
|
||||
if ($bwidth > $lwidth+5 && $bheight > $lheight+5)
|
||||
{
|
||||
//where exaxtly do we have to make the watermark ..
|
||||
$src_x = $bwidth - ($lwidth + 5);
|
||||
$src_y = $bheight - ($lheight + 5);
|
||||
|
||||
if (strpos($ext, 'jp') !== false)
|
||||
{
|
||||
#no compression, same quality
|
||||
@imagejpeg($src_img, $name, 100);
|
||||
}
|
||||
elseif (strpos($ext, 'png') !== false)
|
||||
{
|
||||
#no compression, same quality
|
||||
@imagepng($src_img, $name, 0);
|
||||
}
|
||||
elseif (strpos($ext, 'gif') !== false)
|
||||
{
|
||||
@imagegif($src_img, $name);
|
||||
}
|
||||
elseif (strpos($ext, 'bmp') !== false)
|
||||
{
|
||||
@imagebmp($src_img, $name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#image is not big enough to watermark it
|
||||
return;
|
||||
}
|
||||
//make it now, watermark it
|
||||
@imagealphablending($src_img, true);
|
||||
@imagecopy($src_img, $src_logo, $src_x, $src_y, 0, 0, $lwidth, $lheight);
|
||||
|
||||
if (strpos($ext, 'jp') !== false)
|
||||
{
|
||||
//no compression, same quality
|
||||
@imagejpeg($src_img, $name, 100);
|
||||
}
|
||||
elseif (strpos($ext, 'png') !== false)
|
||||
{
|
||||
//no compression, same quality
|
||||
@imagepng($src_img, $name, 0);
|
||||
}
|
||||
elseif (strpos($ext, 'gif') !== false)
|
||||
{
|
||||
@imagegif($src_img, $name);
|
||||
}
|
||||
elseif (strpos($ext, 'bmp') !== false)
|
||||
{
|
||||
@imagebmp($src_img, $name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//image is not big enough to watermark it
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# generate watermarked images by imagick
|
||||
#
|
||||
//
|
||||
// generate watermarked images by imagick
|
||||
//
|
||||
function helper_watermark_imagick($name, $ext, $logo)
|
||||
{
|
||||
#Not just me babe, All the places misses you ..
|
||||
$im = new Imagick($name);
|
||||
//Not just me babe, All the places misses you ..
|
||||
$im = new Imagick($name);
|
||||
|
||||
$watermark = new Imagick($logo);
|
||||
//$watermark->readImage($);
|
||||
$watermark = new Imagick($logo);
|
||||
//$watermark->readImage($);
|
||||
|
||||
#how big are the images?
|
||||
$iWidth = $im->getImageWidth();
|
||||
$iHeight= $im->getImageHeight();
|
||||
$wWidth = $watermark->getImageWidth();
|
||||
$wHeight= $watermark->getImageHeight();
|
||||
//how big are the images?
|
||||
$iWidth = $im->getImageWidth();
|
||||
$iHeight= $im->getImageHeight();
|
||||
$wWidth = $watermark->getImageWidth();
|
||||
$wHeight= $watermark->getImageHeight();
|
||||
|
||||
if ($iHeight < $wHeight || $iWidth < $wWidth)
|
||||
{
|
||||
#resize the watermark
|
||||
$watermark->scaleImage($iWidth, $iHeight);
|
||||
if ($iHeight < $wHeight || $iWidth < $wWidth)
|
||||
{
|
||||
//resize the watermark
|
||||
$watermark->scaleImage($iWidth, $iHeight);
|
||||
|
||||
#get new size
|
||||
$wWidth = $watermark->getImageWidth();
|
||||
$wHeight = $watermark->getImageHeight();
|
||||
}
|
||||
//get new size
|
||||
$wWidth = $watermark->getImageWidth();
|
||||
$wHeight = $watermark->getImageHeight();
|
||||
}
|
||||
|
||||
#calculate the position
|
||||
$x = $iWidth - ($wWidth - 5);
|
||||
$y = $iHeight - ($wHeight - 5);
|
||||
//calculate the position
|
||||
$x = $iWidth - ($wWidth - 5);
|
||||
$y = $iHeight - ($wHeight - 5);
|
||||
|
||||
#an exception for gif image
|
||||
#generating thumb with 10 frames only, big gif is a devil
|
||||
if($ext == 'gif')
|
||||
{
|
||||
$i = 0;
|
||||
//$gif_new = new Imagick();
|
||||
foreach ($im as $frame)
|
||||
{
|
||||
$frame->compositeImage($watermark, imagick::COMPOSITE_OVER, $x, $y);
|
||||
//an exception for gif image
|
||||
//generating thumb with 10 frames only, big gif is a devil
|
||||
if ($ext == 'gif')
|
||||
{
|
||||
$i = 0;
|
||||
//$gif_new = new Imagick();
|
||||
foreach ($im as $frame)
|
||||
{
|
||||
$frame->compositeImage($watermark, imagick::COMPOSITE_OVER, $x, $y);
|
||||
|
||||
// $gif_new->addImage($frame->getImage());
|
||||
if($i >= 10)
|
||||
{
|
||||
# more than 10 frames, quit it
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$im->writeImages($name, true);
|
||||
return;
|
||||
}
|
||||
// $gif_new->addImage($frame->getImage());
|
||||
if ($i >= 10)
|
||||
{
|
||||
// more than 10 frames, quit it
|
||||
break;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
$im->writeImages($name, true);
|
||||
return;
|
||||
}
|
||||
|
||||
$im->compositeImage($watermark, imagick::COMPOSITE_OVER, $x, $y);
|
||||
|
||||
$im->writeImages($name, false);
|
||||
$im->compositeImage($watermark, imagick::COMPOSITE_OVER, $x, $y);
|
||||
|
||||
$im->writeImages($name, false);
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
#includes important functions
|
||||
//includes important functions
|
||||
include_once dirname(__file__) . '/../up_helpers/others.php';
|
||||
include_once dirname(__file__) . '/../up_helpers/thumbs.php';
|
||||
include_once dirname(__file__) . '/../up_helpers/watermark.php';
|
||||
@@ -28,19 +28,19 @@ include_once dirname(__file__) . '/../up_helpers/remote_uploading.php';
|
||||
*/
|
||||
class defaultUploader implements KleejaUploader
|
||||
{
|
||||
protected $messages = array();
|
||||
protected $messages = [];
|
||||
|
||||
protected $allowed_file_extensions = array();
|
||||
protected $allowed_file_extensions = [];
|
||||
|
||||
protected $upload_fields_limit = 0;
|
||||
protected $upload_fields_limit = 0;
|
||||
|
||||
protected $total_uploaded_files = 0;
|
||||
protected $total_uploaded_files = 0;
|
||||
|
||||
/**
|
||||
* set the allowed extensions of uploaded files
|
||||
* @param array $allowed_file_extensions an array of allowed extensions ['gif', 'png' ..]
|
||||
*/
|
||||
function setAllowedFileExtensions($allowed_file_extensions)
|
||||
public function setAllowedFileExtensions($allowed_file_extensions)
|
||||
{
|
||||
$this->allowed_file_extensions = $allowed_file_extensions;
|
||||
}
|
||||
@@ -50,9 +50,9 @@ class defaultUploader implements KleejaUploader
|
||||
* get the allowed extensions of uploaded files
|
||||
* @return array
|
||||
*/
|
||||
function getAllowedFileExtensions()
|
||||
public function getAllowedFileExtensions()
|
||||
{
|
||||
return $this->allowed_file_extensions;
|
||||
return $this->allowed_file_extensions;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class defaultUploader implements KleejaUploader
|
||||
* set the allowed limit of the uploaded files
|
||||
* @param int $limit
|
||||
*/
|
||||
function setUploadFieldsLimit($limit)
|
||||
public function setUploadFieldsLimit($limit)
|
||||
{
|
||||
$this->upload_fields_limit = $limit;
|
||||
}
|
||||
@@ -70,7 +70,7 @@ class defaultUploader implements KleejaUploader
|
||||
* get the allowed limit of the uploaded files
|
||||
* @return int
|
||||
*/
|
||||
function getUploadFieldsLimit()
|
||||
public function getUploadFieldsLimit()
|
||||
{
|
||||
return $this->upload_fields_limit;
|
||||
}
|
||||
@@ -78,23 +78,23 @@ class defaultUploader implements KleejaUploader
|
||||
|
||||
/**
|
||||
* add an information message to output it to the user
|
||||
* @param string $message
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function addInfoMessage($message)
|
||||
public function addInfoMessage($message)
|
||||
{
|
||||
array_push($this->messages, array($message, 'info'));
|
||||
array_push($this->messages, [$message, 'info']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add an error message to output it to the user
|
||||
* @param string $message
|
||||
* @param string $message
|
||||
* @return void
|
||||
*/
|
||||
function addErrorMessage($message)
|
||||
public function addErrorMessage($message)
|
||||
{
|
||||
array_push($this->messages, array($message, 'error'));
|
||||
array_push($this->messages, [$message, 'error']);
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class defaultUploader implements KleejaUploader
|
||||
* get all the messages
|
||||
* @return array
|
||||
*/
|
||||
function getMessages()
|
||||
public function getMessages()
|
||||
{
|
||||
return $this->messages;
|
||||
}
|
||||
@@ -110,10 +110,10 @@ class defaultUploader implements KleejaUploader
|
||||
|
||||
/**
|
||||
* save the file information to the database
|
||||
* @param array $fileInfo
|
||||
* @param array $fileInfo
|
||||
* @return void
|
||||
*/
|
||||
function saveToDatabase($fileInfo)
|
||||
public function saveToDatabase($fileInfo)
|
||||
{
|
||||
global $SQL, $dbprefix, $config;
|
||||
|
||||
@@ -133,53 +133,53 @@ class defaultUploader implements KleejaUploader
|
||||
// [
|
||||
|
||||
|
||||
#sometime cant see file after uploading.. but ..
|
||||
//sometime cant see file after uploading.. but ..
|
||||
@chmod($fileInfo['saveToFolder'] . '/' . $fileInfo['generatedFileName'], 0644);
|
||||
|
||||
$fileInfo['DeleteCode'] = sha1($fileInfo['generatedFileName'] . uniqid());
|
||||
|
||||
$queryValues = array
|
||||
(
|
||||
'name' => $fileInfo['generatedFileName'],
|
||||
$queryValues =
|
||||
[
|
||||
'name' => $fileInfo['generatedFileName'],
|
||||
'real_filename' => $fileInfo['originalFileName'],
|
||||
'size' => intval($fileInfo['fileSize']),
|
||||
'time' => time(),
|
||||
'folder'=> $fileInfo['saveToFolder'],
|
||||
'type' => $fileInfo['fileExtension'],
|
||||
'user' => $fileInfo['currentUserId'],
|
||||
'code_del' => $fileInfo['DeleteCode'],
|
||||
'user_ip' => get_ip(),
|
||||
'id_form' => $config['id_form'],
|
||||
);
|
||||
'size' => intval($fileInfo['fileSize']),
|
||||
'time' => time(),
|
||||
'folder' => $fileInfo['saveToFolder'],
|
||||
'type' => $fileInfo['fileExtension'],
|
||||
'user' => $fileInfo['currentUserId'],
|
||||
'code_del' => $fileInfo['DeleteCode'],
|
||||
'user_ip' => get_ip(),
|
||||
'id_form' => $config['id_form'],
|
||||
];
|
||||
|
||||
$is_img = in_array($fileInfo['fileExtension'], array('png','gif','jpg','jpeg', 'bmp')) ? true : false;
|
||||
$is_img = in_array($fileInfo['fileExtension'], ['png','gif','jpg','jpeg', 'bmp']) ? true : false;
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_saveToDatabase_qr', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
# insertion query
|
||||
$insert_query = array(
|
||||
'INSERT' => '`' . implode('` , `' , array_keys($queryValues)) . '`',
|
||||
'INTO' => "{$dbprefix}files",
|
||||
'VALUES' => "'" . implode("', '", array_map(array($SQL, 'escape'), array_values($queryValues))) . "'"
|
||||
);
|
||||
// insertion query
|
||||
$insert_query = [
|
||||
'INSERT' => '`' . implode('` , `', array_keys($queryValues)) . '`',
|
||||
'INTO' => "{$dbprefix}files",
|
||||
'VALUES' => "'" . implode("', '", array_map([$SQL, 'escape'], array_values($queryValues))) . "'"
|
||||
];
|
||||
|
||||
|
||||
# do the query
|
||||
// do the query
|
||||
$SQL->build($insert_query);
|
||||
|
||||
|
||||
# inset id so it can be used in url like in do.php?id={id_for_url}
|
||||
// inset id so it can be used in url like in do.php?id={id_for_url}
|
||||
$fileInfo['insertId'] = $SQL->insert_id();
|
||||
|
||||
|
||||
|
||||
# update Kleeja stats
|
||||
$update_query = array(
|
||||
// update Kleeja stats
|
||||
$update_query = [
|
||||
'UPDATE' => "{$dbprefix}stats",
|
||||
'SET' => ($is_img ? "imgs=imgs+1" : "files=files+1") . ",sizes=sizes+" . intval($fileInfo['fileSize']) . ""
|
||||
);
|
||||
'SET' => ($is_img ? 'imgs=imgs+1' : 'files=files+1') . ',sizes=sizes+' . intval($fileInfo['fileSize']) . ''
|
||||
];
|
||||
|
||||
$SQL->build($update_query);
|
||||
|
||||
@@ -190,10 +190,10 @@ class defaultUploader implements KleejaUploader
|
||||
|
||||
/**
|
||||
* generate a box of the result and add it to addInfoMessage
|
||||
* @param array $fileInfo
|
||||
* @param array $fileInfo
|
||||
* @return void
|
||||
*/
|
||||
function generateOutputBox($fileInfo)
|
||||
public function generateOutputBox($fileInfo)
|
||||
{
|
||||
global $config, $lang;
|
||||
|
||||
@@ -210,42 +210,44 @@ class defaultUploader implements KleejaUploader
|
||||
// [
|
||||
|
||||
|
||||
$is_img = in_array($fileInfo['fileExtension'], array('png','gif','jpg','jpeg', 'bmp')) ? true : false;
|
||||
$is_img = in_array($fileInfo['fileExtension'], ['png','gif','jpg','jpeg', 'bmp']) ? true : false;
|
||||
|
||||
|
||||
# information of file, used for generating a url boxes
|
||||
$file_info = array(
|
||||
'::ID::' => $fileInfo['insertId'],
|
||||
'::NAME::' => $fileInfo['generatedFileName'],
|
||||
'::DIR::' => $fileInfo['saveToFolder'],
|
||||
'::FNAME::' => $fileInfo['originalFileName'],
|
||||
);
|
||||
// information of file, used for generating a url boxes
|
||||
$file_info = [
|
||||
'::ID::' => $fileInfo['insertId'],
|
||||
'::NAME::' => $fileInfo['generatedFileName'],
|
||||
'::DIR::' => $fileInfo['saveToFolder'],
|
||||
'::FNAME::' => $fileInfo['originalFileName'],
|
||||
];
|
||||
|
||||
# show del code link box
|
||||
// show del code link box
|
||||
$extra_del = '';
|
||||
|
||||
if ($config['del_url_file'])
|
||||
{
|
||||
$extra_del = get_up_tpl_box('del_file_code',
|
||||
array(
|
||||
'b_title' => $lang['URL_F_DEL'],
|
||||
'b_code_link' => kleeja_get_link('del', array('::CODE::'=>$fileInfo['DeleteCode']))
|
||||
)
|
||||
[
|
||||
'b_title' => $lang['URL_F_DEL'],
|
||||
'b_code_link' => kleeja_get_link('del', ['::CODE::'=>$fileInfo['DeleteCode']])
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
//show imgs
|
||||
if($is_img)
|
||||
if ($is_img)
|
||||
{
|
||||
$img_html_result = '';
|
||||
|
||||
# get default thumb dimensions
|
||||
// get default thumb dimensions
|
||||
$thmb_dim_w = $thmb_dim_h = 150;
|
||||
if(strpos($config['thmb_dims'], '*') !== false)
|
||||
|
||||
if (strpos($config['thmb_dims'], '*') !== false)
|
||||
{
|
||||
list($thmb_dim_w, $thmb_dim_h) = array_map('trim', explode('*', $config['thmb_dims']));
|
||||
}
|
||||
|
||||
# generate a thumbnail
|
||||
// generate a thumbnail
|
||||
helper_thumb(
|
||||
$fileInfo['saveToFolder'] . '/' . $fileInfo['generatedFileName'],
|
||||
$fileInfo['fileExtension'],
|
||||
@@ -256,63 +258,63 @@ class defaultUploader implements KleejaUploader
|
||||
|
||||
|
||||
$img_html_result .= get_up_tpl_box('image_thumb',
|
||||
array(
|
||||
'b_title' => $lang['URL_F_THMB'],
|
||||
[
|
||||
'b_title' => $lang['URL_F_THMB'],
|
||||
'b_url_link'=> kleeja_get_link('image', $file_info),
|
||||
'b_img_link'=> kleeja_get_link('thumb', $file_info)
|
||||
)
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
# watermark on image
|
||||
if($config['write_imgs'] != 0 && in_array($fileInfo['fileExtension'], array('gif', 'png', 'jpg', 'jpeg', 'bmp')))
|
||||
// watermark on image
|
||||
if ($config['write_imgs'] != 0 && in_array($fileInfo['fileExtension'], ['gif', 'png', 'jpg', 'jpeg', 'bmp']))
|
||||
{
|
||||
helper_watermark($fileInfo['saveToFolder'] . "/" . $fileInfo['generatedFileName'], $fileInfo['fileExtension']);
|
||||
helper_watermark($fileInfo['saveToFolder'] . '/' . $fileInfo['generatedFileName'], $fileInfo['fileExtension']);
|
||||
}
|
||||
|
||||
#then show, image box
|
||||
//then show, image box
|
||||
$img_html_result .= get_up_tpl_box('image',
|
||||
array(
|
||||
'b_title' => $lang['URL_F_IMG'],
|
||||
[
|
||||
'b_title' => $lang['URL_F_IMG'],
|
||||
'b_bbc_title'=> $lang['URL_F_BBC'],
|
||||
'b_url_link'=> kleeja_get_link('image', $file_info),
|
||||
)
|
||||
'b_url_link' => kleeja_get_link('image', $file_info),
|
||||
]
|
||||
);
|
||||
|
||||
#add del link box to the result if there is any
|
||||
//add del link box to the result if there is any
|
||||
$img_html_result .= $extra_del;
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_generateOutputBox_image_result', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
#show success message
|
||||
//show success message
|
||||
$this->addInfoMessage(
|
||||
'<div class="up-box-title">'. $lang['IMG_DOWNLAODED'] . ': ' .
|
||||
'<div class="up-box-title">' . $lang['IMG_DOWNLAODED'] . ': ' .
|
||||
htmlspecialchars($fileInfo['originalFileName']) . '</div>' . "\n" .
|
||||
$img_html_result
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
#then show other files
|
||||
//then show other files
|
||||
$else_html_result = get_up_tpl_box('file',
|
||||
array(
|
||||
'b_title' => $lang['URL_F_FILE'],
|
||||
[
|
||||
'b_title' => $lang['URL_F_FILE'],
|
||||
'b_bbc_title'=> $lang['URL_F_BBC'],
|
||||
'b_url_link'=> kleeja_get_link('file', $file_info),
|
||||
)
|
||||
'b_url_link' => kleeja_get_link('file', $file_info),
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
#add del link box to the result if there is any
|
||||
//add del link box to the result if there is any
|
||||
$else_html_result .= $extra_del;
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_generateOutputBox_file_result', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
#show success message
|
||||
//show success message
|
||||
$this->addInfoMessage(
|
||||
'<div class="up-box-title">'. $lang['FILE_DOWNLAODED']. ': '
|
||||
'<div class="up-box-title">' . $lang['FILE_DOWNLAODED'] . ': '
|
||||
. htmlspecialchars($fileInfo['originalFileName']) . '</div>' . "\n" .
|
||||
$else_html_result
|
||||
);
|
||||
@@ -326,22 +328,22 @@ class defaultUploader implements KleejaUploader
|
||||
* here happens the magic, call this on upload submit
|
||||
* @param int $uploadType upload from files input or links
|
||||
*/
|
||||
function upload($uploadType)
|
||||
public function upload($uploadType)
|
||||
{
|
||||
global $usrcp, $config, $lang;
|
||||
|
||||
# when $uploadType = 1, then we upload from _file input
|
||||
# if $uploadType = 2, then we uploading from url which is disabled by default and is buggy
|
||||
// when $uploadType = 1, then we upload from _file input
|
||||
// if $uploadType = 2, then we uploading from url which is disabled by default and is buggy
|
||||
|
||||
|
||||
#upload to this folder
|
||||
//upload to this folder
|
||||
$current_uploading_folder = $config['foldername'];
|
||||
|
||||
#current user id
|
||||
//current user id
|
||||
$current_user_id = $usrcp->name() ? $usrcp->id() : '-1';
|
||||
|
||||
|
||||
#is captcha is on?
|
||||
//is captcha is on?
|
||||
$captcha_enabled = intval($config['safe_code']);
|
||||
|
||||
$return_now = false;
|
||||
@@ -349,52 +351,52 @@ class defaultUploader implements KleejaUploader
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_upload_1st', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
# check folder our real folder
|
||||
if(!file_exists($current_uploading_folder))
|
||||
// check folder our real folder
|
||||
if (! file_exists($current_uploading_folder))
|
||||
{
|
||||
if(!make_folder($current_uploading_folder))
|
||||
if (! make_folder($current_uploading_folder))
|
||||
{
|
||||
$this->addErrorMessage($lang['CANT_DIR_CRT']);
|
||||
$this->addErrorMessage($lang['CANT_DIR_CRT']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if($return_now)
|
||||
if ($return_now)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#no uploading yet, or just go to index.php, so we have make a new session
|
||||
if(!$uploadType)
|
||||
//no uploading yet, or just go to index.php, so we have make a new session
|
||||
if (! $uploadType)
|
||||
{
|
||||
unset($_SESSION['FIILES_NOT_DUPLI'], $_SESSION['FIILES_NOT_DUPLI_LINKS']);
|
||||
}
|
||||
|
||||
|
||||
# is captcha on, and there is uploading going on
|
||||
if($captcha_enabled && $uploadType)
|
||||
// is captcha on, and there is uploading going on
|
||||
if ($captcha_enabled && $uploadType)
|
||||
{
|
||||
#captcha is wrong
|
||||
if(!kleeja_check_captcha())
|
||||
//captcha is wrong
|
||||
if (! kleeja_check_captcha())
|
||||
{
|
||||
$this->addErrorMessage($lang['WRONG_VERTY_CODE']);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
# to prevent flooding, user must wait, waiting-time is grapped from Kleeja settings, admin is exceptional
|
||||
if(! user_can('enter_acp') && user_is_flooding($current_user_id))
|
||||
// to prevent flooding, user must wait, waiting-time is grapped from Kleeja settings, admin is exceptional
|
||||
if (! user_can('enter_acp') && user_is_flooding($current_user_id))
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['YOU_HAVE_TO_WAIT'],
|
||||
$this->addErrorMessage(sprintf($lang['YOU_HAVE_TO_WAIT'],
|
||||
$current_user_id == '-1' ? $config['guestsectoupload'] : $config['usersectoupload']));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#detect flooding, TODO fix it or remove it
|
||||
if ($uploadType == 1 && isset($_SESSION['FIILES_NOT_DUPLI']))
|
||||
//detect flooding, TODO fix it or remove it
|
||||
if ($uploadType == 1 && isset($_SESSION['FIILES_NOT_DUPLI']))
|
||||
{
|
||||
if(!empty($_SESSION['FIILES_NOT_DUPLI']) && $_SESSION['FIILES_NOT_DUPLI'] == sha1(serialize(array_column($_FILES, 'name'))))
|
||||
if (! empty($_SESSION['FIILES_NOT_DUPLI']) && $_SESSION['FIILES_NOT_DUPLI'] == sha1(serialize(array_column($_FILES, 'name'))))
|
||||
{
|
||||
unset($_SESSION['FIILES_NOT_DUPLI']);
|
||||
// if(!ip('ajax'))
|
||||
@@ -407,12 +409,13 @@ class defaultUploader implements KleejaUploader
|
||||
}
|
||||
}
|
||||
|
||||
if ($uploadType == 2 && isset($_SESSION['FIILES_NOT_DUPLI_LINKS']))
|
||||
if ($uploadType == 2 && isset($_SESSION['FIILES_NOT_DUPLI_LINKS']))
|
||||
{
|
||||
if($_SESSION['FIILES_NOT_DUPLI_LINKS'] == sha1(serialize($_POST)))
|
||||
if ($_SESSION['FIILES_NOT_DUPLI_LINKS'] == sha1(serialize($_POST)))
|
||||
{
|
||||
unset($_SESSION['FIILES_NOT_DUPLI_LINKS']);
|
||||
if(!ip('ajax'))
|
||||
|
||||
if (! ip('ajax'))
|
||||
{
|
||||
redirect('./');
|
||||
}
|
||||
@@ -423,41 +426,41 @@ class defaultUploader implements KleejaUploader
|
||||
}
|
||||
|
||||
|
||||
# flooding code, making sure every ok session is cleared
|
||||
if ($uploadType == 1 && sizeof($_FILES) > 0)
|
||||
// flooding code, making sure every ok session is cleared
|
||||
if ($uploadType == 1 && sizeof($_FILES) > 0)
|
||||
{
|
||||
$_SESSION['FIILES_NOT_DUPLI'] = sha1(serialize(array_column($_FILES, 'name')));
|
||||
}
|
||||
elseif($uploadType == 2)
|
||||
elseif ($uploadType == 2)
|
||||
{
|
||||
$_SESSION['FIILES_NOT_DUPLI_LINKS'] = sha1(serialize($_POST));
|
||||
}
|
||||
|
||||
|
||||
#now close session to let user open any other page in Kleeja
|
||||
session_write_close();
|
||||
//now close session to let user open any other page in Kleeja
|
||||
session_write_close();
|
||||
|
||||
|
||||
# do upload
|
||||
switch($uploadType)
|
||||
// do upload
|
||||
switch ($uploadType)
|
||||
{
|
||||
#uploading from a _files input
|
||||
//uploading from a _files input
|
||||
default:
|
||||
case 1:
|
||||
|
||||
if(!empty($_FILES['file']['tmp_name']))
|
||||
if (! empty($_FILES['file']['tmp_name']))
|
||||
{
|
||||
$_FILES['file'][0] = $_FILES['file'];
|
||||
}
|
||||
|
||||
|
||||
# loop the uploaded files
|
||||
for($i=0; $i<=$this->getUploadFieldsLimit(); $i++)
|
||||
// loop the uploaded files
|
||||
for ($i=0; $i<=$this->getUploadFieldsLimit(); $i++)
|
||||
{
|
||||
//no file!
|
||||
if(empty($_FILES['file_' . $i . '_']['tmp_name']) && empty($_FILES['file'][$i]['tmp_name']))
|
||||
if (empty($_FILES['file_' . $i . '_']['tmp_name']) && empty($_FILES['file'][$i]['tmp_name']))
|
||||
{
|
||||
if(is_null($_FILES['file_' . $i . '_']) && is_null($_FILES['file'][$i]))
|
||||
if (is_null($_FILES['file_' . $i . '_']) && is_null($_FILES['file'][$i]))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -489,21 +492,29 @@ class defaultUploader implements KleejaUploader
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
// $message = "The uploaded file was only partially uploaded";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
// $message = "No file was uploaded";
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_NO_TMP_DIR:
|
||||
$this->addErrorMessage('Missing a temporary folder');
|
||||
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_CANT_WRITE:
|
||||
$this->addErrorMessage('Failed to write file to disk');
|
||||
|
||||
break;
|
||||
|
||||
case UPLOAD_ERR_EXTENSION:
|
||||
$this->addErrorMessage('File upload stopped by extension');
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
$this->addErrorMessage(sprintf($lang['CANT_UPLAOD'], htmlspecialchars($filename)));
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -519,17 +530,17 @@ class defaultUploader implements KleejaUploader
|
||||
break;
|
||||
|
||||
|
||||
#uploading from a url text-input
|
||||
//uploading from a url text-input
|
||||
case 2:
|
||||
|
||||
#if not enabled, quit it
|
||||
if($config['www_url'] != 1)
|
||||
//if not enabled, quit it
|
||||
if ($config['www_url'] != 1)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
#loop text inputs
|
||||
for($i=0; $i<=$this->getUploadFieldsLimit(); $i++)
|
||||
//loop text inputs
|
||||
for ($i=0; $i<=$this->getUploadFieldsLimit(); $i++)
|
||||
{
|
||||
$this->uploadTypeUrl($i, $current_uploading_folder, $current_user_id);
|
||||
}
|
||||
@@ -539,8 +550,8 @@ class defaultUploader implements KleejaUploader
|
||||
|
||||
|
||||
|
||||
# well, no file uploaded, ask user to choose a file before submit
|
||||
if($this->total_uploaded_files == 0 && sizeof($this->messages) == 0)
|
||||
// well, no file uploaded, ask user to choose a file before submit
|
||||
if ($this->total_uploaded_files == 0 && sizeof($this->messages) == 0)
|
||||
{
|
||||
$this->addErrorMessage($lang['CHOSE_F']);
|
||||
}
|
||||
@@ -553,60 +564,60 @@ class defaultUploader implements KleejaUploader
|
||||
* @param $current_uploading_folder
|
||||
* @param $current_user_id
|
||||
*/
|
||||
function uploadTypeFile($fieldNumber, $current_uploading_folder, $current_user_id)
|
||||
public function uploadTypeFile($fieldNumber, $current_uploading_folder, $current_user_id)
|
||||
{
|
||||
global $config, $lang;
|
||||
|
||||
$fileInfo = array(
|
||||
$fileInfo = [
|
||||
'saveToFolder',
|
||||
'originalFileName',
|
||||
'generatedFileName',
|
||||
'fileSize',
|
||||
'currentUserId',
|
||||
'fileExtension'
|
||||
);
|
||||
];
|
||||
|
||||
|
||||
$fileInfo['saveToFolder'] = $current_uploading_folder;
|
||||
$fileInfo['saveToFolder'] = $current_uploading_folder;
|
||||
$fileInfo['currentUserId'] = $current_user_id;
|
||||
|
||||
|
||||
if(!isset($_FILES['file_' . $fieldNumber . '_']) && isset($_FILES['file'][$fieldNumber]))
|
||||
if (! isset($_FILES['file_' . $fieldNumber . '_']) && isset($_FILES['file'][$fieldNumber]))
|
||||
{
|
||||
$_FILES['file_' . $fieldNumber . '_'] = $_FILES['file'][$fieldNumber];
|
||||
}
|
||||
|
||||
# file name
|
||||
// file name
|
||||
$fileInfo['originalFileName'] = isset($_FILES['file_' . $fieldNumber . '_']['name'])
|
||||
? urldecode(str_replace(array(';',','), '', $_FILES['file_' . $fieldNumber . '_']['name']))
|
||||
? urldecode(str_replace([';',','], '', $_FILES['file_' . $fieldNumber . '_']['name']))
|
||||
: '';
|
||||
|
||||
if(empty($fileInfo['originalFileName']))
|
||||
if (empty($fileInfo['originalFileName']))
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['WRONG_F_NAME'], htmlspecialchars($_FILES['file_' . $fieldNumber . '_']['name'])));
|
||||
return;
|
||||
}
|
||||
|
||||
# get the extension of file
|
||||
// get the extension of file
|
||||
$fileInfo['fileExtension'] = strtolower(array_pop(explode('.', $fileInfo['originalFileName'])));
|
||||
|
||||
|
||||
# them the size
|
||||
$fileInfo['fileSize'] = !empty($_FILES['file_' . $fieldNumber . '_']['size'])
|
||||
// them the size
|
||||
$fileInfo['fileSize'] = ! empty($_FILES['file_' . $fieldNumber . '_']['size'])
|
||||
? intval($_FILES['file_' . $fieldNumber . '_']['size'])
|
||||
: 0;
|
||||
|
||||
|
||||
# get the other filename, changed depend on kleeja settings
|
||||
// get the other filename, changed depend on kleeja settings
|
||||
$fileInfo['generatedFileName'] = change_filename_decoding($fileInfo['originalFileName'], $fieldNumber, $fileInfo['fileExtension']);
|
||||
|
||||
|
||||
# filename templates {rand:..}, {date:..}
|
||||
// filename templates {rand:..}, {date:..}
|
||||
$fileInfo['generatedFileName'] = change_filename_templates(trim($config['prefixname']) . $fileInfo['generatedFileName']);
|
||||
|
||||
|
||||
# file exists before? change it a little
|
||||
if(file_exists($current_uploading_folder . '/' . $fileInfo['generatedFileName']))
|
||||
// file exists before? change it a little
|
||||
if (file_exists($current_uploading_folder . '/' . $fileInfo['generatedFileName']))
|
||||
{
|
||||
$fileInfo['generatedFileName'] = change_filename_decoding(
|
||||
$fileInfo['generatedFileName'],
|
||||
@@ -618,41 +629,41 @@ class defaultUploader implements KleejaUploader
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_uploadTypeFile_1st', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
# now, let process it
|
||||
if(!in_array(strtolower($fileInfo['fileExtension']), array_keys($this->getAllowedFileExtensions())))
|
||||
// now, let process it
|
||||
if (! in_array(strtolower($fileInfo['fileExtension']), array_keys($this->getAllowedFileExtensions())))
|
||||
{
|
||||
# guest
|
||||
if($current_user_id == '-1')
|
||||
// guest
|
||||
if ($current_user_id == '-1')
|
||||
{
|
||||
$this->addErrorMessage(
|
||||
sprintf($lang['FORBID_EXT'], $fileInfo['fileExtension'])
|
||||
. '<br> <a href="' . ($config['mod_writer'] ? "register.html" : "ucp.php?go=register") .
|
||||
. '<br> <a href="' . ($config['mod_writer'] ? 'register.html' : 'ucp.php?go=register') .
|
||||
'" title="' . htmlspecialchars($lang['REGISTER']) . '">' . $lang['REGISTER'] . '</a>'
|
||||
);
|
||||
}
|
||||
# a member
|
||||
// a member
|
||||
else
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['FORBID_EXT'], $fileInfo['fileExtension']));
|
||||
}
|
||||
}
|
||||
# bad chars in the filename
|
||||
elseif(preg_match ("#[\\\/\:\*\?\<\>\|\"]#", $fileInfo['generatedFileName']))
|
||||
// bad chars in the filename
|
||||
elseif (preg_match ("#[\\\/\:\*\?\<\>\|\"]#", $fileInfo['generatedFileName']))
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['WRONG_F_NAME'], htmlspecialchars($_FILES['file_' . $fieldNumber . '_']['name'])));
|
||||
}
|
||||
# check file extension for bad stuff
|
||||
elseif(ext_check_safe($_FILES['file_' . $fieldNumber . '_']['name']) == false)
|
||||
// check file extension for bad stuff
|
||||
elseif (ext_check_safe($_FILES['file_' . $fieldNumber . '_']['name']) == false)
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['WRONG_F_NAME'], htmlspecialchars($_FILES['file_' . $fieldNumber . '_']['name'])));
|
||||
}
|
||||
# check the mime-type for the file
|
||||
elseif(check_mime_type($_FILES['file_' . $fieldNumber . '_']['type'], $fileInfo['fileExtension'], $_FILES['file_' . $fieldNumber . '_']['tmp_name']) == false)
|
||||
// check the mime-type for the file
|
||||
elseif (check_mime_type($_FILES['file_' . $fieldNumber . '_']['type'], $fileInfo['fileExtension'], $_FILES['file_' . $fieldNumber . '_']['tmp_name']) == false)
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['NOT_SAFE_FILE'], htmlspecialchars($_FILES['file_' . $fieldNumber . '_']['name'])));
|
||||
}
|
||||
# check file size
|
||||
elseif($this->getAllowedFileExtensions()[$fileInfo['fileExtension']] > 0 && $fileInfo['fileSize'] >= $this->getAllowedFileExtensions()[$fileInfo['fileExtension']])
|
||||
// check file size
|
||||
elseif ($this->getAllowedFileExtensions()[$fileInfo['fileExtension']] > 0 && $fileInfo['fileSize'] >= $this->getAllowedFileExtensions()[$fileInfo['fileExtension']])
|
||||
{
|
||||
$this->addErrorMessage(sprintf(
|
||||
$lang['SIZE_F_BIG'],
|
||||
@@ -660,13 +671,13 @@ class defaultUploader implements KleejaUploader
|
||||
readable_size($this->getAllowedFileExtensions()[$fileInfo['fileExtension']]))
|
||||
);
|
||||
}
|
||||
# no errors, so upload it
|
||||
// no errors, so upload it
|
||||
else
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_uploadTypeFile_2nd', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
# now, upload the file
|
||||
$file = move_uploaded_file($_FILES['file_' . $fieldNumber . '_']['tmp_name'], $current_uploading_folder . "/" . $fileInfo['generatedFileName']);
|
||||
// now, upload the file
|
||||
$file = move_uploaded_file($_FILES['file_' . $fieldNumber . '_']['tmp_name'], $current_uploading_folder . '/' . $fileInfo['generatedFileName']);
|
||||
|
||||
if ($file)
|
||||
{
|
||||
@@ -674,7 +685,7 @@ class defaultUploader implements KleejaUploader
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['CANT_UPLAOD'], $fileInfo['originalFileName']));
|
||||
$this->addErrorMessage(sprintf($lang['CANT_UPLAOD'], $fileInfo['originalFileName']));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -686,43 +697,43 @@ class defaultUploader implements KleejaUploader
|
||||
* @param $current_uploading_folder
|
||||
* @param $current_user_id
|
||||
*/
|
||||
function uploadTypeUrl($fieldNumber, $current_uploading_folder, $current_user_id)
|
||||
public function uploadTypeUrl($fieldNumber, $current_uploading_folder, $current_user_id)
|
||||
{
|
||||
global $config, $lang;
|
||||
|
||||
$fileInfo = array(
|
||||
$fileInfo = [
|
||||
'saveToFolder',
|
||||
'originalFileName',
|
||||
'generatedFileName',
|
||||
'fileSize',
|
||||
'currentUserId',
|
||||
'fileExtension'
|
||||
);
|
||||
];
|
||||
|
||||
|
||||
$fileInfo['saveToFolder'] = $current_uploading_folder;
|
||||
$fileInfo['saveToFolder'] = $current_uploading_folder;
|
||||
$fileInfo['currentUserId'] = $current_user_id;
|
||||
|
||||
|
||||
if(p('file_' . $fieldNumber . '_') == '' || p('file_' . $fieldNumber . '_') == $lang['PAST_URL_HERE'])
|
||||
if (p('file_' . $fieldNumber . '_') == '' || p('file_' . $fieldNumber . '_') == $lang['PAST_URL_HERE'])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
# get file name
|
||||
// get file name
|
||||
$fileInfo['originalFileName'] = basename(p('file_' . $fieldNumber . '_'));
|
||||
|
||||
|
||||
# file extension, type
|
||||
$fileExtensions = array_map('strtolower', explode(".", $fileInfo['originalFileName']));
|
||||
// file extension, type
|
||||
$fileExtensions = array_map('strtolower', explode('.', $fileInfo['originalFileName']));
|
||||
|
||||
|
||||
if(sizeof($fileExtensions) > 1 && in_array($fileExtensions[sizeof($fileExtensions)-1], array('html', 'php', 'html')))
|
||||
if (sizeof($fileExtensions) > 1 && in_array($fileExtensions[sizeof($fileExtensions)-1], ['html', 'php', 'html']))
|
||||
{
|
||||
$fileInfo['fileExtension'] = strtolower($fileExtensions[sizeof($fileExtensions)-2]);
|
||||
}
|
||||
else if(sizeof($fileExtensions) > 0)
|
||||
elseif (sizeof($fileExtensions) > 0)
|
||||
{
|
||||
$fileInfo['fileExtension'] = strtolower($fileExtensions[sizeof($fileExtensions)-1]);
|
||||
}
|
||||
@@ -732,7 +743,7 @@ class defaultUploader implements KleejaUploader
|
||||
}
|
||||
|
||||
|
||||
# change to another filename depend on kleeja settings
|
||||
// change to another filename depend on kleeja settings
|
||||
$fileInfo['generatedFileName'] = change_filename_decoding($fileInfo['originalFileName'], $fieldNumber, $fileInfo['fileExtension']);
|
||||
$fileInfo['generatedFileName'] = change_filename_templates(trim($config['prefixname']) . $fileInfo['generatedFileName']);
|
||||
|
||||
@@ -740,45 +751,44 @@ class defaultUploader implements KleejaUploader
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_uploadTypeUrl_1st', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
#forbbiden type ? quit it
|
||||
if(!in_array(strtolower($fileInfo['fileExtension']), array_keys($this->getAllowedFileExtensions())))
|
||||
//forbbiden type ? quit it
|
||||
if (! in_array(strtolower($fileInfo['fileExtension']), array_keys($this->getAllowedFileExtensions())))
|
||||
{
|
||||
if($current_user_id == '-1')
|
||||
if ($current_user_id == '-1')
|
||||
{
|
||||
$this->addErrorMessage(
|
||||
sprintf($lang['FORBID_EXT'], $fileInfo['fileExtension']) .
|
||||
'<br> <a href="' . ($config['mod_writer'] ? "register.html" : "ucp.php?go=register") . '">' .
|
||||
'<br> <a href="' . ($config['mod_writer'] ? 'register.html' : 'ucp.php?go=register') . '">' .
|
||||
$lang['REGISTER'] . '</a>'
|
||||
);
|
||||
}
|
||||
# a member
|
||||
// a member
|
||||
else
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['FORBID_EXT'], $fileInfo['fileExtension']));
|
||||
}
|
||||
}
|
||||
# file exists before ? quit it
|
||||
elseif(file_exists($current_uploading_folder . '/' . $fileInfo['generatedFileName']))
|
||||
// file exists before ? quit it
|
||||
elseif (file_exists($current_uploading_folder . '/' . $fileInfo['generatedFileName']))
|
||||
{
|
||||
$this->addErrorMessage(sprintf($lang['SAME_FILE_EXIST'], htmlspecialchars($fileInfo['generatedFileName'])));
|
||||
}
|
||||
# no errors, ok, lets upload now
|
||||
// no errors, ok, lets upload now
|
||||
else
|
||||
{
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('defaultUploader_uploadTypeUrl_2nd', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
|
||||
#no prefix ? http or even ftp, then add one
|
||||
if(!in_array(strtolower(substr(p('file_' . $fieldNumber . '_'), 0, 4)), array('http', 'ftp:')))
|
||||
//no prefix ? http or even ftp, then add one
|
||||
if (! in_array(strtolower(substr(p('file_' . $fieldNumber . '_'), 0, 4)), ['http', 'ftp:']))
|
||||
{
|
||||
$_POST['file_' . $fieldNumber . '_'] = 'http://' . p('file_' . $fieldNumber . '_');
|
||||
}
|
||||
|
||||
#get size, if big quit it
|
||||
//get size, if big quit it
|
||||
$fileInfo['fileSize'] = get_remote_file_size(p('file_' . $fieldNumber . '_'));
|
||||
|
||||
if($this->getAllowedFileExtensions()[$fileInfo['fileExtension']] > 0 && $fileInfo['fileSize'] >= $this->getAllowedFileExtensions()[$fileInfo['fileExtension']])
|
||||
if ($this->getAllowedFileExtensions()[$fileInfo['fileExtension']] > 0 && $fileInfo['fileSize'] >= $this->getAllowedFileExtensions()[$fileInfo['fileExtension']])
|
||||
{
|
||||
$this->addErrorMessage(sprintf(
|
||||
$lang['SIZE_F_BIG'],
|
||||
@@ -788,17 +798,17 @@ class defaultUploader implements KleejaUploader
|
||||
}
|
||||
else
|
||||
{
|
||||
#get remote data, if no data quit it
|
||||
//get remote data, if no data quit it
|
||||
$data = fetch_remote_file(
|
||||
p('file_' . $fieldNumber . '_'),
|
||||
$current_uploading_folder . "/" . $fileInfo['generatedFileName'],
|
||||
$current_uploading_folder . '/' . $fileInfo['generatedFileName'],
|
||||
15,
|
||||
false,
|
||||
2,
|
||||
true
|
||||
);
|
||||
|
||||
if($data === false)
|
||||
if ($data === false)
|
||||
{
|
||||
$this->addErrorMessage($lang['URL_CANT_GET']);
|
||||
}
|
||||
|
||||
984
includes/usr.php
984
includes/usr.php
File diff suppressed because it is too large
Load Diff
@@ -9,9 +9,9 @@
|
||||
|
||||
|
||||
//no for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,3 @@ if (!defined('IN_COMMON'))
|
||||
define('KLEEJA_VERSION', '3.0.2');
|
||||
|
||||
define('KLEEJA_DB_VERSION', '9');
|
||||
|
||||
|
||||
|
||||
|
||||
141
index.php
141
index.php
@@ -17,7 +17,7 @@ define('IN_REAL_INDEX', true);
|
||||
/**
|
||||
* We are in the middle of the uploading process, useful for exceptions
|
||||
*/
|
||||
define('IN_SUBMIT_UPLOADING' , isset($_POST['submitr']) || isset($_POST['submittxt']));
|
||||
define('IN_SUBMIT_UPLOADING', isset($_POST['submitr']) || isset($_POST['submittxt']));
|
||||
|
||||
|
||||
/**
|
||||
@@ -27,7 +27,7 @@ define('IN_KLEEJA', true);
|
||||
require_once 'includes/common.php';
|
||||
require_once 'includes/KleejaUploader.php';
|
||||
|
||||
#current uploading method
|
||||
//current uploading method
|
||||
$uploadingMethodClass = 'includes/up_methods/defaultUploader.php';
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ require_once $uploadingMethodClass;
|
||||
//
|
||||
//Is kleeja only for members?
|
||||
//
|
||||
if(empty($d_groups[2]['exts']) && !$usrcp->name())
|
||||
if (empty($d_groups[2]['exts']) && ! $usrcp->name())
|
||||
{
|
||||
// Send a 503 HTTP response code to prevent search bots from indexing this message
|
||||
//header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
kleeja_info($lang['SITE_FOR_MEMBER_ONLY'], $lang['HOME']);
|
||||
// Send a 503 HTTP response code to prevent search bots from indexing this message
|
||||
//header('HTTP/1.1 503 Service Temporarily Unavailable');
|
||||
kleeja_info($lang['SITE_FOR_MEMBER_ONLY'], $lang['HOME']);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ $action = $config['siteurl'];
|
||||
|
||||
/** @var KleejaUploader $uploader */
|
||||
$uploadingMethodClassBaseName = basename($uploadingMethodClass, '.php');
|
||||
$uploader = new $uploadingMethodClassBaseName;
|
||||
$uploader = new $uploadingMethodClassBaseName;
|
||||
|
||||
$uploader->setAllowedFileExtensions($d_groups[$userinfo['group_id']]['exts']);
|
||||
$uploader->setUploadFieldsLimit($config['filesnum']);
|
||||
@@ -60,20 +60,20 @@ $uploader->setUploadFieldsLimit($config['filesnum']);
|
||||
|
||||
$uploading_type = ip('submitr') ? 1 : (ip('submittxt') ? 2 : false);
|
||||
|
||||
if($uploading_type)
|
||||
if ($uploading_type)
|
||||
{
|
||||
$uploader->upload($uploading_type);
|
||||
}
|
||||
|
||||
|
||||
#file input fields
|
||||
$FILES_NUM_LOOP = array();
|
||||
//file input fields
|
||||
$FILES_NUM_LOOP = [];
|
||||
|
||||
if($config['filesnum'] > 0)
|
||||
if ($config['filesnum'] > 0)
|
||||
{
|
||||
foreach(range(1, $config['filesnum']) as $i)
|
||||
foreach (range(1, $config['filesnum']) as $i)
|
||||
{
|
||||
$FILES_NUM_LOOP[] = array('i' => $i, 'show'=>($i == 1 || (!empty($config['filesnum_show']) && (int) $config['filesnum_show'] == 1) ? '' : 'display: none'));
|
||||
$FILES_NUM_LOOP[] = ['i' => $i, 'show'=>($i == 1 || (! empty($config['filesnum_show']) && (int) $config['filesnum_show'] == 1) ? '' : 'display: none')];
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -82,30 +82,31 @@ else
|
||||
}
|
||||
|
||||
|
||||
#show errors and info
|
||||
$info = array();
|
||||
foreach($uploader->getMessages() as $t => $s)
|
||||
//show errors and info
|
||||
$info = [];
|
||||
|
||||
foreach ($uploader->getMessages() as $t => $s)
|
||||
{
|
||||
$info[] = array(
|
||||
't' => $s[1] == 'error' ? 'index_err' : 'index_info', #for old Kleeja versions
|
||||
$info[] = [
|
||||
't' => $s[1] == 'error' ? 'index_err' : 'index_info', //for old Kleeja versions
|
||||
'i' => $s[0], //#for old Kleeja versions
|
||||
|
||||
|
||||
'message_content' => $s[0],
|
||||
'message_type' => $s[1],
|
||||
);
|
||||
'message_type' => $s[1],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
#some words for template
|
||||
//some words for template
|
||||
$welcome_msg = $config['welcome_msg'];
|
||||
$filecp_link = $usrcp->id() ? $config['siteurl'] . ($config['mod_writer'] ? 'filecp.html' : 'ucp.php?go=filecp') : false;
|
||||
$terms_msg = sprintf($lang['AGREE_RULES'], '<a href="' . ($config['mod_writer'] ? 'rules.html' : 'go.php?go=rules') . '">' , '</a>');
|
||||
$terms_msg = sprintf($lang['AGREE_RULES'], '<a href="' . ($config['mod_writer'] ? 'rules.html' : 'go.php?go=rules') . '">', '</a>');
|
||||
$link_avater = sprintf($lang['EDIT_U_AVATER_LINK'], '<a href="https://www.gravatar.com/" target="_blank">', '</a>');
|
||||
|
||||
|
||||
$js_allowed_extensions_types = "['" . implode("', '", array_keys($d_groups[$userinfo['group_id']]['exts'])) . "']";
|
||||
$js_allowed_extensions_sizes = "[" . implode(", ", array_values($d_groups[$userinfo['group_id']]['exts'])) . "]";
|
||||
$js_allowed_extensions_types = "['" . implode("', '", array_keys($d_groups[$userinfo['group_id']]['exts'])) . "']";
|
||||
$js_allowed_extensions_sizes = '[' . implode(', ', array_values($d_groups[$userinfo['group_id']]['exts'])) . ']';
|
||||
|
||||
|
||||
|
||||
@@ -114,75 +115,75 @@ $js_allowed_extensions_sizes = "[" . implode(", ", array_values($d_groups[$useri
|
||||
//I don't like this feature and I prefer that you disable it
|
||||
//
|
||||
$show_online = $config['allow_online'] == 1 ? true : false;
|
||||
|
||||
if ($show_online)
|
||||
{
|
||||
$current_online_users = 0;
|
||||
$online_names = array();
|
||||
$timeout = 60; //30 second
|
||||
$timeout2 = time()-$timeout;
|
||||
$online_names = [];
|
||||
$timeout = 60; //30 second
|
||||
$timeout2 = time()-$timeout;
|
||||
|
||||
//put another bot name
|
||||
//put another bot name
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('anotherbots_online_index_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$query = array(
|
||||
'SELECT' => 'u.name',
|
||||
'FROM' => "{$dbprefix}users u",
|
||||
'WHERE' => "u.last_visit > $timeout2"
|
||||
);
|
||||
$query = [
|
||||
'SELECT' => 'u.name',
|
||||
'FROM' => "{$dbprefix}users u",
|
||||
'WHERE' => "u.last_visit > $timeout2"
|
||||
];
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('qr_select_online_index_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$result = $SQL->build($query);
|
||||
$result = $SQL->build($query);
|
||||
|
||||
while($row=$SQL->fetch_array($result))
|
||||
{
|
||||
while ($row=$SQL->fetch_array($result))
|
||||
{
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('while_qr_select_online_index_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
$current_online_users++;
|
||||
$online_names[$row['name']] = $row['name'];
|
||||
}#while
|
||||
$online_names[$row['name']] = $row['name'];
|
||||
}//while
|
||||
|
||||
$SQL->freeresult($result);
|
||||
$SQL->freeresult($result);
|
||||
|
||||
//make names as array to print them in template
|
||||
$show_names = array();
|
||||
//make names as array to print them in template
|
||||
$show_names = [];
|
||||
$show_names_sizeof = sizeof($online_names);
|
||||
|
||||
foreach ($online_names as $k)
|
||||
{
|
||||
$show_names[] = array('name' => $k, 'separator' => $show_names_sizeof ? ',' : '');
|
||||
}
|
||||
foreach ($online_names as $k)
|
||||
{
|
||||
$show_names[] = ['name' => $k, 'separator' => $show_names_sizeof ? ',' : ''];
|
||||
}
|
||||
|
||||
//some variables must be destroyed here
|
||||
unset($online_names, $timeout, $timeout2);
|
||||
//some variables must be destroyed here
|
||||
unset($online_names, $timeout, $timeout2);
|
||||
|
||||
//check & update most ever users and visitors were online
|
||||
if(empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '')
|
||||
{
|
||||
if (empty($config['most_user_online_ever']) || trim($config['most_user_online_ever']) == '')
|
||||
{
|
||||
$most_online = $current_online_users;
|
||||
$online_time = time();
|
||||
}
|
||||
else
|
||||
{
|
||||
list($most_online, $online_time) = @explode(':', $config['most_user_online_ever']);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
list($most_online, $online_time) = @explode(':', $config['most_user_online_ever']);
|
||||
}
|
||||
|
||||
if ($most_online < $current_online_users || empty($config['most_user_online_ever']))
|
||||
{
|
||||
update_config('most_user_online_ever', $current_online_users . ':' . time());
|
||||
}
|
||||
if ($most_online < $current_online_users || empty($config['most_user_online_ever']))
|
||||
{
|
||||
update_config('most_user_online_ever', $current_online_users . ':' . time());
|
||||
}
|
||||
|
||||
$online_time = kleeja_date('d-m-Y h:i a', $online_time);
|
||||
$online_time = kleeja_date('d-m-Y h:i a', $online_time);
|
||||
|
||||
|
||||
//before 1.8, styles computability
|
||||
$usersnum = $current_online_users;
|
||||
$shownames = $show_names;
|
||||
//before 1.8, styles computability
|
||||
$usersnum = $current_online_users;
|
||||
$shownames = $show_names;
|
||||
|
||||
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('if_online_index_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
|
||||
}#allow_online
|
||||
is_array($plugin_run_result = Plugins::getInstance()->run('if_online_index_page', get_defined_vars())) ? extract($plugin_run_result) : null; //run hook
|
||||
}//allow_online
|
||||
|
||||
|
||||
$show_style = true;
|
||||
@@ -191,22 +192,22 @@ is_array($plugin_run_result = Plugins::getInstance()->run('end_index_page', get_
|
||||
|
||||
|
||||
//is ajax
|
||||
if(ip('ajax'))
|
||||
if (ip('ajax'))
|
||||
{
|
||||
if(!empty($info))
|
||||
if (! empty($info))
|
||||
{
|
||||
header('Content-Type: text/plain; charset=utf-8');
|
||||
echo json_encode($info);
|
||||
}
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
//show style
|
||||
if($show_style)
|
||||
if ($show_style)
|
||||
{
|
||||
Saaheader();
|
||||
echo $tpl->display(($config['filesnum'] > 0 ? "index_body" : "info"));
|
||||
echo $tpl->display(($config['filesnum'] > 0 ? 'index_body' : 'info'));
|
||||
Saafooter();
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
*/
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,50 +18,50 @@ if (!defined('IN_COMMON'))
|
||||
// Configuration values
|
||||
//
|
||||
|
||||
$config_values = array();
|
||||
$config_values = [];
|
||||
|
||||
// do it like this :
|
||||
//$config_values = array('name', 'value', 'option', 'display_order', 'type', 'plg_id', 'dynamic');
|
||||
|
||||
// General settings
|
||||
$config_values[] = array('sitename', $config_sitename, '<input type=\"text\" id=\"sitename\" name=\"sitename\" value=\"{con.sitename}\" size=\"50\" />', 1, 'general', 0, 0);
|
||||
$config_values[] = array('siteurl', $config_siteurl, '<input type=\"text\" id=\"siteurl\" name=\"siteurl\" value=\"{con.siteurl}\" size=\"50\" style=\"direction:ltr\" />', 2, 'general', 0, 0);
|
||||
$config_values[] = array('sitemail', $config_sitemail, '<input type=\"text\" id=\"sitemail\" name=\"sitemail\" value=\"{con.sitemail}\" size=\"25\" style=\"direction:ltr\" />', 3, 'general', 0, 0);
|
||||
$config_values[] = array('sitemail2', $config_sitemail, '<input type=\"text\" id=\"sitemail2\" name=\"sitemail2\" value=\"{con.sitemail2}\" size=\"25\" style=\"direction:ltr\" />', '4', 'general', 0, 0);
|
||||
$config_values[] = array('del_f_day', '0', '<input type=\"text\" id=\"del_f_day\" name=\"del_f_day\" value=\"{con.del_f_day}\" size=\"6\" style=\"text-align:center\" />{lang.DELF_CAUTION}', 5, 'advanced', 0, 0);
|
||||
$config_values[] = array('language', getlang(), '<select name=\"language\" id=\"language\">\r\n {lngfiles}\r\n </select>', 6, 'groups', 0, 0);
|
||||
$config_values[] = array('time_zone', $config_time_zone, '<select name=\"time_zone\" id=\"time_zone\">\r\n {time_zones}\r\n </select>', 10, 'general', 0, 0);
|
||||
$config_values[] = array('siteclose', '0', '<label>{lang.YES}<input type=\"radio\" id=\"siteclose\" name=\"siteclose\" value=\"1\" <IF NAME=\"con.siteclose==1\"> checked=\"checked\"</IF> /></label><label>{lang.NO}<input type=\"radio\" id=\"siteclose\" name=\"siteclose\" value=\"0\" <IF NAME=\"con.siteclose==0\"> checked=\"checked\"</IF> /></label>', 7, 'general', 0, 0);
|
||||
$config_values[] = array('closemsg', 'sits is closed now', '<input type=\"text\" id=\"closemsg\" name=\"closemsg\" value=\"{con.closemsg}\" size=\"68\" />', 8, 'general', 0, 0);
|
||||
$config_values[] = array('user_system', '1', '<select id=\"user_system\" name=\"user_system\">{authtypes}</select>', 9, 'advanced', 0, 0);
|
||||
$config_values[] = array('register', '1', '<label>{lang.YES}<input type=\"radio\" id=\"register\" name=\"register\" value=\"1\" <IF NAME=\"con.register==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"register\" name=\"register\" value=\"0\" <IF NAME=\"con.register==0\"> checked=\"checked\"</IF> /></label>', 10, 'general', 0, 0);
|
||||
$config_values[] = array('enable_userfile', '1', '<label>{lang.YES}<input type=\"radio\" id=\"enable_userfile\" name=\"enable_userfile\" value=\"1\" <IF NAME=\"con.enable_userfile==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"enable_userfile\" name=\"enable_userfile\" value=\"0\" <IF NAME=\"con.enable_userfile==0\"> checked=\"checked\"</IF> /></label>', 11, 'groups', 0, 0);
|
||||
$config_values[] = array('mod_writer', '0', '<label>{lang.YES}<input type=\"radio\" id=\"mod_writer\" name=\"mod_writer\" value=\"1\" <IF NAME=\"con.mod_writer==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"mod_writer\" name=\"mod_writer\" value=\"0\" <IF NAME=\"con.mod_writer==0\"> checked=\"checked\"</IF> /></label>\r\n [ {lang.MOD_WRITER_EX} ]', 12, 'advanced', 0, 0);
|
||||
$config_values[] = ['sitename', $config_sitename, '<input type=\"text\" id=\"sitename\" name=\"sitename\" value=\"{con.sitename}\" size=\"50\" />', 1, 'general', 0, 0];
|
||||
$config_values[] = ['siteurl', $config_siteurl, '<input type=\"text\" id=\"siteurl\" name=\"siteurl\" value=\"{con.siteurl}\" size=\"50\" style=\"direction:ltr\" />', 2, 'general', 0, 0];
|
||||
$config_values[] = ['sitemail', $config_sitemail, '<input type=\"text\" id=\"sitemail\" name=\"sitemail\" value=\"{con.sitemail}\" size=\"25\" style=\"direction:ltr\" />', 3, 'general', 0, 0];
|
||||
$config_values[] = ['sitemail2', $config_sitemail, '<input type=\"text\" id=\"sitemail2\" name=\"sitemail2\" value=\"{con.sitemail2}\" size=\"25\" style=\"direction:ltr\" />', '4', 'general', 0, 0];
|
||||
$config_values[] = ['del_f_day', '0', '<input type=\"text\" id=\"del_f_day\" name=\"del_f_day\" value=\"{con.del_f_day}\" size=\"6\" style=\"text-align:center\" />{lang.DELF_CAUTION}', 5, 'advanced', 0, 0];
|
||||
$config_values[] = ['language', getlang(), '<select name=\"language\" id=\"language\">\r\n {lngfiles}\r\n </select>', 6, 'groups', 0, 0];
|
||||
$config_values[] = ['time_zone', $config_time_zone, '<select name=\"time_zone\" id=\"time_zone\">\r\n {time_zones}\r\n </select>', 10, 'general', 0, 0];
|
||||
$config_values[] = ['siteclose', '0', '<label>{lang.YES}<input type=\"radio\" id=\"siteclose\" name=\"siteclose\" value=\"1\" <IF NAME=\"con.siteclose==1\"> checked=\"checked\"</IF> /></label><label>{lang.NO}<input type=\"radio\" id=\"siteclose\" name=\"siteclose\" value=\"0\" <IF NAME=\"con.siteclose==0\"> checked=\"checked\"</IF> /></label>', 7, 'general', 0, 0];
|
||||
$config_values[] = ['closemsg', 'sits is closed now', '<input type=\"text\" id=\"closemsg\" name=\"closemsg\" value=\"{con.closemsg}\" size=\"68\" />', 8, 'general', 0, 0];
|
||||
$config_values[] = ['user_system', '1', '<select id=\"user_system\" name=\"user_system\">{authtypes}</select>', 9, 'advanced', 0, 0];
|
||||
$config_values[] = ['register', '1', '<label>{lang.YES}<input type=\"radio\" id=\"register\" name=\"register\" value=\"1\" <IF NAME=\"con.register==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"register\" name=\"register\" value=\"0\" <IF NAME=\"con.register==0\"> checked=\"checked\"</IF> /></label>', 10, 'general', 0, 0];
|
||||
$config_values[] = ['enable_userfile', '1', '<label>{lang.YES}<input type=\"radio\" id=\"enable_userfile\" name=\"enable_userfile\" value=\"1\" <IF NAME=\"con.enable_userfile==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"enable_userfile\" name=\"enable_userfile\" value=\"0\" <IF NAME=\"con.enable_userfile==0\"> checked=\"checked\"</IF> /></label>', 11, 'groups', 0, 0];
|
||||
$config_values[] = ['mod_writer', '0', '<label>{lang.YES}<input type=\"radio\" id=\"mod_writer\" name=\"mod_writer\" value=\"1\" <IF NAME=\"con.mod_writer==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"mod_writer\" name=\"mod_writer\" value=\"0\" <IF NAME=\"con.mod_writer==0\"> checked=\"checked\"</IF> /></label>\r\n [ {lang.MOD_WRITER_EX} ]', 12, 'advanced', 0, 0];
|
||||
|
||||
// Cookies settings
|
||||
$cookie_data = get_cookies_settings();
|
||||
$config_values[] = array('cookie_name', $cookie_data['cookie_name'], '<input type=\"text\" id=\"cookie_name\" name=\"cookie_name\" value=\"{con.cookie_name}\" size=\"20\" style=\"direction:ltr\" />', '13', 'advanced', 0, 0);
|
||||
$config_values[] = array('cookie_path', $cookie_data['cookie_path'], '<input type=\"text\" id=\"cookie_path\" name=\"cookie_path\" value=\"{con.cookie_path}\" size=\"20\" style=\"direction:ltr\" />', '14', 'advanced', 0, 0);
|
||||
$config_values[] = array('cookie_domain', $cookie_data['cookie_domain'], '<input type=\"text\" id=\"cookie_domain\" name=\"cookie_domain\" value=\"{con.cookie_domain}\" size=\"20\" style=\"direction:ltr\" />', '15', 'advanced', 0, 0);
|
||||
$config_values[] = array('cookie_secure', ($cookie_data['cookie_secure'] ? '1' : '0'), '<label>{lang.YES}<input type=\"radio\" id=\"cookie_secure\" name=\"cookie_secure\" value=\"1\" <IF NAME=\"con.cookie_secure==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"cookie_secure\" name=\"cookie_secure\" value=\"0\" <IF NAME=\"con.cookie_secure==0\"> checked=\"checked\"</IF> /></label>', '16', 'advanced', 0, 0);
|
||||
$cookie_data = get_cookies_settings();
|
||||
$config_values[] = ['cookie_name', $cookie_data['cookie_name'], '<input type=\"text\" id=\"cookie_name\" name=\"cookie_name\" value=\"{con.cookie_name}\" size=\"20\" style=\"direction:ltr\" />', '13', 'advanced', 0, 0];
|
||||
$config_values[] = ['cookie_path', $cookie_data['cookie_path'], '<input type=\"text\" id=\"cookie_path\" name=\"cookie_path\" value=\"{con.cookie_path}\" size=\"20\" style=\"direction:ltr\" />', '14', 'advanced', 0, 0];
|
||||
$config_values[] = ['cookie_domain', $cookie_data['cookie_domain'], '<input type=\"text\" id=\"cookie_domain\" name=\"cookie_domain\" value=\"{con.cookie_domain}\" size=\"20\" style=\"direction:ltr\" />', '15', 'advanced', 0, 0];
|
||||
$config_values[] = ['cookie_secure', ($cookie_data['cookie_secure'] ? '1' : '0'), '<label>{lang.YES}<input type=\"radio\" id=\"cookie_secure\" name=\"cookie_secure\" value=\"1\" <IF NAME=\"con.cookie_secure==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"cookie_secure\" name=\"cookie_secure\" value=\"0\" <IF NAME=\"con.cookie_secure==0\"> checked=\"checked\"</IF> /></label>', '16', 'advanced', 0, 0];
|
||||
|
||||
// Upload settings
|
||||
$config_values[] = array('total_size', '10000000000', '<input type=\"text\" id=\"total_size\" name=\"total_size\" value=\"{con.total_size}\" size=\"20\" style=\"direction:ltr\" />', 17, 'upload', 0, 0);
|
||||
$config_values[] = array('foldername', 'uploads', '<input type=\"text\" id=\"foldername\" name=\"foldername\" value=\"{con.foldername}\" size=\"20\" style=\"direction:ltr\" />', 18, 'upload', 0, 0);
|
||||
$config_values[] = array('prefixname', '', '<input type=\"text\" id=\"prefixname\" name=\"prefixname\" value=\"{con.prefixname}\" size=\"20\" style=\"direction:ltr\" />', 19, 'upload', 0, 0);
|
||||
$config_values[] = array('decode', '1', '<select id=\"decode\" name=\"decode\">\r\n <option <IF NAME=\"con.decode==0\">selected=\"selected\"</IF> value=\"0\">{lang.NO_CHANGE}</option>\r\n <option <IF NAME=\"con.decode==2\">selected=\"selected\"</IF> value=\"2\">{lang.CHANGE_MD5}</option>\r\n <option <IF NAME=\"con.decode==1\">selected=\"selected\"</IF> value=\"1\">{lang.CHANGE_TIME}</option>\r\n <!-- another config decode options -->\r\n </select>', 20, 'upload', 0, 0);
|
||||
$config_values[] = array('id_form', $config_urls_type, '<select id=\"id_form\" name=\"id_form\">\r\n <option <IF NAME=\"con.id_form==id\">selected=\"selected\"</IF> value=\"id\">{lang.IDF}</option>\r\n <option <IF NAME=\"con.id_form==filename\">selected=\"selected\"</IF> value=\"filename\">{lang.IDFF}</option>\r\n<option <IF NAME=\"con.id_form==direct\">selected=\"selected\"</IF> value=\"direct\">{lang.IDFD}</option>\r\n </select>', 21, 'upload', 0, 0);
|
||||
$config_values[] = array('id_form_img', $config_urls_type, '<select id=\"id_form_img\" name=\"id_form_img\">\r\n <option <IF NAME=\"con.id_form_img==id\">selected=\"selected\"</IF> value=\"id\">{lang.IDF_IMG}</option>\r\n <option <IF NAME=\"con.id_form_img==filename\">selected=\"selected\"</IF> value=\"filename\">{lang.IDFF_IMG}</option>\r\n<option <IF NAME=\"con.id_form_img==direct\">selected=\"selected\"</IF> value=\"direct\">{lang.IDFD_IMG}</option>\r\n </select>', 21, 'upload', 0, 0);
|
||||
$config_values[] = array('filesnum', '3', '<input type=\"text\" id=\"filesnum\" name=\"filesnum\" value=\"{con.filesnum}\" size=\"6\" style=\"text-align:center\" />', 22, 'groups', 0, 0);
|
||||
$config_values[] = array('sec_down', '5', '<input type=\"text\" id=\"sec_down\" name=\"sec_down\" value=\"{con.sec_down}\" size=\"6\" style=\"text-align:center\" />', 23, 'groups', 0, 0);
|
||||
$config_values[] = array('del_url_file', '1', '<label>{lang.YES}<input type=\"radio\" id=\"del_url_file\" name=\"del_url_file\" value=\"1\" <IF NAME=\"con.del_url_file==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"del_url_file\" name=\"del_url_file\" value=\"0\" <IF NAME=\"con.del_url_file==0\"> checked=\"checked\"</IF> /></label>', 24, 'upload', 0, 0);
|
||||
$config_values[] = array('safe_code', '0', '<label>{lang.YES}<input type=\"radio\" id=\"safe_code\" name=\"safe_code\" value=\"1\" <IF NAME=\"con.safe_code==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"safe_code\" name=\"safe_code\" value=\"0\" <IF NAME=\"con.safe_code==0\"> checked=\"checked\"</IF> /></label>', 25, 'upload', 0, 0);
|
||||
$config_values[] = array('www_url', '0', '<label>{lang.YES}<input type=\"radio\" id=\"www_url\" name=\"www_url\" value=\"1\" <IF NAME=\"con.www_url==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"www_url\" name=\"www_url\" value=\"0\" <IF NAME=\"con.www_url==0\"> checked=\"checked\"</IF> /></label>', 26, 'upload', 0, 0);
|
||||
$config_values[] = array('thumbs_imgs', '1', '<input type=\"text\" id=\"thmb_dim_w\" name=\"thmb_dim_w\" value=\"{thmb_dim_w}\" size=\"2\" style=\"text-align:center\" /> * <input type=\"text\" id=\"thmb_dim_h\" name=\"thmb_dim_h\" value=\"{thmb_dim_h}\" size=\"2\" style=\"text-align:center\" /> ', 27, 'upload', 0, 0);
|
||||
$config_values[] = array('write_imgs', '0' , '<label>{lang.YES}<input type=\"radio\" id=\"write_imgs\" name=\"write_imgs\" value=\"1\" <IF NAME=\"con.write_imgs==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"write_imgs\" name=\"write_imgs\" value=\"0\" <IF NAME=\"con.write_imgs==0\"> checked=\"checked\"</IF> /></label>\r\n <br /><img src=\"{STAMP_IMG_URL}\" alt=\"Seal photo\" style=\"margin-top:4px;border:1px groove #FF865E;\" />\r\n ', 28, 'groups', 0, 0);
|
||||
$config_values[] = array('livexts', 'swf', '<input type=\"text\" id=\"livexts\" name=\"livexts\" value=\"{con.livexts}\" size=\"62\" style=\"direction:ltr\" />{lang.COMMA_X}', '29', 'upload', 0, 0);
|
||||
$config_values[] = array('usersectoupload', '10', '<input type=\"text\" id=\"usersectoupload\" name=\"usersectoupload\" value=\"{con.usersectoupload}\" size=\"10\" />', 44, 'groups', 0, 0);
|
||||
$config_values[] = array('filesnum_show', '1', '<label>{lang.YES}<input type=\"radio\" id=\"filesnum_show\" name=\"filesnum_show\" value=\"1\" <IF NAME=\"con.filesnum_show==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"filesnum_show\" name=\"filesnum_show\" value=\"0\" <IF NAME=\"con.filesnum_show==0\"> checked=\"checked\"</IF> /></label>', 22, 'upload', 0, 0);
|
||||
$config_values[] = ['total_size', '10000000000', '<input type=\"text\" id=\"total_size\" name=\"total_size\" value=\"{con.total_size}\" size=\"20\" style=\"direction:ltr\" />', 17, 'upload', 0, 0];
|
||||
$config_values[] = ['foldername', 'uploads', '<input type=\"text\" id=\"foldername\" name=\"foldername\" value=\"{con.foldername}\" size=\"20\" style=\"direction:ltr\" />', 18, 'upload', 0, 0];
|
||||
$config_values[] = ['prefixname', '', '<input type=\"text\" id=\"prefixname\" name=\"prefixname\" value=\"{con.prefixname}\" size=\"20\" style=\"direction:ltr\" />', 19, 'upload', 0, 0];
|
||||
$config_values[] = ['decode', '1', '<select id=\"decode\" name=\"decode\">\r\n <option <IF NAME=\"con.decode==0\">selected=\"selected\"</IF> value=\"0\">{lang.NO_CHANGE}</option>\r\n <option <IF NAME=\"con.decode==2\">selected=\"selected\"</IF> value=\"2\">{lang.CHANGE_MD5}</option>\r\n <option <IF NAME=\"con.decode==1\">selected=\"selected\"</IF> value=\"1\">{lang.CHANGE_TIME}</option>\r\n <!-- another config decode options -->\r\n </select>', 20, 'upload', 0, 0];
|
||||
$config_values[] = ['id_form', $config_urls_type, '<select id=\"id_form\" name=\"id_form\">\r\n <option <IF NAME=\"con.id_form==id\">selected=\"selected\"</IF> value=\"id\">{lang.IDF}</option>\r\n <option <IF NAME=\"con.id_form==filename\">selected=\"selected\"</IF> value=\"filename\">{lang.IDFF}</option>\r\n<option <IF NAME=\"con.id_form==direct\">selected=\"selected\"</IF> value=\"direct\">{lang.IDFD}</option>\r\n </select>', 21, 'upload', 0, 0];
|
||||
$config_values[] = ['id_form_img', $config_urls_type, '<select id=\"id_form_img\" name=\"id_form_img\">\r\n <option <IF NAME=\"con.id_form_img==id\">selected=\"selected\"</IF> value=\"id\">{lang.IDF_IMG}</option>\r\n <option <IF NAME=\"con.id_form_img==filename\">selected=\"selected\"</IF> value=\"filename\">{lang.IDFF_IMG}</option>\r\n<option <IF NAME=\"con.id_form_img==direct\">selected=\"selected\"</IF> value=\"direct\">{lang.IDFD_IMG}</option>\r\n </select>', 21, 'upload', 0, 0];
|
||||
$config_values[] = ['filesnum', '3', '<input type=\"text\" id=\"filesnum\" name=\"filesnum\" value=\"{con.filesnum}\" size=\"6\" style=\"text-align:center\" />', 22, 'groups', 0, 0];
|
||||
$config_values[] = ['sec_down', '5', '<input type=\"text\" id=\"sec_down\" name=\"sec_down\" value=\"{con.sec_down}\" size=\"6\" style=\"text-align:center\" />', 23, 'groups', 0, 0];
|
||||
$config_values[] = ['del_url_file', '1', '<label>{lang.YES}<input type=\"radio\" id=\"del_url_file\" name=\"del_url_file\" value=\"1\" <IF NAME=\"con.del_url_file==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"del_url_file\" name=\"del_url_file\" value=\"0\" <IF NAME=\"con.del_url_file==0\"> checked=\"checked\"</IF> /></label>', 24, 'upload', 0, 0];
|
||||
$config_values[] = ['safe_code', '0', '<label>{lang.YES}<input type=\"radio\" id=\"safe_code\" name=\"safe_code\" value=\"1\" <IF NAME=\"con.safe_code==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"safe_code\" name=\"safe_code\" value=\"0\" <IF NAME=\"con.safe_code==0\"> checked=\"checked\"</IF> /></label>', 25, 'upload', 0, 0];
|
||||
$config_values[] = ['www_url', '0', '<label>{lang.YES}<input type=\"radio\" id=\"www_url\" name=\"www_url\" value=\"1\" <IF NAME=\"con.www_url==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"www_url\" name=\"www_url\" value=\"0\" <IF NAME=\"con.www_url==0\"> checked=\"checked\"</IF> /></label>', 26, 'upload', 0, 0];
|
||||
$config_values[] = ['thumbs_imgs', '1', '<input type=\"text\" id=\"thmb_dim_w\" name=\"thmb_dim_w\" value=\"{thmb_dim_w}\" size=\"2\" style=\"text-align:center\" /> * <input type=\"text\" id=\"thmb_dim_h\" name=\"thmb_dim_h\" value=\"{thmb_dim_h}\" size=\"2\" style=\"text-align:center\" /> ', 27, 'upload', 0, 0];
|
||||
$config_values[] = ['write_imgs', '0' , '<label>{lang.YES}<input type=\"radio\" id=\"write_imgs\" name=\"write_imgs\" value=\"1\" <IF NAME=\"con.write_imgs==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"write_imgs\" name=\"write_imgs\" value=\"0\" <IF NAME=\"con.write_imgs==0\"> checked=\"checked\"</IF> /></label>\r\n <br /><img src=\"{STAMP_IMG_URL}\" alt=\"Seal photo\" style=\"margin-top:4px;border:1px groove #FF865E;\" />\r\n ', 28, 'groups', 0, 0];
|
||||
$config_values[] = ['livexts', 'swf', '<input type=\"text\" id=\"livexts\" name=\"livexts\" value=\"{con.livexts}\" size=\"62\" style=\"direction:ltr\" />{lang.COMMA_X}', '29', 'upload', 0, 0];
|
||||
$config_values[] = ['usersectoupload', '10', '<input type=\"text\" id=\"usersectoupload\" name=\"usersectoupload\" value=\"{con.usersectoupload}\" size=\"10\" />', 44, 'groups', 0, 0];
|
||||
$config_values[] = ['filesnum_show', '1', '<label>{lang.YES}<input type=\"radio\" id=\"filesnum_show\" name=\"filesnum_show\" value=\"1\" <IF NAME=\"con.filesnum_show==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"filesnum_show\" name=\"filesnum_show\" value=\"0\" <IF NAME=\"con.filesnum_show==0\"> checked=\"checked\"</IF> /></label>', 22, 'upload', 0, 0];
|
||||
|
||||
//KLIVE
|
||||
//$config_values[] = array('imagefolder', 'uploads', '<input type=\"text\" id=\"imagefolder\" name=\"imagefolder\" value=\"{con.imagefolder}\" size=\"40\">', '10', 'KLIVE', '0', '0');
|
||||
@@ -69,28 +69,28 @@ $config_values[] = array('filesnum_show', '1', '<label>{lang.YES}<input type=\"r
|
||||
//$config_values[] = array('imagefoldere', '1', '<label>{lang.YES}<input type=\"radio\" id=\"imagefoldere\" name=\"imagefoldere\" value=\"1\" <IF NAME=\"con.imagefoldere\"> checked=\"checked\"</IF>></label><label>{lang.NO}<input type=\"radio\" id=\"imagefoldere\" name=\"imagefoldere\" value=\"0\" <IF NAME=\"con.imagefoldere\"> <ELSE> checked=\"checked\"</IF>></label>', '30', 'KLIVE', '0', '0');
|
||||
|
||||
// Interface settings
|
||||
$config_values[] = array('welcome_msg', $lang['INST_MSGINS'], '<input type=\"text\" id=\"welcome_msg\" name=\"welcome_msg\" value=\"{con.welcome_msg}\" size=\"68\" />', 30, 'interface', 0, 0);
|
||||
$config_values[] = array('allow_stat_pg', '1', '<label>{lang.YES}<input type=\"radio\" id=\"allow_stat_pg\" name=\"allow_stat_pg\" value=\"1\" <IF NAME=\"con.allow_stat_pg==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"allow_stat_pg\" name=\"allow_stat_pg\" value=\"0\" <IF NAME=\"con.allow_stat_pg==0\"> checked=\"checked\"</IF> /></label>', 31, 'interface', 0, 0);
|
||||
$config_values[] = array('allow_online', '0', '<label>{lang.YES}<input type=\"radio\" id=\"allow_online\" name=\"allow_online\" value=\"1\" <IF NAME=\"con.allow_online==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"allow_online\" name=\"allow_online\" value=\"0\" <IF NAME=\"con.allow_online==0\"> checked=\"checked\"</IF> /></label>', 32, 'interface', 0, 0);
|
||||
$config_values[] = array('statfooter', '0' , '<label>{lang.YES}<input type=\"radio\" id=\"statfooter\" name=\"statfooter\" value=\"1\" <IF NAME=\"con.statfooter==1\"> checked=\"checked=\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"statfooter\" name=\"statfooter\" value=\"0\" <IF NAME=\"con.statfooter==0\"> checked=\"checked\"</IF> /></label>', 33, 'interface', 0, 0);
|
||||
$config_values[] = ['welcome_msg', $lang['INST_MSGINS'], '<input type=\"text\" id=\"welcome_msg\" name=\"welcome_msg\" value=\"{con.welcome_msg}\" size=\"68\" />', 30, 'interface', 0, 0];
|
||||
$config_values[] = ['allow_stat_pg', '1', '<label>{lang.YES}<input type=\"radio\" id=\"allow_stat_pg\" name=\"allow_stat_pg\" value=\"1\" <IF NAME=\"con.allow_stat_pg==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"allow_stat_pg\" name=\"allow_stat_pg\" value=\"0\" <IF NAME=\"con.allow_stat_pg==0\"> checked=\"checked\"</IF> /></label>', 31, 'interface', 0, 0];
|
||||
$config_values[] = ['allow_online', '0', '<label>{lang.YES}<input type=\"radio\" id=\"allow_online\" name=\"allow_online\" value=\"1\" <IF NAME=\"con.allow_online==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"allow_online\" name=\"allow_online\" value=\"0\" <IF NAME=\"con.allow_online==0\"> checked=\"checked\"</IF> /></label>', 32, 'interface', 0, 0];
|
||||
$config_values[] = ['statfooter', '0' , '<label>{lang.YES}<input type=\"radio\" id=\"statfooter\" name=\"statfooter\" value=\"1\" <IF NAME=\"con.statfooter==1\"> checked=\"checked=\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"statfooter\" name=\"statfooter\" value=\"0\" <IF NAME=\"con.statfooter==0\"> checked=\"checked\"</IF> /></label>', 33, 'interface', 0, 0];
|
||||
//$config_values[] = array('gzip', '0', '<label>{lang.YES}<input type=\"radio\" id=\"gzip\" name=\"gzip\" value=\"1\" <IF NAME=\"con.gzip==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"gzip\" name=\"gzip\" value=\"0\" <IF NAME=\"con.gzip==0\"> checked=\"checked\"</IF> /></label>', 34, 'interface', 0, 0);
|
||||
$config_values[] = array('googleanalytics', '', '<input type=\"text\" id=\"googleanalytics\" name=\"googleanalytics\" value=\"{con.googleanalytics}\" size=\"10\" />', 35, 'interface', 0, 0);
|
||||
$config_values[] = array('enable_captcha', '1', '<label>{lang.YES}<input type=\"radio\" id=\"enable_captcha\" name=\"enable_captcha\" value=\"1\" <IF NAME=\"con.enable_captcha==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"enable_captcha\" name=\"enable_captcha\" value=\"0\" <IF NAME=\"con.enable_captcha==0\"> checked=\"checked\"</IF> /></label>', 36, 'interface', 0, 0);
|
||||
$config_values[] = ['googleanalytics', '', '<input type=\"text\" id=\"googleanalytics\" name=\"googleanalytics\" value=\"{con.googleanalytics}\" size=\"10\" />', 35, 'interface', 0, 0];
|
||||
$config_values[] = ['enable_captcha', '1', '<label>{lang.YES}<input type=\"radio\" id=\"enable_captcha\" name=\"enable_captcha\" value=\"1\" <IF NAME=\"con.enable_captcha==1\"> checked=\"checked\"</IF> /></label>\r\n <label>{lang.NO}<input type=\"radio\" id=\"enable_captcha\" name=\"enable_captcha\" value=\"0\" <IF NAME=\"con.enable_captcha==0\"> checked=\"checked\"</IF> /></label>', 36, 'interface', 0, 0];
|
||||
|
||||
// System settings [ invisible configs ]
|
||||
$config_values[] = array('thmb_dims', '100*100', '', 0, 0, 0);
|
||||
$config_values[] = array('style', 'bootstrap', '', 0, '0', 0, 0);
|
||||
$config_values[] = array('new_version', '', '', 0, 0, 0);
|
||||
$config_values[] = array('db_version', LAST_DB_VERSION, '', 0, 0, 0);
|
||||
$config_values[] = array('last_online_time_update', time(), '', 0, 0, 1);
|
||||
$config_values[] = array('klj_clean_files_from', '0', '', 0, 0, 1);
|
||||
$config_values[] = array('style_depend_on', '', '', 0, 0, 0);
|
||||
$config_values[] = array('most_user_online_ever', '', '', 0, 0, 1);
|
||||
$config_values[] = array('expand_menu', '0', '', 0, 0, 1);
|
||||
$config_values[] = array('firstime', '0', '', 0, 0, 1);
|
||||
$config_values[] = array('ftp_info', '', '', 0, 0, 0);
|
||||
$config_values[] = array('queue', '', '', 0, 0, 1);
|
||||
$config_values[] = array('default_group', '3', '', 0, 0, 1);
|
||||
$config_values[] = ['thmb_dims', '100*100', '', 0, 0, 0];
|
||||
$config_values[] = ['style', 'bootstrap', '', 0, '0', 0, 0];
|
||||
$config_values[] = ['new_version', '', '', 0, 0, 0];
|
||||
$config_values[] = ['db_version', LAST_DB_VERSION, '', 0, 0, 0];
|
||||
$config_values[] = ['last_online_time_update', time(), '', 0, 0, 1];
|
||||
$config_values[] = ['klj_clean_files_from', '0', '', 0, 0, 1];
|
||||
$config_values[] = ['style_depend_on', '', '', 0, 0, 0];
|
||||
$config_values[] = ['most_user_online_ever', '', '', 0, 0, 1];
|
||||
$config_values[] = ['expand_menu', '0', '', 0, 0, 1];
|
||||
$config_values[] = ['firstime', '0', '', 0, 0, 1];
|
||||
$config_values[] = ['ftp_info', '', '', 0, 0, 0];
|
||||
$config_values[] = ['queue', '', '', 0, 0, 1];
|
||||
$config_values[] = ['default_group', '3', '', 0, 0, 1];
|
||||
|
||||
//
|
||||
// Extensions
|
||||
@@ -98,50 +98,50 @@ $config_values[] = array('default_group', '3', '', 0, 0, 1);
|
||||
|
||||
// do it like this :
|
||||
//$ext_values[group_id] = array('ext'=>sizeInKB);
|
||||
$ext_values = array();
|
||||
$ext_values = [];
|
||||
|
||||
#admins
|
||||
$ext_values[1] = array(
|
||||
'gif' => 2097152,
|
||||
'png' => 2097152,
|
||||
'jpg' => 2097152,
|
||||
'jpeg' => 2097152,
|
||||
'bmp' => 2097152,
|
||||
'zip' => 2097152,
|
||||
'rar' => 2097152,
|
||||
);
|
||||
#guests
|
||||
$ext_values[2] = array(
|
||||
'gif' => 2097152,
|
||||
'png' => 2097152,
|
||||
'jpg' => 2097152,
|
||||
'jpeg' => 2097152,
|
||||
'bmp' => 2097152,
|
||||
'zip' => 2097152,
|
||||
'rar' => 2097152,
|
||||
);
|
||||
#users
|
||||
$ext_values[3] = array(
|
||||
'gif' => 2097152,
|
||||
'png' => 2097152,
|
||||
'jpg' => 2097152,
|
||||
'jpeg' => 2097152,
|
||||
'bmp' => 2097152,
|
||||
'zip' => 2097152,
|
||||
'rar' => 2097152,
|
||||
);
|
||||
//admins
|
||||
$ext_values[1] = [
|
||||
'gif' => 2097152,
|
||||
'png' => 2097152,
|
||||
'jpg' => 2097152,
|
||||
'jpeg' => 2097152,
|
||||
'bmp' => 2097152,
|
||||
'zip' => 2097152,
|
||||
'rar' => 2097152,
|
||||
];
|
||||
//guests
|
||||
$ext_values[2] = [
|
||||
'gif' => 2097152,
|
||||
'png' => 2097152,
|
||||
'jpg' => 2097152,
|
||||
'jpeg' => 2097152,
|
||||
'bmp' => 2097152,
|
||||
'zip' => 2097152,
|
||||
'rar' => 2097152,
|
||||
];
|
||||
//users
|
||||
$ext_values[3] = [
|
||||
'gif' => 2097152,
|
||||
'png' => 2097152,
|
||||
'jpg' => 2097152,
|
||||
'jpeg' => 2097152,
|
||||
'bmp' => 2097152,
|
||||
'zip' => 2097152,
|
||||
'rar' => 2097152,
|
||||
];
|
||||
|
||||
|
||||
//
|
||||
// ACLs
|
||||
//
|
||||
|
||||
$acls_values = array();
|
||||
$acls_values = [];
|
||||
|
||||
//$acls_values['name of acl'] = array(admins, guests, users);
|
||||
$acls_values['enter_acp'] = array(1, 0, 0);
|
||||
$acls_values['access_fileuser'] = array(1, 0, 1);
|
||||
$acls_values['access_fileusers'] = array(1, 1, 1);
|
||||
$acls_values['access_stats'] = array(1, 1, 1);
|
||||
$acls_values['access_call'] = array(1, 1, 1);
|
||||
$acls_values['access_report'] = array(0, 0, 0);
|
||||
$acls_values['enter_acp'] = [1, 0, 0];
|
||||
$acls_values['access_fileuser'] = [1, 0, 1];
|
||||
$acls_values['access_fileusers'] = [1, 1, 1];
|
||||
$acls_values['access_stats'] = [1, 1, 1];
|
||||
$acls_values['access_call'] = [1, 1, 1];
|
||||
$acls_values['access_report'] = [0, 0, 0];
|
||||
|
||||
@@ -7,24 +7,22 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Requirements of Kleeja
|
||||
*/
|
||||
// Requirements of Kleeja
|
||||
define('MIN_PHP_VERSION', '7.0');
|
||||
define('MIN_MYSQL_VERSION', '4.2.2');
|
||||
//version of latest changes at db
|
||||
define ('LAST_DB_VERSION' , '9');
|
||||
define ('LAST_DB_VERSION', '9');
|
||||
//set no errors
|
||||
define('MYSQL_NO_ERRORS', true);
|
||||
|
||||
|
||||
// Detect choosing another lang while installing
|
||||
if(ig('change_lang'))
|
||||
if (ig('change_lang'))
|
||||
{
|
||||
if (ip('lang'))
|
||||
{
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?step=' . p('step_is') . '&lang=' . p('lang'));
|
||||
}
|
||||
if (ip('lang'))
|
||||
{
|
||||
header('Location: ' . $_SERVER['PHP_SELF'] . '?step=' . p('step_is') . '&lang=' . p('lang'));
|
||||
}
|
||||
}
|
||||
|
||||
// Including current language
|
||||
@@ -34,48 +32,48 @@ $lang = array_merge($lang, require $_path . 'lang/' . getlang() . '/install.php'
|
||||
|
||||
$IN_DEV = false;
|
||||
// Exceptions for development
|
||||
if(file_exists($_path . '.svn/entries') || file_exists('dev.txt'))
|
||||
if (file_exists($_path . '.svn/entries') || file_exists('dev.txt'))
|
||||
{
|
||||
define('DEV_STAGE', true);
|
||||
$IN_DEV = true;
|
||||
define('DEV_STAGE', true);
|
||||
$IN_DEV = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return current language of installing wizard
|
||||
* @param bool $link
|
||||
* @param bool $link
|
||||
* @return mixed|string
|
||||
*/
|
||||
function getlang ($link = false)
|
||||
{
|
||||
global $_path;
|
||||
global $_path;
|
||||
|
||||
if (ig('lang'))
|
||||
{
|
||||
$lang = preg_replace('/[^a-z0-9]/i', '', g('lang', 'str', 'en'));
|
||||
if (ig('lang'))
|
||||
{
|
||||
$lang = preg_replace('/[^a-z0-9]/i', '', g('lang', 'str', 'en'));
|
||||
|
||||
$ln = file_exists($_path . 'lang/' . $lang . '/install.php') ? $lang : 'en';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ln = 'en';
|
||||
}
|
||||
$ln = file_exists($_path . 'lang/' . $lang . '/install.php') ? $lang : 'en';
|
||||
}
|
||||
else
|
||||
{
|
||||
$ln = 'en';
|
||||
}
|
||||
|
||||
return $link ? 'lang=' . $ln : $ln;
|
||||
return $link ? 'lang=' . $ln : $ln;
|
||||
}
|
||||
|
||||
function getjquerylink()
|
||||
{
|
||||
global $_path;
|
||||
global $_path;
|
||||
|
||||
if(file_exists($_path . 'admin/Masmak/js/jquery.min.js'))
|
||||
{
|
||||
return $_path . 'admin/Masmak/js/jquery.min.js';
|
||||
}
|
||||
else
|
||||
{
|
||||
return 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
|
||||
}
|
||||
if (file_exists($_path . 'admin/Masmak/js/jquery.min.js'))
|
||||
{
|
||||
return $_path . 'admin/Masmak/js/jquery.min.js';
|
||||
}
|
||||
else
|
||||
{
|
||||
return 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,15 +81,15 @@ function getjquerylink()
|
||||
*/
|
||||
function gettpl($tplname)
|
||||
{
|
||||
global $lang, $_path;
|
||||
global $lang, $_path;
|
||||
|
||||
$tpl = preg_replace('/{{([^}]+)}}/', '<?php \\1 ?>', file_get_contents('style/' . $tplname));
|
||||
ob_start();
|
||||
eval('?> ' . $tpl . '<?php ');
|
||||
$stpl = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$tpl = preg_replace('/{{([^}]+)}}/', '<?php \\1 ?>', file_get_contents('style/' . $tplname));
|
||||
ob_start();
|
||||
eval('?> ' . $tpl . '<?php ');
|
||||
$stpl = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
return $stpl;
|
||||
return $stpl;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,49 +97,52 @@ function gettpl($tplname)
|
||||
*/
|
||||
function do_config_export($srv, $usr, $pass, $nm, $prf, $fpath = '')
|
||||
{
|
||||
global $_path;
|
||||
global $_path;
|
||||
|
||||
if(!in_array($type, array('mysql', 'mysqli')))
|
||||
{
|
||||
$type = 'mysql';
|
||||
}
|
||||
if (! in_array($type, ['mysql', 'mysqli']))
|
||||
{
|
||||
$type = 'mysql';
|
||||
}
|
||||
|
||||
$data = '<?php' . "\n\n" . '//fill these variables with your data' . "\n";
|
||||
//$data .= '$db_type = \'' . $type . "'; //mysqli or mysql \n";
|
||||
$data .= '$dbserver = \'' . str_replace("'", "\'", $srv) . "'; //database server \n";
|
||||
$data .= '$dbuser = \'' . str_replace("'", "\'", $usr) . "' ; // database user \n";
|
||||
$data .= '$dbpass = \'' . str_replace("'", "\'", $pass) . "'; // database password \n";
|
||||
$data .= '$dbname = \'' . str_replace("'", "\'", $nm) . "'; // database name \n";
|
||||
//$data .= '$db_type = \'' . $type . "'; //mysqli or mysql \n";
|
||||
$data .= '$dbserver = \'' . str_replace("'", "\'", $srv) . "'; //database server \n";
|
||||
$data .= '$dbuser = \'' . str_replace("'", "\'", $usr) . "' ; // database user \n";
|
||||
$data .= '$dbpass = \'' . str_replace("'", "\'", $pass) . "'; // database password \n";
|
||||
$data .= '$dbname = \'' . str_replace("'", "\'", $nm) . "'; // database name \n";
|
||||
$data .= '$dbprefix = \'' . str_replace("'", "\'", $prf) . "'; // if you use prefix for tables , fill it \n";
|
||||
//$data .= '$adminpath = \'admin.php\';// if you renamed your acp file , please fill the new name here \n';
|
||||
//$data .= "\n\n\n";
|
||||
//$data .= "//for integration with script must change user systen from admin cp \n";
|
||||
//$data .= '$script_path = \'' . str_replace("'", "\'", $fpath) . "'; // path of script (./forums) \n";
|
||||
//$data .= "\n\n";
|
||||
//$data .= '?'.'>';
|
||||
//$data .= '$adminpath = \'admin.php\';// if you renamed your acp file , please fill the new name here \n';
|
||||
//$data .= "\n\n\n";
|
||||
//$data .= "//for integration with script must change user systen from admin cp \n";
|
||||
//$data .= '$script_path = \'' . str_replace("'", "\'", $fpath) . "'; // path of script (./forums) \n";
|
||||
//$data .= "\n\n";
|
||||
//$data .= '?'.'>';
|
||||
|
||||
$written = false;
|
||||
if (is_writable($_path))
|
||||
{
|
||||
$fh = @fopen($_path . 'config.php', 'wb');
|
||||
if ($fh)
|
||||
{
|
||||
fwrite($fh, $data);
|
||||
fclose($fh);
|
||||
$written = false;
|
||||
|
||||
$written = true;
|
||||
}
|
||||
}
|
||||
if (is_writable($_path))
|
||||
{
|
||||
$fh = @fopen($_path . 'config.php', 'wb');
|
||||
|
||||
if(!$written)
|
||||
{
|
||||
header('Content-Type: text/x-delimtext; name="config.php"');
|
||||
header('Content-disposition: attachment; filename=config.php');
|
||||
echo $data;
|
||||
exit;
|
||||
}
|
||||
if ($fh)
|
||||
{
|
||||
fwrite($fh, $data);
|
||||
fclose($fh);
|
||||
|
||||
return true;
|
||||
$written = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $written)
|
||||
{
|
||||
header('Content-Type: text/x-delimtext; name="config.php"');
|
||||
header('Content-disposition: attachment; filename=config.php');
|
||||
echo $data;
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,8 +151,8 @@ function do_config_export($srv, $usr, $pass, $nm, $prf, $fpath = '')
|
||||
*/
|
||||
function get_microtime()
|
||||
{
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
return ((float) $usec + (float) $sec);
|
||||
list($usec, $sec) = explode(' ', microtime());
|
||||
return ((float) $usec + (float) $sec);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -159,35 +160,37 @@ function get_microtime()
|
||||
*/
|
||||
function inst_get_config($name)
|
||||
{
|
||||
global $SQL, $dbprefix;
|
||||
global $SQL, $dbprefix;
|
||||
|
||||
if(!$SQL)
|
||||
{
|
||||
global $dbserver, $dbuser, $dbpass, $dbname;
|
||||
if(!isset($dbserver))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (! $SQL)
|
||||
{
|
||||
global $dbserver, $dbuser, $dbpass, $dbname;
|
||||
|
||||
if (! isset($dbserver))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
}
|
||||
}
|
||||
|
||||
if(!$SQL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (! $SQL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = "SELECT value FROM `{$dbprefix}config` WHERE `name` = '" . $name . "'";
|
||||
$result = $SQL->query($sql);
|
||||
if($SQL->num_rows($result) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$current_ver = $SQL->fetch_array($result);
|
||||
return $current_ver['value'];
|
||||
}
|
||||
$sql = "SELECT value FROM `{$dbprefix}config` WHERE `name` = '" . $name . "'";
|
||||
$result = $SQL->query($sql);
|
||||
|
||||
if ($SQL->num_rows($result) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$current_ver = $SQL->fetch_array($result);
|
||||
return $current_ver['value'];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -197,46 +200,56 @@ function inst_get_config($name)
|
||||
*/
|
||||
function get_cookies_settings()
|
||||
{
|
||||
$server_port = !empty($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : (int) @getenv('SERVER_PORT');
|
||||
$server_name = $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : @getenv('SERVER_NAME'));
|
||||
$server_port = ! empty($_SERVER['SERVER_PORT']) ? (int) $_SERVER['SERVER_PORT'] : (int) @getenv('SERVER_PORT');
|
||||
$server_name = $server_name = (! empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((! empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : @getenv('SERVER_NAME'));
|
||||
|
||||
// HTTP HOST can carry a port number...
|
||||
if (strpos($server_name, ':') !== false)
|
||||
$server_name = substr($server_name, 0, strpos($server_name, ':'));
|
||||
// HTTP HOST can carry a port number...
|
||||
if (strpos($server_name, ':') !== false)
|
||||
{
|
||||
$server_name = substr($server_name, 0, strpos($server_name, ':'));
|
||||
}
|
||||
|
||||
|
||||
$cookie_secure = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? true : false;
|
||||
$cookie_name = 'klj_' . strtolower(substr(str_replace('0', 'z', base_convert(md5(mt_rand()), 16, 35)), 0, 5));
|
||||
$cookie_secure = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? true : false;
|
||||
$cookie_name = 'klj_' . strtolower(substr(str_replace('0', 'z', base_convert(md5(mt_rand()), 16, 35)), 0, 5));
|
||||
|
||||
$name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
|
||||
if (!$name)
|
||||
$name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : @getenv('REQUEST_URI');
|
||||
$name = (! empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
|
||||
|
||||
$script_path = trim(dirname(str_replace(array('\\', '//'), '/', $name)));
|
||||
if (! $name)
|
||||
{
|
||||
$name = (! empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : @getenv('REQUEST_URI');
|
||||
}
|
||||
|
||||
$script_path = trim(dirname(str_replace(['\\', '//'], '/', $name)));
|
||||
|
||||
|
||||
if ($script_path !== '/')
|
||||
{
|
||||
if (substr($script_path, -1) == '/')
|
||||
$script_path = substr($script_path, 0, -1);
|
||||
if ($script_path !== '/')
|
||||
{
|
||||
if (substr($script_path, -1) == '/')
|
||||
{
|
||||
$script_path = substr($script_path, 0, -1);
|
||||
}
|
||||
|
||||
$script_path = str_replace(array('../', './'), '', $script_path);
|
||||
if ($script_path[0] != '/')
|
||||
$script_path = '/' . $script_path;
|
||||
}
|
||||
$script_path = str_replace(['../', './'], '', $script_path);
|
||||
|
||||
$cookie_domain = $server_name;
|
||||
if (strpos($cookie_domain, 'www.') === 0)
|
||||
{
|
||||
$cookie_domain = str_replace('www.', '.', $cookie_domain);
|
||||
}
|
||||
if ($script_path[0] != '/')
|
||||
{
|
||||
$script_path = '/' . $script_path;
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'server_name' => $server_name,
|
||||
'cookie_secure' => $cookie_secure,
|
||||
'cookie_name' => $cookie_name,
|
||||
'cookie_domain' => $cookie_domain,
|
||||
'cookie_path' => str_replace('/install', '', $script_path),
|
||||
);
|
||||
$cookie_domain = $server_name;
|
||||
|
||||
if (strpos($cookie_domain, 'www.') === 0)
|
||||
{
|
||||
$cookie_domain = str_replace('www.', '.', $cookie_domain);
|
||||
}
|
||||
|
||||
return [
|
||||
'server_name' => $server_name,
|
||||
'cookie_secure' => $cookie_secure,
|
||||
'cookie_name' => $cookie_name,
|
||||
'cookie_domain' => $cookie_domain,
|
||||
'cookie_path' => str_replace('/install', '', $script_path),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@
|
||||
*/
|
||||
|
||||
// not for directly open
|
||||
if (!defined('IN_COMMON'))
|
||||
if (! defined('IN_COMMON'))
|
||||
{
|
||||
exit();
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if(empty($install_sqls) || !is_array($install_sqls))
|
||||
if (empty($install_sqls) || ! is_array($install_sqls))
|
||||
{
|
||||
$install_sqls = array();
|
||||
$install_sqls = [];
|
||||
}
|
||||
|
||||
$install_sqls['ALTER_DATABASE_UTF'] = "
|
||||
@@ -238,10 +238,10 @@ CREATE TABLE `{$dbprefix}filters` (
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=1 ;
|
||||
";
|
||||
|
||||
$install_sqls['stats_insert'] = "INSERT INTO `{$dbprefix}stats` VALUES (0,0,1,0,0," . time() . ",0,0,0,0,'',0,0,0,0,'','','','')";
|
||||
$install_sqls['users_insert'] = "INSERT INTO `{$dbprefix}users` (`id`,`name`,`group_id`,`password`,`password_salt`,`mail`,`founder`,`clean_name`) VALUES (1,'" . $user_name . "', 1, '" . $user_pass . "','" . $user_salt . "', '" . $user_mail . "', 1,'" . $clean_name . "')";
|
||||
$install_sqls['stats_insert'] = "INSERT INTO `{$dbprefix}stats` VALUES (0,0,1,0,0," . time() . ",0,0,0,0,'',0,0,0,0,'','','','')";
|
||||
$install_sqls['users_insert'] = "INSERT INTO `{$dbprefix}users` (`id`,`name`,`group_id`,`password`,`password_salt`,`mail`,`founder`,`clean_name`) VALUES (1,'" . $user_name . "', 1, '" . $user_pass . "','" . $user_salt . "', '" . $user_mail . "', 1,'" . $clean_name . "')";
|
||||
$install_sqls['TeamMsg_insert'] = "INSERT INTO `{$dbprefix}call` (`name`,`text`,`mail`,`time`,`ip`) VALUES ('" . $SQL->escape($lang['KLEEJA_TEAM_MSG_NAME']) . "', '" . $SQL->escape($lang['KLEEJA_TEAM_MSG_TEXT']) . "','info@kleeja.com', " . time() . ", '127.0.0.1')";
|
||||
$install_sqls['groups_insert'] = "INSERT INTO `{$dbprefix}groups` (`group_id`, `group_name`, `group_is_default`, `group_is_essential`) VALUES
|
||||
$install_sqls['groups_insert'] = "INSERT INTO `{$dbprefix}groups` (`group_id`, `group_name`, `group_is_default`, `group_is_essential`) VALUES
|
||||
(1, '{lang.ADMINS}', 0, 1),
|
||||
(2, '{lang.GUESTS}', 0, 1),
|
||||
(3, '{lang.USERS}', 1, 1);";
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
|
||||
|
||||
|
||||
$update_sqls = array
|
||||
(
|
||||
'files_size_big' => "ALTER TABLE `{$dbprefix}files` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';",
|
||||
'group_size_big' => "ALTER TABLE `{$dbprefix}groups_exts` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';",
|
||||
'files_index_type' => "ALTER TABLE `{$dbprefix}files` ADD INDEX `type` (`type`);",
|
||||
'id_form_img' => 'INSERT INTO `'.$dbprefix.'config` (`name`, `value`, `option`, `display_order`, `type`, `plg_id`, `dynamic`) VALUES (\'id_form_img\', X\'6964\', \'<select id=\"id_form_img\" name=\"id_form_img\">\r\n <option <IF NAME=\"con.id_form_img==id\">selected=\"selected\"</IF> value=\"id\">{lang.IDF_IMG}</option>\r\n <option <IF NAME=\"con.id_form_img ==filename\">selected=\"selected\"</IF> value=\"filename\">{lang.IDFF_IMG}</option>\r\n<option <IF NAME=\"con.id_form_img ==direct\">selected=\"selected\"</IF> value=\"direct\">{lang.IDFD_IMG}</option>\r\n </select>\n\', \'21\', X\'75706C6F6164\', \'0\', \'0\');',
|
||||
);
|
||||
$update_sqls =
|
||||
[
|
||||
'files_size_big' => "ALTER TABLE `{$dbprefix}files` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';",
|
||||
'group_size_big' => "ALTER TABLE `{$dbprefix}groups_exts` CHANGE `size` `size` BIGINT(20) NOT NULL DEFAULT '0';",
|
||||
'files_index_type' => "ALTER TABLE `{$dbprefix}files` ADD INDEX `type` (`type`);",
|
||||
'id_form_img' => 'INSERT INTO `' . $dbprefix . 'config` (`name`, `value`, `option`, `display_order`, `type`, `plg_id`, `dynamic`) VALUES (\'id_form_img\', X\'6964\', \'<select id=\"id_form_img\" name=\"id_form_img\">\r\n <option <IF NAME=\"con.id_form_img==id\">selected=\"selected\"</IF> value=\"id\">{lang.IDF_IMG}</option>\r\n <option <IF NAME=\"con.id_form_img ==filename\">selected=\"selected\"</IF> value=\"filename\">{lang.IDFF_IMG}</option>\r\n<option <IF NAME=\"con.id_form_img ==direct\">selected=\"selected\"</IF> value=\"direct\">{lang.IDFD_IMG}</option>\r\n </select>\n\', \'21\', X\'75706C6F6164\', \'0\', \'0\');',
|
||||
];
|
||||
|
||||
|
||||
//$update_functions = array
|
||||
@@ -29,4 +29,4 @@ $update_sqls = array
|
||||
//(
|
||||
// 'note .......',
|
||||
// 'note 2 .......',
|
||||
//);
|
||||
//);
|
||||
|
||||
@@ -42,9 +42,9 @@ if (! function_exists('mysqli_connect'))
|
||||
|
||||
|
||||
|
||||
if(file_exists($_path . 'config.php'))
|
||||
if (file_exists($_path . 'config.php'))
|
||||
{
|
||||
include_once ($_path . 'config.php');
|
||||
include_once $_path . 'config.php';
|
||||
}
|
||||
|
||||
include_once $_path . 'includes/functions.php';
|
||||
@@ -58,9 +58,9 @@ include_once 'includes/functions_install.php';
|
||||
/**
|
||||
* print header
|
||||
*/
|
||||
if (!ip('lang'))
|
||||
if (! ip('lang'))
|
||||
{
|
||||
echo gettpl('header.html');
|
||||
echo gettpl('header.html');
|
||||
}
|
||||
|
||||
|
||||
@@ -72,53 +72,58 @@ switch (g('step', 'str'))
|
||||
default:
|
||||
case 'language':
|
||||
|
||||
if(ig('ln') && g('ln', 'str', '') !== '')
|
||||
{
|
||||
// header('Location: ./?step=official&lang=' . g('ln'));
|
||||
echo '<meta http-equiv="refresh" content="0;url=./?step=what_is_kleeja&lang=' . g('ln') . '">';
|
||||
exit;
|
||||
}
|
||||
if (ig('ln') && g('ln', 'str', '') !== '')
|
||||
{
|
||||
// header('Location: ./?step=official&lang=' . g('ln'));
|
||||
echo '<meta http-equiv="refresh" content="0;url=./?step=what_is_kleeja&lang=' . g('ln') . '">';
|
||||
|
||||
echo gettpl('lang.html');
|
||||
exit;
|
||||
}
|
||||
|
||||
echo gettpl('lang.html');
|
||||
|
||||
break;
|
||||
|
||||
case 'what_is_kleeja':
|
||||
|
||||
echo gettpl('what_is_kleeja.html');
|
||||
echo gettpl('what_is_kleeja.html');
|
||||
|
||||
break;
|
||||
|
||||
case 'official':
|
||||
|
||||
echo gettpl('official.html');
|
||||
echo gettpl('official.html');
|
||||
|
||||
break;
|
||||
|
||||
case 'choose' :
|
||||
|
||||
$install_or_no = $php_ver = true;
|
||||
$install_or_no = $php_ver = true;
|
||||
|
||||
//check version of PHP
|
||||
if (! function_exists('version_compare')
|
||||
//check version of PHP
|
||||
if (! function_exists('version_compare')
|
||||
|| version_compare(PHP_VERSION, MIN_PHP_VERSION, '<'))
|
||||
{
|
||||
$php_ver = false;
|
||||
}
|
||||
{
|
||||
$php_ver = false;
|
||||
}
|
||||
|
||||
if(file_exists($_path . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
if(!empty($dbuser) && !empty($dbname))
|
||||
{
|
||||
$d = inst_get_config('language');
|
||||
if (file_exists($_path . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
|
||||
if(!empty($d))
|
||||
{
|
||||
$install_or_no = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! empty($dbuser) && ! empty($dbname))
|
||||
{
|
||||
$d = inst_get_config('language');
|
||||
|
||||
if (! empty($d))
|
||||
{
|
||||
$install_or_no = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo gettpl('choose.html');
|
||||
|
||||
echo gettpl('choose.html');
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -127,5 +132,3 @@ break;
|
||||
* print footer
|
||||
*/
|
||||
echo gettpl('footer.html');
|
||||
|
||||
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
* include important files
|
||||
*/
|
||||
define('IN_COMMON', true);
|
||||
$_path = "../";
|
||||
$_path = '../';
|
||||
define('PATH', $_path);
|
||||
if(file_exists($_path . 'config.php'))
|
||||
|
||||
if (file_exists($_path . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
include_once $_path . 'config.php';
|
||||
}
|
||||
include_once $_path . 'includes/functions_display.php';
|
||||
include_once $_path . 'includes/functions_alternative.php';
|
||||
@@ -30,7 +31,7 @@ include_once $_path . 'includes/mysqli.php';
|
||||
|
||||
include_once 'includes/functions_install.php';
|
||||
|
||||
#an alias class for plugins class
|
||||
//an alias class for plugins class
|
||||
class Plugins
|
||||
{
|
||||
private static $instance;
|
||||
@@ -43,56 +44,60 @@ class Plugins
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
function run($name){ return null; }
|
||||
public function run($name)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if(!ig('step'))
|
||||
if (! ig('step'))
|
||||
{
|
||||
//if anyone request this file directly without passing index.php we will return him to index.php
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
//if anyone request this file directly without passing index.php we will return him to index.php
|
||||
header('Location: index.php');
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Kleeja must be safe ..
|
||||
//
|
||||
if(!empty($dbuser) && !empty($dbname) && !(ig('step') && in_array(g('step'), array('c','check', 'data', 'end', 'wizard'))))
|
||||
if (! empty($dbuser) && ! empty($dbname) && ! (ig('step') && in_array(g('step'), ['c','check', 'data', 'end', 'wizard'])))
|
||||
{
|
||||
$d = inst_get_config('language');
|
||||
if(!empty($d))
|
||||
{
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
$d = inst_get_config('language');
|
||||
|
||||
if (! empty($d))
|
||||
{
|
||||
header('Location: index.php');
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print header
|
||||
*/
|
||||
if(ip('dbsubmit') && !is_writable($_path))
|
||||
if (ip('dbsubmit') && ! is_writable($_path))
|
||||
{
|
||||
// soon
|
||||
// soon
|
||||
}
|
||||
else
|
||||
{
|
||||
echo gettpl('header.html');
|
||||
echo gettpl('header.html');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
//navigate ..
|
||||
*/
|
||||
// //navigate ..
|
||||
switch (g('step'))
|
||||
{
|
||||
default:
|
||||
case 'license':
|
||||
|
||||
$contentof_license = "GPL version 2
|
||||
$contentof_license = 'GPL version 2
|
||||
GNU General Public License, Free Software Foundation
|
||||
The GNU General Public License is a Free Software license. Like any Free Software license, it grants to you the four following freedoms:
|
||||
1. The freedom to run the program for any purpose.
|
||||
@@ -103,7 +108,7 @@ You may exercise the freedoms specified here provided that you comply with the e
|
||||
You must conspicuously and appropriately publish on each copy distributed an appropriate copyright notice and disclaimer of warranty and keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of the GNU General Public License along with the Program. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.
|
||||
If you modify your copy or copies of the program or any portion of it, or develop a program based upon it, you may distribute the resulting work provided you do so under the GNU General Public License. Any translation of the GNU General Public License must be accompanied by the GNU General Public License.
|
||||
If you copy or distribute the program, you must accompany it with the complete corresponding machine-readable source code or with a written offer, valid for at least three years, to furnish the complete corresponding machine-readable source code.
|
||||
Any of the above conditions can be waived if you get permission from the copyright holder.";
|
||||
Any of the above conditions can be waived if you get permission from the copyright holder.';
|
||||
$contentof_license = nl2br($contentof_license);
|
||||
echo gettpl('license.html');
|
||||
|
||||
@@ -111,278 +116,326 @@ break;
|
||||
|
||||
case 'f':
|
||||
|
||||
$check_ok = true;
|
||||
$advices = $register_globals = $get_magic_quotes_gpc = false;
|
||||
$check_ok = true;
|
||||
$advices = $register_globals = $get_magic_quotes_gpc = false;
|
||||
|
||||
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
|
||||
{
|
||||
$register_globals = true;
|
||||
}
|
||||
if( (function_exists("get_magic_quotes_gpc") && get_magic_quotes_gpc()) ||
|
||||
(@ini_get('magic_quotes_sybase') && (strtolower(@ini_get('magic_quotes_sybase')) != "off")) )
|
||||
{
|
||||
$get_magic_quotes_gpc = true;
|
||||
}
|
||||
if (@ini_get('register_globals') == '1' || strtolower(@ini_get('register_globals')) == 'on')
|
||||
{
|
||||
$register_globals = true;
|
||||
}
|
||||
|
||||
if($register_globals || $get_magic_quotes_gpc)
|
||||
{
|
||||
$advices = true;
|
||||
}
|
||||
if ( (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) ||
|
||||
(@ini_get('magic_quotes_sybase') && (strtolower(@ini_get('magic_quotes_sybase')) != 'off')) )
|
||||
{
|
||||
$get_magic_quotes_gpc = true;
|
||||
}
|
||||
|
||||
echo gettpl('check.html');
|
||||
if ($register_globals || $get_magic_quotes_gpc)
|
||||
{
|
||||
$advices = true;
|
||||
}
|
||||
|
||||
echo gettpl('check.html');
|
||||
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
|
||||
// after submit, generate config file
|
||||
if(ip('dbsubmit'))
|
||||
{
|
||||
//lets do it
|
||||
do_config_export(
|
||||
p('db_server'),
|
||||
p('db_user'),
|
||||
p('db_pass'),
|
||||
p('db_name'),
|
||||
p('db_prefix')
|
||||
);
|
||||
}
|
||||
// after submit, generate config file
|
||||
if (ip('dbsubmit'))
|
||||
{
|
||||
//lets do it
|
||||
do_config_export(
|
||||
p('db_server'),
|
||||
p('db_user'),
|
||||
p('db_pass'),
|
||||
p('db_name'),
|
||||
p('db_prefix')
|
||||
);
|
||||
}
|
||||
|
||||
$no_config = !file_exists($_path . 'config.php') ? false : true;
|
||||
$writeable_path = is_writable($_path) ? true : false;
|
||||
$no_config = ! file_exists($_path . 'config.php') ? false : true;
|
||||
$writeable_path = is_writable($_path) ? true : false;
|
||||
|
||||
echo gettpl('configs.html');
|
||||
echo gettpl('configs.html');
|
||||
|
||||
break;
|
||||
|
||||
case 'check':
|
||||
|
||||
$submit_disabled = $no_connection = $mysql_ver = false;
|
||||
$submit_disabled = $no_connection = $mysql_ver = false;
|
||||
|
||||
//config.php
|
||||
if(!empty($dbname) && !empty($dbuser))
|
||||
{
|
||||
//connect .. for check
|
||||
//config.php
|
||||
if (! empty($dbname) && ! empty($dbuser))
|
||||
{
|
||||
//connect .. for check
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
|
||||
|
||||
if (!$SQL->is_connected())
|
||||
{
|
||||
$no_connection = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!empty($SQL->mysql_version()) && version_compare($SQL->mysql_version(), MIN_MYSQL_VERSION, '<'))
|
||||
{
|
||||
$mysql_ver = $SQL->mysql_version();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (! $SQL->is_connected())
|
||||
{
|
||||
$no_connection = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($SQL->mysql_version()) && version_compare($SQL->mysql_version(), MIN_MYSQL_VERSION, '<'))
|
||||
{
|
||||
$mysql_ver = $SQL->mysql_version();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//try to chmod them
|
||||
if(function_exists('chmod'))
|
||||
{
|
||||
//try to chmod them
|
||||
if (function_exists('chmod'))
|
||||
{
|
||||
@chmod($_path . 'cache', 0755);
|
||||
@chmod($_path . 'uploads', 0755);
|
||||
@chmod($_path . 'uploads/thumbs', 0755);
|
||||
}
|
||||
}
|
||||
|
||||
echo gettpl('check_all.html');
|
||||
echo gettpl('check_all.html');
|
||||
|
||||
break;
|
||||
|
||||
case 'data' :
|
||||
|
||||
if (ip('datasubmit'))
|
||||
{
|
||||
if (ip('datasubmit'))
|
||||
{
|
||||
|
||||
|
||||
//check data ...
|
||||
if (empty(p('sitename')) || empty(p('siteurl')) || empty(p('sitemail'))
|
||||
|| empty(p('username')) || empty(p('password')) || empty(p('password2')) || empty(p('email')) )
|
||||
{
|
||||
echo $lang['EMPTY_FIELDS'];
|
||||
echo $footer_inst;
|
||||
exit();
|
||||
}
|
||||
//check data ...
|
||||
if (empty(p('sitename')) || empty(p('siteurl')) || empty(p('sitemail'))
|
||||
|| empty(p('username')) || empty(p('password')) || empty(p('password2')) || empty(p('email')) )
|
||||
{
|
||||
echo $lang['EMPTY_FIELDS'];
|
||||
echo $footer_inst;
|
||||
|
||||
//fix bug #r1777 (alta3rq revision)
|
||||
if(!empty(p('password')) && !empty(p('password2')) && p('password') != p('password2'))
|
||||
{
|
||||
echo $lang['PASS_NEQ_PASS2'];
|
||||
echo $footer_inst;
|
||||
exit();
|
||||
}
|
||||
if (strpos(p('email'),'@') === false)
|
||||
{
|
||||
echo $lang['WRONG_EMAIL'];
|
||||
echo $footer_inst;
|
||||
exit();
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
//connect .. for check
|
||||
//fix bug #r1777 (alta3rq revision)
|
||||
if (! empty(p('password')) && ! empty(p('password2')) && p('password') != p('password2'))
|
||||
{
|
||||
echo $lang['PASS_NEQ_PASS2'];
|
||||
echo $footer_inst;
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
if (strpos(p('email'), '@') === false)
|
||||
{
|
||||
echo $lang['WRONG_EMAIL'];
|
||||
echo $footer_inst;
|
||||
|
||||
exit();
|
||||
}
|
||||
|
||||
//connect .. for check
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
|
||||
include_once '../includes/usr.php';
|
||||
include_once '../includes/functions_alternative.php';
|
||||
$usrcp = new usrcp;
|
||||
include_once '../includes/usr.php';
|
||||
include_once '../includes/functions_alternative.php';
|
||||
$usrcp = new usrcp;
|
||||
|
||||
$user_salt = substr(kleeja_base64_encode(pack("H*", sha1(mt_rand()))), 0, 7);
|
||||
$user_pass = $usrcp->kleeja_hash_password(p('password') . $user_salt);
|
||||
$user_name = $SQL->escape(p('username'));
|
||||
$user_mail = $SQL->escape(p('email'));
|
||||
$config_sitename = $SQL->escape(p('sitename'));
|
||||
$config_siteurl = $SQL->escape(p('siteurl'));
|
||||
$config_sitemail = $SQL->escape(p('sitemail'));
|
||||
$config_time_zone = $SQL->escape(p('time_zone'));
|
||||
//$config_style = ip('style') ? $SQL->escape(p('style')) : '';
|
||||
$config_urls_type = in_array(p('urls_type'), array('id', 'filename', 'direct')) ? p('urls_type') : 'id';
|
||||
$clean_name = $usrcp->cleanusername($SQL->escape($user_name));
|
||||
$user_salt = substr(kleeja_base64_encode(pack('H*', sha1(mt_rand()))), 0, 7);
|
||||
$user_pass = $usrcp->kleeja_hash_password(p('password') . $user_salt);
|
||||
$user_name = $SQL->escape(p('username'));
|
||||
$user_mail = $SQL->escape(p('email'));
|
||||
$config_sitename = $SQL->escape(p('sitename'));
|
||||
$config_siteurl = $SQL->escape(p('siteurl'));
|
||||
$config_sitemail = $SQL->escape(p('sitemail'));
|
||||
$config_time_zone = $SQL->escape(p('time_zone'));
|
||||
//$config_style = ip('style') ? $SQL->escape(p('style')) : '';
|
||||
$config_urls_type = in_array(p('urls_type'), ['id', 'filename', 'direct']) ? p('urls_type') : 'id';
|
||||
$clean_name = $usrcp->cleanusername($SQL->escape($user_name));
|
||||
|
||||
/// ok .. we will get sqls now ..
|
||||
include 'includes/install_sqls.php';
|
||||
include 'includes/default_values.php';
|
||||
/// ok .. we will get sqls now ..
|
||||
include 'includes/install_sqls.php';
|
||||
include 'includes/default_values.php';
|
||||
|
||||
$err = $dots = 0;
|
||||
$errors = '';
|
||||
$err = $dots = 0;
|
||||
$errors = '';
|
||||
|
||||
//do important alter before
|
||||
$SQL->query($install_sqls['ALTER_DATABASE_UTF']);
|
||||
//do important alter before
|
||||
$SQL->query($install_sqls['ALTER_DATABASE_UTF']);
|
||||
|
||||
$sqls_done = $sql_err = array();
|
||||
foreach($install_sqls as $name=>$sql_content)
|
||||
{
|
||||
if($name == 'DROP_TABLES' || $name == 'ALTER_DATABASE_UTF')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$sqls_done = $sql_err = [];
|
||||
|
||||
if($SQL->query($sql_content))
|
||||
{
|
||||
if ($name == 'call') $sqls_done[] = $lang['INST_CRT_CALL'];
|
||||
elseif ($name == 'reports') $sqls_done[] = $lang['INST_CRT_REPRS'];
|
||||
elseif ($name == 'stats') $sqls_done[] = $lang['INST_CRT_STS'];
|
||||
elseif ($name == 'users') $sqls_done[] = $lang['INST_CRT_USRS'];
|
||||
elseif ($name == 'users') $sqls_done[] = $lang['INST_CRT_ADM'];
|
||||
elseif ($name == 'files') $sqls_done[] = $lang['INST_CRT_FLS'];
|
||||
elseif ($name == 'config') $sqls_done[] = $lang['INST_CRT_CNF'];
|
||||
elseif ($name == 'exts') $sqls_done[] = $lang['INST_CRT_EXT'];
|
||||
elseif ($name == 'online') $sqls_done[] = $lang['INST_CRT_ONL'];
|
||||
elseif ($name == 'hooks') $sqls_done[] = $lang['INST_CRT_HKS'];
|
||||
elseif ($name == 'plugins') $sqls_done[] = $lang['INST_CRT_PLG'];
|
||||
elseif ($name == 'lang') $sqls_done[] = $lang['INST_CRT_LNG'];
|
||||
else
|
||||
{
|
||||
$sqls_done[] = $name . '...';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : ' . $name . '[basic]';
|
||||
$err++;
|
||||
}
|
||||
foreach ($install_sqls as $name=>$sql_content)
|
||||
{
|
||||
if ($name == 'DROP_TABLES' || $name == 'ALTER_DATABASE_UTF')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
}#for
|
||||
if ($SQL->query($sql_content))
|
||||
{
|
||||
if ($name == 'call')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_CALL'];
|
||||
}
|
||||
elseif ($name == 'reports')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_REPRS'];
|
||||
}
|
||||
elseif ($name == 'stats')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_STS'];
|
||||
}
|
||||
elseif ($name == 'users')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_USRS'];
|
||||
}
|
||||
elseif ($name == 'users')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_ADM'];
|
||||
}
|
||||
elseif ($name == 'files')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_FLS'];
|
||||
}
|
||||
elseif ($name == 'config')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_CNF'];
|
||||
}
|
||||
elseif ($name == 'exts')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_EXT'];
|
||||
}
|
||||
elseif ($name == 'online')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_ONL'];
|
||||
}
|
||||
elseif ($name == 'hooks')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_HKS'];
|
||||
}
|
||||
elseif ($name == 'plugins')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_PLG'];
|
||||
}
|
||||
elseif ($name == 'lang')
|
||||
{
|
||||
$sqls_done[] = $lang['INST_CRT_LNG'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$sqls_done[] = $name . '...';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : ' . $name . '[basic]';
|
||||
$err++;
|
||||
}
|
||||
}//for
|
||||
|
||||
if($err == 0)
|
||||
{
|
||||
//add configs
|
||||
foreach($config_values as $cn)
|
||||
{
|
||||
if(empty($cn[6]))
|
||||
{
|
||||
$cn[6] = 0;
|
||||
}
|
||||
if ($err == 0)
|
||||
{
|
||||
//add configs
|
||||
foreach ($config_values as $cn)
|
||||
{
|
||||
if (empty($cn[6]))
|
||||
{
|
||||
$cn[6] = 0;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}config` (`name`, `value`, `option`, `display_order`, `type`, `plg_id`, `dynamic`) VALUES ('$cn[0]', '$cn[1]', '$cn[2]', '$cn[3]', '$cn[4]', '$cn[5]', '$cn[6]');";
|
||||
if(!$SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [configs_values] ' . $cn;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
$sql = "INSERT INTO `{$dbprefix}config` (`name`, `value`, `option`, `display_order`, `type`, `plg_id`, `dynamic`) VALUES ('$cn[0]', '$cn[1]', '$cn[2]', '$cn[3]', '$cn[4]', '$cn[5]', '$cn[6]');";
|
||||
|
||||
//add groups configs
|
||||
foreach($config_values as $cn)
|
||||
{
|
||||
if($cn[4] != 'groups' or !$cn[4])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [configs_values] ' . $cn;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
$itxt = '';
|
||||
foreach(array(1, 2, 3) as $im)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ','). "($im, '$cn[0]', '$cn[1]')";
|
||||
}
|
||||
//add groups configs
|
||||
foreach ($config_values as $cn)
|
||||
{
|
||||
if ($cn[4] != 'groups' or ! $cn[4])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_data` (`group_id`, `name`, `value`) VALUES " . $itxt . ";";
|
||||
if(!$SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [groups_configs_values] ' . $cn;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
$itxt = '';
|
||||
|
||||
//add exts
|
||||
foreach($ext_values as $gid=>$exts)
|
||||
{
|
||||
$itxt = '';
|
||||
foreach($exts as $t=>$v)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ','). "('$t', $gid, $v)";
|
||||
}
|
||||
foreach ([1, 2, 3] as $im)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ',') . "($im, '$cn[0]', '$cn[1]')";
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_exts` (`ext`, `group_id`, `size`) VALUES " . $itxt . ";";
|
||||
if(!$SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [ext_values] ' . $gid;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_data` (`group_id`, `name`, `value`) VALUES " . $itxt . ';';
|
||||
|
||||
//add acls
|
||||
foreach($acls_values as $cn=>$ct)
|
||||
{
|
||||
$it = 1;
|
||||
$itxt = '';
|
||||
foreach($ct as $ctk)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ','). "('$cn', '$it', '$ctk')";
|
||||
$it++;
|
||||
}
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [groups_configs_values] ' . $cn;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
//add exts
|
||||
foreach ($ext_values as $gid=>$exts)
|
||||
{
|
||||
$itxt = '';
|
||||
|
||||
foreach ($exts as $t=>$v)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ',') . "('$t', $gid, $v)";
|
||||
}
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_exts` (`ext`, `group_id`, `size`) VALUES " . $itxt . ';';
|
||||
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [ext_values] ' . $gid;
|
||||
$err++;
|
||||
}
|
||||
}
|
||||
|
||||
//add acls
|
||||
foreach ($acls_values as $cn=>$ct)
|
||||
{
|
||||
$it = 1;
|
||||
$itxt = '';
|
||||
|
||||
foreach ($ct as $ctk)
|
||||
{
|
||||
$itxt .= ($itxt == '' ? '' : ',') . "('$cn', '$it', '$ctk')";
|
||||
$it++;
|
||||
}
|
||||
|
||||
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_acl` (`acl_name`, `group_id`, `acl_can`) VALUES " . $itxt . ";";
|
||||
if(!$SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [acl_values] ' . $cn;
|
||||
$err++;
|
||||
}
|
||||
$it++;
|
||||
}
|
||||
}
|
||||
$sql = "INSERT INTO `{$dbprefix}groups_acl` (`acl_name`, `group_id`, `acl_can`) VALUES " . $itxt . ';';
|
||||
|
||||
echo gettpl('sqls_done.html');
|
||||
if (! $SQL->query($sql))
|
||||
{
|
||||
$errors .= implode(':', $SQL->get_error()) . '' . "\n___\n";
|
||||
$sql_err[] = $lang['INST_SQL_ERR'] . ' : [acl_values] ' . $cn;
|
||||
$err++;
|
||||
}
|
||||
$it++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$urlsite = 'http://' . $_SERVER['HTTP_HOST'] . str_replace('install', '', dirname($_SERVER['PHP_SELF']));
|
||||
echo gettpl('data.html');
|
||||
}
|
||||
echo gettpl('sqls_done.html');
|
||||
}
|
||||
else
|
||||
{
|
||||
$urlsite = 'http://' . $_SERVER['HTTP_HOST'] . str_replace('install', '', dirname($_SERVER['PHP_SELF']));
|
||||
echo gettpl('data.html');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'end' :
|
||||
|
||||
echo gettpl('end.html');
|
||||
//for safe ..
|
||||
//@rename("install.php", "install.lock");
|
||||
echo gettpl('end.html');
|
||||
//for safe ..
|
||||
//@rename("install.php", "install.lock");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -391,6 +444,3 @@ break;
|
||||
* print footer
|
||||
*/
|
||||
echo gettpl('footer.html');
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -16,11 +16,12 @@
|
||||
* include important files
|
||||
*/
|
||||
define('IN_COMMON', true);
|
||||
$_path = "../";
|
||||
$_path = '../';
|
||||
define('PATH', $_path);
|
||||
if(file_exists($_path . 'config.php'))
|
||||
|
||||
if (file_exists($_path . 'config.php'))
|
||||
{
|
||||
include_once $_path . 'config.php';
|
||||
include_once $_path . 'config.php';
|
||||
}
|
||||
|
||||
include_once $_path . 'includes/functions.php';
|
||||
@@ -31,20 +32,21 @@ include_once $_path . 'includes/mysqli.php';
|
||||
include_once 'includes/functions_install.php';
|
||||
|
||||
|
||||
$order_update_files = array(
|
||||
'1.7_to_2.0' => 9,
|
||||
// filename => db_version
|
||||
);
|
||||
$order_update_files = [
|
||||
'1.7_to_2.0' => 9,
|
||||
// filename => db_version
|
||||
];
|
||||
|
||||
$SQL = new KleejaDatabase($dbserver, $dbuser, $dbpass, $dbname);
|
||||
|
||||
|
||||
//
|
||||
// Is current db is up-to-date ?
|
||||
//
|
||||
$config['db_version'] = inst_get_config('db_version');
|
||||
if($config['db_version'] == false)
|
||||
|
||||
if ($config['db_version'] == false)
|
||||
{
|
||||
$SQL->query("INSERT INTO `{$dbprefix}config` (`name` ,`value`) VALUES ('db_version', '')");
|
||||
$SQL->query("INSERT INTO `{$dbprefix}config` (`name` ,`value`) VALUES ('db_version', '')");
|
||||
}
|
||||
|
||||
|
||||
@@ -54,9 +56,9 @@ $IN_UPDATE = true;
|
||||
/**
|
||||
* print header
|
||||
*/
|
||||
if (!ip('action_file_do'))
|
||||
if (! ip('action_file_do'))
|
||||
{
|
||||
echo gettpl('header.html');
|
||||
echo gettpl('header.html');
|
||||
}
|
||||
|
||||
|
||||
@@ -69,141 +71,146 @@ switch (g('step', 'str', 'action_file'))
|
||||
default:
|
||||
case 'action_file':
|
||||
|
||||
if (ip('action_file_do'))
|
||||
{
|
||||
if (p('action_file_do', 'str', '') !== '')
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['PHP_SELF'] . '?step=update_now&action_file_do=' . p('action_file_do') . '&' . getlang(1) . '">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//get fles
|
||||
$s_path = "includes/update_files";
|
||||
$dh = opendir($s_path);
|
||||
$upfiles = array();
|
||||
if (ip('action_file_do'))
|
||||
{
|
||||
if (p('action_file_do', 'str', '') !== '')
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['PHP_SELF'] . '?step=update_now&action_file_do=' . p('action_file_do') . '&' . getlang(1) . '">';
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//get fles
|
||||
$s_path = 'includes/update_files';
|
||||
$dh = opendir($s_path);
|
||||
$upfiles = [];
|
||||
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if(substr($file, -3) == 'php')
|
||||
{
|
||||
$file = str_replace('.php','', $file);
|
||||
$db_ver = $order_update_files[$file];
|
||||
while (($file = readdir($dh)) !== false)
|
||||
{
|
||||
if (substr($file, -3) == 'php')
|
||||
{
|
||||
$file = str_replace('.php', '', $file);
|
||||
$db_ver = $order_update_files[$file];
|
||||
|
||||
// var_dump($db_ver);
|
||||
// var_dump($db_ver);
|
||||
|
||||
if((empty($config['db_version']) || $db_ver > $config['db_version']))
|
||||
{
|
||||
if ((empty($config['db_version']) || $db_ver > $config['db_version']))
|
||||
{
|
||||
$upfiles[$db_ver] = $file;
|
||||
}
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
}
|
||||
}
|
||||
@closedir($dh);
|
||||
|
||||
ksort($upfiles);
|
||||
|
||||
echo gettpl('update_list.html');
|
||||
}
|
||||
ksort($upfiles);
|
||||
|
||||
echo gettpl('update_list.html');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'update_now':
|
||||
|
||||
if(!ig('action_file_do'))
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['PHP_SELF'] . '?step=action_file&' . getlang(1) . '">';
|
||||
exit();
|
||||
}
|
||||
|
||||
if(ig('complet_up_func'))
|
||||
{
|
||||
define('C_U_F', true);
|
||||
}
|
||||
|
||||
$file_for_up = 'includes/update_files/' . preg_replace('/[^a-z0-9_\-\.]/i', '', g('action_file_do')) . '.php';
|
||||
if(!file_exists($file_for_up))
|
||||
{
|
||||
echo '<span style="color:red;">' . $lang['INST_ERR_NO_SELECTED_UPFILE_GOOD'] . ' [ ' . $file_for_up . ' ]</span><br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
//get it
|
||||
require $file_for_up;
|
||||
$complete_update = true;
|
||||
$update_msgs_arr = array();
|
||||
|
||||
|
||||
if($config['db_version'] >= LAST_DB_VERSION && !defined('DEV_STAGE'))
|
||||
{
|
||||
$update_msgs_arr[] = '<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP']. '</span>';
|
||||
$complete_update = false;
|
||||
}
|
||||
|
||||
//
|
||||
//is there any sqls
|
||||
//
|
||||
if(($complete_update || (defined('DEV_STAGE')) && !defined('C_U_F')))
|
||||
{
|
||||
$SQL->show_errors = false;
|
||||
if(isset($update_sqls) && sizeof($update_sqls) > 0)
|
||||
{
|
||||
$err = '';
|
||||
foreach($update_sqls as $name=>$sql_content)
|
||||
{
|
||||
$err = '';
|
||||
$SQL->query($sql_content);
|
||||
$err = $SQL->get_error();
|
||||
if (! ig('action_file_do'))
|
||||
{
|
||||
echo '<meta http-equiv="refresh" content="0;url=' . $_SERVER['PHP_SELF'] . '?step=action_file&' . getlang(1) . '">';
|
||||
|
||||
if(strpos($err[1], 'Duplicate') !== false || $err[0] == '1062' || $err[0] == '1060')
|
||||
{
|
||||
$update_msgs_arr[] = '<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP']. '</span>';
|
||||
$complete_update = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
//
|
||||
//is there any functions
|
||||
//
|
||||
if($complete_update || defined('DEV_STAGE') || defined('C_U_F'))
|
||||
{
|
||||
if(isset($update_functions) && sizeof($update_functions) > 0)
|
||||
{
|
||||
foreach($update_functions as $n)
|
||||
{
|
||||
if(is_callable($n))
|
||||
{
|
||||
$n();
|
||||
if (ig('complet_up_func'))
|
||||
{
|
||||
define('C_U_F', true);
|
||||
}
|
||||
|
||||
$file_for_up = 'includes/update_files/' . preg_replace('/[^a-z0-9_\-\.]/i', '', g('action_file_do')) . '.php';
|
||||
|
||||
if (! file_exists($file_for_up))
|
||||
{
|
||||
echo '<span style="color:red;">' . $lang['INST_ERR_NO_SELECTED_UPFILE_GOOD'] . ' [ ' . $file_for_up . ' ]</span><br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
//get it
|
||||
require $file_for_up;
|
||||
$complete_update = true;
|
||||
$update_msgs_arr = [];
|
||||
|
||||
|
||||
if ($config['db_version'] >= LAST_DB_VERSION && ! defined('DEV_STAGE'))
|
||||
{
|
||||
$update_msgs_arr[] = '<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . '</span>';
|
||||
$complete_update = false;
|
||||
}
|
||||
|
||||
//
|
||||
//is there any sqls
|
||||
//
|
||||
if (($complete_update || (defined('DEV_STAGE')) && ! defined('C_U_F')))
|
||||
{
|
||||
$SQL->show_errors = false;
|
||||
|
||||
if (isset($update_sqls) && sizeof($update_sqls) > 0)
|
||||
{
|
||||
$err = '';
|
||||
|
||||
foreach ($update_sqls as $name=>$sql_content)
|
||||
{
|
||||
$err = '';
|
||||
$SQL->query($sql_content);
|
||||
$err = $SQL->get_error();
|
||||
|
||||
if (strpos($err[1], 'Duplicate') !== false || $err[0] == '1062' || $err[0] == '1060')
|
||||
{
|
||||
$update_msgs_arr[] = '<span style="color:green;">' . $lang['INST_UPDATE_CUR_VER_IS_UP'] . '</span>';
|
||||
$complete_update = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//is there any notes
|
||||
//
|
||||
$NOTES_CUP = false;
|
||||
if($complete_update || defined('DEV_STAGE'))
|
||||
{
|
||||
if(isset($update_notes) && sizeof($update_notes) > 0)
|
||||
{
|
||||
$i=1;
|
||||
$NOTES_CUP = array();
|
||||
foreach($update_notes as $n)
|
||||
{
|
||||
$NOTES_CUP[$i] = $n;
|
||||
++$i;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//
|
||||
//is there any functions
|
||||
//
|
||||
if ($complete_update || defined('DEV_STAGE') || defined('C_U_F'))
|
||||
{
|
||||
if (isset($update_functions) && sizeof($update_functions) > 0)
|
||||
{
|
||||
foreach ($update_functions as $n)
|
||||
{
|
||||
if (is_callable($n))
|
||||
{
|
||||
$n();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
//is there any notes
|
||||
//
|
||||
$NOTES_CUP = false;
|
||||
|
||||
if ($complete_update || defined('DEV_STAGE'))
|
||||
{
|
||||
if (isset($update_notes) && sizeof($update_notes) > 0)
|
||||
{
|
||||
$i =1;
|
||||
$NOTES_CUP = [];
|
||||
|
||||
foreach ($update_notes as $n)
|
||||
{
|
||||
$NOTES_CUP[$i] = $n;
|
||||
++$i;
|
||||
}
|
||||
}
|
||||
|
||||
$sql = "UPDATE `{$dbprefix}config` SET `value` = '" . LAST_DB_VERSION . "' WHERE `name` = 'db_version'";
|
||||
$SQL->query($sql);
|
||||
}
|
||||
}
|
||||
|
||||
echo gettpl('update_end.html');
|
||||
}
|
||||
echo gettpl('update_end.html');
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
520
lang/ar/acp.php
520
lang/ar/acp.php
@@ -4,283 +4,283 @@
|
||||
// Arabic
|
||||
//
|
||||
|
||||
return array(
|
||||
'U_NOT_ADMIN' => 'يجب أن تملك صلاحية الإدارة',
|
||||
'UPDATE_CONFIG' => 'تحديث الإعدادات',
|
||||
'NO_CHANGE' => 'بلا تغيير',
|
||||
'CHANGE_MD5' => 'تغيير مع دالة md5 (8c7dd922ad47494fc02c388e12c00eac.png) ',
|
||||
'CHANGE_TIME' => 'تغيير مع دالة TIME (1501440381.png)',
|
||||
'SITENAME' => 'إسم المركز',
|
||||
'SITEMAIL' => 'بريد المركز',
|
||||
'SITEMAIL2' => 'بريد التبليغات , المراسلات',
|
||||
'SITEURL' => 'رابط المركز <small>(مع / بنهايته)</small>',
|
||||
'FOLDERNAME' => '</small>إسم مجلد التحميل <small>(يمكنك استخدام {year} و {month} و {day} و {week} و {username})',
|
||||
'PREFIXNAME' => 'بادئة أسماء الملفات <small>(مثلا : kleeja_ وستضاف قبل اسم كل ملف مرفوع, يمكن استخدام ايضا {rand:4} و {date:d_Y})</small>',
|
||||
'FILESNUM' => 'عدد حقول ملفات التحميل',
|
||||
'FILESNUM_SHOW' => 'عرض حقول حقول التحميل كلها',
|
||||
'SITECLOSE' => 'إغلاق المركز',
|
||||
'CLOSEMSG' => 'رسالة الإغلاق',
|
||||
'DECODE' => 'تغيير إسم الملف <small>(لاحظ : عند عرض الملف سيظهر اسمه الاصلي, اما هذا فللحماية والتنظيم)</small>',
|
||||
'SEC_DOWN' => 'عدد الثواني قبل بدء التحميل',
|
||||
'STATFOOTER' => 'إحصائيات الصفحة بالفوتر',
|
||||
'GZIP' => 'GZIP <small>(ضاغط المحتويات لتسريع عرضها)</small>',
|
||||
'GOOGLEANALYTICS' => '<a href="http://www.google.com/analytics" target="_kleeja"><span style="color:orange">Google</span> Analytics</a>',
|
||||
'WELCOME_MSG' => 'كلمة الترحيب',
|
||||
'USER_SYSTEM' => 'نظام العضوية <small>(لاحظ: تغييرها قد يمنعك من الدخول مالم تتبع الشروحات)</small>',
|
||||
return [
|
||||
'U_NOT_ADMIN' => 'يجب أن تملك صلاحية الإدارة',
|
||||
'UPDATE_CONFIG' => 'تحديث الإعدادات',
|
||||
'NO_CHANGE' => 'بلا تغيير',
|
||||
'CHANGE_MD5' => 'تغيير مع دالة md5 (8c7dd922ad47494fc02c388e12c00eac.png) ',
|
||||
'CHANGE_TIME' => 'تغيير مع دالة TIME (1501440381.png)',
|
||||
'SITENAME' => 'إسم المركز',
|
||||
'SITEMAIL' => 'بريد المركز',
|
||||
'SITEMAIL2' => 'بريد التبليغات , المراسلات',
|
||||
'SITEURL' => 'رابط المركز <small>(مع / بنهايته)</small>',
|
||||
'FOLDERNAME' => '</small>إسم مجلد التحميل <small>(يمكنك استخدام {year} و {month} و {day} و {week} و {username})',
|
||||
'PREFIXNAME' => 'بادئة أسماء الملفات <small>(مثلا : kleeja_ وستضاف قبل اسم كل ملف مرفوع, يمكن استخدام ايضا {rand:4} و {date:d_Y})</small>',
|
||||
'FILESNUM' => 'عدد حقول ملفات التحميل',
|
||||
'FILESNUM_SHOW' => 'عرض حقول حقول التحميل كلها',
|
||||
'SITECLOSE' => 'إغلاق المركز',
|
||||
'CLOSEMSG' => 'رسالة الإغلاق',
|
||||
'DECODE' => 'تغيير إسم الملف <small>(لاحظ : عند عرض الملف سيظهر اسمه الاصلي, اما هذا فللحماية والتنظيم)</small>',
|
||||
'SEC_DOWN' => 'عدد الثواني قبل بدء التحميل',
|
||||
'STATFOOTER' => 'إحصائيات الصفحة بالفوتر',
|
||||
'GZIP' => 'GZIP <small>(ضاغط المحتويات لتسريع عرضها)</small>',
|
||||
'GOOGLEANALYTICS' => '<a href="http://www.google.com/analytics" target="_kleeja"><span style="color:orange">Google</span> Analytics</a>',
|
||||
'WELCOME_MSG' => 'كلمة الترحيب',
|
||||
'USER_SYSTEM' => 'نظام العضوية <small>(لاحظ: تغييرها قد يمنعك من الدخول مالم تتبع الشروحات)</small>',
|
||||
|
||||
'TOTAL_SIZE' => 'أقصى حجم كلي للمركز <small>(ميقا بايت)</small>',
|
||||
'THUMBS_IMGS' => 'أبعاد مصغرات الصور (عرض x إرتفاع)',
|
||||
'WRITE_IMGS' => 'تفعيل ختم الصور',
|
||||
'ID_FORM' => 'شكل روابط الملفات <small>(المباشر لايخضع لحمايتنا ولا للاحصائيات .. )</small>',
|
||||
'IDF' => 'الاساسي (example.com/do.php?id=123)',
|
||||
'IDFF' => 'إسم الملف (example.com/do.php?file=filename.pdf)',
|
||||
'IDFD' => 'رابط مباشر (example.com/uploads/filename.pdf)',
|
||||
'ID_FORM_IMG' => 'شكل روابط الصور <small>(المباشر لايخضع لحمايتنا ولا للاحصائيات .. )</small>',
|
||||
'IDF_IMG' => 'الاساسي (example.com/do.php?img=123)',
|
||||
'IDFF_IMG' => 'إسم الملف (example.com/do.php?imgf=filename.png)',
|
||||
'IDFD_IMG' => 'رابط مباشر (example.com/uploads/filename.png)',
|
||||
'DEL_URL_FILE' => 'تفعيل رابط الحذف المباشر',
|
||||
'WWW_URL' => 'تفعيل التحميل من رابط',
|
||||
'ALLOW_STAT_PG' => 'تفعيل صفحة الإحصائيات',
|
||||
'ALLOW_ONLINE' => 'تفعيل عرض المتواجدون الآن',
|
||||
'DEL_F_DAY' => 'حذف الملفات الخاملة بعد × يوم - صفر للتعطيل',
|
||||
'MOD_WRITER' => 'Mod Rewrite <small>(لاحظ: لن يعمل الا بعد نقل ملف .htaccess للمجلد الرئيسي)</small>',
|
||||
'MOD_WRITER_EX' => '<b style="color:#0B55C4">روابط كـ HTML ..</b>',
|
||||
'NUMFIELD_S' => 'رجاءاً .. الحقول الرقمية .. يجب أن تكون رقمية!',
|
||||
'CONFIGS_UPDATED' => 'تم تحديت الإعدادات بنجاح',
|
||||
'TOTAL_SIZE' => 'أقصى حجم كلي للمركز <small>(ميقا بايت)</small>',
|
||||
'THUMBS_IMGS' => 'أبعاد مصغرات الصور (عرض x إرتفاع)',
|
||||
'WRITE_IMGS' => 'تفعيل ختم الصور',
|
||||
'ID_FORM' => 'شكل روابط الملفات <small>(المباشر لايخضع لحمايتنا ولا للاحصائيات .. )</small>',
|
||||
'IDF' => 'الاساسي (example.com/do.php?id=123)',
|
||||
'IDFF' => 'إسم الملف (example.com/do.php?file=filename.pdf)',
|
||||
'IDFD' => 'رابط مباشر (example.com/uploads/filename.pdf)',
|
||||
'ID_FORM_IMG' => 'شكل روابط الصور <small>(المباشر لايخضع لحمايتنا ولا للاحصائيات .. )</small>',
|
||||
'IDF_IMG' => 'الاساسي (example.com/do.php?img=123)',
|
||||
'IDFF_IMG' => 'إسم الملف (example.com/do.php?imgf=filename.png)',
|
||||
'IDFD_IMG' => 'رابط مباشر (example.com/uploads/filename.png)',
|
||||
'DEL_URL_FILE' => 'تفعيل رابط الحذف المباشر',
|
||||
'WWW_URL' => 'تفعيل التحميل من رابط',
|
||||
'ALLOW_STAT_PG' => 'تفعيل صفحة الإحصائيات',
|
||||
'ALLOW_ONLINE' => 'تفعيل عرض المتواجدون الآن',
|
||||
'DEL_F_DAY' => 'حذف الملفات الخاملة بعد × يوم - صفر للتعطيل',
|
||||
'MOD_WRITER' => 'Mod Rewrite <small>(لاحظ: لن يعمل الا بعد نقل ملف .htaccess للمجلد الرئيسي)</small>',
|
||||
'MOD_WRITER_EX' => '<b style="color:#0B55C4">روابط كـ HTML ..</b>',
|
||||
'NUMFIELD_S' => 'رجاءاً .. الحقول الرقمية .. يجب أن تكون رقمية!',
|
||||
'CONFIGS_UPDATED' => 'تم تحديت الإعدادات بنجاح',
|
||||
|
||||
'E_EXTS' => 'ملاحظة : الأحجام تضبط بالكليوبايت .',
|
||||
'UPDATED_EXTS' => 'تم تحديث الإمتدادات بنجاح',
|
||||
'EXT_DELETED' => 'تم حذف الامتداد بنجاح.',
|
||||
'REPLY' => 'إرسال',
|
||||
'REPLY_REPORT' => 'رد على تبليغ',
|
||||
'U_REPORT_ON' => 'بسبب تبليغك في ',
|
||||
'BY_EMAIL' => 'بواسطة البريد ',
|
||||
'ADMIN_REPLIED' => 'فقد قام المدير بالرد التالي',
|
||||
'IS_SEND_MAIL' => 'تم إرسال الرد البريدي',
|
||||
'REPORTS_UPDATED' => 'تم تحديث التبليغات',
|
||||
'REPLY_CALL' => 'رد على رسالة',
|
||||
'REPLIED_ON_CAL' => 'بخصوص مراسلتك ',
|
||||
'CALLS_UPDATED' => 'تم تحديث المراسلات',
|
||||
'FOUNDER' => 'مؤسس',
|
||||
'USER_UPDATED' => 'تم تحديث بيانات المستخدم ..',
|
||||
'REPAIRE_TABLE' => '[جداول] تم إصلاح ',
|
||||
'REPAIRE_CACHE' => 'تم حذف/تجديد الكاش (الملفات المؤقتة) ...',
|
||||
'KLEEJA_CP' => 'لوحة التحكم',
|
||||
'GENERAL_STAT' => 'إحصائيات عامة',
|
||||
'SEARCH_STAT' => 'إحصائيات محركات البحث',
|
||||
'OTHER_INFO' => 'معلومات أخرى',
|
||||
'AFILES_NUM' => 'عدد جميع الملفات',
|
||||
'AFILES_SIZE_SPACE' => 'المساحة التي تم استهلاكها حتى الآن',
|
||||
'AUSERS_NUM' => 'عدد الأعضاء',
|
||||
'LAST_GOOGLE' => 'آخر زيارة لجوجل',
|
||||
'GOOGLE_NUM' => 'عدد زيارات جوجل',
|
||||
'LAST_BING' => 'آخر زيارات بينق',
|
||||
'BING_NUM' => 'عدد زيارات بينق',
|
||||
'KLEEJA_CP_W' => 'مرحباً بك, في لوحة الإدارة',
|
||||
'PHP_VER' => 'إصدار PHP',
|
||||
'MYSQL_VER' => 'إصدار MySQL',
|
||||
'R_CONFIGS' => 'إعدادات',
|
||||
'R_CPINDEX' => 'بداية لوحة كليجا',
|
||||
'R_EXTS' => 'إعدادات الإمتدادات',
|
||||
'R_FILES' => 'إدارة الملفات',
|
||||
'R_REPORTS' => 'تبليغات',
|
||||
'R_CALLS' => 'رسائل',
|
||||
'R_USERS' => 'الأعضاء والمجموعات',
|
||||
'R_REPAIR' => 'صيانة',
|
||||
'R_LGOUTCP' => 'مسح جلسة الإدارة',
|
||||
'R_BAN' => 'التحكم بالحظر',
|
||||
'BAN_EXP1' => 'قم بتحرير الآيبيات المحظورة وإضافة الجديد من هنا..',
|
||||
'BAN_EXP2' => 'إستخدم رمز النجمة (*)لاستبدال الارقام ..إذا كنت تريد الحظر الشامل ..وأستخدم الفاصل (|) للفصل بين الآيبيات',
|
||||
'UPDATE_BAN' => 'حفظ تعديلات الحظر',
|
||||
'BAN_UPDATED' => 'تم تحديث قائمة الحظر بنجاح..',
|
||||
'R_RULES' => 'شروط الخدمة',
|
||||
'RULES_EXP' => 'من هنا تستطيع تعديل الشروط التي سوف تظهر للزوار والأعضاء',
|
||||
'UPDATE_RULES' => 'تحديث الشروط',
|
||||
'RULES_UPDATED' => 'تم تحديث الشروط بنجاح..',
|
||||
'R_SEARCH' => 'بحث متقدم',
|
||||
'SEARCH_FILES' => 'بحث عن الملفات',
|
||||
'SEARCH_SUBMIT' => 'بحث',
|
||||
'LAST_DOWN' => 'آخر تحميل',
|
||||
'WAS_B4' => 'كان قبل',
|
||||
'SEARCH_USERS' => 'بحث عن مستخدمين',
|
||||
'R_IMG_CTRL' => 'إدارة الصور',
|
||||
'ENABLE_USERFILE' => 'تفعيل مجلدات المستخدمين',
|
||||
'R_EXTRA' => 'هيدر وفوتر إضافي',
|
||||
'EX_HEADER_N' => 'الهيدر الإضافي.. وهو ما يظهر أسفل الهيدر الأصلي ..',
|
||||
'EX_FOOTER_N' => 'الفوتر الإضافي.. وهو ما يظهر أعلى الفوتر الأصلي ..',
|
||||
'UPDATE_EXTRA' => 'تحديث الإضافات القوالبية',
|
||||
'EXTRA_UPDATED' => 'تم تحديث الإضافات القوالبية',
|
||||
'R_STYLES' => 'الستايلات',
|
||||
'NO_TPL_SHOOSED' => 'لم تقم بإختيار قالب!',
|
||||
'E_EXTS' => 'ملاحظة : الأحجام تضبط بالكليوبايت .',
|
||||
'UPDATED_EXTS' => 'تم تحديث الإمتدادات بنجاح',
|
||||
'EXT_DELETED' => 'تم حذف الامتداد بنجاح.',
|
||||
'REPLY' => 'إرسال',
|
||||
'REPLY_REPORT' => 'رد على تبليغ',
|
||||
'U_REPORT_ON' => 'بسبب تبليغك في ',
|
||||
'BY_EMAIL' => 'بواسطة البريد ',
|
||||
'ADMIN_REPLIED' => 'فقد قام المدير بالرد التالي',
|
||||
'IS_SEND_MAIL' => 'تم إرسال الرد البريدي',
|
||||
'REPORTS_UPDATED' => 'تم تحديث التبليغات',
|
||||
'REPLY_CALL' => 'رد على رسالة',
|
||||
'REPLIED_ON_CAL' => 'بخصوص مراسلتك ',
|
||||
'CALLS_UPDATED' => 'تم تحديث المراسلات',
|
||||
'FOUNDER' => 'مؤسس',
|
||||
'USER_UPDATED' => 'تم تحديث بيانات المستخدم ..',
|
||||
'REPAIRE_TABLE' => '[جداول] تم إصلاح ',
|
||||
'REPAIRE_CACHE' => 'تم حذف/تجديد الكاش (الملفات المؤقتة) ...',
|
||||
'KLEEJA_CP' => 'لوحة التحكم',
|
||||
'GENERAL_STAT' => 'إحصائيات عامة',
|
||||
'SEARCH_STAT' => 'إحصائيات محركات البحث',
|
||||
'OTHER_INFO' => 'معلومات أخرى',
|
||||
'AFILES_NUM' => 'عدد جميع الملفات',
|
||||
'AFILES_SIZE_SPACE' => 'المساحة التي تم استهلاكها حتى الآن',
|
||||
'AUSERS_NUM' => 'عدد الأعضاء',
|
||||
'LAST_GOOGLE' => 'آخر زيارة لجوجل',
|
||||
'GOOGLE_NUM' => 'عدد زيارات جوجل',
|
||||
'LAST_BING' => 'آخر زيارات بينق',
|
||||
'BING_NUM' => 'عدد زيارات بينق',
|
||||
'KLEEJA_CP_W' => 'مرحباً بك, في لوحة الإدارة',
|
||||
'PHP_VER' => 'إصدار PHP',
|
||||
'MYSQL_VER' => 'إصدار MySQL',
|
||||
'R_CONFIGS' => 'إعدادات',
|
||||
'R_CPINDEX' => 'بداية لوحة كليجا',
|
||||
'R_EXTS' => 'إعدادات الإمتدادات',
|
||||
'R_FILES' => 'إدارة الملفات',
|
||||
'R_REPORTS' => 'تبليغات',
|
||||
'R_CALLS' => 'رسائل',
|
||||
'R_USERS' => 'الأعضاء والمجموعات',
|
||||
'R_REPAIR' => 'صيانة',
|
||||
'R_LGOUTCP' => 'مسح جلسة الإدارة',
|
||||
'R_BAN' => 'التحكم بالحظر',
|
||||
'BAN_EXP1' => 'قم بتحرير الآيبيات المحظورة وإضافة الجديد من هنا..',
|
||||
'BAN_EXP2' => 'إستخدم رمز النجمة (*)لاستبدال الارقام ..إذا كنت تريد الحظر الشامل ..وأستخدم الفاصل (|) للفصل بين الآيبيات',
|
||||
'UPDATE_BAN' => 'حفظ تعديلات الحظر',
|
||||
'BAN_UPDATED' => 'تم تحديث قائمة الحظر بنجاح..',
|
||||
'R_RULES' => 'شروط الخدمة',
|
||||
'RULES_EXP' => 'من هنا تستطيع تعديل الشروط التي سوف تظهر للزوار والأعضاء',
|
||||
'UPDATE_RULES' => 'تحديث الشروط',
|
||||
'RULES_UPDATED' => 'تم تحديث الشروط بنجاح..',
|
||||
'R_SEARCH' => 'بحث متقدم',
|
||||
'SEARCH_FILES' => 'بحث عن الملفات',
|
||||
'SEARCH_SUBMIT' => 'بحث',
|
||||
'LAST_DOWN' => 'آخر تحميل',
|
||||
'WAS_B4' => 'كان قبل',
|
||||
'SEARCH_USERS' => 'بحث عن مستخدمين',
|
||||
'R_IMG_CTRL' => 'إدارة الصور',
|
||||
'ENABLE_USERFILE' => 'تفعيل مجلدات المستخدمين',
|
||||
'R_EXTRA' => 'هيدر وفوتر إضافي',
|
||||
'EX_HEADER_N' => 'الهيدر الإضافي.. وهو ما يظهر أسفل الهيدر الأصلي ..',
|
||||
'EX_FOOTER_N' => 'الفوتر الإضافي.. وهو ما يظهر أعلى الفوتر الأصلي ..',
|
||||
'UPDATE_EXTRA' => 'تحديث الإضافات القوالبية',
|
||||
'EXTRA_UPDATED' => 'تم تحديث الإضافات القوالبية',
|
||||
'R_STYLES' => 'الستايلات',
|
||||
'NO_TPL_SHOOSED' => 'لم تقم بإختيار قالب!',
|
||||
|
||||
'R_PLUGINS' => 'إضافات برمجية',
|
||||
'ADD_NEW_PLUGIN' => 'أضف إضافة برمجية جديدة',
|
||||
'PLUGIN_DELETED' => 'لقد تم حذف الإضافة البرمجية...',
|
||||
'PLGUIN_DISABLED_ENABLED' => 'لقد تم تفعيل \ تعطيل الإضافة البرمجية..',
|
||||
'NO_PLUGINS' => 'لا يوجد أي إضافات برمجية ..',
|
||||
'NEW_PLUGIN_ADDED' => 'لقد تمت إضافة الإضافة البرمجية .. ',
|
||||
'PLUGIN_EXISTS_BEFORE' => 'الاضافة هذه موجودة سابقاً بنفس الاصدار أو أعلى ولاتحتاج تحديث !',
|
||||
'R_CHECK_UPDATE' => 'فحص عن تحديثات',
|
||||
'ERROR_CHECK_VER' => 'خطأ: لا يمكن جلب معلومات عن آخر نسخة في هذه اللحظة، حاول مجدداً لاحقا!.',
|
||||
'UPDATE_KLJ_NOW' => 'يجب أن تقوم بتحديث نسختك إلى آخر نسخة الآن، قم بالذهاب لموقع كليجا لمعلومات أكثر .',
|
||||
'U_LAST_VER_KLJ' => 'أنت تستخدم آخر نسخة من كليجا. شكراً لمتابعة نسختك بإستمرار.',
|
||||
'U_USE_PRE_RE' => 'أنت تستخدم نسخة تطويرية لم تصدر حتى الآن , اضغط <a href="mailto:info@kleeja.com">هنا</a> لإخبارنا بأي أخطاء برمجية وثغرات قد تقابلك.',
|
||||
'STYLE_IS_DEFAULT' => 'استايل افتراضي',
|
||||
'MAKE_AS_DEFAULT' => 'تعيينه افتراضي',
|
||||
'STYLE_NOW_IS_DEFAULT' => 'تم تعيين الاستايل "%s" ستايل افتراضي',
|
||||
'UPDATE_NOW_S' => 'انت تستخدم نسخة قديمة من كليجا، قم بالترقية فوراً، نسختك الحالية هي %1$s والنسخة الجديدة هي %2$s .',
|
||||
'ADD_NEW_EXT' => 'أضف امتداد جديد',
|
||||
'ADD_NEW_EXT_EXP' => 'قم بكتابة الامتداد ليتم اضافته لهذه المجموعة.',
|
||||
'EMPTY_EXT_FIELD' => 'حقل الامتداد فارغ!',
|
||||
'NEW_EXT_ADD' => 'تم إضافة الامتداد الجديد ',
|
||||
'NEW_EXT_EXISTS_B4' => 'الامتداد الجديد %s موجود مسبقاً !',
|
||||
'CONFIG_WRITEABLE' => 'ملف config.php قابل للكتابة حالياً ونوصي وبشدة تغيير التصريح له لـ 640 أو على الأقل 644.',
|
||||
'USERS_NOT_NORMAL_SYS' => 'نظام العضويات الحالي ليس النظام العادي ، أي أن الأعضاء الحاليين لا يمكن تحريرهم من هنا بل من السكربت الذي تم ربط كليجا به، هؤلا الأعضاء يتبعون لنظام العضويات العادي.',
|
||||
'DIMENSIONS_THMB' => 'أبعاد المصغرات',
|
||||
'R_PLUGINS' => 'إضافات برمجية',
|
||||
'ADD_NEW_PLUGIN' => 'أضف إضافة برمجية جديدة',
|
||||
'PLUGIN_DELETED' => 'لقد تم حذف الإضافة البرمجية...',
|
||||
'PLGUIN_DISABLED_ENABLED' => 'لقد تم تفعيل \ تعطيل الإضافة البرمجية..',
|
||||
'NO_PLUGINS' => 'لا يوجد أي إضافات برمجية ..',
|
||||
'NEW_PLUGIN_ADDED' => 'لقد تمت إضافة الإضافة البرمجية .. ',
|
||||
'PLUGIN_EXISTS_BEFORE' => 'الاضافة هذه موجودة سابقاً بنفس الاصدار أو أعلى ولاتحتاج تحديث !',
|
||||
'R_CHECK_UPDATE' => 'فحص عن تحديثات',
|
||||
'ERROR_CHECK_VER' => 'خطأ: لا يمكن جلب معلومات عن آخر نسخة في هذه اللحظة، حاول مجدداً لاحقا!.',
|
||||
'UPDATE_KLJ_NOW' => 'يجب أن تقوم بتحديث نسختك إلى آخر نسخة الآن، قم بالذهاب لموقع كليجا لمعلومات أكثر .',
|
||||
'U_LAST_VER_KLJ' => 'أنت تستخدم آخر نسخة من كليجا. شكراً لمتابعة نسختك بإستمرار.',
|
||||
'U_USE_PRE_RE' => 'أنت تستخدم نسخة تطويرية لم تصدر حتى الآن , اضغط <a href="mailto:info@kleeja.com">هنا</a> لإخبارنا بأي أخطاء برمجية وثغرات قد تقابلك.',
|
||||
'STYLE_IS_DEFAULT' => 'استايل افتراضي',
|
||||
'MAKE_AS_DEFAULT' => 'تعيينه افتراضي',
|
||||
'STYLE_NOW_IS_DEFAULT' => 'تم تعيين الاستايل "%s" ستايل افتراضي',
|
||||
'UPDATE_NOW_S' => 'انت تستخدم نسخة قديمة من كليجا، قم بالترقية فوراً، نسختك الحالية هي %1$s والنسخة الجديدة هي %2$s .',
|
||||
'ADD_NEW_EXT' => 'أضف امتداد جديد',
|
||||
'ADD_NEW_EXT_EXP' => 'قم بكتابة الامتداد ليتم اضافته لهذه المجموعة.',
|
||||
'EMPTY_EXT_FIELD' => 'حقل الامتداد فارغ!',
|
||||
'NEW_EXT_ADD' => 'تم إضافة الامتداد الجديد ',
|
||||
'NEW_EXT_EXISTS_B4' => 'الامتداد الجديد %s موجود مسبقاً !',
|
||||
'CONFIG_WRITEABLE' => 'ملف config.php قابل للكتابة حالياً ونوصي وبشدة تغيير التصريح له لـ 640 أو على الأقل 644.',
|
||||
'USERS_NOT_NORMAL_SYS' => 'نظام العضويات الحالي ليس النظام العادي ، أي أن الأعضاء الحاليين لا يمكن تحريرهم من هنا بل من السكربت الذي تم ربط كليجا به، هؤلا الأعضاء يتبعون لنظام العضويات العادي.',
|
||||
'DIMENSIONS_THMB' => 'أبعاد المصغرات',
|
||||
|
||||
'ADMIN_DELETE_FILE_OK' => 'تم حذف كافة ملفات العضو',
|
||||
'ADMIN_DELETE_FILES' => 'حذف كل ملفات العضوية',
|
||||
'ADMIN_DELETE_FILE_OK' => 'تم حذف كافة ملفات العضو',
|
||||
'ADMIN_DELETE_FILES' => 'حذف كل ملفات العضوية',
|
||||
|
||||
|
||||
'BCONVERTER' => 'آلة حاسبة لتحويل الأحجام',
|
||||
'NO_HTACCESS_DIR_UP' => 'لايوجد ملف .htaccess في مجلد التحميل "%s", هذا يعني انه لو تم رفع اكواد خبيثه فسيتمكن المخترق من تشغيلها وقد يحدث امور لاتحمد عقباها!',
|
||||
'NO_HTACCESS_DIR_UP_THUMB' => 'لايوجد ملف .htaccess في مجلد المصغرات داخل مجلد التحميل "%s", هذا يعني انه لو تم رفع اكواد خبيثه فسيتمكن المخترق المخترق من تشغيلها وقد يحدث امور لاتحمد عقباها!',
|
||||
'COOKIE_DOMAIN' => 'نطاق الكوكيز',
|
||||
'COOKIE_NAME' => 'بادئة الكوكيز',
|
||||
'COOKIE_PATH' => 'مسار الكوكيز',
|
||||
'COOKIE_SECURE' => 'تفعيل الكوكيز الآمنة',
|
||||
'SHOWFILESBYIP' => 'عرض ملفات الـ IP',
|
||||
'DELETEALLRES' => 'حذف كل ملفات البحث هذا',
|
||||
'ADMIN_DELETE_FILES_OK' => 'تم حذف %s ملف بنجاح',
|
||||
'ADMIN_DELETE_FILES_NOF' => 'لاتوجد نتائج للقيام بعملية الحذف',
|
||||
'NOT_EXSIT_USER' => 'عفواً العضو الذي تبحث عنه غير موجود في قاعدة البيانات .. ربما أنك تحاول الوصول لعضوية غير موجودة او محذوفة!',
|
||||
'ADMIN_DELETE_NO_FILE' => 'هذا المستخدم لا يملك ملفات لحذفها!',
|
||||
'CONFIG_KLJ_MENUS_OTHER' => 'خيارات اخرى',
|
||||
'CONFIG_KLJ_MENUS_GENERAL' => 'خيارات عامة',
|
||||
'CONFIG_KLJ_MENUS_ALL' => 'عرض كل الخيارات',
|
||||
'CONFIG_KLJ_MENUS_UPLOAD' => 'اعدادات التحميل',
|
||||
'CONFIG_KLJ_MENUS_INTERFACE'=> 'خيارات الواجهة والتصميم',
|
||||
'CONFIG_KLJ_MENUS_ADVANCED' => 'خيارات متقدمة',
|
||||
'DELF_CAUTION' => '<small class="delf_caution">تحذير : هذه الخاصية قد تكون خطرة عند وضع ارقام صغيرة أو عند إستخدام الروابط المباشرة.</small>',
|
||||
'PLUGIN_N_CMPT_KLJ' => 'هذه الإضافة غيره متوافقة مع إصدار كليجا الذي تستخدمه ! .',
|
||||
'PHPINI_FILESIZE_SMALL' => 'اعلى حجم يستطيع المستخدمين تحميله لديك "%1$s" بينما إعدادات الـ PHP لديك فيما يتعلق بـ upload_max_filesize هي فقط "%2$s" , قم بسؤال مدير خادمك لرفعها ليستطيع المستخدمين رفع ملفات بالحجم الذي وضعته.',
|
||||
'PHPINI_MPOSTSIZE_SMALL' => 'بما أنك سمحت بتحميل "%1$s" ملفات دفعة واحدة , فيجب ان تسأل مدير خادمك لرفع قيمة post_max_size من اعدادات ال PHP بالخادم لما يقارب "%2$s" لتضمن لكليجا عمل أفضل.',
|
||||
'NUMPER_REPORT' => 'البلاغات',
|
||||
'NO_UP_CHANGE_S' => 'لا يوجد أي تتغير في البيانات , وبالتالي لم يتم تحديث البيانات !.',
|
||||
'ADD_HEADER_EXTRA' => 'هيدر إضافي',
|
||||
'ADD_FOOTER_EXTRA' => 'فوتر إضافي',
|
||||
'ADMIN_USING_IE6' => 'أنت تستخدم متصفح "انترنت اكسبلور قديم" هذا رغم انك صاحب موقع وتعرف اكثر ممايعرفه المستخدمون العاديون ! قم بترقية متصفحك او استخدم فيرفوكس الآن.',
|
||||
'BCONVERTER' => 'آلة حاسبة لتحويل الأحجام',
|
||||
'NO_HTACCESS_DIR_UP' => 'لايوجد ملف .htaccess في مجلد التحميل "%s", هذا يعني انه لو تم رفع اكواد خبيثه فسيتمكن المخترق من تشغيلها وقد يحدث امور لاتحمد عقباها!',
|
||||
'NO_HTACCESS_DIR_UP_THUMB' => 'لايوجد ملف .htaccess في مجلد المصغرات داخل مجلد التحميل "%s", هذا يعني انه لو تم رفع اكواد خبيثه فسيتمكن المخترق المخترق من تشغيلها وقد يحدث امور لاتحمد عقباها!',
|
||||
'COOKIE_DOMAIN' => 'نطاق الكوكيز',
|
||||
'COOKIE_NAME' => 'بادئة الكوكيز',
|
||||
'COOKIE_PATH' => 'مسار الكوكيز',
|
||||
'COOKIE_SECURE' => 'تفعيل الكوكيز الآمنة',
|
||||
'SHOWFILESBYIP' => 'عرض ملفات الـ IP',
|
||||
'DELETEALLRES' => 'حذف كل ملفات البحث هذا',
|
||||
'ADMIN_DELETE_FILES_OK' => 'تم حذف %s ملف بنجاح',
|
||||
'ADMIN_DELETE_FILES_NOF' => 'لاتوجد نتائج للقيام بعملية الحذف',
|
||||
'NOT_EXSIT_USER' => 'عفواً العضو الذي تبحث عنه غير موجود في قاعدة البيانات .. ربما أنك تحاول الوصول لعضوية غير موجودة او محذوفة!',
|
||||
'ADMIN_DELETE_NO_FILE' => 'هذا المستخدم لا يملك ملفات لحذفها!',
|
||||
'CONFIG_KLJ_MENUS_OTHER' => 'خيارات اخرى',
|
||||
'CONFIG_KLJ_MENUS_GENERAL' => 'خيارات عامة',
|
||||
'CONFIG_KLJ_MENUS_ALL' => 'عرض كل الخيارات',
|
||||
'CONFIG_KLJ_MENUS_UPLOAD' => 'اعدادات التحميل',
|
||||
'CONFIG_KLJ_MENUS_INTERFACE'=> 'خيارات الواجهة والتصميم',
|
||||
'CONFIG_KLJ_MENUS_ADVANCED' => 'خيارات متقدمة',
|
||||
'DELF_CAUTION' => '<small class="delf_caution">تحذير : هذه الخاصية قد تكون خطرة عند وضع ارقام صغيرة أو عند إستخدام الروابط المباشرة.</small>',
|
||||
'PLUGIN_N_CMPT_KLJ' => 'هذه الإضافة غيره متوافقة مع إصدار كليجا الذي تستخدمه ! .',
|
||||
'PHPINI_FILESIZE_SMALL' => 'اعلى حجم يستطيع المستخدمين تحميله لديك "%1$s" بينما إعدادات الـ PHP لديك فيما يتعلق بـ upload_max_filesize هي فقط "%2$s" , قم بسؤال مدير خادمك لرفعها ليستطيع المستخدمين رفع ملفات بالحجم الذي وضعته.',
|
||||
'PHPINI_MPOSTSIZE_SMALL' => 'بما أنك سمحت بتحميل "%1$s" ملفات دفعة واحدة , فيجب ان تسأل مدير خادمك لرفع قيمة post_max_size من اعدادات ال PHP بالخادم لما يقارب "%2$s" لتضمن لكليجا عمل أفضل.',
|
||||
'NUMPER_REPORT' => 'البلاغات',
|
||||
'NO_UP_CHANGE_S' => 'لا يوجد أي تتغير في البيانات , وبالتالي لم يتم تحديث البيانات !.',
|
||||
'ADD_HEADER_EXTRA' => 'هيدر إضافي',
|
||||
'ADD_FOOTER_EXTRA' => 'فوتر إضافي',
|
||||
'ADMIN_USING_IE6' => 'أنت تستخدم متصفح "انترنت اكسبلور قديم" هذا رغم انك صاحب موقع وتعرف اكثر ممايعرفه المستخدمون العاديون ! قم بترقية متصفحك او استخدم فيرفوكس الآن.',
|
||||
|
||||
'T_CLEANING_FILES_NOW' => 'جاري تنفيذ عملية حذف الملفات الخاملة حالياً على دفعات تفادياً للضغط ,وقت العملية يعتمد على عدد الملفات وحجمها ...',
|
||||
'T_CLEANING_FILES_NOW' => 'جاري تنفيذ عملية حذف الملفات الخاملة حالياً على دفعات تفادياً للضغط ,وقت العملية يعتمد على عدد الملفات وحجمها ...',
|
||||
|
||||
'HOW_UPDATE_KLEEJA' => 'كيف تقوم بتحديث كليجا ؟',
|
||||
'HOW_UPDATE_KLEEJA_STEP1' => 'توجه الى موقع سكربت كليجا الرسمي <a target="_blank" href="http://www.kleeja.com/">Kleeja.com</a> ثم توجه إلى صفحة التحميل وقم بتنزيل آخر تسخة صدرت من الاسكربت في حال توفر سكربت الترقية قم بتحميله',
|
||||
'HOW_UPDATE_KLEEJA_STEP2' => ' بعد ذلك قم بفك الضغط عن الملف الذي قمت بتحميله ثم رفعه الى موقعك لاستبدال الملفات القدييمة بالجديدة <b> عدا ملف config.php</b>.',
|
||||
'HOW_UPDATE_KLEEJA_STEP3' => 'بعد اتمام الخطوة السابقة بنجاح , قم بطلب العنوان التالي للتحديث قاعدة بيانـات الاسكربت:',
|
||||
'HOW_UPDATE_KLEEJA' => 'كيف تقوم بتحديث كليجا ؟',
|
||||
'HOW_UPDATE_KLEEJA_STEP1' => 'توجه الى موقع سكربت كليجا الرسمي <a target="_blank" href="http://www.kleeja.com/">Kleeja.com</a> ثم توجه إلى صفحة التحميل وقم بتنزيل آخر تسخة صدرت من الاسكربت في حال توفر سكربت الترقية قم بتحميله',
|
||||
'HOW_UPDATE_KLEEJA_STEP2' => ' بعد ذلك قم بفك الضغط عن الملف الذي قمت بتحميله ثم رفعه الى موقعك لاستبدال الملفات القدييمة بالجديدة <b> عدا ملف config.php</b>.',
|
||||
'HOW_UPDATE_KLEEJA_STEP3' => 'بعد اتمام الخطوة السابقة بنجاح , قم بطلب العنوان التالي للتحديث قاعدة بيانـات الاسكربت:',
|
||||
|
||||
'DEPEND_ON_NO_STYLE_ERR' => 'هذا الستايل يعتمد على ستايل "%s" غير الموجود لديك ضمن الستايلات !.',
|
||||
'PLUGINS_REQ_NO_STYLE_ERR' => 'هذا الستايل يتطلب ان تكون الإضافة/الاضافات [ %s ] مثبتة لديك , ثبتها وحاول من جديد !.',
|
||||
'KLJ_VER_NO_STYLE_ERR' => 'هذا الستايل يتطلب على الاقل اصدار %s من كليجا .',
|
||||
'DEPEND_ON_NO_STYLE_ERR' => 'هذا الستايل يعتمد على ستايل "%s" غير الموجود لديك ضمن الستايلات !.',
|
||||
'PLUGINS_REQ_NO_STYLE_ERR' => 'هذا الستايل يتطلب ان تكون الإضافة/الاضافات [ %s ] مثبتة لديك , ثبتها وحاول من جديد !.',
|
||||
'KLJ_VER_NO_STYLE_ERR' => 'هذا الستايل يتطلب على الاقل اصدار %s من كليجا .',
|
||||
|
||||
'STYLE_DEPEND_ON' => 'يعتمد على ستايل',
|
||||
'MESSAGE_NONE' => 'حتى الآن لا يوجد أي رسائل ..',
|
||||
'KLEEJA_TEAM' => 'فريق تطوير كليجا',
|
||||
'ERR_SEND_MAIL' => 'هناك خطأ بالارسال , حاول مجدداً!',
|
||||
'FIND_IP_FILES' => 'تم العثور على',
|
||||
'ALPHABETICAL_ORDER_FILES' => 'ترتيب الملفات حسب التسلسل الأبجدي',
|
||||
'ORDER_SIZE' => 'ترتيب الملفات حسب أحجامها من الأكبر حتى الأصغر',
|
||||
'ORDER_TOTAL_DOWNLOADS' => 'ترتيب الملفات حسب عدد مرات التحميل',
|
||||
'LIVEXTS' => 'الامتدادات التي لاتمر على صفحة الانتظار',
|
||||
'COMMA_X' => '<p class="live_xts">افصل بين الامتدادات باستخدام الفاصلة (<span style="font-size:large"> , </span>)</p>',
|
||||
'NO_SEARCH_WORD' => 'لم تقم بكتابة كلمة بحث !',
|
||||
'USERSECTOUPLOAD' => 'عدد الثواني بين كل عملية رفع',
|
||||
'ADM_UNWANTED_FILES' => 'يبدوا انك قمت بالترقية من نسخة سابقة وبسبب اختلاف اسماء بعض الملفات ستلاحظ وجود ازرار متكررة بلوحة التحكم . <br /> لحل المشكلة قم بإزالة كافة الملفات في المسار "includes/adm" واعادة رفعها من جديد. ايضا قم بحذف ملف admin.php من المجلد الرئيسي اذا وجد.',
|
||||
'HTML_URLS_ENABLED_NO_HTCC' => 'لقد قمت بتفعيل روابط الهتمل ولكنك نسيت أن تقوم بإعادة تسمية الملف htaccess.txt في مجلد كليجا الرئيسي ليصبح ".htaccess". اذا لم تفهم شيئاً من هذا الكلام قم بالسؤال في الدعم الفني لكليجا او قم بتعطيل روابط الهتمل .',
|
||||
'STYLE_DEPEND_ON' => 'يعتمد على ستايل',
|
||||
'MESSAGE_NONE' => 'حتى الآن لا يوجد أي رسائل ..',
|
||||
'KLEEJA_TEAM' => 'فريق تطوير كليجا',
|
||||
'ERR_SEND_MAIL' => 'هناك خطأ بالارسال , حاول مجدداً!',
|
||||
'FIND_IP_FILES' => 'تم العثور على',
|
||||
'ALPHABETICAL_ORDER_FILES' => 'ترتيب الملفات حسب التسلسل الأبجدي',
|
||||
'ORDER_SIZE' => 'ترتيب الملفات حسب أحجامها من الأكبر حتى الأصغر',
|
||||
'ORDER_TOTAL_DOWNLOADS' => 'ترتيب الملفات حسب عدد مرات التحميل',
|
||||
'LIVEXTS' => 'الامتدادات التي لاتمر على صفحة الانتظار',
|
||||
'COMMA_X' => '<p class="live_xts">افصل بين الامتدادات باستخدام الفاصلة (<span style="font-size:large"> , </span>)</p>',
|
||||
'NO_SEARCH_WORD' => 'لم تقم بكتابة كلمة بحث !',
|
||||
'USERSECTOUPLOAD' => 'عدد الثواني بين كل عملية رفع',
|
||||
'ADM_UNWANTED_FILES' => 'يبدوا انك قمت بالترقية من نسخة سابقة وبسبب اختلاف اسماء بعض الملفات ستلاحظ وجود ازرار متكررة بلوحة التحكم . <br /> لحل المشكلة قم بإزالة كافة الملفات في المسار "includes/adm" واعادة رفعها من جديد. ايضا قم بحذف ملف admin.php من المجلد الرئيسي اذا وجد.',
|
||||
'HTML_URLS_ENABLED_NO_HTCC' => 'لقد قمت بتفعيل روابط الهتمل ولكنك نسيت أن تقوم بإعادة تسمية الملف htaccess.txt في مجلد كليجا الرئيسي ليصبح ".htaccess". اذا لم تفهم شيئاً من هذا الكلام قم بالسؤال في الدعم الفني لكليجا او قم بتعطيل روابط الهتمل .',
|
||||
|
||||
'PLUGIN_CONFIRM_ADD' => 'انتبه, الاضافات هي تعديلات برمجية على السكربت و قد تكون ضارة أحياناً , لذا ان كنت غير متأكد من مصدر الإضافة ولم تقم بتحميلها من موقع كليجا فالافضل ان تراجع نفسك الآن . ',
|
||||
'PLUGIN_CONFIRM_ADD' => 'انتبه, الاضافات هي تعديلات برمجية على السكربت و قد تكون ضارة أحياناً , لذا ان كنت غير متأكد من مصدر الإضافة ولم تقم بتحميلها من موقع كليجا فالافضل ان تراجع نفسك الآن . ',
|
||||
|
||||
'LOADING' => 'جاري التنفيذ',
|
||||
'LOADING' => 'جاري التنفيذ',
|
||||
|
||||
'WELCOME' => 'مرحباً',
|
||||
'ENABLE_CAPTCHA' => 'تفعيل كود الامان بكليجا',
|
||||
'NO_THUMB_FOLDER' => 'يبدو ان المصغرات مُفعلة لديك ولكن في نفس الوقت مجلد %s غير متوفر مما يمنع عملية انشاء المصغرات, قم بإنشاء المجلد.',
|
||||
'DELETE_EARLIER_30DAYS' => 'حذف ما مضى عليه 30 يوماً',
|
||||
'DELETE_ALL' => 'حذف الكل',
|
||||
'DELETE_PROCESS_QUEUED' => 'تم اضافة عملية الحذف لقائمة الانتظار, سيتم تنفيذها تدريجياً لكي لايتم زيادة الحمل على الخادم.',
|
||||
'DELETE_PROCESS_IN_WORK' => 'جاري تنفيذ عملية الحذف التدريجية حالياً ...',
|
||||
'SHOW_FROM_24H' => 'عرض آخر 24 ساعة',
|
||||
'THUMB_DIS_LONGTIME' => 'المصغرات معطلة, هذا سيجعل كليجا تقوم بتصغير الصور الكبيرة لك هنا, وبالتالي ستاخذ وقتاً طويلاً لعرضها, فعل المصغرات الآن.',
|
||||
'WELCOME' => 'مرحباً',
|
||||
'ENABLE_CAPTCHA' => 'تفعيل كود الامان بكليجا',
|
||||
'NO_THUMB_FOLDER' => 'يبدو ان المصغرات مُفعلة لديك ولكن في نفس الوقت مجلد %s غير متوفر مما يمنع عملية انشاء المصغرات, قم بإنشاء المجلد.',
|
||||
'DELETE_EARLIER_30DAYS' => 'حذف ما مضى عليه 30 يوماً',
|
||||
'DELETE_ALL' => 'حذف الكل',
|
||||
'DELETE_PROCESS_QUEUED' => 'تم اضافة عملية الحذف لقائمة الانتظار, سيتم تنفيذها تدريجياً لكي لايتم زيادة الحمل على الخادم.',
|
||||
'DELETE_PROCESS_IN_WORK' => 'جاري تنفيذ عملية الحذف التدريجية حالياً ...',
|
||||
'SHOW_FROM_24H' => 'عرض آخر 24 ساعة',
|
||||
'THUMB_DIS_LONGTIME' => 'المصغرات معطلة, هذا سيجعل كليجا تقوم بتصغير الصور الكبيرة لك هنا, وبالتالي ستاخذ وقتاً طويلاً لعرضها, فعل المصغرات الآن.',
|
||||
|
||||
'R_GROUPS' => 'ادارة المجموعات',
|
||||
'ESSENTIAL_GROUPS' => 'مجموعات اساسية',
|
||||
'CUSTOM_GROUPS' => 'مجموعات معرفة بواسطة المستخدم',
|
||||
'EDIT_DATA' => ' تعديل البيانات',
|
||||
'EDIT_ACL' => 'تعديل الصلاحيات',
|
||||
'HE_CAN' => 'يستطيع',
|
||||
'HE_CAN_NOT' => 'لا يستطيع',
|
||||
#ACLS roles
|
||||
'ACLS_ENTER_ACP' => 'دخول لوحة التحكم',
|
||||
'ACLS_ACCESS_FILEUSER' => 'الوصول لمجلد ملفاته',
|
||||
'R_GROUPS' => 'ادارة المجموعات',
|
||||
'ESSENTIAL_GROUPS' => 'مجموعات اساسية',
|
||||
'CUSTOM_GROUPS' => 'مجموعات معرفة بواسطة المستخدم',
|
||||
'EDIT_DATA' => ' تعديل البيانات',
|
||||
'EDIT_ACL' => 'تعديل الصلاحيات',
|
||||
'HE_CAN' => 'يستطيع',
|
||||
'HE_CAN_NOT' => 'لا يستطيع',
|
||||
//ACLS roles
|
||||
'ACLS_ENTER_ACP' => 'دخول لوحة التحكم',
|
||||
'ACLS_ACCESS_FILEUSER' => 'الوصول لمجلد ملفاته',
|
||||
'ACLS_ACCESS_FILEUSERS' => 'تصفح مجلدات الملفات للاعضاء',
|
||||
'ACLS_ACCESS_CALL' => 'الوصول لصفحة اتصل بنا',
|
||||
'ACLS_ACCESS_REPORT' => 'إظهار صفحة ابلاغ عن محتوى',
|
||||
'ACLS_ACCESS_STATS' => 'الوصول لصفحة الإحصائيات',
|
||||
'ACLS_ACCESS_CALL' => 'الوصول لصفحة اتصل بنا',
|
||||
'ACLS_ACCESS_REPORT' => 'إظهار صفحة ابلاغ عن محتوى',
|
||||
'ACLS_ACCESS_STATS' => 'الوصول لصفحة الإحصائيات',
|
||||
|
||||
'GROUP_IS_DEFAULT' => 'هذه المجموعة افتراضية عند التسجيل',
|
||||
'ADD_NEW_GROUP' => 'اضف مجموعة جديدة',
|
||||
'DELETE_GROUP' => 'حذف مجموعة',
|
||||
'GROUP_NAME' => 'اسم المجموعة',
|
||||
'COPY_FROM' => 'نسخ من',
|
||||
'USERNAME_NOT_YOU' => 'ليس انت؟ %1$sسجل خروج%2$s',
|
||||
'DEFAULT_GROUP' => 'المجموعة الافتراضية',
|
||||
'G_USERS_MOVE_TO' => 'نقل اعضاء المجموعة لـ',
|
||||
'TAKEN_NAMES' => 'هذا الاسم من الاسماء المحجوزة، قم باختيار غيره!.',
|
||||
'GROUP_DELETED' => 'تم حذف المجموعة "%1$s" وتم نقل العضويات الخاصة بها للمجموعة "%2$s".',
|
||||
'NO_MOVE_SAME_GRP' => 'لايمكن نقل الاعضاء لنفس المجموعة !.',
|
||||
'DEFAULT_GRP_NO_DEL' => 'لايمكن حذف المجموعة الافتراضية, قم بتغيير المجموعة الافتراضية لمجموعة اخرى ثم قم بحذف هذه المجموعة من جديد!.',
|
||||
'GROUP_ADDED' => 'تم اضافة المجموعة "%s" بنجاح... ',
|
||||
'SEARCH4FILES_BYIP' => 'بحث عن الملفات بواسطة الـ IP',
|
||||
'SEARCH4FILES_BYUSER' => 'بحث عن الملفات لهذا المستخدم',
|
||||
'USER_DELETED' => 'تم حذف المستخدم بنجاح !.',
|
||||
'USER_ADDED' => 'تم اضافة المستخدم بنجاح..',
|
||||
'DIRECT_FILE_NOTE' => 'هذا ملف مباشر, الملفات المباشرة لايتم عمل احصائيات لها.',
|
||||
'IMAGEFOLDER' => 'مجلد الصور والملفات المباشرة',
|
||||
'IMAGEFOLDEREXTS' => 'صيغ الصور والملفات المباشرة - مثل: mp3, mp4, swf (لن تمر على صفحة إنتظار وسيتم تخزينها بمجلد مختلف أن أردت)',
|
||||
'IMAGEFOLDERE' => 'تغيير اسم الملف او الصورة المباشرة',
|
||||
'LAST_VIEW' => 'آخر استعراض',
|
||||
'HURRY_HURRY' => 'إعدادات سريعة',
|
||||
'RESYNC' => 'إعادة مزامنة',
|
||||
'DEL_CACHE' => 'حذف الكاش - الملفات المؤقتة',
|
||||
'SYNCING' => 'جاري عمل المزامنة: (%s), إنتظر ...',
|
||||
'SYNCING_DONE' => 'تم الإنتهاء من عمل المزامنة (%s).',
|
||||
'WHY_SYNCING' => 'كليجا تستخدم التزايد التلقائي بحيث لايتم حساب الاعداد كل مرة لزيادة اداء كليجا, استخدم هذه الميزة بعد الترقية او عندما يتم طلب ذلك منك.',
|
||||
'REPAIR_DB_TABLES' => 'إصلاح جداول قاعدة البيانات',
|
||||
'NO_RESULT_USE_SYNC' => 'لايوجد نتائج, اذا كان المركز جديد فهذا امر عادي. <br/> اما اذا كنت قد قمت بالترقية مؤخرا فقم بعمل مزامنة من صفحة الصيانة لعدد الملفات او الصور.',
|
||||
'GROUP_IS_DEFAULT' => 'هذه المجموعة افتراضية عند التسجيل',
|
||||
'ADD_NEW_GROUP' => 'اضف مجموعة جديدة',
|
||||
'DELETE_GROUP' => 'حذف مجموعة',
|
||||
'GROUP_NAME' => 'اسم المجموعة',
|
||||
'COPY_FROM' => 'نسخ من',
|
||||
'USERNAME_NOT_YOU' => 'ليس انت؟ %1$sسجل خروج%2$s',
|
||||
'DEFAULT_GROUP' => 'المجموعة الافتراضية',
|
||||
'G_USERS_MOVE_TO' => 'نقل اعضاء المجموعة لـ',
|
||||
'TAKEN_NAMES' => 'هذا الاسم من الاسماء المحجوزة، قم باختيار غيره!.',
|
||||
'GROUP_DELETED' => 'تم حذف المجموعة "%1$s" وتم نقل العضويات الخاصة بها للمجموعة "%2$s".',
|
||||
'NO_MOVE_SAME_GRP' => 'لايمكن نقل الاعضاء لنفس المجموعة !.',
|
||||
'DEFAULT_GRP_NO_DEL' => 'لايمكن حذف المجموعة الافتراضية, قم بتغيير المجموعة الافتراضية لمجموعة اخرى ثم قم بحذف هذه المجموعة من جديد!.',
|
||||
'GROUP_ADDED' => 'تم اضافة المجموعة "%s" بنجاح... ',
|
||||
'SEARCH4FILES_BYIP' => 'بحث عن الملفات بواسطة الـ IP',
|
||||
'SEARCH4FILES_BYUSER' => 'بحث عن الملفات لهذا المستخدم',
|
||||
'USER_DELETED' => 'تم حذف المستخدم بنجاح !.',
|
||||
'USER_ADDED' => 'تم اضافة المستخدم بنجاح..',
|
||||
'DIRECT_FILE_NOTE' => 'هذا ملف مباشر, الملفات المباشرة لايتم عمل احصائيات لها.',
|
||||
'IMAGEFOLDER' => 'مجلد الصور والملفات المباشرة',
|
||||
'IMAGEFOLDEREXTS' => 'صيغ الصور والملفات المباشرة - مثل: mp3, mp4, swf (لن تمر على صفحة إنتظار وسيتم تخزينها بمجلد مختلف أن أردت)',
|
||||
'IMAGEFOLDERE' => 'تغيير اسم الملف او الصورة المباشرة',
|
||||
'LAST_VIEW' => 'آخر استعراض',
|
||||
'HURRY_HURRY' => 'إعدادات سريعة',
|
||||
'RESYNC' => 'إعادة مزامنة',
|
||||
'DEL_CACHE' => 'حذف الكاش - الملفات المؤقتة',
|
||||
'SYNCING' => 'جاري عمل المزامنة: (%s), إنتظر ...',
|
||||
'SYNCING_DONE' => 'تم الإنتهاء من عمل المزامنة (%s).',
|
||||
'WHY_SYNCING' => 'كليجا تستخدم التزايد التلقائي بحيث لايتم حساب الاعداد كل مرة لزيادة اداء كليجا, استخدم هذه الميزة بعد الترقية او عندما يتم طلب ذلك منك.',
|
||||
'REPAIR_DB_TABLES' => 'إصلاح جداول قاعدة البيانات',
|
||||
'NO_RESULT_USE_SYNC' => 'لايوجد نتائج, اذا كان المركز جديد فهذا امر عادي. <br/> اما اذا كنت قد قمت بالترقية مؤخرا فقم بعمل مزامنة من صفحة الصيانة لعدد الملفات او الصور.',
|
||||
'ADVICE_CRON_LINK' => 'يفضل وضع رابط طابور المهام المتكررة كعملية Cron كل ساعة أو ساعتين',
|
||||
'UPLOAD_LOCAL_PC' => 'رفع من جهازك',
|
||||
'NO_ZIP_ARCHIVE' => 'يبدو أن ZipArchive ليس متوفراً علي خادمك، قم بتثبيته فهو من المتطلبات.',
|
||||
'EXTRACT_ZIP_FAILED' => 'صادفتنا مشكلة أثناء فك الأرشيف! تأكد من أنه ملف zip صالح، وأن مجلد "%s" قابل للكتابة.',
|
||||
'NO_PROBLEM_AFTER_ZIP' => 'لقد تم فك الملف بنجاح وهو جاهز للتفعيل.',
|
||||
'SESSION_ENDED' => 'انتهت الجلسة، هل تريد تسجل الدخول من جديد؟',
|
||||
//3.0.3
|
||||
'CUSTOMIZATION' => 'تخصيص',
|
||||
'SHOW' => 'عرض',
|
||||
'HIDE' => 'إخفاء',
|
||||
'VIEW' => 'إستعراض',
|
||||
'INSTALL' => 'تثبيت',
|
||||
'CLOSE' => 'إغلاق',
|
||||
'STATS_BOXES' => 'صناديق الإحصائيات',
|
||||
'PLUGIN_UPDATED' => 'الإضافة "%s" تم تحديثها بنجاح ..',
|
||||
'PLUGIN_DOWNLOADED' => 'الإضافة "%s" تم تحميلها بنجاح ..',
|
||||
'PLUGIN_FILE_NOT_FOUND' => 'ملف الإضافة مفقود لايمكن إيجاده!',
|
||||
'PLUGIN_REMOTE_FILE_MISSING' => 'الإضافة "%s" ليست على موجوة على متجر كليجا الخارجي!',
|
||||
'PLUGINS_SERVER_ERROR' => 'واجهنا خطأ أثناء الإتصال بخادم متجر كليجا الخارجي...',
|
||||
'INSTALLED_PLUGINS' => 'الإضافات المثبتة',
|
||||
'LOCAL_PLUGINS' => 'الإضافات المحلية',
|
||||
'KLEEJA_STORE' => 'متجر كليجا',
|
||||
'KLJ_VER_NO_PLUGIN' => 'هذه الإضافة يمكنها العمل على إصدار كليجا %1$s حتى إصدار %2$s.',
|
||||
'VERSION' => 'الإصدار',
|
||||
'DEVELOPER' => 'المطور',
|
||||
'ALL_PLUGINS_UPDATED' => 'لا يوجد إضافات تحتاج تحديث حالياً ... ',
|
||||
);
|
||||
'NO_PROBLEM_AFTER_ZIP' => 'لقد تم فك الملف بنجاح وهو جاهز للتفعيل.',
|
||||
'SESSION_ENDED' => 'انتهت الجلسة، هل تريد تسجل الدخول من جديد؟',
|
||||
//3.0.3
|
||||
'CUSTOMIZATION' => 'تخصيص',
|
||||
'SHOW' => 'عرض',
|
||||
'HIDE' => 'إخفاء',
|
||||
'VIEW' => 'إستعراض',
|
||||
'INSTALL' => 'تثبيت',
|
||||
'CLOSE' => 'إغلاق',
|
||||
'STATS_BOXES' => 'صناديق الإحصائيات',
|
||||
'PLUGIN_UPDATED' => 'الإضافة "%s" تم تحديثها بنجاح ..',
|
||||
'PLUGIN_DOWNLOADED' => 'الإضافة "%s" تم تحميلها بنجاح ..',
|
||||
'PLUGIN_FILE_NOT_FOUND' => 'ملف الإضافة مفقود لايمكن إيجاده!',
|
||||
'PLUGIN_REMOTE_FILE_MISSING' => 'الإضافة "%s" ليست على موجوة على متجر كليجا الخارجي!',
|
||||
'PLUGINS_SERVER_ERROR' => 'واجهنا خطأ أثناء الإتصال بخادم متجر كليجا الخارجي...',
|
||||
'INSTALLED_PLUGINS' => 'الإضافات المثبتة',
|
||||
'LOCAL_PLUGINS' => 'الإضافات المحلية',
|
||||
'KLEEJA_STORE' => 'متجر كليجا',
|
||||
'KLJ_VER_NO_PLUGIN' => 'هذه الإضافة يمكنها العمل على إصدار كليجا %1$s حتى إصدار %2$s.',
|
||||
'VERSION' => 'الإصدار',
|
||||
'DEVELOPER' => 'المطور',
|
||||
'ALL_PLUGINS_UPDATED' => 'لا يوجد إضافات تحتاج تحديث حالياً ... ',
|
||||
];
|
||||
|
||||
@@ -4,251 +4,251 @@
|
||||
// Arabic
|
||||
//
|
||||
|
||||
return array(
|
||||
return [
|
||||
//language information
|
||||
'DIR' => 'rtl',
|
||||
'LANG_SMALL_NAME' => 'ar-sa',
|
||||
'DIR' => 'rtl',
|
||||
'LANG_SMALL_NAME' => 'ar-sa',
|
||||
|
||||
'HOME' => 'البداية',
|
||||
'INDEX' => 'الرئيسية',
|
||||
'SITE_CLOSED' => 'الموقع مغلق !',
|
||||
'STOP_FOR_SIZE' => 'متوقف حالياً !',
|
||||
'SIZES_EXCCEDED' => 'الحجم الكلي للمركز استنفذ .. سوف نعود قريباً',
|
||||
'SAFE_CODE' => 'تفعيل الكود الأمني في التحميل',
|
||||
'LAST_VISIT' => 'آخر زيارة',
|
||||
'FLS_LST_VST_SEARCH' => 'عرض الملفات منذ',
|
||||
'IMG_LST_VST_SEARCH' => 'عرض الصور منذ',
|
||||
'NEXT' => 'التالي »',
|
||||
'PREV' => '« السابق',
|
||||
'INFORMATION' => 'تعليمات',
|
||||
'WELCOME' => 'مرحباً بك',
|
||||
'KLEEJA_VERSION' => 'إصدار كليجا',
|
||||
'NUMBER_ONLINE' => 'الاعضاء المتواجدون حالياً',
|
||||
#'NUMBER_UONLINE' => 'أعضاء',
|
||||
#'NUMBER_VONLINE' => 'زوار',
|
||||
'USERS_SYSTEM' => 'نظام المستخدمين',
|
||||
'ERROR_NAVIGATATION' => 'خطأ بالتوجه..',
|
||||
'USER_LOGIN' => 'تسجيل الدخول',
|
||||
'LOGIN' => 'دخول',
|
||||
'USERNAME' => 'اسم المستخدم',
|
||||
'PASSWORD' => 'كلمة المرور',
|
||||
#'EMPTY_USERNAME' => 'حقل اسم المستخدم فارغ',
|
||||
#'EMPTY_PASSWORD' => 'حقل كلمة المرور فارغ',
|
||||
'LOSS_PASSWORD' => 'نسيت كلمة المرور؟',
|
||||
'LOGINED_BEFORE' => 'أنت داخل بالفعل',
|
||||
'LOGOUT' => 'خروج',
|
||||
'EMPTY_FIELDS' => 'خطأ.. حقول ناقصة!',
|
||||
'LOGIN_SUCCESFUL' => 'لقد تم الدخول بنجاح',
|
||||
'LOGIN_ERROR' => 'خطأ.. لا يمكن الدخول!',
|
||||
'REGISTER_CLOSED' => 'نأسف.. التسجيل مقفل حالياً',
|
||||
'PLACE_NO_YOU' => 'منطقة محظورة',
|
||||
'NOT_EXSIT_USER' => 'لا يوجد لدينا عضو بهذه البيانات , او انه تم حذفه!',
|
||||
'REGISTERED_BEFORE' => 'لقد قمت بالتسجيل سابقاً',
|
||||
'REGISTER' => 'تسجيل عضوية',
|
||||
'EMAIL' => 'البريد الإلكتروني',
|
||||
'VERTY_CODE' => 'كود الأمان',
|
||||
'NOTE_CODE' => 'ادخل الأحرف الموجود في الصورة بالشكل الصحيح مرتبة بشكل دقيق.',
|
||||
'WRONG_EMAIL' => 'بريد خاطيء',
|
||||
'WRONG_NAME' => 'الاسم يجب أن يكون بين 4 احرف و 25 حرف وبدون مسافات أو أحرف خاصة (فقط _- مسموحة)!.',
|
||||
#'WRONG_LINK' => 'رابط خاطيء..',
|
||||
'EXIST_NAME' => 'الاسم موجود مسبقاً',
|
||||
'EXIST_EMAIL' => 'البريد موجود مسبقاً',
|
||||
'WRONG_VERTY_CODE' => 'كود الأمان خاطيء',
|
||||
#'CANT_UPDATE_SQL' => 'لا يمكن التحديث لقاعدة البيانات',
|
||||
#'CANT_INSERT_SQL' => 'لا يمكن إدخال المعلومات لقاعدة البيانات',
|
||||
'REGISTER_SUCCESFUL' => 'شكراً لتسجيلك معناً',
|
||||
'LOGOUT_SUCCESFUL' => 'تم الخروج بنجاح',
|
||||
'LOGOUT_ERROR' => 'هناك مشكلة بالخروج',
|
||||
#'FILECP' => 'إدارة الملفات',
|
||||
'DEL_SELECTED' => 'حذف المحدد',
|
||||
'DEL_ALL' => 'حذف كل ملفاتي',
|
||||
'HOME' => 'البداية',
|
||||
'INDEX' => 'الرئيسية',
|
||||
'SITE_CLOSED' => 'الموقع مغلق !',
|
||||
'STOP_FOR_SIZE' => 'متوقف حالياً !',
|
||||
'SIZES_EXCCEDED' => 'الحجم الكلي للمركز استنفذ .. سوف نعود قريباً',
|
||||
'SAFE_CODE' => 'تفعيل الكود الأمني في التحميل',
|
||||
'LAST_VISIT' => 'آخر زيارة',
|
||||
'FLS_LST_VST_SEARCH' => 'عرض الملفات منذ',
|
||||
'IMG_LST_VST_SEARCH' => 'عرض الصور منذ',
|
||||
'NEXT' => 'التالي »',
|
||||
'PREV' => '« السابق',
|
||||
'INFORMATION' => 'تعليمات',
|
||||
'WELCOME' => 'مرحباً بك',
|
||||
'KLEEJA_VERSION' => 'إصدار كليجا',
|
||||
'NUMBER_ONLINE' => 'الاعضاء المتواجدون حالياً',
|
||||
//'NUMBER_UONLINE' => 'أعضاء',
|
||||
//'NUMBER_VONLINE' => 'زوار',
|
||||
'USERS_SYSTEM' => 'نظام المستخدمين',
|
||||
'ERROR_NAVIGATATION' => 'خطأ بالتوجه..',
|
||||
'USER_LOGIN' => 'تسجيل الدخول',
|
||||
'LOGIN' => 'دخول',
|
||||
'USERNAME' => 'اسم المستخدم',
|
||||
'PASSWORD' => 'كلمة المرور',
|
||||
//'EMPTY_USERNAME' => 'حقل اسم المستخدم فارغ',
|
||||
//'EMPTY_PASSWORD' => 'حقل كلمة المرور فارغ',
|
||||
'LOSS_PASSWORD' => 'نسيت كلمة المرور؟',
|
||||
'LOGINED_BEFORE' => 'أنت داخل بالفعل',
|
||||
'LOGOUT' => 'خروج',
|
||||
'EMPTY_FIELDS' => 'خطأ.. حقول ناقصة!',
|
||||
'LOGIN_SUCCESFUL' => 'لقد تم الدخول بنجاح',
|
||||
'LOGIN_ERROR' => 'خطأ.. لا يمكن الدخول!',
|
||||
'REGISTER_CLOSED' => 'نأسف.. التسجيل مقفل حالياً',
|
||||
'PLACE_NO_YOU' => 'منطقة محظورة',
|
||||
'NOT_EXSIT_USER' => 'لا يوجد لدينا عضو بهذه البيانات , او انه تم حذفه!',
|
||||
'REGISTERED_BEFORE' => 'لقد قمت بالتسجيل سابقاً',
|
||||
'REGISTER' => 'تسجيل عضوية',
|
||||
'EMAIL' => 'البريد الإلكتروني',
|
||||
'VERTY_CODE' => 'كود الأمان',
|
||||
'NOTE_CODE' => 'ادخل الأحرف الموجود في الصورة بالشكل الصحيح مرتبة بشكل دقيق.',
|
||||
'WRONG_EMAIL' => 'بريد خاطيء',
|
||||
'WRONG_NAME' => 'الاسم يجب أن يكون بين 4 احرف و 25 حرف وبدون مسافات أو أحرف خاصة (فقط _- مسموحة)!.',
|
||||
//'WRONG_LINK' => 'رابط خاطيء..',
|
||||
'EXIST_NAME' => 'الاسم موجود مسبقاً',
|
||||
'EXIST_EMAIL' => 'البريد موجود مسبقاً',
|
||||
'WRONG_VERTY_CODE' => 'كود الأمان خاطيء',
|
||||
//'CANT_UPDATE_SQL' => 'لا يمكن التحديث لقاعدة البيانات',
|
||||
//'CANT_INSERT_SQL' => 'لا يمكن إدخال المعلومات لقاعدة البيانات',
|
||||
'REGISTER_SUCCESFUL' => 'شكراً لتسجيلك معناً',
|
||||
'LOGOUT_SUCCESFUL' => 'تم الخروج بنجاح',
|
||||
'LOGOUT_ERROR' => 'هناك مشكلة بالخروج',
|
||||
//'FILECP' => 'إدارة الملفات',
|
||||
'DEL_SELECTED' => 'حذف المحدد',
|
||||
'DEL_ALL' => 'حذف كل ملفاتي',
|
||||
'ALL_DELETED' => 'تم حذف كل ملفاتك',
|
||||
'NO_FILES_DELETE' => 'لا تملك ملفات لحذفها',
|
||||
#'EDIT_U_FILES' => 'إدارة ملفاتك',
|
||||
'FILES_UPDATED' => 'تم تحديث الملفات بنجاح',
|
||||
'PUBLIC_USER_FILES' => 'مجلد ملفات العضو',
|
||||
'FILEUSER' => 'مجلد ملفات',
|
||||
#'GO_FILECP' => 'اضغط هنا لإدارة ملفاتك هذه',
|
||||
'YOUR_FILEUSER' => 'مجلدك الشخصي',
|
||||
'COPY_AND_GET_DUD' => 'انسخ الرابط وشاركهُ مع أصدقائك ليطلعوا على مجلدك ',
|
||||
'NO_FILE_USER' => 'لا يوجد أي ملفات في حساب العضوية حتى الآن!',
|
||||
'CLOSED_FEATURE' => 'خاصية مغلقة',
|
||||
'USERFILE_CLOSED' => 'خاصية مجلدات المستخدمين مغلقة!',
|
||||
'PFILE_4_FORUM' => 'قم بالذهاب لمنطقة الأعضاء لتغيير بياناتك',
|
||||
'USER_PLACE' => 'منطقة أعضاء',
|
||||
'PROFILE' => 'تعديل البيانات',
|
||||
'EDIT_U_DATA' => 'تحديث بياناتك',
|
||||
'PASS_ON_CHANGE' => 'تغيير كلمة المرور',
|
||||
'OLD' => 'القديمة',
|
||||
'NEW' => 'الجديدة',
|
||||
'NEW_AGAIN' => 'تكرار الجديدة',
|
||||
'UPDATE' => 'تحديث',
|
||||
'PASS_O_PASS2' => 'كلمة المرور القديمة مهمة واكتب كلمتا المرور الجديدتان بدقة',
|
||||
'DATA_CHANGED_O_LO' => 'تم تحديث بياناتك وسوف تستخدم بدخولك القادم',
|
||||
'CURRENT_PASS_WRONG' => 'كلمة المرور الحالية خاطئة, أعد كتابتها لتستطيع التعديل!',
|
||||
'DATA_CHANGED_NO' => 'لم تحدث بياناتك.. لن تتغير المعلومات',
|
||||
'LOST_PASS_FORUM' => 'اذهب للمنتدى واسترجع كلمة المرور',
|
||||
'GET_LOSTPASS' => 'استعادة كلمة المرور',
|
||||
'E_GET_LOSTPASS' => 'لاستعادة كلمة المرور يجب أن تكتب البريد الالكتروني المسجل لدينا',
|
||||
'WRONG_DB_EMAIL' => 'لا يوجد بريد كهذا في قاعدة البيانات لدينا',
|
||||
'GET_LOSTPASS_MSG' => "لقد قمت بطلب إستعادة كلمة مرورك , لكن لتجنب السبام قم بالضغط على الرابط التالي لتأكيدها : \r\n %1\$s \r\n كلمة المرور الجديده : %2\$s",
|
||||
'CANT_SEND_NEWPASS' => 'خطأ.. لم يتم إرسال كلمة المرور الجديدة!',
|
||||
'OK_SEND_NEWPASS' => 'تم إرسال كلمة المرور الجديدة..',
|
||||
'OK_APPLY_NEWPASS' => 'تم ضبط كلمة المرور الجديده , يمكنك الآن الدخول بها .',
|
||||
'GUIDE' => 'الملفات المسموحة',
|
||||
'GUIDE_EXP' => 'الملفات المسموحة وامتداداتها',
|
||||
'EXT' => 'الامتداد',
|
||||
'SIZE' => 'الحجم',
|
||||
'REPORT' => 'إبلاغ عن محتوى',
|
||||
'YOURNAME' => 'اسمك',
|
||||
'URL' => 'الرابط',
|
||||
'REASON' => 'السبب',
|
||||
'NO_ID' => 'لم تحدد ملف..!',
|
||||
'NO_ME300RES' => 'رجاءً.. حقل السبب لا يمكن ملأه بأكثر من 300 حرف!',
|
||||
'THNX_REPORTED' => 'تم التبليغ.. شكراً لاهتمامك',
|
||||
'RULES' => 'شروط الخدمة',
|
||||
'NO_RULES_NOW' => 'لا يوجد قوانين حالياً',
|
||||
'E_RULES' => 'هذه هي شروط الخدمة',
|
||||
'CALL' => 'اتصل بنا',
|
||||
'SEND' => 'أرسل',
|
||||
'TEXT' => 'نص الرسالة',
|
||||
'NO_ME300TEXT' => 'رجاءً.. حقل النص لا يمكن ملأه بأكثر من 300 حرف!',
|
||||
'THNX_CALLED' => 'تم الإرسال. . سوف يتم الرد قريباً',
|
||||
'NO_DEL_F' => 'نأسف.. خاصية الحذف المباشر معطلة من المدير',
|
||||
'E_DEL_F' => 'الحذف المباشر',
|
||||
'WRONG_URL' => 'خطأ.. في الرابط..',
|
||||
//'EDIT_U_FILES' => 'إدارة ملفاتك',
|
||||
'FILES_UPDATED' => 'تم تحديث الملفات بنجاح',
|
||||
'PUBLIC_USER_FILES' => 'مجلد ملفات العضو',
|
||||
'FILEUSER' => 'مجلد ملفات',
|
||||
//'GO_FILECP' => 'اضغط هنا لإدارة ملفاتك هذه',
|
||||
'YOUR_FILEUSER' => 'مجلدك الشخصي',
|
||||
'COPY_AND_GET_DUD' => 'انسخ الرابط وشاركهُ مع أصدقائك ليطلعوا على مجلدك ',
|
||||
'NO_FILE_USER' => 'لا يوجد أي ملفات في حساب العضوية حتى الآن!',
|
||||
'CLOSED_FEATURE' => 'خاصية مغلقة',
|
||||
'USERFILE_CLOSED' => 'خاصية مجلدات المستخدمين مغلقة!',
|
||||
'PFILE_4_FORUM' => 'قم بالذهاب لمنطقة الأعضاء لتغيير بياناتك',
|
||||
'USER_PLACE' => 'منطقة أعضاء',
|
||||
'PROFILE' => 'تعديل البيانات',
|
||||
'EDIT_U_DATA' => 'تحديث بياناتك',
|
||||
'PASS_ON_CHANGE' => 'تغيير كلمة المرور',
|
||||
'OLD' => 'القديمة',
|
||||
'NEW' => 'الجديدة',
|
||||
'NEW_AGAIN' => 'تكرار الجديدة',
|
||||
'UPDATE' => 'تحديث',
|
||||
'PASS_O_PASS2' => 'كلمة المرور القديمة مهمة واكتب كلمتا المرور الجديدتان بدقة',
|
||||
'DATA_CHANGED_O_LO' => 'تم تحديث بياناتك وسوف تستخدم بدخولك القادم',
|
||||
'CURRENT_PASS_WRONG' => 'كلمة المرور الحالية خاطئة, أعد كتابتها لتستطيع التعديل!',
|
||||
'DATA_CHANGED_NO' => 'لم تحدث بياناتك.. لن تتغير المعلومات',
|
||||
'LOST_PASS_FORUM' => 'اذهب للمنتدى واسترجع كلمة المرور',
|
||||
'GET_LOSTPASS' => 'استعادة كلمة المرور',
|
||||
'E_GET_LOSTPASS' => 'لاستعادة كلمة المرور يجب أن تكتب البريد الالكتروني المسجل لدينا',
|
||||
'WRONG_DB_EMAIL' => 'لا يوجد بريد كهذا في قاعدة البيانات لدينا',
|
||||
'GET_LOSTPASS_MSG' => "لقد قمت بطلب إستعادة كلمة مرورك , لكن لتجنب السبام قم بالضغط على الرابط التالي لتأكيدها : \r\n %1\$s \r\n كلمة المرور الجديده : %2\$s",
|
||||
'CANT_SEND_NEWPASS' => 'خطأ.. لم يتم إرسال كلمة المرور الجديدة!',
|
||||
'OK_SEND_NEWPASS' => 'تم إرسال كلمة المرور الجديدة..',
|
||||
'OK_APPLY_NEWPASS' => 'تم ضبط كلمة المرور الجديده , يمكنك الآن الدخول بها .',
|
||||
'GUIDE' => 'الملفات المسموحة',
|
||||
'GUIDE_EXP' => 'الملفات المسموحة وامتداداتها',
|
||||
'EXT' => 'الامتداد',
|
||||
'SIZE' => 'الحجم',
|
||||
'REPORT' => 'إبلاغ عن محتوى',
|
||||
'YOURNAME' => 'اسمك',
|
||||
'URL' => 'الرابط',
|
||||
'REASON' => 'السبب',
|
||||
'NO_ID' => 'لم تحدد ملف..!',
|
||||
'NO_ME300RES' => 'رجاءً.. حقل السبب لا يمكن ملأه بأكثر من 300 حرف!',
|
||||
'THNX_REPORTED' => 'تم التبليغ.. شكراً لاهتمامك',
|
||||
'RULES' => 'شروط الخدمة',
|
||||
'NO_RULES_NOW' => 'لا يوجد قوانين حالياً',
|
||||
'E_RULES' => 'هذه هي شروط الخدمة',
|
||||
'CALL' => 'اتصل بنا',
|
||||
'SEND' => 'أرسل',
|
||||
'TEXT' => 'نص الرسالة',
|
||||
'NO_ME300TEXT' => 'رجاءً.. حقل النص لا يمكن ملأه بأكثر من 300 حرف!',
|
||||
'THNX_CALLED' => 'تم الإرسال. . سوف يتم الرد قريباً',
|
||||
'NO_DEL_F' => 'نأسف.. خاصية الحذف المباشر معطلة من المدير',
|
||||
'E_DEL_F' => 'الحذف المباشر',
|
||||
'WRONG_URL' => 'خطأ.. في الرابط..',
|
||||
|
||||
'DELETE_SUCCESFUL' => 'تم الحذف بنجاح',
|
||||
'STATS' => 'إحصائيات المركز',
|
||||
'STATS_CLOSED' => 'صفحة الإحصائيات معطلة من المدير!',
|
||||
'FILES_ST' => 'تم تحميل ',
|
||||
'FILE' => 'ملف',
|
||||
'IMAGE' => 'صورة',
|
||||
'USERS_ST' => 'عدد الأعضاء',
|
||||
'USER' => 'عضو',
|
||||
'SIZES_ST' => 'حجم جميع الملفات',
|
||||
#'LSTFLE_ST' => 'آخر ملف تم رفعه',
|
||||
'LSTDELST' => 'آخر فحص للملفات الخاملة ',
|
||||
'LAST_1_H' => 'هذه الإحصائيات لقبل ساعة من الآن',
|
||||
'DOWNLAOD' => 'تحميل',
|
||||
'DOWNLOAD' => 'تحميل',
|
||||
'FILE_FOUNDED' => 'تم إيجاد الملف',
|
||||
'WAIT' => 'انتظر رجاءً ..',
|
||||
'CLICK_DOWN' => 'اضغط هنا لتنزيل الملف',
|
||||
'JS_MUST_ON' => 'لا بد من تفعيل الجافا سكربت في متصفحك !',
|
||||
'FILE_INFO' => 'معلومات عن الملف',
|
||||
'FILENAME' => 'اسم الملف',
|
||||
'FILESIZE' => 'حجم الملف',
|
||||
'FILETYPE' => 'نوع الملف',
|
||||
'FILEDATE' => 'تاريخ الرفع',
|
||||
'LAST_DOWN' => 'آخر تحميل',
|
||||
'FILEUPS' => 'عدد التحميلات',
|
||||
'FILEREPORT' => 'ملف مخالف : إرسال إبلاغ عن المحتوى',
|
||||
'FILE_NO_FOUNDED' => 'لم نتمكن من إيجاد الملف!',
|
||||
'IMG_NO_FOUNDED' => 'لم نتمكن من إيجاد الصورة!',
|
||||
'NOT_IMG' => 'ليست صورة.. هذا ملف!',
|
||||
'MORE_F_FILES' => 'هذا آخر حد يمكنك تحميله',
|
||||
'DOWNLOAD_F' => 'رفع الملفات',
|
||||
'DOWNLOAD_T' => 'سحب الملفات من رابط',
|
||||
'PAST_URL_HERE' => 'ألصق الرابط هنا',
|
||||
'SAME_FILE_EXIST' => 'الملف "%s" موجود مسبقاً , قم بإعادة تسمية الملف او تحميل ملف آخر.',
|
||||
'NO_FILE_SELECTED' => 'لم تقم بإختيار ملف!',
|
||||
'WRONG_F_NAME' => 'اسم الملف "%s" يحتوي على أحرف غير مسموحة .. الرجاء تغيير اسم الملف والمحاولة من جديد ',
|
||||
'FORBID_EXT' => ' الامتداد "%s" غير مسموح ',
|
||||
'SIZE_F_BIG' => 'الحجم للملف "%1$s" يجب أن يكون أقل من %2$s .',
|
||||
#'CANT_CON_FTP' => 'لايمكن الاتصال بـ ',
|
||||
'URL_F_DEL' => 'رابط الحذف',
|
||||
'URL_F_THMB' => 'رابط المصغرة',
|
||||
'URL_F_FILE' => 'رابط الملف',
|
||||
'URL_F_IMG' => 'رابط الصورة المباشر',
|
||||
'URL_F_BBC' => 'رابط للمنتديات',
|
||||
'IMG_DOWNLAODED' => 'تم تحميل الصورة بنجاح',
|
||||
'FILE_DOWNLAODED' => 'تم تحميل الملف بنجاح',
|
||||
'CANT_UPLAOD' => 'خطأ.. لم يتم تحميل الملف "%s" لأسباب غير معروفة',
|
||||
'CANT_DIR_CRT' => 'لم يتم إنشاء مجلد تلقائياً.. قم بإنشاءه انت',
|
||||
'AGREE_RULES' => 'بالضغط على الزر بالاسفل فانت توافق على %1$sشروط الخدمة%2$s.',
|
||||
#'CHANG_TO_URL_FILE' => 'تبديل طريقة التحميل.. رابط أو إدخال',
|
||||
'URL_CANT_GET' => 'خطأ في جلب الملف من الرابط',
|
||||
'ADMINCP' => 'مركز التحكم',
|
||||
#'JUMPTO' => 'انتقل إلى',
|
||||
'GO_BACK_BROWSER' => 'رجوع للخلف',
|
||||
'U_R_BANNED' => 'لقد تم حظر الآي بي هذا..',
|
||||
'U_R_FLOODER' => 'لقد قمت بتخطي عدد مرات عرض الصفحة بالوقت المحدد..',
|
||||
'YES' => 'نعم',
|
||||
'NO' => 'لا',
|
||||
'LANGUAGE' => 'اللغة',
|
||||
'NORMAL' => 'عادي',
|
||||
'STYLE' => 'الستايل',
|
||||
'GROUP' => 'المجموعة',
|
||||
#'UPDATE_FILES' => 'تحديث الملفات',
|
||||
'BY' => 'من',
|
||||
'FILDER' => 'مجلد',
|
||||
'DELETE' => 'حذف',
|
||||
'GUST' => 'زائر',
|
||||
'NAME' => 'الإسم',
|
||||
'CLICKHERE' => 'اضغط هنا',
|
||||
'IP' => 'IP',
|
||||
'TIME' => 'الوقت',
|
||||
'RETURN_HOME' => 'رجوع إلى المركز',
|
||||
'TODAY' => 'اليوم',
|
||||
'DAYS' => 'أيام',
|
||||
'SUBMIT' => 'موافق',
|
||||
'EDIT' => 'تعديل',
|
||||
'DISABLE' => 'تعطيل',
|
||||
'ENABLE' => 'تفعيل',
|
||||
'OPEN' => 'افتح',
|
||||
'NOTE' => 'ملاحظة',
|
||||
'WARN' => 'انتبه',
|
||||
#'BITE' => 'بايت',
|
||||
'KILOBYTE' => 'كيلوبايت',
|
||||
'NOT_SAFE_FILE' => 'نظام كليجا اكتشف أن الملف "%s" غير آمن ويحتوي على أكواد خبيثه .. !!',
|
||||
'ARE_YOU_SURE_DO_THIS' => 'هل أنت متأكد من القيام بهذه العملية؟',
|
||||
'SITE_FOR_MEMBER_ONLY' => 'المركز للأعضاء فقط ، قم بالتسجيل أو بالدخول حتى تتمكن من التحميل.',
|
||||
'AUTH_INTEGRATION_N_UTF8_T' => '%s ليست utf8',
|
||||
'AUTH_INTEGRATION_N_UTF8' => '%s يجب أن يكون ترميز قاعدة البيانات الخاصة به utf8 لكي يتم الربط مع كليجا!.',
|
||||
'SCRIPT_AUTH_PATH_WRONG' => 'مسار السكربت %s الذي تم ربط عضويات كليجا معه خاطئ ,قم بضبطه',
|
||||
'SHOW_MY_FILECP' => 'السماح بعرض ملفاتي',
|
||||
'PASS_CHANGE' => 'تغيير كلمة المرور',
|
||||
'EDIT_U_AVATER' => 'تغيير الصورة الرمزية',
|
||||
'EDIT_U_AVATER_LINK' => 'لتغيير الصورة الرمزية, قم بالدخول الى الموقع %1$s" اضغط هنا "%2$s والتسجيل بالبريد الخاص بك. ',
|
||||
'MOST_EVER_ONLINE' => 'اكثر عدد تواجد للاعضاء بالمركز كان',
|
||||
'ON' => 'في',
|
||||
'LAST_REG' => 'آخر عضو مسجل',
|
||||
'NEW_USER' => 'عضو جديد',
|
||||
'COPYRIGHTS_X' => 'جميع الحقوق محفوظة',
|
||||
'CHECK_ALL' => 'تحديد الكل',
|
||||
'BROSWERF' => 'استعراض الملفات',
|
||||
'REMME' => 'تذكرني',
|
||||
'REMME_EXP' => 'علًم هذا الخيار ان كان جهازك غير مشترك مع غيرك',
|
||||
'HOUR' => 'ساعة',
|
||||
'5HOURS' => '5 ساعات',
|
||||
'DAY' => 'يوم',
|
||||
'WEEK' => 'اسبوع',
|
||||
'MONTH' => 'شهر',
|
||||
'YEAR' => 'سنة',
|
||||
'INVALID_FORM_KEY' => 'نموذج خاطئ , او انك تعديت الوقت المسموح فيه لملأ النموذج، أعد العملية.',
|
||||
'INVALID_GET_KEY' => 'عفوا, هذا الرابط خاص بجلسة انتهت مدتها وتم منعه للامان, اعد المحاولة .',
|
||||
'REFRESH_CAPTCHA' => 'إضغط لتحديث الصورة بأخرى جديدة',
|
||||
'CHOSE_F' => 'فضلا قم بإختيار ملف واحد على الاقل',
|
||||
'FILES_DELETED' => 'تم حذف الملفات المحددة بنجاح !',
|
||||
'ALL_FILES' => 'عدد جميع الملفات',
|
||||
'ALL_IMAGES' => 'عدد جميع الصور',
|
||||
'WAIT_LOADING' => 'فضلاً انتظر جاري رفع الملفات .....',
|
||||
'NOTICECLOSED' => 'تنبيه : المركز مغلق',
|
||||
'UNKNOWN' => 'غير معروف',
|
||||
'WE_UPDATING_KLEEJA_NOW' => 'الموقع مغلق للتطوير والترقية لاخر نسخة , لذا يرجى الصبر ...',
|
||||
'ERROR_TRY_AGAIN' => 'خطأ , حاول مجدداً.',
|
||||
'VIEW' => 'عرض',
|
||||
'NONE' => 'لا شيء',
|
||||
'NOTHING' => 'لا يوجد شيء!',
|
||||
'YOU_HAVE_TO_WAIT' => 'انتظر %s ثانية وبعد انقضاء الفترة الزمنية قم بإعادة رفع الملفات',
|
||||
'REPEAT_PASS' => 'اعد كلمة المرور',
|
||||
'PASS_NEQ_PASS2' => 'كلمات المرور غير متطابقة !',
|
||||
'ADMINS' => 'المسؤولين',
|
||||
'GUESTS' => 'الزوار',
|
||||
'USERS' => 'الاعضاء',
|
||||
'DELETE_INSTALL_FOLDER' => 'لتستطيع استخدام كليجا الآن، قم بحذف مجلد install. لن تعمل كليجا بوجود هذا المجلد.',
|
||||
'HV_NOT_PRVLG_ACCESS' => 'لاتملك صلاحيات للوصول لهذه الصفحة',
|
||||
'DELETE_SUCCESFUL' => 'تم الحذف بنجاح',
|
||||
'STATS' => 'إحصائيات المركز',
|
||||
'STATS_CLOSED' => 'صفحة الإحصائيات معطلة من المدير!',
|
||||
'FILES_ST' => 'تم تحميل ',
|
||||
'FILE' => 'ملف',
|
||||
'IMAGE' => 'صورة',
|
||||
'USERS_ST' => 'عدد الأعضاء',
|
||||
'USER' => 'عضو',
|
||||
'SIZES_ST' => 'حجم جميع الملفات',
|
||||
//'LSTFLE_ST' => 'آخر ملف تم رفعه',
|
||||
'LSTDELST' => 'آخر فحص للملفات الخاملة ',
|
||||
'LAST_1_H' => 'هذه الإحصائيات لقبل ساعة من الآن',
|
||||
'DOWNLAOD' => 'تحميل',
|
||||
'DOWNLOAD' => 'تحميل',
|
||||
'FILE_FOUNDED' => 'تم إيجاد الملف',
|
||||
'WAIT' => 'انتظر رجاءً ..',
|
||||
'CLICK_DOWN' => 'اضغط هنا لتنزيل الملف',
|
||||
'JS_MUST_ON' => 'لا بد من تفعيل الجافا سكربت في متصفحك !',
|
||||
'FILE_INFO' => 'معلومات عن الملف',
|
||||
'FILENAME' => 'اسم الملف',
|
||||
'FILESIZE' => 'حجم الملف',
|
||||
'FILETYPE' => 'نوع الملف',
|
||||
'FILEDATE' => 'تاريخ الرفع',
|
||||
'LAST_DOWN' => 'آخر تحميل',
|
||||
'FILEUPS' => 'عدد التحميلات',
|
||||
'FILEREPORT' => 'ملف مخالف : إرسال إبلاغ عن المحتوى',
|
||||
'FILE_NO_FOUNDED' => 'لم نتمكن من إيجاد الملف!',
|
||||
'IMG_NO_FOUNDED' => 'لم نتمكن من إيجاد الصورة!',
|
||||
'NOT_IMG' => 'ليست صورة.. هذا ملف!',
|
||||
'MORE_F_FILES' => 'هذا آخر حد يمكنك تحميله',
|
||||
'DOWNLOAD_F' => 'رفع الملفات',
|
||||
'DOWNLOAD_T' => 'سحب الملفات من رابط',
|
||||
'PAST_URL_HERE' => 'ألصق الرابط هنا',
|
||||
'SAME_FILE_EXIST' => 'الملف "%s" موجود مسبقاً , قم بإعادة تسمية الملف او تحميل ملف آخر.',
|
||||
'NO_FILE_SELECTED' => 'لم تقم بإختيار ملف!',
|
||||
'WRONG_F_NAME' => 'اسم الملف "%s" يحتوي على أحرف غير مسموحة .. الرجاء تغيير اسم الملف والمحاولة من جديد ',
|
||||
'FORBID_EXT' => ' الامتداد "%s" غير مسموح ',
|
||||
'SIZE_F_BIG' => 'الحجم للملف "%1$s" يجب أن يكون أقل من %2$s .',
|
||||
//'CANT_CON_FTP' => 'لايمكن الاتصال بـ ',
|
||||
'URL_F_DEL' => 'رابط الحذف',
|
||||
'URL_F_THMB' => 'رابط المصغرة',
|
||||
'URL_F_FILE' => 'رابط الملف',
|
||||
'URL_F_IMG' => 'رابط الصورة المباشر',
|
||||
'URL_F_BBC' => 'رابط للمنتديات',
|
||||
'IMG_DOWNLAODED' => 'تم تحميل الصورة بنجاح',
|
||||
'FILE_DOWNLAODED' => 'تم تحميل الملف بنجاح',
|
||||
'CANT_UPLAOD' => 'خطأ.. لم يتم تحميل الملف "%s" لأسباب غير معروفة',
|
||||
'CANT_DIR_CRT' => 'لم يتم إنشاء مجلد تلقائياً.. قم بإنشاءه انت',
|
||||
'AGREE_RULES' => 'بالضغط على الزر بالاسفل فانت توافق على %1$sشروط الخدمة%2$s.',
|
||||
//'CHANG_TO_URL_FILE' => 'تبديل طريقة التحميل.. رابط أو إدخال',
|
||||
'URL_CANT_GET' => 'خطأ في جلب الملف من الرابط',
|
||||
'ADMINCP' => 'مركز التحكم',
|
||||
//'JUMPTO' => 'انتقل إلى',
|
||||
'GO_BACK_BROWSER' => 'رجوع للخلف',
|
||||
'U_R_BANNED' => 'لقد تم حظر الآي بي هذا..',
|
||||
'U_R_FLOODER' => 'لقد قمت بتخطي عدد مرات عرض الصفحة بالوقت المحدد..',
|
||||
'YES' => 'نعم',
|
||||
'NO' => 'لا',
|
||||
'LANGUAGE' => 'اللغة',
|
||||
'NORMAL' => 'عادي',
|
||||
'STYLE' => 'الستايل',
|
||||
'GROUP' => 'المجموعة',
|
||||
//'UPDATE_FILES' => 'تحديث الملفات',
|
||||
'BY' => 'من',
|
||||
'FILDER' => 'مجلد',
|
||||
'DELETE' => 'حذف',
|
||||
'GUST' => 'زائر',
|
||||
'NAME' => 'الإسم',
|
||||
'CLICKHERE' => 'اضغط هنا',
|
||||
'IP' => 'IP',
|
||||
'TIME' => 'الوقت',
|
||||
'RETURN_HOME' => 'رجوع إلى المركز',
|
||||
'TODAY' => 'اليوم',
|
||||
'DAYS' => 'أيام',
|
||||
'SUBMIT' => 'موافق',
|
||||
'EDIT' => 'تعديل',
|
||||
'DISABLE' => 'تعطيل',
|
||||
'ENABLE' => 'تفعيل',
|
||||
'OPEN' => 'افتح',
|
||||
'NOTE' => 'ملاحظة',
|
||||
'WARN' => 'انتبه',
|
||||
//'BITE' => 'بايت',
|
||||
'KILOBYTE' => 'كيلوبايت',
|
||||
'NOT_SAFE_FILE' => 'نظام كليجا اكتشف أن الملف "%s" غير آمن ويحتوي على أكواد خبيثه .. !!',
|
||||
'ARE_YOU_SURE_DO_THIS' => 'هل أنت متأكد من القيام بهذه العملية؟',
|
||||
'SITE_FOR_MEMBER_ONLY' => 'المركز للأعضاء فقط ، قم بالتسجيل أو بالدخول حتى تتمكن من التحميل.',
|
||||
'AUTH_INTEGRATION_N_UTF8_T' => '%s ليست utf8',
|
||||
'AUTH_INTEGRATION_N_UTF8' => '%s يجب أن يكون ترميز قاعدة البيانات الخاصة به utf8 لكي يتم الربط مع كليجا!.',
|
||||
'SCRIPT_AUTH_PATH_WRONG' => 'مسار السكربت %s الذي تم ربط عضويات كليجا معه خاطئ ,قم بضبطه',
|
||||
'SHOW_MY_FILECP' => 'السماح بعرض ملفاتي',
|
||||
'PASS_CHANGE' => 'تغيير كلمة المرور',
|
||||
'EDIT_U_AVATER' => 'تغيير الصورة الرمزية',
|
||||
'EDIT_U_AVATER_LINK' => 'لتغيير الصورة الرمزية, قم بالدخول الى الموقع %1$s" اضغط هنا "%2$s والتسجيل بالبريد الخاص بك. ',
|
||||
'MOST_EVER_ONLINE' => 'اكثر عدد تواجد للاعضاء بالمركز كان',
|
||||
'ON' => 'في',
|
||||
'LAST_REG' => 'آخر عضو مسجل',
|
||||
'NEW_USER' => 'عضو جديد',
|
||||
'COPYRIGHTS_X' => 'جميع الحقوق محفوظة',
|
||||
'CHECK_ALL' => 'تحديد الكل',
|
||||
'BROSWERF' => 'استعراض الملفات',
|
||||
'REMME' => 'تذكرني',
|
||||
'REMME_EXP' => 'علًم هذا الخيار ان كان جهازك غير مشترك مع غيرك',
|
||||
'HOUR' => 'ساعة',
|
||||
'5HOURS' => '5 ساعات',
|
||||
'DAY' => 'يوم',
|
||||
'WEEK' => 'اسبوع',
|
||||
'MONTH' => 'شهر',
|
||||
'YEAR' => 'سنة',
|
||||
'INVALID_FORM_KEY' => 'نموذج خاطئ , او انك تعديت الوقت المسموح فيه لملأ النموذج، أعد العملية.',
|
||||
'INVALID_GET_KEY' => 'عفوا, هذا الرابط خاص بجلسة انتهت مدتها وتم منعه للامان, اعد المحاولة .',
|
||||
'REFRESH_CAPTCHA' => 'إضغط لتحديث الصورة بأخرى جديدة',
|
||||
'CHOSE_F' => 'فضلا قم بإختيار ملف واحد على الاقل',
|
||||
'FILES_DELETED' => 'تم حذف الملفات المحددة بنجاح !',
|
||||
'ALL_FILES' => 'عدد جميع الملفات',
|
||||
'ALL_IMAGES' => 'عدد جميع الصور',
|
||||
'WAIT_LOADING' => 'فضلاً انتظر جاري رفع الملفات .....',
|
||||
'NOTICECLOSED' => 'تنبيه : المركز مغلق',
|
||||
'UNKNOWN' => 'غير معروف',
|
||||
'WE_UPDATING_KLEEJA_NOW' => 'الموقع مغلق للتطوير والترقية لاخر نسخة , لذا يرجى الصبر ...',
|
||||
'ERROR_TRY_AGAIN' => 'خطأ , حاول مجدداً.',
|
||||
'VIEW' => 'عرض',
|
||||
'NONE' => 'لا شيء',
|
||||
'NOTHING' => 'لا يوجد شيء!',
|
||||
'YOU_HAVE_TO_WAIT' => 'انتظر %s ثانية وبعد انقضاء الفترة الزمنية قم بإعادة رفع الملفات',
|
||||
'REPEAT_PASS' => 'اعد كلمة المرور',
|
||||
'PASS_NEQ_PASS2' => 'كلمات المرور غير متطابقة !',
|
||||
'ADMINS' => 'المسؤولين',
|
||||
'GUESTS' => 'الزوار',
|
||||
'USERS' => 'الاعضاء',
|
||||
'DELETE_INSTALL_FOLDER' => 'لتستطيع استخدام كليجا الآن، قم بحذف مجلد install. لن تعمل كليجا بوجود هذا المجلد.',
|
||||
'HV_NOT_PRVLG_ACCESS' => 'لاتملك صلاحيات للوصول لهذه الصفحة',
|
||||
|
||||
|
||||
'W_PERIODS_0' => 'ثانية',
|
||||
@@ -260,14 +260,14 @@ return array(
|
||||
'W_PERIODS_6' => 'سنة',
|
||||
'W_PERIODS_7' => 'عقد',
|
||||
|
||||
'W_PERIODS_DP_0'=> "ثانيتين",
|
||||
'W_PERIODS_DP_1'=> "دقيقتين",
|
||||
'W_PERIODS_DP_2'=> "ساعتين",
|
||||
'W_PERIODS_DP_3'=> "يومين",
|
||||
'W_PERIODS_DP_4'=> "أسبوعين",
|
||||
'W_PERIODS_DP_5'=> "شهرين",
|
||||
'W_PERIODS_DP_6'=> "سنتين",
|
||||
'W_PERIODS_DP_7'=> "عقدين",
|
||||
'W_PERIODS_DP_0'=> 'ثانيتين',
|
||||
'W_PERIODS_DP_1'=> 'دقيقتين',
|
||||
'W_PERIODS_DP_2'=> 'ساعتين',
|
||||
'W_PERIODS_DP_3'=> 'يومين',
|
||||
'W_PERIODS_DP_4'=> 'أسبوعين',
|
||||
'W_PERIODS_DP_5'=> 'شهرين',
|
||||
'W_PERIODS_DP_6'=> 'سنتين',
|
||||
'W_PERIODS_DP_7'=> 'عقدين',
|
||||
|
||||
'W_PERIODS_P_0' => 'ثواني',
|
||||
'W_PERIODS_P_1' => 'دقائق',
|
||||
@@ -279,23 +279,23 @@ return array(
|
||||
'W_PERIODS_P_7' => 'عقود',
|
||||
|
||||
|
||||
'W_FROM' => 'منذ',
|
||||
'W_AGO' => 'مضت',
|
||||
'TIME_PM' => 'م',
|
||||
'TIME_AM' => 'ص',
|
||||
'NOT_YET' => 'ليس بعد!',
|
||||
'NOT_FOUND' => 'إما انه غير موجود , او تم حذفه من قبل المستخدم نفسه , او الادارة , او هناك خطأء في فتح الملف!.',
|
||||
'TIME_ZONE' => 'المنطقة الزمنية',
|
||||
'OR' => 'او',
|
||||
'AND' => 'و',
|
||||
'CHANGE' => 'تغيير',
|
||||
'FOR' => 'لـ',
|
||||
'ALL' => 'الجميع',
|
||||
'NOW' => 'الآن',
|
||||
'W_FROM' => 'منذ',
|
||||
'W_AGO' => 'مضت',
|
||||
'TIME_PM' => 'م',
|
||||
'TIME_AM' => 'ص',
|
||||
'NOT_YET' => 'ليس بعد!',
|
||||
'NOT_FOUND' => 'إما انه غير موجود , او تم حذفه من قبل المستخدم نفسه , او الادارة , او هناك خطأء في فتح الملف!.',
|
||||
'TIME_ZONE' => 'المنطقة الزمنية',
|
||||
'OR' => 'او',
|
||||
'AND' => 'و',
|
||||
'CHANGE' => 'تغيير',
|
||||
'FOR' => 'لـ',
|
||||
'ALL' => 'الجميع',
|
||||
'NOW' => 'الآن',
|
||||
'EMAIL_CHANGE_REQ_PASS' => 'لتغيير بريدك الإلكتروني يجب أن تقوم بكتابة كلمة مرورك الحالية.',
|
||||
'DRAG_AND_DROP' => 'جر وأسقط ملف هنا للرفع…',
|
||||
'OR_MANUAL_SELECT' => 'أو قم بالضغط هنا <em>لإختيار</em> ملف يدوياً..',
|
||||
//3.0.3
|
||||
'NOTIFICATIONS' => 'تنبيهات',
|
||||
'KJ_TWEETS' => 'تغريدات كليجا' ,
|
||||
);
|
||||
'DRAG_AND_DROP' => 'جر وأسقط ملف هنا للرفع…',
|
||||
'OR_MANUAL_SELECT' => 'أو قم بالضغط هنا <em>لإختيار</em> ملف يدوياً..',
|
||||
//3.0.3
|
||||
'NOTIFICATIONS' => 'تنبيهات',
|
||||
'KJ_TWEETS' => 'تغريدات كليجا' ,
|
||||
];
|
||||
|
||||
@@ -5,113 +5,113 @@
|
||||
//
|
||||
|
||||
|
||||
return array(
|
||||
'DIR' =>'rtl',
|
||||
'INST_INSTALL_WIZARD' =>'معالج تثبيت كليجا',
|
||||
'INST_INSTALL_CLEAN_VER' =>"تثبيت نسخة جديدة ",
|
||||
'INST_UPDATE_P_VER' =>"تحديث نسخة سابقة ",
|
||||
'INST_AGR_LICENSE' =>'أوافق على شروط ترخيص إستخدام كليجا .',
|
||||
'INST_NEXT' =>'التالي',
|
||||
'INST_PREVIOUS' =>'السابق',
|
||||
'INST_SITE_INFO' =>'أدخل بيانات المركز',
|
||||
'INST_ADMIN_INFO' =>'أدخل بيانات مدير المركز',
|
||||
'INST_CHANG_CONFIG' =>'بعض البيانات المهمة ناقصة إملأ ملف config.php',
|
||||
'INST_CONNCET_ERR' =>'لا يمكن الإتصال ...',
|
||||
return [
|
||||
'DIR' => 'rtl',
|
||||
'INST_INSTALL_WIZARD' => 'معالج تثبيت كليجا',
|
||||
'INST_INSTALL_CLEAN_VER' => 'تثبيت نسخة جديدة ',
|
||||
'INST_UPDATE_P_VER' => 'تحديث نسخة سابقة ',
|
||||
'INST_AGR_LICENSE' => 'أوافق على شروط ترخيص إستخدام كليجا .',
|
||||
'INST_NEXT' => 'التالي',
|
||||
'INST_PREVIOUS' => 'السابق',
|
||||
'INST_SITE_INFO' => 'أدخل بيانات المركز',
|
||||
'INST_ADMIN_INFO' => 'أدخل بيانات مدير المركز',
|
||||
'INST_CHANG_CONFIG' => 'بعض البيانات المهمة ناقصة إملأ ملف config.php',
|
||||
'INST_CONNCET_ERR' => 'لا يمكن الإتصال ...',
|
||||
|
||||
'INST_NO_WRTABLE' =>'مجلد غير قابل للكتابة .. يحتاج تصريح 777',
|
||||
'INST_GOOD_GO' =>'تم التأكد من المتغييرات والإتصال والتراخيص .. تابع',
|
||||
'INST_MSGINS' =>'يمكنك تحميل ماتشاء وفق المسموح به .. شكراُ لزيارتك',
|
||||
'INST_CRT_CALL' =>'تم إنشاء جدول المراسلات',
|
||||
'INST_CRT_ONL' =>'تم إنشاء جدول المتواجدون الآن',
|
||||
'INST_CRT_REPRS' =>'تم إنشاء جدول التبليغات',
|
||||
'INST_CRT_STS' =>'تم إنشاء جدول الإحصائيات',
|
||||
'INST_CRT_USRS' =>'تم إنشاء جدول الأعضاء',
|
||||
'INST_CRT_ADM' =>'تم إدخال معلومات المسؤول',
|
||||
'INST_CRT_FLS' =>'تم إنشاء جدول الملفات',
|
||||
'INST_CRT_CNF' =>'تم إنشاء جدول الإعدادات',
|
||||
'INST_CRT_EXT' =>'تم إنشاء جدول الإمتدادات',
|
||||
'INST_CRT_HKS' =>'تم إنشاء جدول الخطاطيف',
|
||||
'INST_CRT_LNG' =>'تم إنشاء جدول اللغة',
|
||||
'INST_CRT_PLG' =>'تم إنشاء جدول الإضافات',
|
||||
'INST_SQL_ERR' =>'خطأ في تنفيذ الإستعلام',
|
||||
'INST_FINISH_SQL' =>'تم تثبيت كليجا بنجاح',
|
||||
'INST_NOTES' =>'ملاحظات التثبيت',
|
||||
'INST_END' =>'معالج التثبيت انتهى، يجب الآن حذف مجلد INSTALL <span style="color:red">(الموقع لن يعمل في حال وجود المجلد)</span>',
|
||||
'INST_NOTE_D' =>'أي ملاحظات أو مشاكل تتعلق بأداء كليجا، نرجوا التواصل مع مطوري كليجا!',
|
||||
'INST_FINISH_ERRSQL' =>'هناك مشكلة تعيق التثبيت، تأكد من حساب مستخدم القاعدة وحاول مجدداً او استفسر من مطوري كليجا',
|
||||
'INST_KLEEJADEVELOPERS' =>'شكراً لإستخدامك كليجا ... مع أحلى و أطيب التمنيات .. من فريق عمل كليجا',
|
||||
'SITENAME' =>'اسم الموقع',
|
||||
'SITEURL' =>'رابط الموقع',
|
||||
'SITEMAIL' =>'بريد الموقع',
|
||||
'USERNAME' =>'اسم المستخدم',
|
||||
'PASSWORD' =>'كلمة المرور',
|
||||
'PASSWORD2' =>'أعد كلمة المرور',
|
||||
'EMAIL' =>'البريد الالكتروني',
|
||||
'INDEX' =>'الرئيسيه',
|
||||
'ADMINCP' =>'لوحة التحكم',
|
||||
'EMPTY_FIELDS' =>'هناك حقول مهمة, تركتها فارغة!',
|
||||
'WRONG_EMAIL' =>'البريد الإلكتروني خاطئ!',
|
||||
//
|
||||
|
||||
'DB_INFO_NW' =>'أدخل بيانات القاعدة بشكل صحيح ، واضغط على (تصدير الملف)وسيقوم المعالج بتصدير ملف config.php لتضعه في مجلد السكربت الرئيسي كما يتضح لك بالصورة!',
|
||||
'DB_INFO' =>'أدخل معلومات قاعدة البيانات',
|
||||
'DB_SERVER' =>'الخادم',
|
||||
'DB_TYPE' =>'نوع قاعدة البيانات',
|
||||
'DB_TYPE_MYSQL' =>'MySQL القياسي',
|
||||
'DB_TYPE_MYSQLI' =>'MySQL المطور',
|
||||
'DB_USER' =>'اسم المستخدم لقاعدة البيانات',
|
||||
'DB_PASSWORD' =>'كلمة المرور لقاعدة البيانات',
|
||||
'DB_NAME' =>'إسم قاعدة البيانات',
|
||||
'DB_PREFIX' =>'بادئة الجداول',
|
||||
'VALIDATING_FORM_WRONG' =>'يبدو أنك تركت أحد الحقول المطلوبة فارغاً ...',
|
||||
'CONFIG_EXISTS' =>'تم إيجاد ملف config.php قم بالمتابعة ...',
|
||||
'INST_SUBMIT_CONFIGOK' =>'أرفع ملف config.php في دليل كليجا الرئيسي وتابع عملية التثبيت !',
|
||||
'INST_EXPORT' =>'تصدير الملف',
|
||||
'INST_OTHER_INFO' =>'معلومات اخرى',
|
||||
'URLS_TYPES' =>'شكل روابط الملفات',
|
||||
'DEFAULT' =>'الافتراضي - ينصح به',
|
||||
'FILENAME_URL' =>'اسماء الملفات',
|
||||
'DIRECT_URL' =>'روابط مباشرة - لايتم تسجيل إحصائيات',
|
||||
'LIKE_THIS' =>'مثال',
|
||||
|
||||
//
|
||||
'FUNCTIONS_CHECK' =>'فحص الدوال',
|
||||
'RE_CHECK' =>'إعادة الفحص',
|
||||
'FUNCTION_IS_NOT_EXISTS' =>'الدالة %s مُعطلة لديك.',
|
||||
'FUNCTION_IS_EXISTS' =>'الدالة %s مُفعلة لديك.',
|
||||
'FUNCTION_DISC_UNLINK' =>'دالة unlink يتم استخدامها لحذف الملفات وأيضا لحذف ملفات الكاش وتحديثها.',
|
||||
'FUNCTION_DISC_GD' =>'دالة imagecreatetruecolor هي من دوال مكتبة GD التي تستخدم لإنشاء مصغرات الصور والكود الأمني , عدم وجود الداله غالبا يعني عدم تواجد مكتبه GD على السيرفر .. ',
|
||||
'FUNCTION_DISC_FOPEN' =>'دالة fopen تستخدم في التحكم بالستايل والملفات في كليجا.',
|
||||
'FUNCTION_DISC_MUF' =>'دالة move_uploaded_file تستخدم لتحميل الملفات وهي اهم دالة في السكربت.',
|
||||
//
|
||||
'ADVICES_CHECK' =>'فحص متقدم (يمكن تثبيت كليجا بدون تحقق هذا الفحص , لكنه مجرد معلومات لك)',
|
||||
'ADVICES_REGISTER_GLOBALS' =>'<span style="color:red;padding:0 6px">خاصية register_globals مفعلة !</span><br /> هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً .',
|
||||
'ADVICES_MAGIC_QUOTES' =>'<span style="color:red;padding:0 6px">خاصية magic_quotes مفعله !</span><br /> هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً ..',
|
||||
|
||||
//UPDATOR
|
||||
'INST_CHOOSE_UPDATE_FILE' =>'قم بإختيار التحديث المناسب لك ومن ثم تابع التحديث ..',
|
||||
'INST_ERR_NO_SELECTED_UPFILE_GOOD' =>'ملف التحديث غير مناسب أو أنه غير موجود من الأساس ! ..',
|
||||
'INST_UPDATE_CUR_VER_IS_UP' =>'نسختك الحالية محدثة لهذا التحديث المحدد.',
|
||||
|
||||
'INST_NOTES_UPDATE' =>'ملاحظات التحديث',
|
||||
'INST_NO_WRTABLE' => 'مجلد غير قابل للكتابة .. يحتاج تصريح 777',
|
||||
'INST_GOOD_GO' => 'تم التأكد من المتغييرات والإتصال والتراخيص .. تابع',
|
||||
'INST_MSGINS' => 'يمكنك تحميل ماتشاء وفق المسموح به .. شكراُ لزيارتك',
|
||||
'INST_CRT_CALL' => 'تم إنشاء جدول المراسلات',
|
||||
'INST_CRT_ONL' => 'تم إنشاء جدول المتواجدون الآن',
|
||||
'INST_CRT_REPRS' => 'تم إنشاء جدول التبليغات',
|
||||
'INST_CRT_STS' => 'تم إنشاء جدول الإحصائيات',
|
||||
'INST_CRT_USRS' => 'تم إنشاء جدول الأعضاء',
|
||||
'INST_CRT_ADM' => 'تم إدخال معلومات المسؤول',
|
||||
'INST_CRT_FLS' => 'تم إنشاء جدول الملفات',
|
||||
'INST_CRT_CNF' => 'تم إنشاء جدول الإعدادات',
|
||||
'INST_CRT_EXT' => 'تم إنشاء جدول الإمتدادات',
|
||||
'INST_CRT_HKS' => 'تم إنشاء جدول الخطاطيف',
|
||||
'INST_CRT_LNG' => 'تم إنشاء جدول اللغة',
|
||||
'INST_CRT_PLG' => 'تم إنشاء جدول الإضافات',
|
||||
'INST_SQL_ERR' => 'خطأ في تنفيذ الإستعلام',
|
||||
'INST_FINISH_SQL' => 'تم تثبيت كليجا بنجاح',
|
||||
'INST_NOTES' => 'ملاحظات التثبيت',
|
||||
'INST_END' => 'معالج التثبيت انتهى، يجب الآن حذف مجلد INSTALL <span style="color:red">(الموقع لن يعمل في حال وجود المجلد)</span>',
|
||||
'INST_NOTE_D' => 'أي ملاحظات أو مشاكل تتعلق بأداء كليجا، نرجوا التواصل مع مطوري كليجا!',
|
||||
'INST_FINISH_ERRSQL' => 'هناك مشكلة تعيق التثبيت، تأكد من حساب مستخدم القاعدة وحاول مجدداً او استفسر من مطوري كليجا',
|
||||
'INST_KLEEJADEVELOPERS' => 'شكراً لإستخدامك كليجا ... مع أحلى و أطيب التمنيات .. من فريق عمل كليجا',
|
||||
'SITENAME' => 'اسم الموقع',
|
||||
'SITEURL' => 'رابط الموقع',
|
||||
'SITEMAIL' => 'بريد الموقع',
|
||||
'USERNAME' => 'اسم المستخدم',
|
||||
'PASSWORD' => 'كلمة المرور',
|
||||
'PASSWORD2' => 'أعد كلمة المرور',
|
||||
'EMAIL' => 'البريد الالكتروني',
|
||||
'INDEX' => 'الرئيسيه',
|
||||
'ADMINCP' => 'لوحة التحكم',
|
||||
'EMPTY_FIELDS' => 'هناك حقول مهمة, تركتها فارغة!',
|
||||
'WRONG_EMAIL' => 'البريد الإلكتروني خاطئ!',
|
||||
|
||||
|
||||
|
||||
'INST_UPDATE_IS_FINISH' =>'معالج التحديث انتهى .. يجب الآن حذف مجلد INSTALL و متابعة عملك في كليجا .',
|
||||
'DB_INFO_NW' => 'أدخل بيانات القاعدة بشكل صحيح ، واضغط على (تصدير الملف)وسيقوم المعالج بتصدير ملف config.php لتضعه في مجلد السكربت الرئيسي كما يتضح لك بالصورة!',
|
||||
'DB_INFO' => 'أدخل معلومات قاعدة البيانات',
|
||||
'DB_SERVER' => 'الخادم',
|
||||
'DB_TYPE' => 'نوع قاعدة البيانات',
|
||||
'DB_TYPE_MYSQL' => 'MySQL القياسي',
|
||||
'DB_TYPE_MYSQLI' => 'MySQL المطور',
|
||||
'DB_USER' => 'اسم المستخدم لقاعدة البيانات',
|
||||
'DB_PASSWORD' => 'كلمة المرور لقاعدة البيانات',
|
||||
'DB_NAME' => 'إسم قاعدة البيانات',
|
||||
'DB_PREFIX' => 'بادئة الجداول',
|
||||
'VALIDATING_FORM_WRONG' => 'يبدو أنك تركت أحد الحقول المطلوبة فارغاً ...',
|
||||
'CONFIG_EXISTS' => 'تم إيجاد ملف config.php قم بالمتابعة ...',
|
||||
'INST_SUBMIT_CONFIGOK' => 'أرفع ملف config.php في دليل كليجا الرئيسي وتابع عملية التثبيت !',
|
||||
'INST_EXPORT' => 'تصدير الملف',
|
||||
'INST_OTHER_INFO' => 'معلومات اخرى',
|
||||
'URLS_TYPES' => 'شكل روابط الملفات',
|
||||
'DEFAULT' => 'الافتراضي - ينصح به',
|
||||
'FILENAME_URL' => 'اسماء الملفات',
|
||||
'DIRECT_URL' => 'روابط مباشرة - لايتم تسجيل إحصائيات',
|
||||
'LIKE_THIS' => 'مثال',
|
||||
|
||||
'INST_PHP_LESSMIN' =>'لتثبيت كليجا يجب على الأقل أن يكون لديك اصدار PHP %1$s , وانت لديك اصدار PHP %2$s.',
|
||||
'INST_MYSQL_LESSMIN' =>'لتثبيت كليجا يجب على الأقل أن يكون لديك اصدار MYSQL %1$s , وانت لديك اصدار MYSQL %2$s.',
|
||||
'IS_IT_OFFICIAL' =>'هل قمت بتحميل النسخة من الموقع الرسمي Kleeja.com ؟',
|
||||
'IS_IT_OFFICIAL_DESC' =>'يصلنا الكثير من الشكاوي والتساؤلات عن سبب بعض المشاكل التي تحدث في بعض النسخ ولا نستطيع معرفة المشكلة غالباً , لكن بعد البحث وجدنا ان هناك نسخاً يتم تحميلها من مواقع اخرى غير رسمية وتكون اما معدلة بطريقة بدائية او مزروع داخلها اكواد خبيثة.<span class="sure">لذا , هل انت متأكد من ان نسختك هذه تم تحميلها من الموقع الرسمي : kleeja.com ؟</span>',
|
||||
|
||||
'INST_WHAT_IS_KLEEJA_T' =>'ماهي كليجا ؟',
|
||||
'INST_WHAT_IS_KLEEJA' =>'Kleeja تنطق عربياً "كليجا" ! وكتعريف مبسط "كليجا" سكربت رفع ملفات مجاني يأتي مع خصائص فريدة لمساعدة أصحاب المواقع بإمتلاك مركز تحميل قوي ويعتمد عليه , والحقيقة أن "كليجا" سكربت ضخم الامكانيات سهل الإدارة تم بناء نظام الحماية على مستوى عالي ويملك من الأنظمة المعقدة ما يؤمن لموقعك الحماية التامة بإذن الله !',
|
||||
'INST_SPECIAL_KLEEJA' =>'من أهم مميزات كليجا !',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' =>'1. نظام أعضاء قوي تستطيع ربطه بأغلب السكربتات المستخدمة في المواقع الاجتماعية .<br />2. لوحة تحكم مذهلة ليس فقط للتحكم بالملفات ولكن للتحكم بكل صغيرة وكبيرة .<br />3. نظام الستايلات البسيط يجعلك تستطيع ان تصنع ستايلك بنفسك.<br />4. مع كليجا ونظام الإضافات البرمجية تستطيع أن تقوم بتركيب الكثير من الاضافات الرائعة .<br />5. ليس هذا فحسب بل كليجا تملك الكثير .. لتعرف أكثر رجاءاً قم بزيارة صفحه <a target="_blank" href="http://ar.kleeja.com/features/">معلومات ومميزات</a> .',
|
||||
'YES' =>'نعم',
|
||||
'NO' =>'لا',
|
||||
'FUNCTIONS_CHECK' => 'فحص الدوال',
|
||||
'RE_CHECK' => 'إعادة الفحص',
|
||||
'FUNCTION_IS_NOT_EXISTS' => 'الدالة %s مُعطلة لديك.',
|
||||
'FUNCTION_IS_EXISTS' => 'الدالة %s مُفعلة لديك.',
|
||||
'FUNCTION_DISC_UNLINK' => 'دالة unlink يتم استخدامها لحذف الملفات وأيضا لحذف ملفات الكاش وتحديثها.',
|
||||
'FUNCTION_DISC_GD' => 'دالة imagecreatetruecolor هي من دوال مكتبة GD التي تستخدم لإنشاء مصغرات الصور والكود الأمني , عدم وجود الداله غالبا يعني عدم تواجد مكتبه GD على السيرفر .. ',
|
||||
'FUNCTION_DISC_FOPEN' => 'دالة fopen تستخدم في التحكم بالستايل والملفات في كليجا.',
|
||||
'FUNCTION_DISC_MUF' => 'دالة move_uploaded_file تستخدم لتحميل الملفات وهي اهم دالة في السكربت.',
|
||||
|
||||
'KLEEJA_TEAM_MSG_NAME' =>'فريق تطوير كليجا',
|
||||
'KLEEJA_TEAM_MSG_TEXT' =>"شكراً لاختيارك سكربت الرفع الأول كليجا\n نتمنى حقا ان تستمتع بالسكربت .\nhttp://www.kleeja.com",
|
||||
'ADVICES_CHECK' => 'فحص متقدم (يمكن تثبيت كليجا بدون تحقق هذا الفحص , لكنه مجرد معلومات لك)',
|
||||
'ADVICES_REGISTER_GLOBALS' => '<span style="color:red;padding:0 6px">خاصية register_globals مفعلة !</span><br /> هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً .',
|
||||
'ADVICES_MAGIC_QUOTES' => '<span style="color:red;padding:0 6px">خاصية magic_quotes مفعله !</span><br /> هذه الخاصية غير محبب تفعيلها ويفضل تعطيلها , ومع هذا فكليجا تحاول تعطيل أثارها برمجياً ..',
|
||||
|
||||
);
|
||||
//UPDATOR
|
||||
'INST_CHOOSE_UPDATE_FILE' => 'قم بإختيار التحديث المناسب لك ومن ثم تابع التحديث ..',
|
||||
'INST_ERR_NO_SELECTED_UPFILE_GOOD' => 'ملف التحديث غير مناسب أو أنه غير موجود من الأساس ! ..',
|
||||
'INST_UPDATE_CUR_VER_IS_UP' => 'نسختك الحالية محدثة لهذا التحديث المحدد.',
|
||||
|
||||
'INST_NOTES_UPDATE' => 'ملاحظات التحديث',
|
||||
|
||||
|
||||
|
||||
'INST_UPDATE_IS_FINISH' => 'معالج التحديث انتهى .. يجب الآن حذف مجلد INSTALL و متابعة عملك في كليجا .',
|
||||
|
||||
'INST_PHP_LESSMIN' => 'لتثبيت كليجا يجب على الأقل أن يكون لديك اصدار PHP %1$s , وانت لديك اصدار PHP %2$s.',
|
||||
'INST_MYSQL_LESSMIN' => 'لتثبيت كليجا يجب على الأقل أن يكون لديك اصدار MYSQL %1$s , وانت لديك اصدار MYSQL %2$s.',
|
||||
'IS_IT_OFFICIAL' => 'هل قمت بتحميل النسخة من الموقع الرسمي Kleeja.com ؟',
|
||||
'IS_IT_OFFICIAL_DESC' => 'يصلنا الكثير من الشكاوي والتساؤلات عن سبب بعض المشاكل التي تحدث في بعض النسخ ولا نستطيع معرفة المشكلة غالباً , لكن بعد البحث وجدنا ان هناك نسخاً يتم تحميلها من مواقع اخرى غير رسمية وتكون اما معدلة بطريقة بدائية او مزروع داخلها اكواد خبيثة.<span class="sure">لذا , هل انت متأكد من ان نسختك هذه تم تحميلها من الموقع الرسمي : kleeja.com ؟</span>',
|
||||
|
||||
'INST_WHAT_IS_KLEEJA_T' => 'ماهي كليجا ؟',
|
||||
'INST_WHAT_IS_KLEEJA' => 'Kleeja تنطق عربياً "كليجا" ! وكتعريف مبسط "كليجا" سكربت رفع ملفات مجاني يأتي مع خصائص فريدة لمساعدة أصحاب المواقع بإمتلاك مركز تحميل قوي ويعتمد عليه , والحقيقة أن "كليجا" سكربت ضخم الامكانيات سهل الإدارة تم بناء نظام الحماية على مستوى عالي ويملك من الأنظمة المعقدة ما يؤمن لموقعك الحماية التامة بإذن الله !',
|
||||
'INST_SPECIAL_KLEEJA' => 'من أهم مميزات كليجا !',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' => '1. نظام أعضاء قوي تستطيع ربطه بأغلب السكربتات المستخدمة في المواقع الاجتماعية .<br />2. لوحة تحكم مذهلة ليس فقط للتحكم بالملفات ولكن للتحكم بكل صغيرة وكبيرة .<br />3. نظام الستايلات البسيط يجعلك تستطيع ان تصنع ستايلك بنفسك.<br />4. مع كليجا ونظام الإضافات البرمجية تستطيع أن تقوم بتركيب الكثير من الاضافات الرائعة .<br />5. ليس هذا فحسب بل كليجا تملك الكثير .. لتعرف أكثر رجاءاً قم بزيارة صفحه <a target="_blank" href="http://ar.kleeja.com/features/">معلومات ومميزات</a> .',
|
||||
'YES' => 'نعم',
|
||||
'NO' => 'لا',
|
||||
|
||||
'KLEEJA_TEAM_MSG_NAME' => 'فريق تطوير كليجا',
|
||||
'KLEEJA_TEAM_MSG_TEXT' => "شكراً لاختيارك سكربت الرفع الأول كليجا\n نتمنى حقا ان تستمتع بالسكربت .\nhttp://www.kleeja.com",
|
||||
|
||||
];
|
||||
|
||||
514
lang/en/acp.php
514
lang/en/acp.php
@@ -4,281 +4,281 @@
|
||||
// English
|
||||
//
|
||||
|
||||
return array(
|
||||
'U_NOT_ADMIN' => 'You do not have the administration permissions',
|
||||
'UPDATE_CONFIG' => 'Update Settings',
|
||||
'NO_CHANGE' => 'Do NOT change',
|
||||
'CHANGE_MD5' => 'Change using MD5 (8c7dd922ad47494fc02c388e12c00eac.png)',
|
||||
'CHANGE_TIME' => 'Change using TIME (1501440381.png)',
|
||||
'SITENAME' => 'Service name',
|
||||
'SITEMAIL' => 'Email address',
|
||||
'SITEMAIL2' => 'Email address of reports',
|
||||
'SITEURL' => 'Service URL with / at the end',
|
||||
'FOLDERNAME' => 'Folder name for uploaded files <small>(you can use {year}, {month}, {day} ,{week} ,{username})</small>',
|
||||
'PREFIXNAME' => 'Files name prefix <small>(you can also use {rand:4} , {date:d_Y})</small>',
|
||||
'FILESNUM' => 'Number of upload input fields',
|
||||
'FILESNUM_SHOW' => 'Show all upload inputs',
|
||||
'SITECLOSE' => 'Shutdown service',
|
||||
'CLOSEMSG' => 'Shutdown message',
|
||||
'DECODE' => 'Change file name',
|
||||
'SEC_DOWN' => 'Waiting period <small>(in Seconds, before download button appears)</small>',
|
||||
'STATFOOTER' => 'Page statistics in footer',
|
||||
'GZIP' => 'use gzip',
|
||||
'GOOGLEANALYTICS' => '<a href="http://www.google.com/analytics" target="_kleeja"><span style="color:orange">Google</span> Analytics</a>',
|
||||
'WELCOME_MSG' => 'Welcome message',
|
||||
'USER_SYSTEM' => 'Users system',
|
||||
'TOTAL_SIZE' => 'Max service size (Megabytes)',
|
||||
'THUMBS_IMGS' => 'thumbnails Dimensions (Width x Height)',
|
||||
'WRITE_IMGS' => 'Enable image watermark',
|
||||
'ID_FORM' => 'Files URLs form <small>(No stats or protection for Direct URLs)</small>',
|
||||
'IDF' => 'Row ID in database (example.com/do.php?id=123)',
|
||||
'IDFF' => 'File name (example.com/do.php?file=filename.pdf)',
|
||||
'IDFD' => 'Direct (example.com/uploads/filename.pdf)',
|
||||
'ID_FORM_IMG' => 'Images URLs form <small>(No stats or protection for Direct URLs)</small>',
|
||||
'IDF_IMG' => 'Row ID in database (example.com/do.php?img=123)',
|
||||
'IDFF_IMG' => 'File name (example.com/do.php?imgf=filename.png)',
|
||||
'IDFD_IMG' => 'Direct (example.com/uploads/filename.png)',
|
||||
'DEL_URL_FILE' => 'Enable file deletion URL feature',
|
||||
'WWW_URL' => 'Enable uploading from URL',
|
||||
'ALLOW_STAT_PG' => 'Enable statistics page',
|
||||
'ALLOW_ONLINE' => 'Enable Who is Online',
|
||||
'MOD_WRITER' => 'Mod Rewrite',
|
||||
'MOD_WRITER_EX' => 'HTML links..',
|
||||
'DEL_F_DAY' => 'Auto Delete undownloaded files (days) (0 = disabled)',
|
||||
'NUMFIELD_S' => 'You can only use numbers with some fields !!',
|
||||
'CONFIGS_UPDATED' => 'Settings updated successfully.',
|
||||
return [
|
||||
'U_NOT_ADMIN' => 'You do not have the administration permissions',
|
||||
'UPDATE_CONFIG' => 'Update Settings',
|
||||
'NO_CHANGE' => 'Do NOT change',
|
||||
'CHANGE_MD5' => 'Change using MD5 (8c7dd922ad47494fc02c388e12c00eac.png)',
|
||||
'CHANGE_TIME' => 'Change using TIME (1501440381.png)',
|
||||
'SITENAME' => 'Service name',
|
||||
'SITEMAIL' => 'Email address',
|
||||
'SITEMAIL2' => 'Email address of reports',
|
||||
'SITEURL' => 'Service URL with / at the end',
|
||||
'FOLDERNAME' => 'Folder name for uploaded files <small>(you can use {year}, {month}, {day} ,{week} ,{username})</small>',
|
||||
'PREFIXNAME' => 'Files name prefix <small>(you can also use {rand:4} , {date:d_Y})</small>',
|
||||
'FILESNUM' => 'Number of upload input fields',
|
||||
'FILESNUM_SHOW' => 'Show all upload inputs',
|
||||
'SITECLOSE' => 'Shutdown service',
|
||||
'CLOSEMSG' => 'Shutdown message',
|
||||
'DECODE' => 'Change file name',
|
||||
'SEC_DOWN' => 'Waiting period <small>(in Seconds, before download button appears)</small>',
|
||||
'STATFOOTER' => 'Page statistics in footer',
|
||||
'GZIP' => 'use gzip',
|
||||
'GOOGLEANALYTICS' => '<a href="http://www.google.com/analytics" target="_kleeja"><span style="color:orange">Google</span> Analytics</a>',
|
||||
'WELCOME_MSG' => 'Welcome message',
|
||||
'USER_SYSTEM' => 'Users system',
|
||||
'TOTAL_SIZE' => 'Max service size (Megabytes)',
|
||||
'THUMBS_IMGS' => 'thumbnails Dimensions (Width x Height)',
|
||||
'WRITE_IMGS' => 'Enable image watermark',
|
||||
'ID_FORM' => 'Files URLs form <small>(No stats or protection for Direct URLs)</small>',
|
||||
'IDF' => 'Row ID in database (example.com/do.php?id=123)',
|
||||
'IDFF' => 'File name (example.com/do.php?file=filename.pdf)',
|
||||
'IDFD' => 'Direct (example.com/uploads/filename.pdf)',
|
||||
'ID_FORM_IMG' => 'Images URLs form <small>(No stats or protection for Direct URLs)</small>',
|
||||
'IDF_IMG' => 'Row ID in database (example.com/do.php?img=123)',
|
||||
'IDFF_IMG' => 'File name (example.com/do.php?imgf=filename.png)',
|
||||
'IDFD_IMG' => 'Direct (example.com/uploads/filename.png)',
|
||||
'DEL_URL_FILE' => 'Enable file deletion URL feature',
|
||||
'WWW_URL' => 'Enable uploading from URL',
|
||||
'ALLOW_STAT_PG' => 'Enable statistics page',
|
||||
'ALLOW_ONLINE' => 'Enable Who is Online',
|
||||
'MOD_WRITER' => 'Mod Rewrite',
|
||||
'MOD_WRITER_EX' => 'HTML links..',
|
||||
'DEL_F_DAY' => 'Auto Delete undownloaded files (days) (0 = disabled)',
|
||||
'NUMFIELD_S' => 'You can only use numbers with some fields !!',
|
||||
'CONFIGS_UPDATED' => 'Settings updated successfully.',
|
||||
|
||||
'EXT_DELETED' => 'The extension deleted successfully.',
|
||||
'E_EXTS' => 'Note : Sizes are measured in kilobytes.',
|
||||
'UPDATED_EXTS' => 'Extensions updated successfully.',
|
||||
'REPLY' => 'Reply',
|
||||
'REPLY_REPORT' => 'Reply to this report',
|
||||
'U_REPORT_ON' => 'For your report about ',
|
||||
'BY_EMAIL' => 'By email ',
|
||||
'ADMIN_REPLIED' => 'Admin Reply',
|
||||
'EXT_DELETED' => 'The extension deleted successfully.',
|
||||
'E_EXTS' => 'Note : Sizes are measured in kilobytes.',
|
||||
'UPDATED_EXTS' => 'Extensions updated successfully.',
|
||||
'REPLY' => 'Reply',
|
||||
'REPLY_REPORT' => 'Reply to this report',
|
||||
'U_REPORT_ON' => 'For your report about ',
|
||||
'BY_EMAIL' => 'By email ',
|
||||
'ADMIN_REPLIED' => 'Admin Reply',
|
||||
|
||||
'IS_SEND_MAIL' => 'Reply has been sent.',
|
||||
'REPORTS_UPDATED' => 'Reports have been updated.',
|
||||
'REPLY_CALL' => 'Reply to this message',
|
||||
'REPLIED_ON_CAL' => 'About your Message ',
|
||||
'CALLS_UPDATED' => 'Messages updated successfully.',
|
||||
'FOUNDER' => 'Founder',
|
||||
'USER_UPDATED' => 'User data has been updated successfully.',
|
||||
'REPAIRE_TABLE' => '[Tables] Repaired. ',
|
||||
'REPAIRE_CACHE' => 'Cache has been deleted/refreshed.',
|
||||
'KLEEJA_CP' => 'Control Panel',
|
||||
'GENERAL_STAT' => 'General Stats',
|
||||
'OTHER_INFO' => 'Other Info',
|
||||
'AFILES_NUM' => 'Total number of files',
|
||||
'AFILES_SIZE_SPACE' => 'Space that has been consumed so far',
|
||||
'AUSERS_NUM' => 'Total users',
|
||||
'LAST_GOOGLE' => 'Last visit of a Google Bot',
|
||||
'GOOGLE_NUM' => 'Total Google\'s bot visits',
|
||||
'LAST_BING' => 'Last visit of a Bing Bot',
|
||||
'BING_NUM' => 'Total Bing\'s bot visits',
|
||||
'KLEEJA_CP_W' => 'Hello! Welcome to Kleeja Control Panel',
|
||||
'PHP_VER' => 'PHP version',
|
||||
'MYSQL_VER' => 'MySQL version',
|
||||
'R_CONFIGS' => 'Settings',
|
||||
'R_CPINDEX' => 'Dashboard',
|
||||
'R_EXTS' => 'Files\' Extensions Settings',
|
||||
'R_FILES' => 'Files Control',
|
||||
'R_REPORTS' => 'Reports',
|
||||
'R_CALLS' => 'Messages',
|
||||
'R_USERS' => 'Users & Groups',
|
||||
'R_REPAIR' => 'Maintenance',
|
||||
'R_LGOUTCP' => 'Clear Session',
|
||||
'R_BAN' => 'Ban Control',
|
||||
'BAN_EXP1' => 'Edit the banned IPs and add new ones here ..',
|
||||
'BAN_EXP2' => 'Use the star (*) symbol to replace numbers if you want a total ban.... and use the (|) to separate the IPs',
|
||||
'UPDATE_BAN' => 'Save Changes',
|
||||
'BAN_UPDATED' => 'Changes saved successfully.',
|
||||
'R_RULES' => 'Terms',
|
||||
'RULES_EXP' => 'You can edit the terms and conditions of your service from here',
|
||||
'UPDATE_RULES' => 'Update',
|
||||
'RULES_UPDATED' => 'Terms and conditions updated successfully ..',
|
||||
'R_SEARCH' => 'Advanced search',
|
||||
'SEARCH_FILES' => 'Search for files',
|
||||
'SEARCH_SUBMIT' => 'Search',
|
||||
'LAST_DOWN' => 'Last download',
|
||||
'WAS_B4' => 'Was before',
|
||||
'SEARCH_USERS' => 'Search for users',
|
||||
'R_IMG_CTRL' => 'Image control only',
|
||||
'ENABLE_USERFILE' => 'Enable users files',
|
||||
'R_EXTRA' => 'Extra Templates',
|
||||
'EX_HEADER_N' => 'Extra header ... which shows at the bottom of the original header',
|
||||
'EX_FOOTER_N' => 'Extra footer ... which shows at the top of the original footer',
|
||||
'UPDATE_EXTRA' => 'Update template',
|
||||
'EXTRA_UPDATED' => 'Template additions updated successfully',
|
||||
'R_STYLES' => 'Styles',
|
||||
'IS_SEND_MAIL' => 'Reply has been sent.',
|
||||
'REPORTS_UPDATED' => 'Reports have been updated.',
|
||||
'REPLY_CALL' => 'Reply to this message',
|
||||
'REPLIED_ON_CAL' => 'About your Message ',
|
||||
'CALLS_UPDATED' => 'Messages updated successfully.',
|
||||
'FOUNDER' => 'Founder',
|
||||
'USER_UPDATED' => 'User data has been updated successfully.',
|
||||
'REPAIRE_TABLE' => '[Tables] Repaired. ',
|
||||
'REPAIRE_CACHE' => 'Cache has been deleted/refreshed.',
|
||||
'KLEEJA_CP' => 'Control Panel',
|
||||
'GENERAL_STAT' => 'General Stats',
|
||||
'OTHER_INFO' => 'Other Info',
|
||||
'AFILES_NUM' => 'Total number of files',
|
||||
'AFILES_SIZE_SPACE' => 'Space that has been consumed so far',
|
||||
'AUSERS_NUM' => 'Total users',
|
||||
'LAST_GOOGLE' => 'Last visit of a Google Bot',
|
||||
'GOOGLE_NUM' => 'Total Google\'s bot visits',
|
||||
'LAST_BING' => 'Last visit of a Bing Bot',
|
||||
'BING_NUM' => 'Total Bing\'s bot visits',
|
||||
'KLEEJA_CP_W' => 'Hello! Welcome to Kleeja Control Panel',
|
||||
'PHP_VER' => 'PHP version',
|
||||
'MYSQL_VER' => 'MySQL version',
|
||||
'R_CONFIGS' => 'Settings',
|
||||
'R_CPINDEX' => 'Dashboard',
|
||||
'R_EXTS' => 'Files\' Extensions Settings',
|
||||
'R_FILES' => 'Files Control',
|
||||
'R_REPORTS' => 'Reports',
|
||||
'R_CALLS' => 'Messages',
|
||||
'R_USERS' => 'Users & Groups',
|
||||
'R_REPAIR' => 'Maintenance',
|
||||
'R_LGOUTCP' => 'Clear Session',
|
||||
'R_BAN' => 'Ban Control',
|
||||
'BAN_EXP1' => 'Edit the banned IPs and add new ones here ..',
|
||||
'BAN_EXP2' => 'Use the star (*) symbol to replace numbers if you want a total ban.... and use the (|) to separate the IPs',
|
||||
'UPDATE_BAN' => 'Save Changes',
|
||||
'BAN_UPDATED' => 'Changes saved successfully.',
|
||||
'R_RULES' => 'Terms',
|
||||
'RULES_EXP' => 'You can edit the terms and conditions of your service from here',
|
||||
'UPDATE_RULES' => 'Update',
|
||||
'RULES_UPDATED' => 'Terms and conditions updated successfully ..',
|
||||
'R_SEARCH' => 'Advanced search',
|
||||
'SEARCH_FILES' => 'Search for files',
|
||||
'SEARCH_SUBMIT' => 'Search',
|
||||
'LAST_DOWN' => 'Last download',
|
||||
'WAS_B4' => 'Was before',
|
||||
'SEARCH_USERS' => 'Search for users',
|
||||
'R_IMG_CTRL' => 'Image control only',
|
||||
'ENABLE_USERFILE' => 'Enable users files',
|
||||
'R_EXTRA' => 'Extra Templates',
|
||||
'EX_HEADER_N' => 'Extra header ... which shows at the bottom of the original header',
|
||||
'EX_FOOTER_N' => 'Extra footer ... which shows at the top of the original footer',
|
||||
'UPDATE_EXTRA' => 'Update template',
|
||||
'EXTRA_UPDATED' => 'Template additions updated successfully',
|
||||
'R_STYLES' => 'Styles',
|
||||
|
||||
'NO_TPL_SHOOSED' => 'You did not select a template!',
|
||||
'NO_TPL_SHOOSED' => 'You did not select a template!',
|
||||
|
||||
|
||||
'R_PLUGINS' => 'Plugins',
|
||||
'ADD_NEW_PLUGIN' => 'Add plugin',
|
||||
'R_PLUGINS' => 'Plugins',
|
||||
'ADD_NEW_PLUGIN' => 'Add plugin',
|
||||
|
||||
'PLUGIN_DELETED' => 'Plugin deleted...',
|
||||
'PLGUIN_DISABLED_ENABLED' => 'Plugin Enabled / Disabled',
|
||||
'NO_PLUGINS' => 'No plugins found! You could start browsing plugins and installing them by clicking the tab "Kleeja Store" or upload a plugin file from the tab "Local Plugins".',
|
||||
'PLUGIN_DELETED' => 'Plugin deleted...',
|
||||
'PLGUIN_DISABLED_ENABLED' => 'Plugin Enabled / Disabled',
|
||||
'NO_PLUGINS' => 'No plugins found! You could start browsing plugins and installing them by clicking the tab "Kleeja Store" or upload a plugin file from the tab "Local Plugins".',
|
||||
'NEW_PLUGIN_ADDED' => 'Plugin added ... ',
|
||||
'PLUGIN_EXISTS_BEFORE' => 'This plugin exists before with same version or above, so no need to update it!.',
|
||||
'R_CHECK_UPDATE' => 'Check for updates',
|
||||
'ERROR_CHECK_VER' => 'Error: cannot get any update information at this moment , try again later !',
|
||||
'UPDATE_KLJ_NOW' => 'You Have to update your version now!. visit Kleeja.com for more information',
|
||||
'U_LAST_VER_KLJ' => 'You are using the latest version of Kleeja...',
|
||||
'U_USE_PRE_RE' => 'You are using a Pre-release version, Click <a href="mailto:info@kleeja.com">here</a> to report any bugs or exploits.',
|
||||
'STYLE_IS_DEFAULT' => 'Default style',
|
||||
'MAKE_AS_DEFAULT' => 'Set as default',
|
||||
'PLUGIN_EXISTS_BEFORE' => 'This plugin exists before with same version or above, so no need to update it!.',
|
||||
'R_CHECK_UPDATE' => 'Check for updates',
|
||||
'ERROR_CHECK_VER' => 'Error: cannot get any update information at this moment , try again later !',
|
||||
'UPDATE_KLJ_NOW' => 'You Have to update your version now!. visit Kleeja.com for more information',
|
||||
'U_LAST_VER_KLJ' => 'You are using the latest version of Kleeja...',
|
||||
'U_USE_PRE_RE' => 'You are using a Pre-release version, Click <a href="mailto:info@kleeja.com">here</a> to report any bugs or exploits.',
|
||||
'STYLE_IS_DEFAULT' => 'Default style',
|
||||
'MAKE_AS_DEFAULT' => 'Set as default',
|
||||
|
||||
'STYLE_NOW_IS_DEFAULT' => 'The style "%s" was set as default',
|
||||
'STYLE_NOW_IS_DEFAULT' => 'The style "%s" was set as default',
|
||||
|
||||
'UPDATE_NOW_S' => 'You are using an old version of Kleeja. Update Now. Your current version is %1$s and the latest one is %2$s',
|
||||
'ADD_NEW_EXT' => 'Add a new extension',
|
||||
'ADD_NEW_EXT_EXP' => 'Type a file extension to add it to this group (for example: doc)',
|
||||
'EMPTY_EXT_FIELD' => 'The extension field is blank!',
|
||||
'NEW_EXT_ADD' => 'New extension added. ',
|
||||
'NEW_EXT_EXISTS_B4' => 'The extension %s already exists!.',
|
||||
'NOT_SAFE_FILE' => 'The file "%s" does not look safe !',
|
||||
'CONFIG_WRITEABLE' => 'The file config.php is currently writable, We strongly recommend that it be changed to 640 or at least 644.',
|
||||
'USERS_NOT_NORMAL_SYS' => 'The current users system is not the normal one, which means that the current users cannot be edited from here but from the script that was integrated with Kleeja, those users use the normal membership system.',
|
||||
'DIMENSIONS_THMB' => 'Thumbs dimensions',
|
||||
'ADMIN_DELETE_FILE_OK' => 'Done !',
|
||||
'ADMIN_DELETE_FILES' => 'Delete all user files',
|
||||
'UPDATE_NOW_S' => 'You are using an old version of Kleeja. Update Now. Your current version is %1$s and the latest one is %2$s',
|
||||
'ADD_NEW_EXT' => 'Add a new extension',
|
||||
'ADD_NEW_EXT_EXP' => 'Type a file extension to add it to this group (for example: doc)',
|
||||
'EMPTY_EXT_FIELD' => 'The extension field is blank!',
|
||||
'NEW_EXT_ADD' => 'New extension added. ',
|
||||
'NEW_EXT_EXISTS_B4' => 'The extension %s already exists!.',
|
||||
'NOT_SAFE_FILE' => 'The file "%s" does not look safe !',
|
||||
'CONFIG_WRITEABLE' => 'The file config.php is currently writable, We strongly recommend that it be changed to 640 or at least 644.',
|
||||
'USERS_NOT_NORMAL_SYS' => 'The current users system is not the normal one, which means that the current users cannot be edited from here but from the script that was integrated with Kleeja, those users use the normal membership system.',
|
||||
'DIMENSIONS_THMB' => 'Thumbs dimensions',
|
||||
'ADMIN_DELETE_FILE_OK' => 'Done !',
|
||||
'ADMIN_DELETE_FILES' => 'Delete all user files',
|
||||
|
||||
'BCONVERTER' => 'Byte Converter',
|
||||
'NO_HTACCESS_DIR_UP' => 'No .htaccess file was found in "%s" folder, Which means if malicious codes were injected a hacker can do damage to your website!',
|
||||
'NO_HTACCESS_DIR_UP_THUMB' => 'No .htaccess file was found in Thumbs folder "%s", Which means if malicious codes were injected a hacker can do damage to your website!',
|
||||
'COOKIE_DOMAIN' => 'Cookie domain',
|
||||
'COOKIE_NAME' => 'Cookie prefix',
|
||||
'COOKIE_PATH' => 'Cookie path',
|
||||
'COOKIE_SECURE' => 'Cookie secure',
|
||||
#'ADMINISTRATORS' => 'Administrators',
|
||||
'DELETEALLRES' => 'Delete all results',
|
||||
'ADMIN_DELETE_FILES_OK' => 'File %s successfully deleted',
|
||||
'ADMIN_DELETE_FILES_NOF' => 'No files to delete',
|
||||
'NOT_EXSIT_USER' => 'Sorry, the user you are looking for does not exist in our database... perhaps you are trying to reach a deleted membership !!!!',
|
||||
'ADMIN_DELETE_NO_FILE' => 'This user has no files to delete ! .',
|
||||
'CONFIG_KLJ_MENUS_OTHER' => 'Other settings',
|
||||
'CONFIG_KLJ_MENUS_GENERAL' => 'General settings',
|
||||
'CONFIG_KLJ_MENUS_ALL' => 'Display all the settings',
|
||||
'CONFIG_KLJ_MENUS_UPLOAD' => 'Upload settings',
|
||||
'CONFIG_KLJ_MENUS_INTERFACE'=> 'Interface and design settings',
|
||||
'CONFIG_KLJ_MENUS_ADVANCED' => 'Advanced settings',
|
||||
'DELF_CAUTION' => '<small class="delf_caution">Caution: might be dangerous when using small numbers or using direct form of URLS.</small>',
|
||||
'PLUGIN_N_CMPT_KLJ' => 'This plugin is not compatible with your current version of Kleeja.',
|
||||
'PHPINI_FILESIZE_SMALL' => 'Maximum file size allowed for your service is "%1$s" while <b>upload_max_filesize</b> in your hosts PHP settings is set to "%2$s", update it so that your chosen size can be applied.',
|
||||
'PHPINI_MPOSTSIZE_SMALL' => 'You have allowed the upload of "%1$s" files at once, You need to use a bigger value for <b>post_max_size</b> in your servers PHP settings, something like "%2$s" for a better performance.',
|
||||
'NUMPER_REPORT' => 'Number of reports',
|
||||
'NO_UP_CHANGE_S' => 'No changes ...',
|
||||
'ADD_HEADER_EXTRA' => 'Extra Header',
|
||||
'ADD_FOOTER_EXTRA' => 'Extra footer',
|
||||
'ADMIN_USING_IE6' => 'You are using an outdated IE browser, Please update your browser or use FireFox now!',
|
||||
'BCONVERTER' => 'Byte Converter',
|
||||
'NO_HTACCESS_DIR_UP' => 'No .htaccess file was found in "%s" folder, Which means if malicious codes were injected a hacker can do damage to your website!',
|
||||
'NO_HTACCESS_DIR_UP_THUMB' => 'No .htaccess file was found in Thumbs folder "%s", Which means if malicious codes were injected a hacker can do damage to your website!',
|
||||
'COOKIE_DOMAIN' => 'Cookie domain',
|
||||
'COOKIE_NAME' => 'Cookie prefix',
|
||||
'COOKIE_PATH' => 'Cookie path',
|
||||
'COOKIE_SECURE' => 'Cookie secure',
|
||||
//'ADMINISTRATORS' => 'Administrators',
|
||||
'DELETEALLRES' => 'Delete all results',
|
||||
'ADMIN_DELETE_FILES_OK' => 'File %s successfully deleted',
|
||||
'ADMIN_DELETE_FILES_NOF' => 'No files to delete',
|
||||
'NOT_EXSIT_USER' => 'Sorry, the user you are looking for does not exist in our database... perhaps you are trying to reach a deleted membership !!!!',
|
||||
'ADMIN_DELETE_NO_FILE' => 'This user has no files to delete ! .',
|
||||
'CONFIG_KLJ_MENUS_OTHER' => 'Other settings',
|
||||
'CONFIG_KLJ_MENUS_GENERAL' => 'General settings',
|
||||
'CONFIG_KLJ_MENUS_ALL' => 'Display all the settings',
|
||||
'CONFIG_KLJ_MENUS_UPLOAD' => 'Upload settings',
|
||||
'CONFIG_KLJ_MENUS_INTERFACE'=> 'Interface and design settings',
|
||||
'CONFIG_KLJ_MENUS_ADVANCED' => 'Advanced settings',
|
||||
'DELF_CAUTION' => '<small class="delf_caution">Caution: might be dangerous when using small numbers or using direct form of URLS.</small>',
|
||||
'PLUGIN_N_CMPT_KLJ' => 'This plugin is not compatible with your current version of Kleeja.',
|
||||
'PHPINI_FILESIZE_SMALL' => 'Maximum file size allowed for your service is "%1$s" while <b>upload_max_filesize</b> in your hosts PHP settings is set to "%2$s", update it so that your chosen size can be applied.',
|
||||
'PHPINI_MPOSTSIZE_SMALL' => 'You have allowed the upload of "%1$s" files at once, You need to use a bigger value for <b>post_max_size</b> in your servers PHP settings, something like "%2$s" for a better performance.',
|
||||
'NUMPER_REPORT' => 'Number of reports',
|
||||
'NO_UP_CHANGE_S' => 'No changes ...',
|
||||
'ADD_HEADER_EXTRA' => 'Extra Header',
|
||||
'ADD_FOOTER_EXTRA' => 'Extra footer',
|
||||
'ADMIN_USING_IE6' => 'You are using an outdated IE browser, Please update your browser or use FireFox now!',
|
||||
|
||||
'T_CLEANING_FILES_NOW' => 'Deleting Un-downloaded files, The process could take a while depending on the size and number of the files.',
|
||||
'HOW_UPDATE_KLEEJA' => 'How to update Kleeja?',
|
||||
'HOW_UPDATE_KLEEJA_STEP1' => 'Visit the official website <a target="_blank" href="http://www.kleeja.com/">Kleeja.com</a> then go to the Download page and download the latest version of the script, or download an upgrade copy if available.',
|
||||
'HOW_UPDATE_KLEEJA_STEP2' => 'Unzip the file and upload it to your website to replace the old files with the new ones <b>Except config.php and uploads folder</b>.',
|
||||
'HOW_UPDATE_KLEEJA_STEP3' => 'When done, go to the following URL to update the database.',
|
||||
'DEPEND_ON_NO_STYLE_ERR' => 'This style is based on the "%s" style which you dont seem to have',
|
||||
'PLUGINS_REQ_NO_STYLE_ERR' => 'This style requires the [ s% ] plugin(s), install it/them and try again.',
|
||||
'KLJ_VER_NO_STYLE_ERR' => 'This style requires Kleeja version %s or above',
|
||||
'STYLE_DEPEND_ON' => 'Based on',
|
||||
'MESSAGE_NONE' => 'No messages yet ...',
|
||||
'KLEEJA_TEAM' => 'Kleeja development team',
|
||||
'ERR_SEND_MAIL' => 'Mail sending error, try again later !',
|
||||
'FIND_IP_FILES' => 'Found',
|
||||
'ALPHABETICAL_ORDER_FILES' => 'Sort files by alphabetical order',
|
||||
'ORDER_SIZE' => 'Sort files by size from largest to smallest',
|
||||
'ORDER_TOTAL_DOWNLOADS' => 'Sort files by number of downloads',
|
||||
'LIVEXTS' => 'Live Extensions (No waiting page)',
|
||||
'COMMA_X' => '<p class="live_xts">separate by comma (<span style="font-size:large"> , </span>)</p>',
|
||||
'NO_SEARCH_WORD' => 'You didn\'t type anything in the search form !',
|
||||
'USERSECTOUPLOAD' => 'The seconds between each upload process',
|
||||
'ADM_UNWANTED_FILES' => 'You seem to have upgraded from a previous version, and because some file names are different now, you\'ll notice duplicated buttons in control panel. </ br> to solve this, remove all the files in "includes/adm" directory and re-upload them.',
|
||||
'HTML_URLS_ENABLED_NO_HTCC' => 'you have enabled the rewrite URLs, but you seem to have forgot to rename .htaccess.txt in Kleeja\'s root directory to ".htaccess", however, if you don\'t know what I\'m talking about, go ask for Kleeja\'s support or simply disable the rewrite urls feature.',
|
||||
'T_CLEANING_FILES_NOW' => 'Deleting Un-downloaded files, The process could take a while depending on the size and number of the files.',
|
||||
'HOW_UPDATE_KLEEJA' => 'How to update Kleeja?',
|
||||
'HOW_UPDATE_KLEEJA_STEP1' => 'Visit the official website <a target="_blank" href="http://www.kleeja.com/">Kleeja.com</a> then go to the Download page and download the latest version of the script, or download an upgrade copy if available.',
|
||||
'HOW_UPDATE_KLEEJA_STEP2' => 'Unzip the file and upload it to your website to replace the old files with the new ones <b>Except config.php and uploads folder</b>.',
|
||||
'HOW_UPDATE_KLEEJA_STEP3' => 'When done, go to the following URL to update the database.',
|
||||
'DEPEND_ON_NO_STYLE_ERR' => 'This style is based on the "%s" style which you dont seem to have',
|
||||
'PLUGINS_REQ_NO_STYLE_ERR' => 'This style requires the [ s% ] plugin(s), install it/them and try again.',
|
||||
'KLJ_VER_NO_STYLE_ERR' => 'This style requires Kleeja version %s or above',
|
||||
'STYLE_DEPEND_ON' => 'Based on',
|
||||
'MESSAGE_NONE' => 'No messages yet ...',
|
||||
'KLEEJA_TEAM' => 'Kleeja development team',
|
||||
'ERR_SEND_MAIL' => 'Mail sending error, try again later !',
|
||||
'FIND_IP_FILES' => 'Found',
|
||||
'ALPHABETICAL_ORDER_FILES' => 'Sort files by alphabetical order',
|
||||
'ORDER_SIZE' => 'Sort files by size from largest to smallest',
|
||||
'ORDER_TOTAL_DOWNLOADS' => 'Sort files by number of downloads',
|
||||
'LIVEXTS' => 'Live Extensions (No waiting page)',
|
||||
'COMMA_X' => '<p class="live_xts">separate by comma (<span style="font-size:large"> , </span>)</p>',
|
||||
'NO_SEARCH_WORD' => 'You didn\'t type anything in the search form !',
|
||||
'USERSECTOUPLOAD' => 'The seconds between each upload process',
|
||||
'ADM_UNWANTED_FILES' => 'You seem to have upgraded from a previous version, and because some file names are different now, you\'ll notice duplicated buttons in control panel. </ br> to solve this, remove all the files in "includes/adm" directory and re-upload them.',
|
||||
'HTML_URLS_ENABLED_NO_HTCC' => 'you have enabled the rewrite URLs, but you seem to have forgot to rename .htaccess.txt in Kleeja\'s root directory to ".htaccess", however, if you don\'t know what I\'m talking about, go ask for Kleeja\'s support or simply disable the rewrite urls feature.',
|
||||
'PLUGIN_CONFIRM_ADD' => 'Caution: the plugins make changes to the script, and they could be harmful at times. so be sure to check the plugin source and make sure that it is an official Kleeja plugin.',
|
||||
'LOADING' => 'Loading',
|
||||
'WELCOME' => 'Welcome',
|
||||
'ENABLE_CAPTCHA' => 'Enable Captcha in Kleeja',
|
||||
'NO_THUMB_FOLDER' => 'It seems you enabled Thumbs but in same time the folder %s does not exist! create it.',
|
||||
'DELETE_EARLIER_30DAYS' => 'Delete items older than 30 days',
|
||||
'DELETE_ALL' => 'Delete all',
|
||||
'DELETE_PROCESS_QUEUED' => 'The delete process has been added to the waiting list to execute it gradually to reduce the load.',
|
||||
'DELETE_PROCESS_IN_WORK' => 'Currently, the delete process is executing ...',
|
||||
'SHOW_FROM_24H' => 'Show past 24 hours',
|
||||
'THUMB_DIS_LONGTIME' => 'Thumbs are disabled, this will force Kleeja to resize every images to be small here, and cost you time and bandwidth!. Enable thumbs now.',
|
||||
'LOADING' => 'Loading',
|
||||
'WELCOME' => 'Welcome',
|
||||
'ENABLE_CAPTCHA' => 'Enable Captcha in Kleeja',
|
||||
'NO_THUMB_FOLDER' => 'It seems you enabled Thumbs but in same time the folder %s does not exist! create it.',
|
||||
'DELETE_EARLIER_30DAYS' => 'Delete items older than 30 days',
|
||||
'DELETE_ALL' => 'Delete all',
|
||||
'DELETE_PROCESS_QUEUED' => 'The delete process has been added to the waiting list to execute it gradually to reduce the load.',
|
||||
'DELETE_PROCESS_IN_WORK' => 'Currently, the delete process is executing ...',
|
||||
'SHOW_FROM_24H' => 'Show past 24 hours',
|
||||
'THUMB_DIS_LONGTIME' => 'Thumbs are disabled, this will force Kleeja to resize every images to be small here, and cost you time and bandwidth!. Enable thumbs now.',
|
||||
|
||||
'R_GROUPS' => 'Groups Management',
|
||||
'ESSENTIAL_GROUPS' => 'Fundamental Groups',
|
||||
'CUSTOM_GROUPS' => 'User-defined Groups',
|
||||
'EDIT_DATA' => 'Edit data',
|
||||
'EDIT_ACL' => 'Edit Permissions',
|
||||
'HE_CAN' => 'Can',
|
||||
'HE_CAN_NOT' => 'Cannot',
|
||||
#ACLS roles
|
||||
'ACLS_ENTER_ACP' => 'Access Admin control panel',
|
||||
'ACLS_ACCESS_FILEUSER' => 'Access his own files\' folder',
|
||||
'R_GROUPS' => 'Groups Management',
|
||||
'ESSENTIAL_GROUPS' => 'Fundamental Groups',
|
||||
'CUSTOM_GROUPS' => 'User-defined Groups',
|
||||
'EDIT_DATA' => 'Edit data',
|
||||
'EDIT_ACL' => 'Edit Permissions',
|
||||
'HE_CAN' => 'Can',
|
||||
'HE_CAN_NOT' => 'Cannot',
|
||||
//ACLS roles
|
||||
'ACLS_ENTER_ACP' => 'Access Admin control panel',
|
||||
'ACLS_ACCESS_FILEUSER' => 'Access his own files\' folder',
|
||||
'ACLS_ACCESS_FILEUSERS' => 'Browse any user files\' folder',
|
||||
'ACLS_ACCESS_CALL' => 'Access "call us" page',
|
||||
'ACLS_ACCESS_REPORT' => 'View "Report" page',
|
||||
'ACLS_ACCESS_STATS' => 'Access "statistics" page',
|
||||
'ACLS_ACCESS_CALL' => 'Access "call us" page',
|
||||
'ACLS_ACCESS_REPORT' => 'View "Report" page',
|
||||
'ACLS_ACCESS_STATS' => 'Access "statistics" page',
|
||||
|
||||
'GROUP_IS_DEFAULT' => 'This group is default at registeration',
|
||||
'ADD_NEW_GROUP' => 'Add new group',
|
||||
'DELETE_GROUP' => 'Delete group',
|
||||
'GROUP_NAME' => 'Group name',
|
||||
'COPY_FROM' => 'Copy from',
|
||||
'USERNAME_NOT_YOU' => 'Not you ? %1$slogout%2$s',
|
||||
'DEFAULT_GROUP' => 'The default group',
|
||||
'G_USERS_MOVE_TO' => 'Move the group users to',
|
||||
'TAKEN_NAMES' => 'This name is taken. Choose another name',
|
||||
'GROUP_IS_DEFAULT' => 'This group is default at registeration',
|
||||
'ADD_NEW_GROUP' => 'Add new group',
|
||||
'DELETE_GROUP' => 'Delete group',
|
||||
'GROUP_NAME' => 'Group name',
|
||||
'COPY_FROM' => 'Copy from',
|
||||
'USERNAME_NOT_YOU' => 'Not you ? %1$slogout%2$s',
|
||||
'DEFAULT_GROUP' => 'The default group',
|
||||
'G_USERS_MOVE_TO' => 'Move the group users to',
|
||||
'TAKEN_NAMES' => 'This name is taken. Choose another name',
|
||||
|
||||
'GROUP_DELETED' => 'Group "%1$s" has been deleted and its user moved to group "%2$s".',
|
||||
'NO_MOVE_SAME_GRP' => 'You can not move the users to the same group!.',
|
||||
'DEFAULT_GRP_NO_DEL' => 'You can not delete this group becuase it is the current default group, change the default group then try to delete it!.',
|
||||
'GROUP_ADDED' => 'Group "%s" has been added successfully ...',
|
||||
'SEARCH4FILES_BYIP' => 'Search files via selected IP',
|
||||
'SEARCH4FILES_BYUSER' => 'Search files for this user',
|
||||
'USER_DELETED' => 'User has been deleted successfully ...',
|
||||
'USER_ADDED' => 'User has been added successfully ...',
|
||||
'DIRECT_FILE_NOTE' => 'This is a Direct file. Direct files have no stats.',
|
||||
'IMAGEFOLDER' => 'Folder of Live links feature',
|
||||
'IMAGEFOLDEREXTS' => 'Files\' Extensions of Live links feature (No waiting page of these files, and has separated folder) (ex: swf, mp4, mp3) ',
|
||||
'IMAGEFOLDERE' => 'Change file name',
|
||||
'LAST_VIEW' => 'Last viewing',
|
||||
'HURRY_HURRY' => 'Quick Actions',
|
||||
'RESYNC' => 're-sync',
|
||||
'DEL_CACHE' => 'Delete Cache (temporary files)',
|
||||
'SYNCING' => 'Sync\'ing is going on : (%s), wait ...',
|
||||
'SYNCING_DONE' => 'Sync\'ing is done for (%s).',
|
||||
'WHY_SYNCING' => 'Kleeja uses auto increment to not perform calculation of total numbers everytime, this rises Kleeja performance. Use this after upgrade or when Kleeja asks you to.',
|
||||
'REPAIR_DB_TABLES' => 'Repair Data base tables',
|
||||
'NO_RESULT_USE_SYNC' => 'There are no results, if you just installed Kleeja then that ok. <br /> If you just made an upgrade, then go to "Mentenance page" then do a "re-sync" for files or images.',
|
||||
'GROUP_DELETED' => 'Group "%1$s" has been deleted and its user moved to group "%2$s".',
|
||||
'NO_MOVE_SAME_GRP' => 'You can not move the users to the same group!.',
|
||||
'DEFAULT_GRP_NO_DEL' => 'You can not delete this group becuase it is the current default group, change the default group then try to delete it!.',
|
||||
'GROUP_ADDED' => 'Group "%s" has been added successfully ...',
|
||||
'SEARCH4FILES_BYIP' => 'Search files via selected IP',
|
||||
'SEARCH4FILES_BYUSER' => 'Search files for this user',
|
||||
'USER_DELETED' => 'User has been deleted successfully ...',
|
||||
'USER_ADDED' => 'User has been added successfully ...',
|
||||
'DIRECT_FILE_NOTE' => 'This is a Direct file. Direct files have no stats.',
|
||||
'IMAGEFOLDER' => 'Folder of Live links feature',
|
||||
'IMAGEFOLDEREXTS' => 'Files\' Extensions of Live links feature (No waiting page of these files, and has separated folder) (ex: swf, mp4, mp3) ',
|
||||
'IMAGEFOLDERE' => 'Change file name',
|
||||
'LAST_VIEW' => 'Last viewing',
|
||||
'HURRY_HURRY' => 'Quick Actions',
|
||||
'RESYNC' => 're-sync',
|
||||
'DEL_CACHE' => 'Delete Cache (temporary files)',
|
||||
'SYNCING' => 'Sync\'ing is going on : (%s), wait ...',
|
||||
'SYNCING_DONE' => 'Sync\'ing is done for (%s).',
|
||||
'WHY_SYNCING' => 'Kleeja uses auto increment to not perform calculation of total numbers everytime, this rises Kleeja performance. Use this after upgrade or when Kleeja asks you to.',
|
||||
'REPAIR_DB_TABLES' => 'Repair Data base tables',
|
||||
'NO_RESULT_USE_SYNC' => 'There are no results, if you just installed Kleeja then that ok. <br /> If you just made an upgrade, then go to "Mentenance page" then do a "re-sync" for files or images.',
|
||||
'ADVICE_CRON_LINK' => 'It\'s recommended to add Kleeja queue link as a Cron job every hour or two hours',
|
||||
'UPLOAD_LOCAL_PC' => 'Upload from Your Computer',
|
||||
'NO_ZIP_ARCHIVE' => 'ZipArchive is not installed on your server, it\'s required.',
|
||||
'EXTRACT_ZIP_FAILED' => 'We encounter a problem while extracting this archive file, make sure it\'s a valid zip file, and that "%s" folder is writable',
|
||||
'NO_PROBLEM_AFTER_ZIP' => 'The file has been extracted successfully and it\'s ready to be enabled',
|
||||
'SESSION_ENDED' => 'Session has ended, do you want to login again?',
|
||||
//3.0.3
|
||||
'CUSTOMIZATION' => 'Customization',
|
||||
'SHOW' => 'Show',
|
||||
'HIDE' => 'Hide',
|
||||
'VIEW' => 'View',
|
||||
'INSTALL' => 'Install',
|
||||
'CLOSE' => 'Close',
|
||||
'STATS_BOXES' => 'Stats Boxes',
|
||||
'PLUGIN_UPDATED' => 'Plugin "%s" has been updated successfully ..',
|
||||
'PLUGIN_DOWNLOADED' => 'Plugin "%s" has been downloaded successfully ..',
|
||||
'PLUGIN_FILE_NOT_FOUND' => 'The plugin file is missing!',
|
||||
'PLUGIN_REMOTE_FILE_MISSING'=> 'The plugin "%s" is not on Kleeja remote server!',
|
||||
'PLUGINS_SERVER_ERROR' => 'We encountered an error while connecting to the plugins remote server ...',
|
||||
'INSTALLED_PLUGINS' => 'Installed Plugins',
|
||||
'LOCAL_PLUGINS' => 'Local Plugins',
|
||||
'KLEEJA_STORE' => 'Kleeja Store',
|
||||
'KLJ_VER_NO_PLUGIN' => 'This plugin can works on Kleeja version %1$s up to version %2$s.',
|
||||
'VERSION' => 'Version',
|
||||
'DEVELOPER' => 'Developer',
|
||||
'ALL_PLUGINS_UPDATED' => 'There are no plugins that require an update currently...',
|
||||
);
|
||||
'SESSION_ENDED' => 'Session has ended, do you want to login again?',
|
||||
//3.0.3
|
||||
'CUSTOMIZATION' => 'Customization',
|
||||
'SHOW' => 'Show',
|
||||
'HIDE' => 'Hide',
|
||||
'VIEW' => 'View',
|
||||
'INSTALL' => 'Install',
|
||||
'CLOSE' => 'Close',
|
||||
'STATS_BOXES' => 'Stats Boxes',
|
||||
'PLUGIN_UPDATED' => 'Plugin "%s" has been updated successfully ..',
|
||||
'PLUGIN_DOWNLOADED' => 'Plugin "%s" has been downloaded successfully ..',
|
||||
'PLUGIN_FILE_NOT_FOUND' => 'The plugin file is missing!',
|
||||
'PLUGIN_REMOTE_FILE_MISSING'=> 'The plugin "%s" is not on Kleeja remote server!',
|
||||
'PLUGINS_SERVER_ERROR' => 'We encountered an error while connecting to the plugins remote server ...',
|
||||
'INSTALLED_PLUGINS' => 'Installed Plugins',
|
||||
'LOCAL_PLUGINS' => 'Local Plugins',
|
||||
'KLEEJA_STORE' => 'Kleeja Store',
|
||||
'KLJ_VER_NO_PLUGIN' => 'This plugin can works on Kleeja version %1$s up to version %2$s.',
|
||||
'VERSION' => 'Version',
|
||||
'DEVELOPER' => 'Developer',
|
||||
'ALL_PLUGINS_UPDATED' => 'There are no plugins that require an update currently...',
|
||||
];
|
||||
|
||||
@@ -4,260 +4,260 @@
|
||||
* Locale: en, English
|
||||
*/
|
||||
|
||||
return array(
|
||||
'DIR' => 'ltr',
|
||||
'LANG_SMALL_NAME' => 'en-us',
|
||||
return [
|
||||
'DIR' => 'ltr',
|
||||
'LANG_SMALL_NAME' => 'en-us',
|
||||
|
||||
'HOME' => 'Home',
|
||||
'INDEX' => 'Homepage',
|
||||
'SITE_CLOSED' => 'The website is closed.',
|
||||
'STOP_FOR_SIZE' => 'The service is suspended.',
|
||||
'SIZES_EXCCEDED' => 'We have ran out of space ... we will be back soon.',
|
||||
'SAFE_CODE' => 'Enable safety code for downloads',
|
||||
'LAST_VISIT' => 'Last visit',
|
||||
'FLS_LST_VST_SEARCH' => 'Show files since',
|
||||
'IMG_LST_VST_SEARCH' => 'Show images since',
|
||||
'NEXT' => 'Next »',
|
||||
'PREV' => '« Previous',
|
||||
'INFORMATION' => 'Instructions',
|
||||
'WELCOME' => 'Welcome',
|
||||
'KLEEJA_VERSION' => 'Kleeja version',
|
||||
'NUMBER_ONLINE' => 'registered online users',
|
||||
'USERS_SYSTEM' => 'Users System',
|
||||
'ERROR_NAVIGATATION' => 'Redirection Error ..',
|
||||
'LOGIN' => 'Login',
|
||||
'USERNAME' => 'User name',
|
||||
'PASSWORD' => 'Password',
|
||||
'LOSS_PASSWORD' => 'Forgot Password?',
|
||||
'LOGINED_BEFORE' => 'You are already logged in.',
|
||||
'LOGOUT' => 'Logout ',
|
||||
'EMPTY_FIELDS' => 'Error ... Missing Fields!',
|
||||
'LOGIN_SUCCESFUL' => 'You have logged in successfully.',
|
||||
'LOGIN_ERROR' => 'Error ... cannot login!',
|
||||
'REGISTER_CLOSED' => 'Sorry, the registration is currently closed.',
|
||||
'PLACE_NO_YOU' => 'Restricted Area',
|
||||
'NOT_EXSIT_USER' => 'The requested user doesn\'t exist, or it has been deleted.',
|
||||
'REGISTERED_BEFORE' => 'already',
|
||||
'REGISTER' => 'Register',
|
||||
'EMAIL' => 'Email address',
|
||||
'VERTY_CODE' => 'Security code',
|
||||
'WRONG_EMAIL' => 'Incorrect email address!',
|
||||
'WRONG_NAME' => 'The username must be 4 to 25 characters, and without spaces or special chars (only _- are allowed)!',
|
||||
'EXIST_NAME' => 'Someone has already registered with this username!',
|
||||
'EXIST_EMAIL' => 'Someone with this email address has already registered!',
|
||||
'WRONG_VERTY_CODE' => 'Incorrect security code!',
|
||||
'REGISTER_SUCCESFUL' => 'Thank you for registering.ً',
|
||||
'LOGOUT_SUCCESFUL' => 'Logged out successfully.',
|
||||
'LOGOUT_ERROR' => 'Logout Error!',
|
||||
'DEL_SELECTED' => 'Delete selected',
|
||||
'DEL_ALL' => 'Delete all my files',
|
||||
'HOME' => 'Home',
|
||||
'INDEX' => 'Homepage',
|
||||
'SITE_CLOSED' => 'The website is closed.',
|
||||
'STOP_FOR_SIZE' => 'The service is suspended.',
|
||||
'SIZES_EXCCEDED' => 'We have ran out of space ... we will be back soon.',
|
||||
'SAFE_CODE' => 'Enable safety code for downloads',
|
||||
'LAST_VISIT' => 'Last visit',
|
||||
'FLS_LST_VST_SEARCH' => 'Show files since',
|
||||
'IMG_LST_VST_SEARCH' => 'Show images since',
|
||||
'NEXT' => 'Next »',
|
||||
'PREV' => '« Previous',
|
||||
'INFORMATION' => 'Instructions',
|
||||
'WELCOME' => 'Welcome',
|
||||
'KLEEJA_VERSION' => 'Kleeja version',
|
||||
'NUMBER_ONLINE' => 'registered online users',
|
||||
'USERS_SYSTEM' => 'Users System',
|
||||
'ERROR_NAVIGATATION' => 'Redirection Error ..',
|
||||
'LOGIN' => 'Login',
|
||||
'USERNAME' => 'User name',
|
||||
'PASSWORD' => 'Password',
|
||||
'LOSS_PASSWORD' => 'Forgot Password?',
|
||||
'LOGINED_BEFORE' => 'You are already logged in.',
|
||||
'LOGOUT' => 'Logout ',
|
||||
'EMPTY_FIELDS' => 'Error ... Missing Fields!',
|
||||
'LOGIN_SUCCESFUL' => 'You have logged in successfully.',
|
||||
'LOGIN_ERROR' => 'Error ... cannot login!',
|
||||
'REGISTER_CLOSED' => 'Sorry, the registration is currently closed.',
|
||||
'PLACE_NO_YOU' => 'Restricted Area',
|
||||
'NOT_EXSIT_USER' => 'The requested user doesn\'t exist, or it has been deleted.',
|
||||
'REGISTERED_BEFORE' => 'already',
|
||||
'REGISTER' => 'Register',
|
||||
'EMAIL' => 'Email address',
|
||||
'VERTY_CODE' => 'Security code',
|
||||
'WRONG_EMAIL' => 'Incorrect email address!',
|
||||
'WRONG_NAME' => 'The username must be 4 to 25 characters, and without spaces or special chars (only _- are allowed)!',
|
||||
'EXIST_NAME' => 'Someone has already registered with this username!',
|
||||
'EXIST_EMAIL' => 'Someone with this email address has already registered!',
|
||||
'WRONG_VERTY_CODE' => 'Incorrect security code!',
|
||||
'REGISTER_SUCCESFUL' => 'Thank you for registering.ً',
|
||||
'LOGOUT_SUCCESFUL' => 'Logged out successfully.',
|
||||
'LOGOUT_ERROR' => 'Logout Error!',
|
||||
'DEL_SELECTED' => 'Delete selected',
|
||||
'DEL_ALL' => 'Delete all my files',
|
||||
'ALL_DELETED' => 'All files has been deleted',
|
||||
'NO_FILES_DELETE' => 'There is no files to delete them',
|
||||
'FILES_UPDATED' => 'File updated successfully.',
|
||||
'PUBLIC_USER_FILES' => 'User files' folder',
|
||||
'FILEUSER' => 'files' folder',
|
||||
'YOUR_FILEUSER' => 'Your folder',
|
||||
'COPY_AND_GET_DUD' => 'Copy URL and give it to your friends To see your files ',
|
||||
'CLOSED_FEATURE' => 'Closed feature',
|
||||
'USERFILE_CLOSED' => 'Users folders feature is closed !',
|
||||
'PFILE_4_FORUM' => 'Go to the users cp to change your details',
|
||||
'USER_PLACE' => 'Users Area',
|
||||
'PROFILE' => 'Profile',
|
||||
'EDIT_U_DATA' => 'Update your details',
|
||||
'PASS_ON_CHANGE' => 'Edit Password',
|
||||
'OLD' => 'Old',
|
||||
'NEW' => 'New',
|
||||
'NEW_AGAIN' => 'Confirm',
|
||||
'UPDATE' => 'Update',
|
||||
'PASS_O_PASS2' => 'The old password is required, and enter the new password carefully.',
|
||||
'DATA_CHANGED_O_LO' => 'Your details have been updated.',
|
||||
'CURRENT_PASS_WRONG' => 'Current password is wrong, it must be written correctly to change your data!',
|
||||
'DATA_CHANGED_NO' => 'No new details entered.',
|
||||
'LOST_PASS_FORUM' => 'Go to the forum to change your details ?',
|
||||
'GET_LOSTPASS' => 'Get your password',
|
||||
'E_GET_LOSTPASS' => 'Enter your email to receive your password.',
|
||||
'WRONG_DB_EMAIL' => 'The specified email address cannot be found in our database!',
|
||||
'GET_LOSTPASS_MSG' => "You have asked for your password to be reset but, to avoid spam click on the link below for confirmation : \r\n %1\$s \r\n New Password : %2\$s",
|
||||
'CANT_SEND_NEWPASS' => 'Error... the new password could not be sent!',
|
||||
'OK_SEND_NEWPASS' => 'We have sent you the new password',
|
||||
'OK_APPLY_NEWPASS' => 'New password set. you can now login to your account.',
|
||||
'GUIDE' => 'Allowed Extensions',
|
||||
'GUIDE_EXP' => 'Allowed extensions & Sizes',
|
||||
'EXT' => 'Extension',
|
||||
'SIZE' => 'Size',
|
||||
'REPORT' => 'Report',
|
||||
'YOURNAME' => 'Your name',
|
||||
'URL' => 'Link',
|
||||
'REASON' => 'Reason',
|
||||
'NO_ID' => 'No file selected ..!!',
|
||||
'NO_ME300RES' => 'The Reason field cannot be more than 300 characters!!',
|
||||
'THNX_REPORTED' => 'We have received your report, Thank you.',
|
||||
'RULES' => 'Terms',
|
||||
'NO_RULES_NOW' => 'No terms have been specified currently.',
|
||||
'E_RULES' => 'Below are the terms of our service',
|
||||
'CALL' => 'Contact Us',
|
||||
'SEND' => 'Send',
|
||||
'TEXT' => 'Comments',
|
||||
'NO_ME300TEXT' => 'The Comments field cannot be more than 300 characters!!',
|
||||
'THNX_CALLED' => 'Sent ... you will get a reply from us as soon as possible.',
|
||||
'NO_DEL_F' => 'Sorry, file deletion URL feature is disabled by admin',
|
||||
'E_DEL_F' => 'File deletion URL',
|
||||
'WRONG_URL' => 'There is something wrong with the URL ..',
|
||||
'DELETE_SUCCESFUL' => 'Deleted successfully.',
|
||||
'STATS' => 'Statistics',
|
||||
'STATS_CLOSED' => 'The statistics page is closed by the administrator.',
|
||||
'FILES_ST' => 'Uploaded',
|
||||
'FILE' => 'File',
|
||||
'IMAGE' => 'Image',
|
||||
'USERS_ST' => 'Total Users',
|
||||
'USER' => 'user',
|
||||
'SIZES_ST' => 'Total size of uploaded files',
|
||||
'LSTDELST' => 'Last check for un-downloaded (inactive) files',
|
||||
'FILES_UPDATED' => 'File updated successfully.',
|
||||
'PUBLIC_USER_FILES' => 'User files' folder',
|
||||
'FILEUSER' => 'files' folder',
|
||||
'YOUR_FILEUSER' => 'Your folder',
|
||||
'COPY_AND_GET_DUD' => 'Copy URL and give it to your friends To see your files ',
|
||||
'CLOSED_FEATURE' => 'Closed feature',
|
||||
'USERFILE_CLOSED' => 'Users folders feature is closed !',
|
||||
'PFILE_4_FORUM' => 'Go to the users cp to change your details',
|
||||
'USER_PLACE' => 'Users Area',
|
||||
'PROFILE' => 'Profile',
|
||||
'EDIT_U_DATA' => 'Update your details',
|
||||
'PASS_ON_CHANGE' => 'Edit Password',
|
||||
'OLD' => 'Old',
|
||||
'NEW' => 'New',
|
||||
'NEW_AGAIN' => 'Confirm',
|
||||
'UPDATE' => 'Update',
|
||||
'PASS_O_PASS2' => 'The old password is required, and enter the new password carefully.',
|
||||
'DATA_CHANGED_O_LO' => 'Your details have been updated.',
|
||||
'CURRENT_PASS_WRONG' => 'Current password is wrong, it must be written correctly to change your data!',
|
||||
'DATA_CHANGED_NO' => 'No new details entered.',
|
||||
'LOST_PASS_FORUM' => 'Go to the forum to change your details ?',
|
||||
'GET_LOSTPASS' => 'Get your password',
|
||||
'E_GET_LOSTPASS' => 'Enter your email to receive your password.',
|
||||
'WRONG_DB_EMAIL' => 'The specified email address cannot be found in our database!',
|
||||
'GET_LOSTPASS_MSG' => "You have asked for your password to be reset but, to avoid spam click on the link below for confirmation : \r\n %1\$s \r\n New Password : %2\$s",
|
||||
'CANT_SEND_NEWPASS' => 'Error... the new password could not be sent!',
|
||||
'OK_SEND_NEWPASS' => 'We have sent you the new password',
|
||||
'OK_APPLY_NEWPASS' => 'New password set. you can now login to your account.',
|
||||
'GUIDE' => 'Allowed Extensions',
|
||||
'GUIDE_EXP' => 'Allowed extensions & Sizes',
|
||||
'EXT' => 'Extension',
|
||||
'SIZE' => 'Size',
|
||||
'REPORT' => 'Report',
|
||||
'YOURNAME' => 'Your name',
|
||||
'URL' => 'Link',
|
||||
'REASON' => 'Reason',
|
||||
'NO_ID' => 'No file selected ..!!',
|
||||
'NO_ME300RES' => 'The Reason field cannot be more than 300 characters!!',
|
||||
'THNX_REPORTED' => 'We have received your report, Thank you.',
|
||||
'RULES' => 'Terms',
|
||||
'NO_RULES_NOW' => 'No terms have been specified currently.',
|
||||
'E_RULES' => 'Below are the terms of our service',
|
||||
'CALL' => 'Contact Us',
|
||||
'SEND' => 'Send',
|
||||
'TEXT' => 'Comments',
|
||||
'NO_ME300TEXT' => 'The Comments field cannot be more than 300 characters!!',
|
||||
'THNX_CALLED' => 'Sent ... you will get a reply from us as soon as possible.',
|
||||
'NO_DEL_F' => 'Sorry, file deletion URL feature is disabled by admin',
|
||||
'E_DEL_F' => 'File deletion URL',
|
||||
'WRONG_URL' => 'There is something wrong with the URL ..',
|
||||
'DELETE_SUCCESFUL' => 'Deleted successfully.',
|
||||
'STATS' => 'Statistics',
|
||||
'STATS_CLOSED' => 'The statistics page is closed by the administrator.',
|
||||
'FILES_ST' => 'Uploaded',
|
||||
'FILE' => 'File',
|
||||
'IMAGE' => 'Image',
|
||||
'USERS_ST' => 'Total Users',
|
||||
'USER' => 'user',
|
||||
'SIZES_ST' => 'Total size of uploaded files',
|
||||
'LSTDELST' => 'Last check for un-downloaded (inactive) files',
|
||||
|
||||
'LAST_1_H' => 'Statistics for the past hour',
|
||||
'DOWNLAOD' => 'Download',
|
||||
'DOWNLOAD' => 'Download',
|
||||
'FILE_FOUNDED' => 'File has been found .. ',
|
||||
'WAIT' => 'Please wait ..',
|
||||
'CLICK_DOWN' => 'Click here to download',
|
||||
'JS_MUST_ON' => 'Enable JavaScript in your browser!',
|
||||
'FILE_INFO' => 'File Info',
|
||||
'FILENAME' => 'File name',
|
||||
'FILESIZE' => 'File size',
|
||||
'FILETYPE' => 'File type',
|
||||
'FILEDATE' => 'File date',
|
||||
'LAST_DOWN' => 'Last download',
|
||||
'FILEUPS' => 'Number of downloads',
|
||||
'FILEREPORT' => 'Report violation of terms',
|
||||
'FILE_NO_FOUNDED' => 'File cannot be found!',
|
||||
'IMG_NO_FOUNDED' => 'Image cannot be found!',
|
||||
'NOT_IMG' => 'This is not an image!',
|
||||
'MORE_F_FILES' => 'This is the final limit for input fields',
|
||||
'DOWNLOAD_F' => 'Upload Files',
|
||||
'DOWNLOAD_T' => 'Download From Link',
|
||||
'PAST_URL_HERE' => 'Paste Link Here',
|
||||
'SAME_FILE_EXIST' => 'File "%s" already exist, Rename it and try again.',
|
||||
'NO_FILE_SELECTED' => 'No file selected!',
|
||||
'WRONG_F_NAME' => 'File name "%s" contains restricted characters.',
|
||||
'FORBID_EXT' => 'Extension "%s" not supported.',
|
||||
'SIZE_F_BIG' => 'File size of "%1$s" must be smaller than %2$s .',
|
||||
'LAST_1_H' => 'Statistics for the past hour',
|
||||
'DOWNLAOD' => 'Download',
|
||||
'DOWNLOAD' => 'Download',
|
||||
'FILE_FOUNDED' => 'File has been found .. ',
|
||||
'WAIT' => 'Please wait ..',
|
||||
'CLICK_DOWN' => 'Click here to download',
|
||||
'JS_MUST_ON' => 'Enable JavaScript in your browser!',
|
||||
'FILE_INFO' => 'File Info',
|
||||
'FILENAME' => 'File name',
|
||||
'FILESIZE' => 'File size',
|
||||
'FILETYPE' => 'File type',
|
||||
'FILEDATE' => 'File date',
|
||||
'LAST_DOWN' => 'Last download',
|
||||
'FILEUPS' => 'Number of downloads',
|
||||
'FILEREPORT' => 'Report violation of terms',
|
||||
'FILE_NO_FOUNDED' => 'File cannot be found!',
|
||||
'IMG_NO_FOUNDED' => 'Image cannot be found!',
|
||||
'NOT_IMG' => 'This is not an image!',
|
||||
'MORE_F_FILES' => 'This is the final limit for input fields',
|
||||
'DOWNLOAD_F' => 'Upload Files',
|
||||
'DOWNLOAD_T' => 'Download From Link',
|
||||
'PAST_URL_HERE' => 'Paste Link Here',
|
||||
'SAME_FILE_EXIST' => 'File "%s" already exist, Rename it and try again.',
|
||||
'NO_FILE_SELECTED' => 'No file selected!',
|
||||
'WRONG_F_NAME' => 'File name "%s" contains restricted characters.',
|
||||
'FORBID_EXT' => 'Extension "%s" not supported.',
|
||||
'SIZE_F_BIG' => 'File size of "%1$s" must be smaller than %2$s .',
|
||||
|
||||
'URL_F_DEL' => 'Link to delete the file',
|
||||
'URL_F_THMB' => 'Thumbnail Link',
|
||||
'URL_F_FILE' => 'File Link',
|
||||
'URL_F_IMG' => 'Image Link',
|
||||
'URL_F_BBC' => 'Forums Link (BBCode)',
|
||||
'IMG_DOWNLAODED' => 'Image uploaded successfully',
|
||||
'FILE_DOWNLAODED' => 'File uploaded successfully',
|
||||
'CANT_UPLAOD' => 'Error: cannot upload file "%s" for UNKNOWN reason!',
|
||||
'CANT_DIR_CRT' => 'The folder has not been created automatically, you must create it manually.',
|
||||
'AGREE_RULES' => 'By clicking on the button below, you agree to %1$sService terms%2$s.',
|
||||
'URL_CANT_GET' => 'error during get file from url..',
|
||||
'ADMINCP' => 'Control Panel',
|
||||
'URL_F_DEL' => 'Link to delete the file',
|
||||
'URL_F_THMB' => 'Thumbnail Link',
|
||||
'URL_F_FILE' => 'File Link',
|
||||
'URL_F_IMG' => 'Image Link',
|
||||
'URL_F_BBC' => 'Forums Link (BBCode)',
|
||||
'IMG_DOWNLAODED' => 'Image uploaded successfully',
|
||||
'FILE_DOWNLAODED' => 'File uploaded successfully',
|
||||
'CANT_UPLAOD' => 'Error: cannot upload file "%s" for UNKNOWN reason!',
|
||||
'CANT_DIR_CRT' => 'The folder has not been created automatically, you must create it manually.',
|
||||
'AGREE_RULES' => 'By clicking on the button below, you agree to %1$sService terms%2$s.',
|
||||
'URL_CANT_GET' => 'error during get file from url..',
|
||||
'ADMINCP' => 'Control Panel',
|
||||
|
||||
'GO_BACK_BROWSER' => 'Go back',
|
||||
'U_R_BANNED' => 'Your IP has been banned.',
|
||||
'U_R_FLOODER' => 'it's anti-flood system ...',
|
||||
'YES' => 'Yes',
|
||||
'NO' => 'No',
|
||||
'LANGUAGE' => 'Language',
|
||||
'STYLE' => 'Style',
|
||||
'NORMAL' => 'Normal',
|
||||
'UPDATE_FILES' => 'Update Files',
|
||||
'BY' => 'By',
|
||||
'FILDER' => 'Folder',
|
||||
'DELETE' => 'Delete',
|
||||
'GUST' => 'Guest',
|
||||
'NAME' => 'Name',
|
||||
'CLICKHERE' => 'Click Here',
|
||||
'TIME' => 'Time',
|
||||
'IP' => 'IP',
|
||||
'RETURN_HOME' => 'Return to home',
|
||||
'TODAY' => 'Today',
|
||||
'DAYS' => 'Days',
|
||||
'BITE' => 'byte',
|
||||
'SUBMIT' => 'Submit',
|
||||
'EDIT' => 'Edit',
|
||||
'DISABLE' => 'Disable',
|
||||
'ENABLE' => 'Enable',
|
||||
'OPEN' => 'Open',
|
||||
'KILOBYTE' => 'Kilobyte',
|
||||
'NOTE' => 'Note',
|
||||
'WARN' => 'Warning',
|
||||
'NOT_SAFE_FILE' => 'Kleeja found that the File "%s" is not safe!',
|
||||
'ARE_YOU_SURE_DO_THIS' => 'Are you sure you want to do this?',
|
||||
'SITE_FOR_MEMBER_ONLY' => 'This center is only for members, register or login to upload your files.',
|
||||
'AUTH_INTEGRATION_N_UTF8_T' => '%s is not utf8',
|
||||
'AUTH_INTEGRATION_N_UTF8' => '%s database must be utf8 to be integrated with Kleeja !.',
|
||||
'SCRIPT_AUTH_PATH_WRONG' => 'Path of %s is not valid, change it now.',
|
||||
'SHOW_MY_FILECP' => 'Show my files',
|
||||
'PASS_CHANGE' => 'Change password',
|
||||
'EDIT_U_AVATER' => 'ُEdit your avatar',
|
||||
'EDIT_U_AVATER_LINK' => 'to change your avatar, go to this site %1$s" Click Here "s%2$s then register via a Email that you register in the defaultUploader site.',
|
||||
'MOST_EVER_ONLINE' => 'Most registered users ever online was',
|
||||
'ON' => 'on',
|
||||
'LAST_REG' => 'newest member',
|
||||
'NEW_USER' => 'New user',
|
||||
'GO_BACK_BROWSER' => 'Go back',
|
||||
'U_R_BANNED' => 'Your IP has been banned.',
|
||||
'U_R_FLOODER' => 'it's anti-flood system ...',
|
||||
'YES' => 'Yes',
|
||||
'NO' => 'No',
|
||||
'LANGUAGE' => 'Language',
|
||||
'STYLE' => 'Style',
|
||||
'NORMAL' => 'Normal',
|
||||
'UPDATE_FILES' => 'Update Files',
|
||||
'BY' => 'By',
|
||||
'FILDER' => 'Folder',
|
||||
'DELETE' => 'Delete',
|
||||
'GUST' => 'Guest',
|
||||
'NAME' => 'Name',
|
||||
'CLICKHERE' => 'Click Here',
|
||||
'TIME' => 'Time',
|
||||
'IP' => 'IP',
|
||||
'RETURN_HOME' => 'Return to home',
|
||||
'TODAY' => 'Today',
|
||||
'DAYS' => 'Days',
|
||||
'BITE' => 'byte',
|
||||
'SUBMIT' => 'Submit',
|
||||
'EDIT' => 'Edit',
|
||||
'DISABLE' => 'Disable',
|
||||
'ENABLE' => 'Enable',
|
||||
'OPEN' => 'Open',
|
||||
'KILOBYTE' => 'Kilobyte',
|
||||
'NOTE' => 'Note',
|
||||
'WARN' => 'Warning',
|
||||
'NOT_SAFE_FILE' => 'Kleeja found that the File "%s" is not safe!',
|
||||
'ARE_YOU_SURE_DO_THIS' => 'Are you sure you want to do this?',
|
||||
'SITE_FOR_MEMBER_ONLY' => 'This center is only for members, register or login to upload your files.',
|
||||
'AUTH_INTEGRATION_N_UTF8_T' => '%s is not utf8',
|
||||
'AUTH_INTEGRATION_N_UTF8' => '%s database must be utf8 to be integrated with Kleeja !.',
|
||||
'SCRIPT_AUTH_PATH_WRONG' => 'Path of %s is not valid, change it now.',
|
||||
'SHOW_MY_FILECP' => 'Show my files',
|
||||
'PASS_CHANGE' => 'Change password',
|
||||
'EDIT_U_AVATER' => 'ُEdit your avatar',
|
||||
'EDIT_U_AVATER_LINK' => 'to change your avatar, go to this site %1$s" Click Here "s%2$s then register via a Email that you register in the defaultUploader site.',
|
||||
'MOST_EVER_ONLINE' => 'Most registered users ever online was',
|
||||
'ON' => 'on',
|
||||
'LAST_REG' => 'newest member',
|
||||
'NEW_USER' => 'New user',
|
||||
|
||||
'COPYRIGHTS_X' => 'All rights reserved',
|
||||
'CHECK_ALL' => 'Check all',
|
||||
'BROSWERF' => 'User files',
|
||||
'REMME' => 'Remember me',
|
||||
'REMME_EXP' => 'Check this if your device isn\'t shared with others',
|
||||
'HOUR' => 'an hour',
|
||||
'5HOURS' => '5 hours',
|
||||
'DAY' => 'a day',
|
||||
'WEEK' => 'a week',
|
||||
'MONTH' => 'a month',
|
||||
'YEAR' => 'a year',
|
||||
'INVALID_FORM_KEY' => 'Invalid form, or your session was expired.',
|
||||
'INVALID_GET_KEY' => 'Sorry, The requested link is expired, and is blocked for security reason, go back and try again.',
|
||||
'REFRESH_CAPTCHA' => 'Click to get a new CAPTCHA image',
|
||||
'CHOSE_F' => 'Please select at least one file',
|
||||
'COPYRIGHTS_X' => 'All rights reserved',
|
||||
'CHECK_ALL' => 'Check all',
|
||||
'BROSWERF' => 'User files',
|
||||
'REMME' => 'Remember me',
|
||||
'REMME_EXP' => 'Check this if your device isn\'t shared with others',
|
||||
'HOUR' => 'an hour',
|
||||
'5HOURS' => '5 hours',
|
||||
'DAY' => 'a day',
|
||||
'WEEK' => 'a week',
|
||||
'MONTH' => 'a month',
|
||||
'YEAR' => 'a year',
|
||||
'INVALID_FORM_KEY' => 'Invalid form, or your session was expired.',
|
||||
'INVALID_GET_KEY' => 'Sorry, The requested link is expired, and is blocked for security reason, go back and try again.',
|
||||
'REFRESH_CAPTCHA' => 'Click to get a new CAPTCHA image',
|
||||
'CHOSE_F' => 'Please select at least one file',
|
||||
|
||||
'NOTE_CODE' => 'Enter the letters shown in the image accurately',
|
||||
'USER_LOGIN' => ' Login + Members Only ',
|
||||
'FILES_DELETED' => 'Files successfully deleted.',
|
||||
'ALL_FILES' => 'Number of all files',
|
||||
'ALL_IMAGES' => 'Number of all images',
|
||||
'NO_FILE_USER' => 'No files were found in the account!',
|
||||
'SHOWFILESBYIP' => 'Show files by IP',
|
||||
'WAIT_LOADING' => 'Please wait, the files are being uploaded to the server...',
|
||||
'NOTICECLOSED' => 'Note: website is closed',
|
||||
'UNKNOWN' => 'Unknown',
|
||||
'WE_UPDATING_KLEEJA_NOW' => 'Closed for maintenance, Check back soon...',
|
||||
'ERROR_TRY_AGAIN' => 'Error, try again.',
|
||||
'VIEW' => 'View',
|
||||
'NONE' => 'None',
|
||||
'SEARCH_STAT' => 'Search Engines Stats',
|
||||
'NOTHING' => 'There are no nothing!',
|
||||
'YOU_HAVE_TO_WAIT' => 'Wait %s seconds .. then try to re-upload your files',
|
||||
'REPEAT_PASS' => 'Repeat Password',
|
||||
'PASS_NEQ_PASS2' => 'Passwords are not equal!',
|
||||
'NOTE_CODE' => 'Enter the letters shown in the image accurately',
|
||||
'USER_LOGIN' => ' Login + Members Only ',
|
||||
'FILES_DELETED' => 'Files successfully deleted.',
|
||||
'ALL_FILES' => 'Number of all files',
|
||||
'ALL_IMAGES' => 'Number of all images',
|
||||
'NO_FILE_USER' => 'No files were found in the account!',
|
||||
'SHOWFILESBYIP' => 'Show files by IP',
|
||||
'WAIT_LOADING' => 'Please wait, the files are being uploaded to the server...',
|
||||
'NOTICECLOSED' => 'Note: website is closed',
|
||||
'UNKNOWN' => 'Unknown',
|
||||
'WE_UPDATING_KLEEJA_NOW' => 'Closed for maintenance, Check back soon...',
|
||||
'ERROR_TRY_AGAIN' => 'Error, try again.',
|
||||
'VIEW' => 'View',
|
||||
'NONE' => 'None',
|
||||
'SEARCH_STAT' => 'Search Engines Stats',
|
||||
'NOTHING' => 'There are no nothing!',
|
||||
'YOU_HAVE_TO_WAIT' => 'Wait %s seconds .. then try to re-upload your files',
|
||||
'REPEAT_PASS' => 'Repeat Password',
|
||||
'PASS_NEQ_PASS2' => 'Passwords are not equal!',
|
||||
|
||||
'GROUP' => 'Group',
|
||||
'ADMINS' => 'Admins',
|
||||
'GUESTS' => 'Guests',
|
||||
'USERS' => 'Users',
|
||||
'DELETE_INSTALL_FOLDER' => 'To start using Kleeja, delete "install" folder, Kleeja will never work while this folder exists.',
|
||||
'HV_NOT_PRVLG_ACCESS' => 'You don\'t have privilege to access this page.',
|
||||
'W_PERIODS_0' => 'second',
|
||||
'W_PERIODS_1' => 'minute',
|
||||
'W_PERIODS_2' => 'hour',
|
||||
'W_PERIODS_3' => 'day',
|
||||
'W_PERIODS_4' => 'week',
|
||||
'W_PERIODS_5' => 'month',
|
||||
'W_PERIODS_6' => 'year',
|
||||
'W_PERIODS_7' => 'decade',
|
||||
'GROUP' => 'Group',
|
||||
'ADMINS' => 'Admins',
|
||||
'GUESTS' => 'Guests',
|
||||
'USERS' => 'Users',
|
||||
'DELETE_INSTALL_FOLDER' => 'To start using Kleeja, delete "install" folder, Kleeja will never work while this folder exists.',
|
||||
'HV_NOT_PRVLG_ACCESS' => 'You don\'t have privilege to access this page.',
|
||||
'W_PERIODS_0' => 'second',
|
||||
'W_PERIODS_1' => 'minute',
|
||||
'W_PERIODS_2' => 'hour',
|
||||
'W_PERIODS_3' => 'day',
|
||||
'W_PERIODS_4' => 'week',
|
||||
'W_PERIODS_5' => 'month',
|
||||
'W_PERIODS_6' => 'year',
|
||||
'W_PERIODS_7' => 'decade',
|
||||
|
||||
'W_PERIODS_DP_0'=> "two seconds",
|
||||
'W_PERIODS_DP_1'=> "two minutes",
|
||||
'W_PERIODS_DP_2'=> "two hours",
|
||||
'W_PERIODS_DP_3'=> "two days",
|
||||
'W_PERIODS_DP_4'=> "two weeks",
|
||||
'W_PERIODS_DP_5'=> "two months",
|
||||
'W_PERIODS_DP_6'=> "two years",
|
||||
'W_PERIODS_DP_7'=> "two decades",
|
||||
'W_PERIODS_DP_0'=> 'two seconds',
|
||||
'W_PERIODS_DP_1'=> 'two minutes',
|
||||
'W_PERIODS_DP_2'=> 'two hours',
|
||||
'W_PERIODS_DP_3'=> 'two days',
|
||||
'W_PERIODS_DP_4'=> 'two weeks',
|
||||
'W_PERIODS_DP_5'=> 'two months',
|
||||
'W_PERIODS_DP_6'=> 'two years',
|
||||
'W_PERIODS_DP_7'=> 'two decades',
|
||||
|
||||
'W_PERIODS_P_0' => 'seconds',
|
||||
'W_PERIODS_P_1' => 'minutes',
|
||||
@@ -269,23 +269,23 @@ return array(
|
||||
'W_PERIODS_P_7' => 'decades',
|
||||
|
||||
|
||||
'W_FROM' => 'from',
|
||||
'W_AGO' => 'ago',
|
||||
'TIME_PM' => 'pm',
|
||||
'TIME_AM' => 'am',
|
||||
'NOT_YET' => 'Not yet!',
|
||||
'NOT_FOUND' => 'This file is not exist. either deleted by the user or the administrator or there is an error opening the file!.',
|
||||
'TIME_ZONE' => 'Time zone',
|
||||
'OR' => 'or',
|
||||
'AND' => 'and',
|
||||
'CHANGE' => 'Change',
|
||||
'FOR' => 'for',
|
||||
'ALL' => 'All',
|
||||
'NOW' => 'Now',
|
||||
'EMAIL_CHANGE_REQ_PASS' => 'In order to change your email address, It\'s required to type your current password.',
|
||||
'DRAG_AND_DROP' => 'Drop a file inside…',
|
||||
'OR_MANUAL_SELECT' => 'Or click here to <em>Select</em> a file manually..',
|
||||
//3.0.3
|
||||
'NOTIFICATIONS' => 'Notifications',
|
||||
'KJ_TWEETS' => 'Kleeja Tweets' ,
|
||||
);
|
||||
'W_FROM' => 'from',
|
||||
'W_AGO' => 'ago',
|
||||
'TIME_PM' => 'pm',
|
||||
'TIME_AM' => 'am',
|
||||
'NOT_YET' => 'Not yet!',
|
||||
'NOT_FOUND' => 'This file is not exist. either deleted by the user or the administrator or there is an error opening the file!.',
|
||||
'TIME_ZONE' => 'Time zone',
|
||||
'OR' => 'or',
|
||||
'AND' => 'and',
|
||||
'CHANGE' => 'Change',
|
||||
'FOR' => 'for',
|
||||
'ALL' => 'All',
|
||||
'NOW' => 'Now',
|
||||
'EMAIL_CHANGE_REQ_PASS' => 'In order to change your email address, It\'s required to type your current password.',
|
||||
'DRAG_AND_DROP' => 'Drop a file inside…',
|
||||
'OR_MANUAL_SELECT' => 'Or click here to <em>Select</em> a file manually..',
|
||||
//3.0.3
|
||||
'NOTIFICATIONS' => 'Notifications',
|
||||
'KJ_TWEETS' => 'Kleeja Tweets' ,
|
||||
];
|
||||
|
||||
@@ -5,113 +5,113 @@
|
||||
//
|
||||
|
||||
|
||||
return array(
|
||||
'DIR' => 'ltr',
|
||||
'INST_INSTALL_WIZARD' => 'Kleeja installing wizard',
|
||||
'INST_INSTALL_CLEAN_VER'=> 'New Installation',
|
||||
'INST_UPDATE_P_VER' => 'Update ',
|
||||
'INST_AGR_LICENSE' => 'I agree to terms and agreements',
|
||||
'INST_NEXT' => 'Next',
|
||||
'INST_PREVIOUS' => 'back',
|
||||
'INST_SITE_INFO' => 'Site Info',
|
||||
'INST_ADMIN_INFO' => 'Admin Info',
|
||||
'INST_CHANG_CONFIG' => 'Missing requirements ... make sure you have edited the config.php file.',
|
||||
'INST_CONNCET_ERR' => 'Cannot connect ..',
|
||||
'INST_NO_WRTABLE' => 'The directory is not writable',
|
||||
'INST_GOOD_GO' => 'Everything seems to be OK .... continue',
|
||||
'INST_MSGINS' => 'Welcome to our uploading service, here you can upload anything as long as it does not violate our terms.',
|
||||
'INST_CRT_CALL' => 'Comments table created.',
|
||||
'INST_CRT_ONL' => 'Online users table created.',
|
||||
'INST_CRT_REPRS' => 'Reports table created.',
|
||||
'INST_CRT_STS' => 'Statistics table created.',
|
||||
'INST_CRT_USRS' => 'Users table created.',
|
||||
'INST_CRT_ADM' => 'Admin details created.',
|
||||
'INST_CRT_FLS' => 'Files table created.',
|
||||
'INST_CRT_CNF' => 'Settings table created.',
|
||||
'INST_CRT_EXT' => 'Extensions table created.',
|
||||
'INST_CRT_HKS' => 'Hacks table created',
|
||||
'INST_CRT_LNG' => 'Language table created',
|
||||
return [
|
||||
'DIR' => 'ltr',
|
||||
'INST_INSTALL_WIZARD' => 'Kleeja installing wizard',
|
||||
'INST_INSTALL_CLEAN_VER'=> 'New Installation',
|
||||
'INST_UPDATE_P_VER' => 'Update ',
|
||||
'INST_AGR_LICENSE' => 'I agree to terms and agreements',
|
||||
'INST_NEXT' => 'Next',
|
||||
'INST_PREVIOUS' => 'back',
|
||||
'INST_SITE_INFO' => 'Site Info',
|
||||
'INST_ADMIN_INFO' => 'Admin Info',
|
||||
'INST_CHANG_CONFIG' => 'Missing requirements ... make sure you have edited the config.php file.',
|
||||
'INST_CONNCET_ERR' => 'Cannot connect ..',
|
||||
'INST_NO_WRTABLE' => 'The directory is not writable',
|
||||
'INST_GOOD_GO' => 'Everything seems to be OK .... continue',
|
||||
'INST_MSGINS' => 'Welcome to our uploading service, here you can upload anything as long as it does not violate our terms.',
|
||||
'INST_CRT_CALL' => 'Comments table created.',
|
||||
'INST_CRT_ONL' => 'Online users table created.',
|
||||
'INST_CRT_REPRS' => 'Reports table created.',
|
||||
'INST_CRT_STS' => 'Statistics table created.',
|
||||
'INST_CRT_USRS' => 'Users table created.',
|
||||
'INST_CRT_ADM' => 'Admin details created.',
|
||||
'INST_CRT_FLS' => 'Files table created.',
|
||||
'INST_CRT_CNF' => 'Settings table created.',
|
||||
'INST_CRT_EXT' => 'Extensions table created.',
|
||||
'INST_CRT_HKS' => 'Hacks table created',
|
||||
'INST_CRT_LNG' => 'Language table created',
|
||||
|
||||
'INST_CRT_PLG' => 'Plugins table created',
|
||||
'INST_SQL_ERR' => 'Error Executing SQL .. ',
|
||||
'INST_FINISH_SQL' => 'Kleeja was installed successfully',
|
||||
'INST_NOTES' => 'Installation Notes ..!',
|
||||
'INST_END' => 'The installation wizard is finished ,, Please remove the INSTALL directory..!',
|
||||
'INST_NOTE_D' => 'Any observations or problems , please contact with the developers kleeja..!!',
|
||||
'INST_FINISH_ERRSQL' => 'Oops! there seems to be a problem, try again.',
|
||||
'INST_KLEEJADEVELOPERS' => 'Thank you for using Kleeja, and we wish you a good luck.',
|
||||
'SITENAME' => 'Website title',
|
||||
'SITEURL' => 'Website URL',
|
||||
'SITEMAIL' => 'Website Email',
|
||||
'USERNAME' => 'Username',
|
||||
'PASSWORD' => 'Password',
|
||||
'PASSWORD2' => 'Password Again',
|
||||
'EMAIL' => 'Email',
|
||||
'INDEX' => 'Home',
|
||||
'ADMINCP' => 'Control Panel',
|
||||
'EMPTY_FIELDS' => 'Some important fields were left blank!',
|
||||
'WRONG_EMAIL' => 'Incorrect Email Address!',
|
||||
|
||||
|
||||
'DB_INFO_NW' => 'Enter the database information correctly .. Then press Next and the wizard will export the config.php file and put it in a directory the main script !',
|
||||
'DB_INFO' => 'Enter the database information ..!',
|
||||
'DB_SERVER' => 'Host',
|
||||
'DB_TYPE' => 'Database type',
|
||||
'DB_TYPE_MYSQL' => 'MySQL Standard',
|
||||
'DB_TYPE_MYSQLI' => 'MySQL Improved',
|
||||
'DB_USER' => 'Database Username',
|
||||
'DB_PASSWORD' => 'Database Password',
|
||||
'DB_NAME' => 'Database Name',
|
||||
'DB_PREFIX' => 'Tables prefix',
|
||||
'VALIDATING_FORM_WRONG' => 'A required field was left blank!',
|
||||
'CONFIG_EXISTS' => 'Config.php was found, Continue...',
|
||||
'INST_SUBMIT_CONFIGOK' => 'Upload the file in the main directory',
|
||||
'INST_EXPORT' => 'Export File',
|
||||
'INST_OTHER_INFO' => 'Other info',
|
||||
'URLS_TYPES' => 'Style of File urls',
|
||||
'DEFAULT' => 'Default - recommended',
|
||||
'FILENAME_URL' => 'Filename',
|
||||
'DIRECT_URL' => 'Direct links - no stats',
|
||||
'LIKE_THIS' => 'Example',
|
||||
|
||||
//
|
||||
'FUNCTIONS_CHECK' => 'Functions Check',
|
||||
'RE_CHECK' => 'ReCheck',
|
||||
'FUNCTION_IS_NOT_EXISTS' => 'The function %s is disabled.',
|
||||
'FUNCTION_IS_EXISTS' => 'The function %s is enabled.',
|
||||
'FUNCTION_DISC_UNLINK' => 'The function Unlink is used to remove and update cache files.',
|
||||
'FUNCTION_DISC_GD' => 'The function imagecreatetruecolor is function of GD library that is used to create thumbnails & control photos.',
|
||||
'FUNCTION_DISC_FOPEN' => 'The function fopen is used to control styles & files in kleeja.',
|
||||
'FUNCTION_DISC_MUF' => 'The function move_uploaded_file is used to upload files and it\'s the most important function in the script.',
|
||||
//
|
||||
'ADVICES_CHECK' => 'Advanced check (Optional)',
|
||||
'ADVICES_REGISTER_GLOBALS' => '<span style="color:red;padding:0 6px;">register_globals function is enabled ..!</span><br /> its recommended that you disable it.',
|
||||
'ADVICES_MAGIC_QUOTES' => '<span style="color:red;padding:0 6px;">magic_quotes function is enabled ..!</span><br /> it is recommended that you disable it.',
|
||||
|
||||
//UPDATE
|
||||
'INST_CHOOSE_UPDATE_FILE' => 'Choose the appropriate update file',
|
||||
'INST_ERR_NO_SELECTED_UPFILE_GOOD' => 'Inappropriate update file, or it is missing!',
|
||||
'INST_UPDATE_CUR_VER_IS_UP' => 'Your current version is newer than this update.',
|
||||
|
||||
'INST_NOTES_UPDATE' => 'Update Notes',
|
||||
'INST_CRT_PLG' => 'Plugins table created',
|
||||
'INST_SQL_ERR' => 'Error Executing SQL .. ',
|
||||
'INST_FINISH_SQL' => 'Kleeja was installed successfully',
|
||||
'INST_NOTES' => 'Installation Notes ..!',
|
||||
'INST_END' => 'The installation wizard is finished ,, Please remove the INSTALL directory..!',
|
||||
'INST_NOTE_D' => 'Any observations or problems , please contact with the developers kleeja..!!',
|
||||
'INST_FINISH_ERRSQL' => 'Oops! there seems to be a problem, try again.',
|
||||
'INST_KLEEJADEVELOPERS' => 'Thank you for using Kleeja, and we wish you a good luck.',
|
||||
'SITENAME' => 'Website title',
|
||||
'SITEURL' => 'Website URL',
|
||||
'SITEMAIL' => 'Website Email',
|
||||
'USERNAME' => 'Username',
|
||||
'PASSWORD' => 'Password',
|
||||
'PASSWORD2' => 'Password Again',
|
||||
'EMAIL' => 'Email',
|
||||
'INDEX' => 'Home',
|
||||
'ADMINCP' => 'Control Panel',
|
||||
'EMPTY_FIELDS' => 'Some important fields were left blank!',
|
||||
'WRONG_EMAIL' => 'Incorrect Email Address!',
|
||||
|
||||
|
||||
'INST_UPDATE_IS_FINISH' => 'Installation completed! you can now delete the INSTALL directory...',
|
||||
'DB_INFO_NW' => 'Enter the database information correctly .. Then press Next and the wizard will export the config.php file and put it in a directory the main script !',
|
||||
'DB_INFO' => 'Enter the database information ..!',
|
||||
'DB_SERVER' => 'Host',
|
||||
'DB_TYPE' => 'Database type',
|
||||
'DB_TYPE_MYSQL' => 'MySQL Standard',
|
||||
'DB_TYPE_MYSQLI' => 'MySQL Improved',
|
||||
'DB_USER' => 'Database Username',
|
||||
'DB_PASSWORD' => 'Database Password',
|
||||
'DB_NAME' => 'Database Name',
|
||||
'DB_PREFIX' => 'Tables prefix',
|
||||
'VALIDATING_FORM_WRONG' => 'A required field was left blank!',
|
||||
'CONFIG_EXISTS' => 'Config.php was found, Continue...',
|
||||
'INST_SUBMIT_CONFIGOK' => 'Upload the file in the main directory',
|
||||
'INST_EXPORT' => 'Export File',
|
||||
'INST_OTHER_INFO' => 'Other info',
|
||||
'URLS_TYPES' => 'Style of File urls',
|
||||
'DEFAULT' => 'Default - recommended',
|
||||
'FILENAME_URL' => 'Filename',
|
||||
'DIRECT_URL' => 'Direct links - no stats',
|
||||
'LIKE_THIS' => 'Example',
|
||||
|
||||
'INST_PHP_LESSMIN' => 'You need PHP %1$s or above to install Kleeja, your current version is %2$s',
|
||||
'INST_MYSQL_LESSMIN' => 'You need MySQL %1$s or above to install Kleeja, your current version is %2$s',
|
||||
'IS_IT_OFFICIAL' => 'Did you get your copy from Kleeja.com (Kleeja official site) ?',
|
||||
'IS_IT_OFFICIAL_DESC' => 'We receive a lot of complaints and questions about the cause of some bugs and issues which occur in kleeja and probably we can\'t figure out what the problem is . After we have checked we have found that there are some unofficially copies released from untrusted publishers .<span class="sure"> So are you sure of this copy is downloaded from kleeja official site ?</span>',
|
||||
'INST_WHAT_IS_KLEEJA_T' => 'What is Kleeja ?',
|
||||
|
||||
'INST_WHAT_IS_KLEEJA' => 'Keeja is a free, features rich, files and images upload system. Kleeja is developed to help webmasters to provide a decent files hosting service on their sites . Kleeja comes with a simple source code and powerful User system , also with easy template system so you can easily customize your styles ',
|
||||
|
||||
'INST_SPECIAL_KLEEJA' => 'Some Kleeja features .. !',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' => 'Kleeja has a simple and powerful user system which can be easily integrated with many boards . Kleeja provide simple admin control panel that enables you to control over everything in your site . Also you can customize Kleeja\'s style and install a lot of add-ons .... <a target="_blank" href="http://www.kleeja.com/features/">more details in Kleeja site </a>',
|
||||
'YES' => 'Yes',
|
||||
'NO' => 'No',
|
||||
|
||||
'KLEEJA_TEAM_MSG_NAME' => 'Kleeja Development Team',
|
||||
'KLEEJA_TEAM_MSG_TEXT' => "Thank you for choosing Kleeja to empower your website,\n We really hope you enjoy the unique experience that Kleeja offers to you.\nDon't forget to visit http://kleeja.com for future updates.",
|
||||
'FUNCTIONS_CHECK' => 'Functions Check',
|
||||
'RE_CHECK' => 'ReCheck',
|
||||
'FUNCTION_IS_NOT_EXISTS' => 'The function %s is disabled.',
|
||||
'FUNCTION_IS_EXISTS' => 'The function %s is enabled.',
|
||||
'FUNCTION_DISC_UNLINK' => 'The function Unlink is used to remove and update cache files.',
|
||||
'FUNCTION_DISC_GD' => 'The function imagecreatetruecolor is function of GD library that is used to create thumbnails & control photos.',
|
||||
'FUNCTION_DISC_FOPEN' => 'The function fopen is used to control styles & files in kleeja.',
|
||||
'FUNCTION_DISC_MUF' => 'The function move_uploaded_file is used to upload files and it\'s the most important function in the script.',
|
||||
|
||||
);
|
||||
'ADVICES_CHECK' => 'Advanced check (Optional)',
|
||||
'ADVICES_REGISTER_GLOBALS' => '<span style="color:red;padding:0 6px;">register_globals function is enabled ..!</span><br /> its recommended that you disable it.',
|
||||
'ADVICES_MAGIC_QUOTES' => '<span style="color:red;padding:0 6px;">magic_quotes function is enabled ..!</span><br /> it is recommended that you disable it.',
|
||||
|
||||
//UPDATE
|
||||
'INST_CHOOSE_UPDATE_FILE' => 'Choose the appropriate update file',
|
||||
'INST_ERR_NO_SELECTED_UPFILE_GOOD' => 'Inappropriate update file, or it is missing!',
|
||||
'INST_UPDATE_CUR_VER_IS_UP' => 'Your current version is newer than this update.',
|
||||
|
||||
'INST_NOTES_UPDATE' => 'Update Notes',
|
||||
|
||||
|
||||
'INST_UPDATE_IS_FINISH' => 'Installation completed! you can now delete the INSTALL directory...',
|
||||
|
||||
'INST_PHP_LESSMIN' => 'You need PHP %1$s or above to install Kleeja, your current version is %2$s',
|
||||
'INST_MYSQL_LESSMIN' => 'You need MySQL %1$s or above to install Kleeja, your current version is %2$s',
|
||||
'IS_IT_OFFICIAL' => 'Did you get your copy from Kleeja.com (Kleeja official site) ?',
|
||||
'IS_IT_OFFICIAL_DESC' => 'We receive a lot of complaints and questions about the cause of some bugs and issues which occur in kleeja and probably we can\'t figure out what the problem is . After we have checked we have found that there are some unofficially copies released from untrusted publishers .<span class="sure"> So are you sure of this copy is downloaded from kleeja official site ?</span>',
|
||||
'INST_WHAT_IS_KLEEJA_T' => 'What is Kleeja ?',
|
||||
|
||||
'INST_WHAT_IS_KLEEJA' => 'Keeja is a free, features rich, files and images upload system. Kleeja is developed to help webmasters to provide a decent files hosting service on their sites . Kleeja comes with a simple source code and powerful User system , also with easy template system so you can easily customize your styles ',
|
||||
|
||||
'INST_SPECIAL_KLEEJA' => 'Some Kleeja features .. !',
|
||||
'INST_WHAT_IS_KLEEJA_ONE' => 'Kleeja has a simple and powerful user system which can be easily integrated with many boards . Kleeja provide simple admin control panel that enables you to control over everything in your site . Also you can customize Kleeja\'s style and install a lot of add-ons .... <a target="_blank" href="http://www.kleeja.com/features/">more details in Kleeja site </a>',
|
||||
'YES' => 'Yes',
|
||||
'NO' => 'No',
|
||||
|
||||
'KLEEJA_TEAM_MSG_NAME' => 'Kleeja Development Team',
|
||||
'KLEEJA_TEAM_MSG_TEXT' => "Thank you for choosing Kleeja to empower your website,\n We really hope you enjoy the unique experience that Kleeja offers to you.\nDon't forget to visit http://kleeja.com for future updates.",
|
||||
|
||||
];
|
||||
|
||||
55
serve.php
55
serve.php
@@ -17,51 +17,51 @@ define('IN_SERVE', true);
|
||||
/**
|
||||
* Defaults rewrite rules
|
||||
*/
|
||||
$rules = array(
|
||||
'^index.html$' => ['file' => 'index.php'],
|
||||
'^download([0-9]*).html$' => ['file' => 'do.php', 'args' => 'id=$1'],
|
||||
'^downloadf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' => 'do.php', 'args' =>'filename=$1&x=$2'],
|
||||
'^down-([0-9]*).html$' => ['file' => 'do.php', 'args' => 'down=$1'],
|
||||
'^downf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' => 'do.php', 'args' => 'downf=$1&x=$2'],
|
||||
'^downex-([0-9]*).html$' => ['file' => 'do.php', 'args' => 'down=$1'],
|
||||
'^downexf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' =>'do.php', 'args' => 'downexf=$1&x=$2'],
|
||||
'^thumb([0-9]*).html$' => ['file' => 'do.php', 'args' => 'thmb=$1'],
|
||||
'^imagef-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' =>'do.php', 'args' => 'imgf=$1&x=$2'],
|
||||
'^thumbf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' => 'do.php', 'args' => 'thmbf=$1&x=$2'],
|
||||
'^image([0-9]*).html$' => ['file' => 'do.php', 'args' => 'img=$1'],
|
||||
'^del([a-zA-Z0-9_-]*).html$' => ['file' => 'go.php', 'args' => 'go=del&cd=$1'],
|
||||
'^(call|guide|rules|stats|report).html$' => ['file' =>'go.php', 'args' => 'go=$1'],
|
||||
'^report[_-]([0-9]*).html$' => ['file' => 'go.php', 'args' => 'go=report&id=$1'],
|
||||
$rules = [
|
||||
'^index.html$' => ['file' => 'index.php'],
|
||||
'^download([0-9]*).html$' => ['file' => 'do.php', 'args' => 'id=$1'],
|
||||
'^downloadf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' => 'do.php', 'args' =>'filename=$1&x=$2'],
|
||||
'^down-([0-9]*).html$' => ['file' => 'do.php', 'args' => 'down=$1'],
|
||||
'^downf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' => 'do.php', 'args' => 'downf=$1&x=$2'],
|
||||
'^downex-([0-9]*).html$' => ['file' => 'do.php', 'args' => 'down=$1'],
|
||||
'^downexf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' =>'do.php', 'args' => 'downexf=$1&x=$2'],
|
||||
'^thumb([0-9]*).html$' => ['file' => 'do.php', 'args' => 'thmb=$1'],
|
||||
'^imagef-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' =>'do.php', 'args' => 'imgf=$1&x=$2'],
|
||||
'^thumbf-(.*)-([a-zA-Z0-9_-]*).html$' => ['file' => 'do.php', 'args' => 'thmbf=$1&x=$2'],
|
||||
'^image([0-9]*).html$' => ['file' => 'do.php', 'args' => 'img=$1'],
|
||||
'^del([a-zA-Z0-9_-]*).html$' => ['file' => 'go.php', 'args' => 'go=del&cd=$1'],
|
||||
'^(call|guide|rules|stats|report).html$' => ['file' =>'go.php', 'args' => 'go=$1'],
|
||||
'^report[_-]([0-9]*).html$' => ['file' => 'go.php', 'args' => 'go=report&id=$1'],
|
||||
'^(filecp|profile|fileuser|register|login|logout).html$' => ['file' => 'ucp.php', 'args' => 'go=$1'],
|
||||
'^fileuser[_-]([0-9]+).html$' => ['file' => 'ucp.php', 'args' => 'go=fileuser&id=$1'],
|
||||
'^fileuser[_-]([0-9]+)-([0-9]+).html$' => ['file' => 'ucp.php', 'args' => 'go=fileuser&id=$1&page=$2'],
|
||||
'^fileuser[_-]([0-9]+).html$' => ['file' => 'ucp.php', 'args' => 'go=fileuser&id=$1'],
|
||||
'^fileuser[_-]([0-9]+)-([0-9]+).html$' => ['file' => 'ucp.php', 'args' => 'go=fileuser&id=$1&page=$2'],
|
||||
// #for future plugins
|
||||
'^go-(.*).html$' => ['file' => 'go.php', 'args' => 'go=$1'],
|
||||
|
||||
//--------->
|
||||
//don't remove the next line ever.
|
||||
#end_kleeja_rewrites_rules#
|
||||
//end_kleeja_rewrites_rules#
|
||||
//<---------
|
||||
);
|
||||
];
|
||||
|
||||
$request_uri = trim(strtok($_SERVER['REQUEST_URI'], '?'), '/');
|
||||
|
||||
|
||||
foreach($rules as $rule_regex => $rule_result)
|
||||
foreach ($rules as $rule_regex => $rule_result)
|
||||
{
|
||||
if (preg_match("/{$rule_regex}/", $request_uri, $matches))
|
||||
if (preg_match("/{$rule_regex}/", $request_uri, $matches))
|
||||
{
|
||||
if(! empty($rule_result['args']))
|
||||
if (! empty($rule_result['args']))
|
||||
{
|
||||
parse_str($rule_result['args'], $args);
|
||||
|
||||
foreach($args as $arg_key => $arg_value)
|
||||
foreach ($args as $arg_key => $arg_value)
|
||||
{
|
||||
if(preg_match('/^\$/', $arg_value))
|
||||
if (preg_match('/^\$/', $arg_value))
|
||||
{
|
||||
$match_number = ltrim($arg_value, '$');
|
||||
|
||||
if(isset($matches[$match_number]))
|
||||
if (isset($matches[$match_number]))
|
||||
{
|
||||
$_GET[$arg_key] = $matches[$match_number];
|
||||
}
|
||||
@@ -74,10 +74,11 @@ foreach($rules as $rule_regex => $rule_result)
|
||||
}
|
||||
|
||||
include $rule_result['file'];
|
||||
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
#fallback
|
||||
//fallback
|
||||
define('SERVE_FALLBACK', true);
|
||||
include 'go.php';
|
||||
include 'go.php';
|
||||
|
||||
Reference in New Issue
Block a user