} @closedir($dh); } # hurry, hurry section, links $del_cache_link = 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 $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_result = $SQL->build($cf_query); $cf_num = $SQL->num($cf_result); if ($cf_num > 4) { $stats_chart = 'arrayOfDataMulti = new Array('; $comma = false; #get currently right now stats, not cached one $prv_files = get_actual_stats('files'); $prev_imgs = get_actual_stats('imgs'); $prev_date = date('d-n-Y'); while ($row = $SQL->fetch($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; $day = date('d-n-Y') == $prev_date ? $lang['TODAY'] . ' ~ ' . $lang['NOW'] : ($prev_date == date('d-n-Y', time() - 60 * 60 * 24) ? $lang['YESTERDAY'] : $prev_date); $stats_chart .= ($comma ? ',' : '') . "[[{$t_files},{$t_imgs}],'" . ($cf_num > 6 ? str_replace(date('-Y'), '', $day) : $day) . "']"; $comma = true; $prv_files = $s_files; $prev_imgs = $s_imgs;
} #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 (!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) { default: # 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 = Customfile_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'; $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; $repair_tables_link = basename(ADMIN_PATH) . '?cp=r_repair&case=tables&' . $GET_FORM_KEY; $status_file_link = basename(ADMIN_PATH) . '?cp=r_repair&case=status_file&' . $GET_FORM_KEY; $stylee = "admin_repair"; break; // We, I mean developrts and support team anywhere, need sometime // some inforamtion about the status of Kleeja .. this will give // a zip file contain those data .. // We, I mean developrts and support team anywhere, need sometime // some inforamtion about the status of Kleeja .. this will give
$img_types = array('gif', 'jpg', 'png', 'bmp', 'jpeg', 'GIF', 'JPG', 'PNG', 'BMP', 'JPEG'); # # There is a bug with IN statment 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 (isset($_GET['last_visit'])) { $query['WHERE'] .= " AND f.time > " . intval($_GET['last_visit']); } else { $do_not_query_total_files = true; } $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($result_p); $nums_rows = $n_fetch['total_files']; $SQL->free($result_p); } //pager $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $Pager = new pagination($images_cp_perpage, $nums_rows, $currentPage); $start = $Pager->get_start_row(); $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_cp_perpage}"; $result = $SQL->build($query);
} #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 (!kleeja_check_form_key_get('REPAIR_FORM_KEY')) { kleeja_admin_err($lang['INVALID_GET_KEY'], true, $lang['ERROR'], true, ADMIN_PATH, 2); } } switch ($case) { default: # 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')); #links $del_cache_link = ADMIN_PATH . '?cp=maintenance&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 = ADMIN_PATH . '?cp=maintenance&case=sync_users&' . $GET_FORM_KEY; $resync_sizes_link = ADMIN_PATH . '?cp=maintenance&case=sync_sizes&' . $GET_FORM_KEY; $repair_tables_link = ADMIN_PATH . '?cp=maintenance&case=tables&' . $GET_FORM_KEY; $status_file_link = ADMIN_PATH . '?cp=maintenance&case=status_file&' . $GET_FORM_KEY; $current_template = "maintenance.php"; break; // We, I mean developrts and support team anywhere, need sometime // some inforamtion about the status of Kleeja .. this will give // a zip file contain those data .. // We, I mean developrts and support team anywhere, need sometime // some inforamtion about the status of Kleeja .. this will give
$query['ORDER BY'] = "f." . $SQL->escape($_REQUEST['order_by']); } else { #list files as default, no need to request total files number $do_not_query_total_files = true; } #if not a search, show only files, not images if (!isset($_GET['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'] = (empty($query['WHERE']) ? '' : $query['WHERE'] . ' AND ') . "f.type NOT IN ('" . implode("', '", $img_types) . "')"; } $query['ORDER BY'] .= isset($_REQUEST['order_way']) && (int) $_REQUEST['order_way'] == 1 ? ' ASC' : ' DESC'; #get total files number or not $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($result_p); $nums_rows = $n_fetch['total_files']; $SQL->free($result_p); } #pagination $currentPage = isset($_GET['page']) ? intval($_GET['page']) : 1; $Pager = new pagination($perpage, $nums_rows, $currentPage); $start = $Pager->get_start_row(); $no_results = false; if ($nums_rows > 0) { $query['SELECT'] = 'f.*' . ((int) $config['user_system'] == 1 ? ', u.name AS username' : ''); $query['LIMIT'] = "{$start}, {$perpage}"; $result = $SQL->build($query);