| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/baberankings.com.bak/members/kernel/init/ |
Upload File : |
<?
/* K-Rate
(C) Rinalds Uzkalns, 2003-2004. All Rights Reserved
http://turn-k.net
Version: 1.00 (22.09.04)
*/
?>
<?
//set language specific fields for certain table
function set_language_specific($table, $fields) {
global $tables, $langs, $has_lang_fields, $lang_fields;
$has_lang_fields[$table] = true;
foreach ($fields as $f) {
//register the field
$lang_fields[$table][$f] = true;
//find the field
foreach ($tables[$table] as $key => $field)
if ($field['name'] == $f) break;
if (is_array($langs)) {
foreach ($langs as $k => $v) {
$field['name'] = $f.'_'.$v['l_code'];
$tables[$table][] = $field;
}
unset($tables[$table][$key]);
}
}
}
//create access privilege and assign it to admin command group
function set_perm_to_all($adm, $perm) {
global $act_perms;
foreach ((array)$adm as $key => $value)
$act_perms[$key] = $perm;
}
//create a privilege for a single command
function set_sub_perm($main_sect, $comm, $name, $depend = false) {
global $subprivileges;
$subprivileges[$main_sect][$name] = array('commands' => $comm, 'depend' => $depend);
return $name;
}
//create a privilege for delete operations
function set_sub_perm_delete($main_sect,$comm, $name, $depend = false) {
global $subprivileges;
$subprivileges[$main_sect][$name] = array('commands' => $comm,'type' => 'delete', 'depend' => $depend);
return $name;
}
//create a privilege for edit operations
function set_sub_perm_edit($main_sect,$comm, $name, $depend = false) {
global $subprivileges;
$subprivileges[$main_sect][$name] = array('commands' => $comm,'type' => 'edit', 'depend' => $depend);
return $name;
}
//create a privilege for accessing items by certain ID
function set_sub_perm_id($main_sect,$table, $field, $name, $depend = false) {
global $subprivileges;
$subprivileges[$main_sect][$name] = array('commands' => $comm,'type' => 'id', 'table' => $table, 'id_field' => $field, 'depend' => $depend);
return $name;
}
//create a privilege for delete operations
function set_sub_perm_field($main_sect,$table, $field, $value, $name, $depend = false) {
global $subprivileges;
$subprivileges[$main_sect][$name] = array('commands' => $comm,'type' => 'field', 'table' => $table, 'field' => $field, 'value' => $value, 'depend' => $depend);
return $name;
}
//get defined fields
require_once('includes/fields.php');
//get base tables
require_once 'includes/tables.php';
if (!defined('in_install') || defined('installed')) {
//initialize arrays
$box = $act_perms = $permissions = $install_dirs = $rewrite = $events = $page_modules = $options = $includes = $adm_includes = array();
//get installed modules
$mods = sql_query('SELECT * FROM '.$names['modstable'].' WHERE mod_active=1');
/* process all modules */
while ($line = sql_fetch_assoc($mods))
if ($line['mod_name'] != '') {
$mod = $line['mod_name'];
//clear previous values
$boxes = $menu_icons = $menu_descr = $inst_dirs = $rew = $onevent = $options = $adm = $inc = $adm_commands = $cron = array();
$adm_section = $whole_page = false;
$priority = $descr = $adm_group = $mod_name = '';
//get include paths for module
include 'modules/'.$mod.'/_index.php';
if (defined('in_admin') && file_exists('modules/'.$mod.'/_adm_index.php'))
include 'modules/'.$mod.'/_adm_index.php';
//module represents as whole page?
if ($whole_page)
$page_modules[] = $mod;
//make absolute paths for includes
foreach ($inc as $key => $value) $inc[$key] = 'modules/'.$mod.'/'.$value;
//merge with big include arrays :)
$includes = array_merge($includes, $inc);
//url rewrite
$rewrite = array_merge($rewrite, $rew);
//url rewrite
$box = array_merge($box, $boxes);
//merge with events array...
if (count($onevent) > 0)
foreach ($onevent as $key => $value) $events[$key][] = $mod.'/'.$value;
//admin data
if (defined('in_admin')) {
foreach ($adm as $key => $value) $adm[$key] = 'modules/'.$mod.'/admin/'.$value;
$adm_includes = array_merge($adm_includes, $adm);
//module representation in admin menu
$modules[$mod]['group'] = $adm_group;
$modules[$mod]['name'] = $mod_name;
$modules[$mod]['adm_menu'] = $adm_commands;
$modules[$mod]['adm_sect'] = $adm_section;
$modules[$mod]['adm_def'] = key($adm);
$modules[$mod]['cron'] = $cron;
}
$modules[$mod]['descr'] = $descr;
$modules[$mod]['menu_descr'] = $menu_descr;
$modules[$mod]['priority'] = $priority;
$modules[$mod]['menu_icons'] = $menu_icons;
$modules[$mod]['default'] = key($inc);
//get options
foreach ($options as $key => $value) {
$settings[$key] = $value;
$settings[$key]['cat'] = $mod;
$settings[$key]['module'] = true;
}
}
asort($page_modules);
extract($names);
//install new boxes
sql_query("DELETE FROM $configtable WHERE c_key='site_layout'");
if (!defined('site_layout')) {
function init_sort_boxes_order($a, $b) {
if ($a['order'] == $b['order']) return 0;
return ($a['order'] < $b['order']) ? -1 : 1;
}
uasort($box,'init_sort_boxes_order');
$bx = array();
foreach ($box as $key => $value) {
if ($value['on']) $bx[$value['pos']][] = $value['code'];
}
$c = base64_encode(serialize($bx));
define('site_layout',$c);
sql_query("INSERT INTO $configtable SET c_value='$c',c_key='site_layout'");
}
$boxes = array();
foreach ($box as $key => $value)
$boxes[$value['code']] = $value;
//admin privileges
$cn = count($tables[$admtable])-1;
foreach ($permissions as $key => $value){
$tables[$admtable][++$cn]['name'] = $key;
$tables[$admtable][$cn]['type'] = 'INTEGER';
}
$privileges = array_merge($permissions, $privileges);
}
?>