} require_once 'mods/clansphere/filetype.php'; for ($run = 0; $run < $count_att; $run++) { $file = $cs_att[$run]['boardfiles_name']; $extension = strlen(strrchr($file, ".")); $name = strlen($file); $ext = substr($file, $name - $extension + 1, $name); $ext_lower = strtolower($ext); $data['attachments'][$run]['icon'] = cs_filetype($ext_lower); if (file_exists('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext)) { $file_file = filesize('uploads/board/files/' . $cs_att[$run]['boardfiles_id'] . '.' . $ext); $data['attachments'][$run]['filename'] = cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?id=' . $cs_att[$run]['boardfiles_id'], $file, 1); $data['attachments'][$run]['size'] = cs_filesize($file_file); } elseif (file_exists('uploads/board/files/' . $file)) { $file_file = filesize('uploads/board/files/' . $file); $data['attachments'][$run]['filename'] = cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?name=' . $file, $file, 1); $data['attachments'][$run]['size'] = cs_filesize($file_file); } else { $data['attachments'][$run]['filename'] = $cs_lang['no_att_exist']; $data['attachments'][$run]['size'] = cs_filesize(0); } $threads_headline = $cs_att[$run]['threads_headline']; $data['attachments'][$run]['topics'] = strlen($threads_headline) <= 15 ? $threads_headline : cs_substr($threads_headline, 0, 15) . '...'; $data['attachments'][$run]['threads_headline'] = $threads_headline; $data['attachments'][$run]['topics_link'] = cs_url('board', 'thread', 'where=' . $cs_att[$run]['threads_id']); $data['attachments'][$run]['downloaded'] = $cs_att[$run]['boardfiles_downloaded']; $data['attachments'][$run]['user'] = $cs_att[$run]['users_nick']; $data['attachments'][$run]['user_link'] = cs_url('users', 'view', 'id=' . $cs_att[$run]['users_id']); $data['attachments'][$run]['remove'] = cs_url('board', 'delatt_admin', 'id=' . $cs_att[$run]['boardfiles_id']); } echo cs_subtemplate(__FILE__, $data, 'board', 'attachements_admin');
$el_id = 'game_1'; $cs_games = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0); $games_count = count($cs_games); for ($run = 0; $run < $games_count; $run++) { $sel = $cs_games[$run]['games_id'] == $cs_replays['games_id'] ? 1 : 0; $data['games'][$run]['op'] = cs_html_option($cs_games[$run]['games_name'], $cs_games[$run]['games_id'], $sel); } $url = 'uploads/games/' . $cs_replays['games_id'] . '.gif'; $data['replays']['games_img'] = cs_html_img($url, 0, 0, 'id="' . $el_id . '"'); $data['replays']['date_sel'] = cs_dateselect('date', 'date', $cs_replays['replays_date'], 1995); $matches[1] = $cs_lang['rep_infos']; $return_types = ''; foreach ($rep_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_size'] . cs_filesize($rep_max['size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['replays']['upload_clip'] = cs_abcode_clip($matches); $data['replays']['abcode_smileys'] = cs_abcode_smileys('replays_info'); $data['replays']['abcode_features'] = cs_abcode_features('replays_info'); $data['replays']['close_check'] = empty($cs_replays['replays_close']) ? '' : 'checked="checked"'; echo cs_subtemplate(__FILE__, $data, 'replays', 'create'); } else { $cs_replays['users_id'] = $account['users_id']; $cs_replays['replays_since'] = cs_time(); $replays_cells = array_keys($cs_replays); $replays_save = array_values($cs_replays); cs_sql_insert(__FILE__, 'replays', $replays_cells, $replays_save); if (!empty($files_gl['replay']['tmp_name'])) { $where = "replays_team1 = '" . cs_sql_escape($cs_replays['replays_team1']) . "'"; $order = 'replays_since DESC';
$data['abcode']['pattern'] = $cs_abcode['abcode_pattern']; $data['abcode']['result'] = $cs_abcode['abcode_result']; if (empty($cs_abcode['abcode_file'])) { $data['abcode']['pic'] = $cs_lang['nopic']; } else { $place = 'uploads/abcode/' . $cs_abcode['abcode_file']; $size = getimagesize($cs_main['def_path'] . '/' . $place); $data['abcode']['pic'] = cs_html_img($place, $size[1], $size[0]); } $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $op_abcode['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $op_abcode['max_height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_abcode['max_size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['abcode']['clip'] = cs_abcode_clip($matches); $data['abcode']['file'] = $cs_abcode['abcode_file']; $data['abcode']['order'] = $cs_abcode['abcode_order']; $data['abcode']['id'] = $abcode_id; echo cs_subtemplate(__FILE__, $data, 'abcode', 'edit'); } else { $abcode_cells = array_keys($cs_abcode); $abcode_save = array_values($cs_abcode); cs_sql_update(__FILE__, 'abcode', $abcode_cells, $abcode_save, $abcode_id); cs_cache_delete('abcode_smileys'); cs_cache_delete('abcode_content'); cs_redirect($cs_lang['changes_done'], 'abcode'); }
$run = 0; $count = 0; foreach ($diff as $pic) { $count++; $data['pictures'][$run]['run'] = $count; $data['pictures'][$run]['name'] = $pic; $img_size = getimagesize("uploads/gallery/pics/{$pic}"); $img_filesize = filesize("uploads/gallery/pics/{$pic}"); $img_width = $img_size[0]; $img_height = $img_size[1]; $img_w_h = $img_width / $img_height; $img_new_height = 40; $img_new_width = $img_new_height * $img_w_h; $data['pictures'][$run]['img'] = cs_html_img('mods/gallery/image.php?picname=' . $pic); $data['pictures'][$run]['size'] = $img_width . 'x' . $img_height; $data['pictures'][$run]['filesize'] = cs_filesize($img_filesize); $run++; } } elseif (empty($checkDiff) and !empty($_POST['read']) or empty($checkDiff) and $zip_file == 1) { $data['if']['nopic'] = TRUE; } if (!empty($checkDiff2) and !empty($_POST['del'])) { $data['if']['thumb'] = TRUE; $run = 0; foreach ($diff2 as $thumb) { if (cs_unlink('gallery', 'Thumb_' . $thumb, 'thumbs') == true) { $where = "gallery_name = '" . $thumb . "'"; $search = cs_sql_count(__FILE__, 'gallery', $where); if (!empty($search)) { $query = "DELETE FROM {pre}_gallery WHERE gallery_name='{$thumb}'"; cs_sql_query(__FILE__, $query);
$count_votes = cs_sql_count(__FILE__, $from, $where); $data['data']['count_votes'] = $count_votes; $gallery = cs_sql_select(__FILE__, 'usersgallery', '*', 'users_id=' . $id, 'usersgallery_id DESC', 0, 0); $loop = count($gallery); $ges_size = 0; $ges_traffic = 0; for ($run = 0; $run < $loop; $run++) { $file = 'uploads/usersgallery/pics/' . $gallery[$run]['usersgallery_name']; $count = $gallery[$run]['usersgallery_count']; $size = filesize($file); $traffic = $size * $count; $ges_traffic += $traffic; $ges_size += $size; } $data['data']['count_size'] = cs_filesize($ges_size, 2); $data['data']['count_trafik'] = cs_filesize($ges_traffic, 2); $options = cs_sql_option(__FILE__, 'usersgallery'); $space = 0; if (!empty($count_pics) and !empty($options['max_files'])) { $space = $count_pics / $options['max_files'] * 100; $space = round($space, 1); } $data['data']['count_space'] = $space; if ($space <= 50) { $data['img']['01'] = 'symbols/messages/messages01.png'; } elseif ($space > 50 and $space < 95) { $data['img']['01'] = 'symbols/messages/messages01_orange.png'; } else { $data['img']['01'] = 'symbols/messages/messages01_red.png'; } if (!empty($space)) {
$sel = 0; while ($levels < 6) { $cs_categories['categories_access'] == $levels ? $sel = 1 : ($sel = 0); $data['access'][$levels]['sel'] = cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $data['cat']['abcode_smileys'] = cs_abcode_smileys('categories_text'); $data['cat']['abcode_features'] = cs_abcode_features('categories_text'); $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $op_categories['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $op_categories['max_height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_categories['max_size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['cat']['picup_clip'] = cs_abcode_clip($matches); echo cs_subtemplate(__FILE__, $data, 'categories', 'create'); } else { $categories_cells = array_keys($cs_categories); $categories_save = array_values($cs_categories); cs_sql_insert(__FILE__, 'categories', $categories_cells, $categories_save); if (!empty($files_gl['picture']['tmp_name'])) { $where = "categories_name = '" . cs_sql_escape($cs_categories['categories_name']) . "'"; $getid = cs_sql_select(__FILE__, 'categories', 'categories_id', $where); $filename = 'picture-' . $getid['categories_id'] . '.' . $extension; cs_upload('categories', $filename, $files_gl['picture']['tmp_name']); $cs_categories2['categories_picture'] = $filename; $categories2_cells = array_keys($cs_categories2); $categories2_save = array_values($cs_categories2);
$data['if']['file'] = TRUE; require_once 'mods/clansphere/filetype.php'; for ($run = 0; $run < $run_loop_files; $run++) { $num = $run + 1; $cs_files["text_{$num}"] = isset($_POST["text_{$num}"]) ? $_POST["text_{$num}"] : ''; $data['files'][$run]['num'] = $num; $data['files'][$run]['if']['empty_file'] = FALSE; $data['files'][$run]['if']['file_exists'] = FALSE; if (empty($file_name[$num])) { $data['files'][$run]['if']['empty_file'] = TRUE; $matches[1] = $cs_lang['infos']; $return_types = ''; foreach ($filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_size'] . cs_filesize($max_size) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . ': ' . $return_types; $data['files'][$run]['clip'] = cs_abcode_clip($matches); } else { $data['files'][$run]['if']['file_exists'] = TRUE; $data['files'][$run]['name'] = $file_name[$num]; $data['files'][$run]['up_name'] = $file_upload_name[$num]; $file = $file_name[$num]; $extension = strlen(strrchr($file, ".")); $name = strlen($file); $ext = substr($file, $name - $extension + 1, $name); $ext_lower = strtolower($ext); $data['files'][$run]['ext'] = cs_filetype($ext_lower); $data['files'][$run]['if']['file_is_picture'] = FALSE; $data['files'][$run]['if']['file_is_other'] = FALSE; #check if file is picture
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('explorer'); include_once 'mods/explorer/functions.php'; $dir = cs_explorer_path($_GET['file'], 'raw'); $lsd = cs_explorer_path($dir, 'escape'); $red_lsd = cs_explorer_path($dir, 'escape', 1); if (empty($_GET['file'])) { cs_redirect($cs_lang['no_object'], 'explorer', 'roots', 'dir=' . $red_lsd); } if (!($info = stat($dir))) { cs_redirect($cs_lang['not_opened'], 'explorer', 'roots', 'dir=' . $red_lsd); } $data = array(); $data['var']['dir'] = $red_lsd; $data['file']['name'] = $dir; $data['file']['size'] = cs_filesize($info[7]); $data['file']['chmod'] = substr(sprintf('%o', fileperms($dir)), -4); $data['file']['lastchange_date'] = date('d.m.Y', $info[10]); $data['file']['lastchange_time'] = date('G:i', $info[10]); $data['file']['lastaccess_date'] = date('d.m.Y', $info[8]); $data['file']['lastaccess_time'] = date('G:i', $info[8]); $data['file']['owner'] = fileowner($dir); $data['file']['ownergroup'] = filegroup($dir); echo cs_subtemplate(__FILE__, $data, 'explorer', 'information');
$data['data']['picture'] = cs_html_link('mods/gallery/image.php?pic=' . $cs_gallery['gallery_id'], $cs_lap, 0, 0, 0, 'rel="lightbox"'); } else { $host = $cs_main['php_self']['website']; $host .= $cs_main['php_self']['dirname']; $host .= 'mods/gallery/image.php?pic=' . $cs_gallery['gallery_id']; $data['data']['picture'] = cs_html_link($host, $cs_lap, 0, 0, 0, 'rel="lightbox"'); } } $data['data']['titel'] = $cs_gallery['gallery_titel']; $data['data']['date'] = cs_date('unix', $cs_gallery['gallery_time'], 1); $users_nick = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $cs_gallery['users_id']); $data['data']['user'] = cs_secure($users_nick['users_nick']); $data['data']['description'] = cs_secure($cs_gallery['gallery_description'], 1, 1); $data['data']['pic_size'] = $img_size[0] . 'x' . $img_size[1] . ' Pixel'; $size = filesize('uploads/gallery/pics/' . $cs_gallery['gallery_name']); $data['data']['filesize'] = cs_filesize($size); $data['data']['count'] = $cs_gallery['gallery_count'] + 1; $more = 'folders_id=' . $cs_gallery['folders_id'] . '&where='; $puac = "gallery_status = 1 AND gallery_access <= '" . $account['access_gallery'] . "' AND folders_id = '" . $cs_gallery['folders_id']; $cond = "' AND gallery_id < '" . $cs_gallery['gallery_id'] . "'"; $before = cs_sql_select(__FILE__, 'gallery', 'gallery_id', $puac . $cond, 'gallery_id DESC'); $data['link']['picture_backward'] = empty($before) ? '' : cs_link(cs_icon('back', 22), 'gallery', 'com_view', $more . $before['gallery_id']); $cond = "' AND gallery_id > '" . $cs_gallery['gallery_id'] . "'"; $next = cs_sql_select(__FILE__, 'gallery', 'gallery_id', $puac . $cond, 'gallery_id ASC'); $data['link']['picture_forward'] = empty($next) ? '' : cs_link(cs_icon('forward', 22), 'gallery', 'com_view', $more . $next['gallery_id']); echo cs_subtemplate(__FILE__, $data, 'gallery', 'com_view'); $where3 = "comments_mod = 'gallery' AND comments_fid = '" . $id . "'"; $count_com = cs_sql_count(__FILE__, 'comments', $where3); include_once 'mods/comments/functions.php'; $data['comments']['view'] = ''; $data['comments']['create'] = '';
$perc_temp = 0; $perc_all = 0; if (!empty($space_total)) { $perc_used = empty($space_used) ? 0 : round($space_used * 100 / $space_total); $perc_free = empty($space_free) ? 0 : round($space_free * 100 / $space_total); $perc_mods = empty($space_mods) ? 0 : round($space_mods * 100 / $space_total); $perc_up = empty($space_up) ? 0 : round($space_up * 100 / $space_total); $perc_sym = empty($space_sym) ? 0 : round($space_sym * 100 / $space_total); $perc_temp = empty($space_temp) ? 0 : round($space_temp * 100 / $space_total); $perc_all = $perc_used + $perc_free; } if (!empty($cs_err) && $cs_err[1] != '') { $data['lang']['body'] = cs_abcode_clip($cs_err); } else { $data['lang']['body'] = $cs_lang['body_storage']; } $data['storage']['space_total'] = cs_filesize($space_total); $data['storage']['space_total_percent'] = $perc_all . ' %'; $data['storage']['space_free'] = cs_filesize($space_free); $data['storage']['space_free_percent'] = $perc_free . ' %'; $data['storage']['space_used'] = cs_filesize($space_used); $data['storage']['space_used_percent'] = $perc_used . ' %'; $data['storage']['space_mods'] = cs_filesize($space_mods); $data['storage']['space_mods_percent'] = $perc_mods . ' %'; $data['storage']['space_sym'] = cs_filesize($space_sym); $data['storage']['space_sym_percent'] = $perc_sym . ' %'; $data['storage']['space_up'] = cs_filesize($space_up); $data['storage']['space_up_percent'] = $perc_up . ' %'; $data['storage']['space_temp'] = cs_filesize($space_temp); $data['storage']['space_temp_percent'] = $perc_temp . ' %'; echo cs_subtemplate(__FILE__, $data, 'clansphere', 'storage');
// $Id$ $cs_lang = cs_translate('clansphere'); $content = cs_cache_info(); $data['data']['cache_mode'] = $cs_main['cache_mode']; $data['info']['cache_cleared'] = ''; $data['link']['reload'] = cs_url('clansphere', 'cache'); $data['link']['empty_cache'] = cs_url('clansphere', 'cache', 'clear=1'); if (!empty($_GET['clear'])) { cs_cache_clear(); $content = array(); $data['info']['cache_cleared'] = cs_html_br(2) . $cs_lang['cache_cleared']; } $start = empty($_GET['start']) ? 0 : (int) $_GET['start']; $data['count']['total'] = count($content); $data['pages']['show'] = cs_pages('clansphere', 'cache', $data['count']['total'], $start); if (empty($content)) { $data['cache'] = ''; } $space = 0; $run = 0; $end = $start + $account['users_limit']; $stop = $end > $data['count']['total'] ? $data['count']['total'] : $end; for ($x = $start; $x < $stop; $x++) { $data['cache'][$run]['name'] = $content[$x]['name']; $data['cache'][$run]['date'] = cs_date('unix', $content[$x]['time'] - date('Z'), 1); $data['cache'][$run]['size'] = cs_filesize($content[$x]['size']); $space += $content[$x]['size']; $run++; } $data['count']['size'] = cs_filesize($space); echo cs_subtemplate(__FILE__, $data, 'clansphere', 'cache');
} unset($_SESSION['ajaxuploads'][$file]); echo $file . ' deleted'; } elseif (isset($_POST['upload_name']) and isset($_FILES['' . $_POST['upload_name'] . '']['tmp_name'])) { $upload_name = $_POST['upload_name']; $file = $_FILES[$upload_name]['tmp_name']; $new_name = 'tmp_' . time() . strrchr($_FILES[$upload_name]['name'], '.'); $error = !cs_upload('cache', $new_name, $_FILES[$upload_name]['tmp_name'], 0); if (!isset($_SESSION['ajaxuploads'])) { $_SESSION['ajaxuploads'] = array(); } $_SESSION['ajaxuploads'][$upload_name] = $new_name; $upload = array(); $upload['name'] = $upload_name; $upload['original_name'] = $_FILES[$upload_name]['name']; $upload['size'] = cs_filesize($_FILES[$upload_name]['size']); if ($error) { $upload['error'] = true; } echo '<script language="javascript" type="text/javascript">'; echo 'window.top.Clansphere.ajax.upload_complete(' . json_encode($upload) . ');'; echo '</script>'; } else { echo '<script language="javascript" type="text/javascript">'; echo 'alert("no file given");'; echo '</script>'; } } else { echo '<script language="javascript" type="text/javascript">'; echo 'alert("Permission denied");'; echo '</script>';
} } if (empty($check_user_voted) and isset($_POST['submit']) and empty($_POST['brokenlink'])) { $time = cs_time(); $voted_ip = cs_getip(); $votes_cells = array('voted_fid', 'users_id', 'voted_time', 'voted_answer', 'voted_ip', 'voted_mod'); $votes_save = array($file_id, $users_id, $time, $voted_answer, $voted_ip, 'files'); cs_sql_insert(__FILE__, 'voted', $votes_cells, $votes_save); cs_redirect(NULL, 'files', 'view', 'where=' . $file_id); } $data['category']['name'] = $cs_file['categories_name']; $data['category']['id'] = $cs_file['categories_id']; $data['file']['id'] = $cs_file['files_id']; $data['file']['name'] = cs_secure($cs_file['files_name']); $data['file']['version'] = cs_secure($cs_file['files_version']); $data['file']['size'] = cs_filesize($cs_file['files_size']); $data['file']['user'] = cs_user($cs_file['users_id'], $cs_file['users_nick'], $cs_file['users_active']); $data['file']['date'] = cs_date('unix', $cs_file['files_time'], 1); $data['file']['count'] = cs_secure($cs_file['files_count']); $data['if']['vote'] = false; $data['if']['unvoted'] = false; if (!empty($cs_file['files_vote'])) { $data['if']['vote'] = true; if (empty($check_user_voted)) { $data['votes'] = array(); $data['if']['unvoted'] = true; for ($l = 1; $l < 7; $l++) { $data['votes'][$l - 1]['name'] = $l . ' - ' . $cs_lang['vote_' . $l]; $data['votes'][$l - 1]['value'] = $l; } } else {
$data['view']['bottom'] = cs_link($view_bottom, 'usersgallery', 'com_view', 'cat_id=' . $cat_id . '&move=' . $move . '&more=0&id=' . $id); } else { $data['view']['bottom'] = cs_link($view_bottom, 'usersgallery', 'com_view', 'cat_id=' . $cat_id . '&move=' . $move . '&more=1&id=' . $id); } if ($detail == '1') { $data['if']['details'] = TRUE; $data['details']['date'] = cs_date('unix', $cs_gallery[$move]['usersgallery_time'], 1); $data['details']['description'] = cs_secure($cs_gallery[$move]['usersgallery_description'], 1, 1); $img_size = getimagesize("uploads/usersgallery/pics/" . $cs_gallery[$move]['usersgallery_name']); $img_width = $img_size[0]; $img_height = $img_size[1]; $img_w_h = $img_width / $img_height; $data['details']['size'] = $img_width . ' x ' . $img_height . ' Pixel'; $file = 'uploads/usersgallery/pics/' . $cs_gallery[$move]['usersgallery_name']; $size = filesize($file); $data['details']['filesize'] = cs_filesize($size); $data['details']['count'] = $cs_gallery[$move]['usersgallery_count'] + 1; #if voting is allowed if (!empty($advanced[0])) { $data['if']['vote'] = TRUE; $data['if']['vote_now'] = FALSE; $data['if']['voted'] = FALSE; #if user hasn't voted yet if (empty($check_user_voted)) { $data['if']['vote_now'] = TRUE; $data['form']['action'] = cs_url('usersgallery', 'com_view', 'cat_id=' . $cat_id . '&move=' . $move . '&more=1&id=' . $id); $levels = 1; $voted_answer = 1; $data['vote']['options'] = ''; while ($levels < 7) { $voted_answer == $levels ? $sel = 1 : ($sel = 0);
} if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_picture']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { $data['head']['getmsg'] = cs_getmsg(); $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . ': ' . $op_wars['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . ': ' . $op_wars['max_height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . ': ' . cs_filesize($op_wars['max_size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['picup']['clip'] = cs_abcode_clip($matches); $data['wars']['id'] = $cs_wars_id; if (empty($war_string)) { $data['pictures'][0]['view_link'] = $cs_lang['nopic']; $data['pictures'][0]['remove_link'] = ''; } else { $run = 0; foreach ($war_pics as $pic) { $link = cs_html_img('uploads/wars/thumb-' . $pic); $data['pictures'][$run]['view_link'] = cs_html_link('uploads/wars/picture-' . $pic, $link) . ' '; $set = 'id=' . $cs_wars_id . '&delete=' . ($run + 1); $data['pictures'][$run]['remove_link'] = cs_link($cs_lang['remove'], 'wars', 'picture', $set); $run++; }
foreach ($img_filetypes as $add => $value) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches_l[2] = $cs_lang['max_width'] . $op_partner['def_width_listimg'] . ' px' . cs_html_br(1); $matches_l[2] .= $cs_lang['max_height'] . $op_partner['def_height_listimg'] . ' px' . cs_html_br(1); $matches_l[2] .= $cs_lang['max_size'] . cs_filesize($op_partner['max_size_listimg']) . cs_html_br(1); $matches_l[2] .= $cs_lang['filetypes'] . $return_types; $data['clip']['limg'] = cs_abcode_clip($matches_l); $matches_r[1] = $cs_lang['infobox']; $return_types = ''; foreach ($img_filetypes as $add => $value) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches_r[2] = $cs_lang['max_width'] . $op_partner['def_width_rotimg'] . ' px' . cs_html_br(1); $matches_r[2] .= $cs_lang['max_height'] . $op_partner['def_height_rotimg'] . ' px' . cs_html_br(1); $matches_r[2] .= $cs_lang['max_size'] . cs_filesize($op_partner['max_size_rotimg']) . cs_html_br(1); $matches_r[2] .= $cs_lang['filetypes'] . $return_types; $data['clip']['rimg'] = cs_abcode_clip($matches_r); echo cs_subtemplate(__FILE__, $data, 'partner', 'create'); } elseif (!empty($_POST['submit']) && empty($error)) { $cells = array('partner_name', 'categories_id', 'partner_url', 'partner_alt', 'partner_text', 'partner_priority'); $values = array($_POST['partner_name'], $categories_id, $_POST['partner_url'], $_POST['partner_alt'], $_POST['partner_text'], $_POST['partner_priority']); cs_sql_insert(__FILE__, 'partner', $cells, $values); // upload navlist-image $where = "partner_name = '" . cs_sql_escape($data['partner']['partner_name']) . "'"; $getid = cs_sql_select(__FILE__, 'partner', 'partner_id', $where); if (!empty($files['partner_nimg']['tmp_name'])) { $filename_navimg = 'navbanner-' . $getid['partner_id'] . '.' . $extension_nimg; cs_upload('partner', $filename_navimg, $files['partner_nimg']['tmp_name'], 0); $cells_navimg = array('partner_nimg'); $values_navimg = array($filename_navimg);
function cs_template($cs_micro, $tpl_file = 'index.htm') { global $account, $cs_logs, $cs_main; if ((empty($cs_main['public']) or $tpl_file == 'admin.htm' and $account['access_clansphere'] < 3) and $account['access_clansphere'] < $cs_main['maintenance_access']) { $cs_main['show'] = 'mods/users/login.php'; $tpl_file = 'login.htm'; $cs_main['ajax'] = 0; } if (!empty($account['users_tpl'])) { $cs_main['template'] = $account['users_tpl']; } if (!empty($_GET['template'])) { $cs_main['template'] = str_replace(array('.', '/'), '', $_GET['template']); } if (!empty($_SESSION['tpl_preview'])) { $cs_main['template'] = str_replace(array('.', '/'), '', $_SESSION['tpl_preview']); } if ($tpl_file == 'error.htm') { $cs_main['template'] = 'install'; } if ($cs_main['template'] != $cs_main['def_tpl'] and !is_dir('templates/' . $cs_main['template'])) { $cs_main['template'] = $cs_main['def_tpl']; } $tpl_path = $cs_main['def_path'] . '/templates/' . $cs_main['template'] . '/' . $tpl_file; if (!file_exists($tpl_path)) { cs_error($tpl_path, 'cs_template - Template file not found'); $msg = 'Template file not found: ' . $tpl_file; if ($tpl_file != 'error.htm') { die(cs_error_internal('tpl', $msg)); } else { die($msg); } } # Initalize array of upcoming additions and get show content $replace = array('func:body_add' => ''); $replace['func:show'] = '<div id="csp_content">' . cs_contentload($cs_main['show']) . '</div>'; if (isset($cs_main['ajax']) and $cs_main['ajax'] == 2 or !empty($account['users_ajax']) and !empty($account['access_ajax'])) { $replace['func:body_add'] = ' onload="Clansphere.initialize(' . $cs_main['mod_rewrite'] . ',\'' . $_SERVER['SCRIPT_NAME'] . '\',' . $cs_main['ajax_reload'] * 1000 . ')"'; } # Provide the def_title and a title with more information $replace['func:title_website'] = htmlentities($cs_main['def_title'], ENT_QUOTES, $cs_main['charset']); $replace['func:title'] = cs_title(); # Fetch template file and parse exploded contents $template = cs_cache_template($tpl_file); $template = cs_tokenizer_parse($template); # Add scriptload to replaces global $cs_main; $replace['func:stylesheet'] = empty($cs_main['scriptload']['stylesheet']) ? '' : $cs_main['scriptload']['stylesheet']; $replace['func:javascript'] = empty($cs_main['scriptload']['javascript']) ? '' : $cs_main['scriptload']['javascript']; # Prepare debug and log data $debug = ''; $logsql = ''; if (!empty($cs_main['developer']) or $account['access_clansphere'] > 4) { $cs_logs['php_errors'] = nl2br($cs_logs['php_errors']); $cs_logs['errors'] = nl2br($cs_logs['errors']); $logsql = cs_log_format('sql'); } else { $cs_logs['php_errors'] = ''; $cs_logs['errors'] = 'Developer mode is turned off'; } if (!empty($cs_main['debug'])) { $data = array('data'); $data['data']['log_sql'] = $logsql; $data['data']['php_errors'] = $cs_logs['php_errors']; $data['data']['csp_errors'] = $cs_logs['errors']; $debug = cs_subtemplate(__FILE__, $data, 'clansphere', 'debug'); } $replace['func:queries'] = $cs_logs['queries']; $replace['func:errors'] = $cs_logs['php_errors'] . $cs_logs['errors']; $replace['func:sql'] = $logsql; $replace['func:debug'] = $debug; $replace['func:parse'] = cs_parsetime($cs_micro); $replace['func:memory'] = function_exists('memory_get_usage') ? cs_filesize(memory_get_usage()) : '-'; if (function_exists('memory_get_peak_usage')) { $replace['func:memory'] .= ' [peak ' . cs_filesize(memory_get_peak_usage()) . ']'; } # Assemble content parts $result = ''; foreach ($template as $num => $content) { if (array_key_exists($content, $replace)) { $result .= $replace[$content]; } else { $result .= $content; } } # Enable zlib output compression if possible if (!empty($cs_main['zlib']) and extension_loaded('zlib')) { ob_start('ob_gzhandler'); } # Send content type header with charset header('Content-type: text/html; charset=' . $cs_main['charset']); return $result; }
$data['sqlinfo']['subtype'] = empty($sql_infos['subtype']) ? '' : $sql_infos['subtype']; $data['sqlinfo']['host'] = $sql_infos['host']; $data['sqlinfo']['encoding'] = $sql_infos['encoding']; $data['sqlinfo']['server'] = $sql_infos['server']; $data['sqlinfo']['client'] = $sql_infos['client']; $data['sqlinfo']['schema'] = $cs_db['name']; if (!empty($sql_infos['tables'])) { $data['sqlinfo']['usage'] = $sql_infos['tables'] . ' ' . $cs_lang['tables']; $data['sqlinfo']['usage'] .= cs_html_br(1) . '--------------------------' . cs_html_br(1); $data['sqlinfo']['usage'] .= cs_filesize($sql_infos['data_size']) . ' ' . $cs_lang['data']; $data['sqlinfo']['usage'] .= cs_html_br(1); $data['sqlinfo']['usage'] .= cs_filesize($sql_infos['index_size']) . ' ' . $cs_lang['indexe']; $data['sqlinfo']['usage'] .= cs_html_br(1) . '--------------------------' . cs_html_br(1); $data['sqlinfo']['usage'] .= cs_filesize($sql_infos['data_size'] + $sql_infos['index_size']) . ' ' . $cs_lang['total']; $data['sqlinfo']['usage'] .= cs_html_br(2); $data['sqlinfo']['usage'] .= cs_filesize($sql_infos['data_free']) . ' ' . $cs_lang['overhead']; } else { $data['sqlinfo']['usage'] = '-'; } $data['roots']['optimize_tables_url'] = cs_url('database', 'optimize'); $data['roots']['import_url'] = cs_url('database', 'import'); $data['roots']['export_url'] = cs_url('database', 'export'); $data['roots']['statistic_url'] = cs_url('database', 'statistic'); // integrity checks $errors = ''; $static = array(); $modules = cs_checkdirs('mods'); $names = array_flip($sql_infos['names']); $count = count($names); foreach ($modules as $mod) { if ($mod['dir'] != 'install' and file_exists('mods/' . $mod['dir'] . '/access.php') and !isset($account['access_' . $mod['dir'] . ''])) {
if (!empty($error) or !isset($_POST['submit'])) { $data['action']['form'] = cs_url('banners', 'create'); $data['banners']['name'] = $cs_banners['banners_name']; $data['banners']['category'] = cs_categories_dropdown('banners', $cs_banners['categories_id']); $data['banners']['url'] = $cs_banners['banners_url']; $data['banners']['or_img_url'] = $cs_banners['banners_picture']; $data['banners']['alt'] = $cs_banners['banners_alt']; $data['banners']['order'] = $cs_banners['banners_order']; $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $op_banners['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $op_banners['max_height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($op_banners['max_size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['banners']['clip'] = cs_abcode_clip($matches); echo cs_subtemplate(__FILE__, $data, 'banners', 'create'); } else { settype($cs_banners['banners_order'], 'integer'); $banners_cells = array_keys($cs_banners); $banners_save = array_values($cs_banners); cs_sql_insert(__FILE__, 'banners', $banners_cells, $banners_save); if (!empty($files['picture']['tmp_name'])) { $where = "banners_name = '" . cs_sql_escape($cs_banners['banners_name']) . "'"; $getid = cs_sql_select(__FILE__, 'banners', 'banners_id', $where); $filename = 'picture-' . $getid['banners_id'] . '.' . $extension; cs_upload('banners', $filename, $files['picture']['tmp_name']); $cs_banners2['banners_picture'] = 'uploads/banners/' . $filename; $banners2_cells = array_keys($cs_banners2);
$file = $cs_thread_files[$run]['boardfiles_name']; $extension = strlen(strrchr($file, ".")); $name = strlen($file); $ext = substr($file, $name - $extension + 1, $name); $cs_thread_files[$run]['boardfiles_typ'] = $ext; } require_once 'mods/clansphere/filetype.php'; for ($run = 0; $run < $loop_files; $run++) { $ext = $cs_thread_files[$run]['boardfiles_typ']; $file = $cs_thread_files[$run]['boardfiles_name']; if (file_exists('uploads/board/files/' . $cs_thread_files[$run]['boardfiles_id'] . '.' . $ext)) { $file_file = filesize('uploads/board/files/' . $cs_thread_files[$run]['boardfiles_id'] . '.' . $ext); $data['files'][$run]['file'] = cs_filetype($ext) . ' ' . cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?id=' . $cs_thread_files[$run]['boardfiles_id'], $file, 1) . ' (' . cs_filesize($file_file) . ' - ' . $cs_thread_files[$run]['boardfiles_downloaded'] . ' ' . $cs_lang['times'] . ' )'; } elseif (file_exists('uploads/board/files/' . $file)) { $file_file = filesize('uploads/board/files/' . $file); $data['files'][$run]['file'] = cs_filetype($ext) . ' ' . cs_html_link($cs_main['php_self']['dirname'] . 'mods/board/attachment.php?id=' . $file, $file, 1) . ' (' . cs_filesize($file_file) . ' - ' . $cs_thread_files[$run]['boardfiles_downloaded'] . ' ' . $cs_lang['times'] . ' )'; } else { $data['files'][$run]['file'] = $cs_lang['no_att_file']; } } } } //Files Ende $data['thread_desc']['signature'] = getUserSignature($data['thread']['users_signature']); if (!empty($data['thread']['threads_edit'])) { $data['thread_desc']['checkedit'] = checkLastEdit($data['thread']['threads_edit'], $cs_lang); } //board_safemode($data['thread']['users_nick'], $data['thread']['threads_time'], $options); $data['thread_desc']['laston'] = cs_userstatus($data['thread']['users_laston'], $data['thread']['users_invisible'], 1); //echo cs_html_hr('100%'); $data['thread_desc']['users_icons'] = getUserIcons($cs_lang, $data['thread']['users_id'], $data['thread']['users_nick'], $data['thread']['users_hidden'], $data['thread']['users_email'], $data['thread']['users_icq'], $data['thread']['users_jabber'], $data['thread']['users_url'], $data['thread']['users_skype']);
} elseif (empty($_GET['delete'])) { $data['head']['text'] = $cs_lang['body_picture']; } else { $data['head']['text'] = $cs_lang['remove_done']; } $data['head']['message'] = cs_getmsg(); $data['file']['id'] = $cs_files_id; if (!empty($error) or empty($_POST['submit'])) { $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $img_max['width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $img_max['height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($img_max['size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['upload']['clip'] = cs_abcode_clip($matches); $data['pictures'] = array(); if (empty($file_string)) { $data['if']['nopics'] = true; } else { $data['if']['nopics'] = false; $run = 1; $i = 0; foreach ($file_pics as $pic) { $data['pictures'][$i]['sad'] = $data['pictures'][$i]['thumbpath'] = 'uploads/files/thumb-' . $pic; $data['pictures'][$i]['picpath'] = 'uploads/files/picture-' . $pic; $data['pictures'][$i]['id'] = $run; $run++; $i++;
$data['data']['info_user_votes'] = cs_sql_count(__FILE__, 'voted', "voted_mod='usersgallery'"); $count_downloads = cs_sql_select(__FILE__, 'usersgallery', 'usersgallery_count_downloads', 0, 'usersgallery_id DESC', 0, 0); $loop_downloads = count($count_downloads); $downloads = 0; for ($run = 0; $run < $loop_downloads; $run++) { $a = cs_secure($count_downloads[$run]['usersgallery_count_downloads']); $downloads += $a; } $data['data']['info_user_downloads'] = $downloads; $cs_gallery_pic = cs_sql_select(__FILE__, 'usersgallery', '*', 0, 'usersgallery_id DESC', 0, 0); $gallery_loop_pic = count($cs_gallery_pic); $ges_size = 0; for ($run = 0; $run < $gallery_loop_pic; $run++) { $file = 'uploads/usersgallery/pics/' . $cs_gallery_pic[$run]['usersgallery_name']; $size = filesize($file); $size = $size; $ges_size += $size; } $data['data']['info_user_picsize'] = cs_filesize($ges_size); $ges_size = 0; for ($run = 0; $run < $gallery_loop_pic; $run++) { $file = 'uploads/usersgallery/pics/' . $cs_gallery_pic[$run]['usersgallery_name']; $count = $cs_gallery_pic[$run]['usersgallery_count']; $size = filesize($file); $size = $size; $size = $size * $count; $ges_size += $size; } $data['data']['info_user_trafik'] = cs_filesize($ges_size); $data['data']['show'] = cs_subtemplate(__FILE__, $data, 'gallery', 'manage_info'); echo cs_subtemplate(__FILE__, $data, 'gallery', 'manage_info');
$data['maps']['maps_name'] = empty($_POST['maps_name']) ? $data['maps']['maps_name'] : $_POST['maps_name']; $data['maps']['maps_text'] = empty($_POST['maps_text']) ? $data['maps']['maps_text'] : $_POST['maps_text']; $data['abcode']['smileys'] = cs_abcode_smileys('maps_text'); $data['abcode']['features'] = cs_abcode_features('maps_text'); $data['maps']['action'] = cs_url('maps', 'edit'); $data['games'] = cs_sql_select(__FILE__, 'games', 'games_name,games_id', 0, 'games_name', 0, 0); $data['games'] = cs_dropdownsel($data['games'], $data['maps']['games_id'], 'games_id'); $data['maps']['picture'] = empty($data['maps']['maps_picture']) ? '-' : cs_html_img('uploads/maps/' . $data['maps']['maps_picture']); $matches[1] = $cs_lang['pic_infos']; $return_types = ''; foreach ($img_filetypes as $add) { $return_types .= empty($return_types) ? $add : ', ' . $add; } $matches[2] = $cs_lang['max_width'] . $options['max_width'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_height'] . $options['max_height'] . ' px' . cs_html_br(1); $matches[2] .= $cs_lang['max_size'] . cs_filesize($options['max_size']) . cs_html_br(1); $matches[2] .= $cs_lang['filetypes'] . $return_types; $data['maps']['matches'] = cs_abcode_clip($matches); $data['if']['picture_remove'] = !empty($data['maps']['maps_picture']) ? TRUE : FALSE; echo cs_subtemplate(__FILE__, $data, 'maps', 'edit'); } else { $cs_maps['games_id'] = (int) $_POST['games_id']; $cs_maps['maps_name'] = $_POST['maps_name']; $cs_maps['server_name'] = $_POST['server_name']; $cs_maps['maps_text'] = $_POST['maps_text']; $maps_id = (int) $_POST['maps_id']; if (empty($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) { $cells = array_keys($cs_maps); $values = array_values($cs_maps); cs_sql_update(__FILE__, 'maps', $cells, $values, $maps_id); } elseif (isset($_POST['pic_del']) and empty($files_gl['picture']['tmp_name'])) {
$from = 'files fls INNER JOIN {pre}_users usr ON fls.users_id = usr.users_id'; $select = 'fls.files_name AS files_name, fls.users_id AS users_id, usr.users_nick'; $select .= ' AS users_nick, usr.users_active AS users_active, fls.files_time AS files_time, fls.files_id AS files_id'; $select .= ', fls.files_mirror AS files_mirror, fls.files_size AS files_size'; $cs_files = cs_sql_select(__FILE__, $from, $select, $where, $order, $start, $account['users_limit']); $files_loop = count($cs_files); $data['sort']['name'] = cs_sort('files', 'listcat', $start, $categories_id, 1, $sort); $data['sort']['date'] = cs_sort('files', 'listcat', $start, $categories_id, 3, $sort); $data['sort']['big'] = cs_sort('files', 'listcat', $start, $categories_id, 5, $sort); $data['files'] = array(); for ($run = 0; $run < $files_loop; $run++) { $data['files'][$run]['id'] = $cs_files[$run]['files_id']; $data['files'][$run]['name'] = $cs_files[$run]['files_name']; $data['files'][$run]['user'] = cs_user($cs_files[$run]['users_id'], $cs_files[$run]['users_nick'], $cs_files[$run]['users_active']); $data['files'][$run]['date'] = cs_date('unix', $cs_files[$run]['files_time'], 1); $data['files'][$run]['size'] = cs_filesize($cs_files[$run]['files_size']); $data['files'][$run]['filetypes'] = array(); $files_mirror = $cs_files[$run]['files_mirror']; $temp = explode("-----", $files_mirror); $temp_loop = count($temp); $file_typ_array = array(); $run_3 = '0'; for ($run_2 = 1; $run_2 < $temp_loop; $run_2++) { $temp_a = explode("\n", $temp[$run_2]); if (in_array($temp_a['3'], $file_typ_array, TRUE)) { } else { $file_typ_array[$run_3] = $temp_a['3']; $run_3++; } } $loop_file_typ_array = count($file_typ_array);