| 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/manage_data/ |
Upload File : |
<?
/* K-Rate
(C) Rinalds Uzkalns, 2003-2004. All Rights Reserved
http://turn-k.net
Version: 1.00 (22.09.04)
*/
?>
<?
function html2specialchars($str){
$trans_table = array_flip(get_html_translation_table(HTML_ENTITIES));
return strtr($str, $trans_table);
}
if (isset($en['save']) && (isset($_POST['edit']) || isset($_POST['file']))) {
if ($admin['adm_user'] == 'demo') {
echo '<b><font color=red>Action disabled for demo account for security reasons!</font></b><br>';
unset($en['save']);
unset($_POST['file']);
}
}
if (isset($en['save']) && (isset($_POST['edit']) || isset($_POST['file']))) {
//FILE UPLOAD METHODS
//upload the file without any checking
function upload_just_move($update_field = '', $function = null) {
global $table, $dir, $arr, $id;
if ($function != null) eval($function.';');
$file = str_replace('//','/',$dir.'/'.$arr['name']);
$f = @move_uploaded_file($arr['tmp_name'],$file);
if ($f && $update_field != '')
sql_query("UPDATE $table SET $update_field = '$arr[name]'");
return $arr['name'];
}
//rename to some field
function upload_rename_to_field($field, $function = null, $opts = array()) {
global $table, $rid, $id, $dir, $arr, $line;
$res = sql_query("SELECT * FROM $table WHERE $rid=$id");
$line = sql_fetch_assoc($res);
//custom function?
if ($function != null)
eval($function.';');
if ($opts['add_rand'])
$line[$field] .= '_'.rand(1,1000000);
$name = $line[$field].'.'.fileext($arr['name']);
$file = str_replace('//','/',$dir.'/'.$name);
$f = @move_uploaded_file($arr['tmp_name'],$file);
if ($opts['update_field']) {
sql_query("UPDATE $table SET $opts[update_field] = '$name' WHERE $rid = $id");
unlink($dir.'/'.$line[$opts['update_field']]);
}
}
//rename to some field and resize image
function upload_rename_to_field_resize($field, $w, $h, $function = null) {
//process upload first
global $table, $rid, $id, $dir, $arr, $file;
$res = sql_query("SELECT * FROM $table WHERE $rid=$id");
$line = sql_fetch_assoc($res);
$file = str_replace('//','/',$dir.'/'.$line[$field].'.jpg');
$r = rand(1,100000);
$temp = str_replace('//','/',$dir.'/'.$r.'-'.$line[$field].'.'.fileext($arr['name']));
$f = @move_uploaded_file($arr['tmp_name'],$temp);
//now resize the image
$s = getimagesize($temp);
if ($s[0] > $w || $s[1] > $h) {
create_thumbnail($w, $h, $temp, $file,20);
unlink($temp);
} else {
rename($temp, $file);
}
//custom function?
if ($function != null)
eval($function.';');
}
//categories?
foreach ($en as $key => $value)
if (substr($key,0,4) == 'cat_') {
$key = substr($key,4);
$id = substr($key,strrpos($key,'_')+1);
$key = substr($key,0,strrpos($key,'_'));
$_POST['edit'][$id][$key] = $value;
}
//save sql data
if (isset($_POST['edit']))
foreach ($_POST['edit'] as $id => $arr) {
//get previous data
$prev = sql_fetch_assoc(sql_query("SELECT * FROM $table WHERE $rid=$id"));
//build query
$st = '';
foreach ($arr as $key => $value)
$st .= ", $key = '".sql_escape_string(stripslashes(html2specialchars($value)))."'";
$st = substr($st,2);
//save changes
$q = 'UPDATE '.$table.' SET '.$st.' WHERE '.$rid.'='.$id;
sql_query($q);
//process approval functions
if ((int)$prev[$approver] == 0 && $prev[$status] != $arr[$status]) {
if ($approver != '')
sql_query("UPDATE $table SET $approver=$admin[adm_id] WHERE $rid=$id");
if (function_exists('on_approve')) on_approve($prev);
}
//add to slide show?
if ($prev[$daily_status] != $arr[$daily_status] && $prev[$daily_status] ==1) {
$q = 'UPDATE '.$table.' SET '.$daily_status.' = 0 WHERE '.$rid.'='.$id;
sql_query($q);
}
}
//delete records?
if (isset($_POST['del']))
foreach ($_POST['del'] as $id => $v)
if ($v == 'ON') {
if (function_exists('delete_record'))
delete_record($id);
$q = 'DELETE FROM '.$table.' WHERE '.$rid.'='.$id;
sql_query($q);
}
//save files
if (isset($_FILES))
foreach ($_FILES as $fid => $arr)
if ($arr['tmp_name'] != '') {
//get index and field name
$fid = substr($fid,strpos($fid,'_')+1);
$fid = $fid;
$id = substr($fid,0,strpos($fid,'_'));
$fid = substr($fid,strpos($fid,'_'));
$fid = substr($fid,1);
//process upload
$dir = $upload[$fid]['dir'];
eval($upload[$fid]['method'].';');
}
//custom save function
if (function_exists('save_data'))
save_data();
}
?>