function cs_optionsave($mod, $save) { $condition = "options_mod = '" . $mod . "' AND options_name = "; $cells = array('options_value'); foreach ($save as $options_name => $options_value) { $values = array($options_value); cs_sql_update(__FILE__, 'options', $cells, $values, 0, $condition . "'" . $options_name . "'"); } cs_cache_delete('op_' . $mod); }
function cs_cache_save($name, $content, $ttl = 0) { $token = empty($ttl) ? $name : 'ttl_' . $name; cs_cache_delete($token); if (is_bool($content)) { cs_error($name, 'cs_cache_save - It is not allowed to just store a boolean'); } else { apc_store($token, $content, $ttl); } return $content; }
function cs_cache_save($name, $content, $ttl = 0) { $token = empty($ttl) ? $name : 'ttl_' . $name; cs_cache_delete($token); global $cs_main; if (is_bool($content)) { cs_error($name, 'cs_cache_save - It is not allowed to just store a boolean'); } elseif (is_writeable('uploads/cache/')) { $store = serialize($content); $cache_file = 'uploads/cache/' . $token . '.tmp'; $save_cache = fopen($cache_file, 'a'); # set stream encoding if possible to avoid converting issues if (function_exists('stream_encoding')) { stream_encoding($save_cache, $cs_main['charset']); } fwrite($save_cache, $store); fclose($save_cache); chmod($cache_file, 0755); } elseif ($cs_main['mod'] != 'install') { cs_error('uploads/cache/' . $token . '.tmp', 'cs_cache_save - Unable to write cache file'); } return $content; }
$query = "DELETE FROM {pre}_comments WHERE comments_mod='board' AND "; $query .= "comments_fid=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_abonements WHERE threads_id=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_boardfiles WHERE threads_id=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_boardvotes WHERE threads_id=" . (int) $thread_id; cs_sql_query(__FILE__, $query); $query = "DELETE FROM {pre}_voted WHERE voted_mod='board' AND "; $query .= "voted_fid=" . (int) $thread_id; cs_sql_query(__FILE__, $query); // Delete Ghostlinks $query = "DELETE FROM {pre}_threads WHERE threads_ghost_thread = " . (int) $thread_id; cs_sql_query(__FILE__, $query); # Update board entry to get correct threads and comments count include_once 'mods/board/repair.php'; cs_board_threads($cs_thread['board_id']); cs_board_comments($cs_thread['board_id']); # Remove attached boardreports if there are any cs_sql_delete(__FILE__, 'boardreport', $thread_id, 'threads_id'); cs_cache_delete('count_boardreport'); cs_redirect($cs_lang['del_true'], 'board', 'listcat', 'where=' . $cs_thread['board_id']); } if (isset($_POST['cancel'])) { cs_redirect($cs_lang['del_false'], 'board', 'thread', 'where=' . $thread_id); } else { $data['head']['body'] = sprintf($cs_lang['del_thread_rly'], cs_secure($cs_thread['threads_headline'])); $data['thread']['id'] = $thread_id; echo cs_subtemplate(__FILE__, $data, 'board', 'thread_remove'); }
$data['value']['dir'] = $dir; $cells = 'access_id, access_name, access_clansphere, access_' . $dir; $data['access'] = cs_sql_select(__FILE__, 'access', $cells, 0, 'access_clansphere ASC', 0, 0); $sel = 'selected="selected"'; $count_access = count($data['access']); for ($run = 0; $run < $count_access; $run++) { $data['access'][$run]['sel0'] = ''; $data['access'][$run]['sel1'] = ''; $data['access'][$run]['sel2'] = ''; $data['access'][$run]['sel3'] = ''; $data['access'][$run]['sel4'] = ''; $data['access'][$run]['sel5'] = ''; if (isset($_GET['activate'])) { $data['access'][$run]['sel' . $data['access'][$run]['access_clansphere']] = $sel; } else { $data['access'][$run]['sel' . $data['access'][$run]['access_' . $dir]] = $sel; } } echo cs_subtemplate(__FILE__, $data, 'modules', 'accessedit_1'); } else { $dir = $_POST['dir']; $access = cs_sql_select(__FILE__, 'access', 'access_id', 0, 'access_clansphere ASC', 0, 0); $cells = array('access_' . $dir); foreach ($access as $level) { $values = array($_POST['access_' . $level['access_id']]); cs_sql_update(__FILE__, 'access', $cells, $values, $level['access_id']); cs_cache_delete('access_' . $level['access_id']); } $data['url']['continue'] = cs_url('modules', 'roots'); echo cs_subtemplate(__FILE__, $data, 'modules', 'accessedit_2'); }
} $result = array_values(array_diff($all_smileys, $act_smileys)); if (!empty($result)) { $counter = 0; for ($run = 0; $run < count($result); $run++) { $data['file'][$run]['name'] = $result[$run]; $data['file'][$run]['preview'] = cs_html_img('uploads/abcode/' . $result[$run]); $data['file'][$run]['run'] = empty($data['file'][$run]['run']) ? '' : $data['file'][$run]['run']; $data['file'][$run]['order'] = empty($_POST['order_' . $counter]) ? '' : (int) $_POST['order_' . $counter]; $data['file'][$run]['counter'] = $counter; $counter++; } } } else { for ($run = 0; $run < count($data['file']); $run++) { $sql_cells = array('abcode_func', 'abcode_pattern', 'abcode_file', 'abcode_order'); $sql_saves = array('img', $data['file'][$run]['run'], $data['file'][$run]['name'], $data['file'][$run]['order']); cs_sql_insert(__FILE__, 'abcode', $sql_cells, $sql_saves); } cs_cache_delete('abcode_smileys'); cs_cache_delete('abcode_content'); cs_redirect($cs_lang['changes_done'], 'abcode', 'manage'); } if (empty($data['file'])) { $data['if']['no_smileys'] = true; $data['if']['smileys'] = false; } else { $data['if']['no_smileys'] = false; $data['if']['smileys'] = true; } echo cs_subtemplate(__FILE__, $data, 'abcode', 'import');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('modules'); # clear old cache content to get actual results $languages = cs_checkdirs('lang'); foreach ($languages as $ln) { cs_cache_delete('mods_' . $ln['dir']); } $data = array(); $modules = cs_checkdirs('mods'); $mod_all = count($modules); $data['if']['wizard'] = FALSE; $data['head']['count'] = $mod_all; $data['head']['getmsg'] = cs_getmsg(); if ($account['access_wizard'] == 5) { $wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_mods' AND options_value = '1'"); if (empty($wizard)) { $data['if']['wizard'] = TRUE; $data['wizard']['roots'] = cs_link($cs_lang['show'], 'wizard', 'roots'); $data['wizard']['task_done'] = cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=mods&done=1'); } } $cs_access = cs_sql_select(__FILE__, 'access', '*', 0, 0, 0, 0); $groups = count($cs_access); $run = 0; foreach ($modules as $mod) { $data['mod'][$run]['icon'] = empty($mod['icon']) ? '' : cs_icon($mod['icon']); $data['mod'][$run]['name_url'] = empty($mod['name']) ? '' : cs_link($mod['name'], 'modules', 'view', 'dir=' . $mod['dir']); $data['mod'][$run]['version'] = empty($mod['version']) ? '' : $mod['version'];
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('wizard'); $turn = (isset($_GET['turn']) and $_GET['turn'] == 'off') ? 0 : 1; $opt_where = "options_mod = 'wizard' AND options_name = "; $def_cell = array('options_value'); $def_cont = array($turn); cs_sql_update(__FILE__, 'options', $def_cell, $def_cont, 0, $opt_where . "'welcome'"); cs_cache_delete('op_wizard'); cs_redirect(empty($turn) ? $cs_lang['turn_off'] : $cs_lang['turn_on'], 'users', 'home');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clansphere'); # clear old cache content to get actual results $languages = cs_checkdirs('lang'); foreach ($languages as $ln) { cs_cache_delete('lang_' . $ln['dir']); } $languages = cs_checkdirs('lang'); $lng_all = count($languages); $activate = isset($_GET['activate']) ? $_GET['activate'] : 0; $allow = 0; if (!empty($activate)) { foreach ($languages as $mod) { if ($mod['dir'] == $activate) { $allow++; } } } $data['lang']['body'] = sprintf($cs_lang['languages_list'], $lng_all); $data['link']['cache'] = cs_url('clansphere', 'cache'); $data['if']['done'] = false; if ($account['access_wizard'] == 5) { $wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_lang' AND options_value = '1'"); if (empty($wizard)) { $data['if']['done'] = true; $data['link']['wizard'] = cs_link($cs_lang['show'], 'wizard', 'roots') . ' - ' . cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=lang&done=1'); } }
if (empty($cs_main['rte_html'])) { $data['abcode']['features'] = cs_abcode_features('news_text', $abcode[3], 1); $data['abcode']['smileys'] = cs_abcode_smileys('news_text', 1); $data['abcode']['features_readmore'] = cs_abcode_features('news_readmore', $abcode[3], 1); $data['abcode']['smileys_readmore'] = cs_abcode_smileys('news_readmore', 1); $data['if']['rte_html'] = false; $data['if']['abcode'] = true; } else { $data['if']['rte_html'] = true; $data['if']['abcode'] = false; $data['rte']['html'] = cs_rte_html('news_text', $cs_news['news_text']); $data['rte']['html_readmore'] = cs_rte_html('news_readmore', $cs_news['news_readmore']); } $data['news']['loop'] = $run_loop; $data['news']['news_readmore_active'] = $cs_news['news_readmore_active'] == 1 ? 'checked="checked"' : ''; $data['news']['news_close'] = $cs_news['news_close'] == 1 ? 'checked="checked"' : ''; $data['news']['news_public'] = $cs_news['news_public'] == 1 ? 'checked="checked"' : ''; $data['news']['news_attached'] = $cs_news['news_attached'] == 1 ? 'checked="checked"' : ''; $data['news']['check_publish'] = !empty($cs_news['news_publishs_at']) ? 'checked="checked"' : ''; $data['news']['news_publishs_at'] = cs_dateselect('date', 'unix', !empty($cs_news['news_publishs_at']) ? $cs_news['news_publishs_at'] : cs_time(), 1995); echo cs_subtemplate(__FILE__, $data, 'news', 'create'); } else { $news_cells = array_keys($cs_news); $news_save = array_values($cs_news); cs_sql_insert(__FILE__, 'news', $news_cells, $news_save); cs_cache_delete('news_publish'); if (!empty($cs_news['news_public'])) { include_once 'mods/news/rss.php'; } cs_redirect($cs_lang['news_created'], 'news'); }
} elseif (!empty($error)) { $data['lang']['head'] = cs_icon('important') . cs_html_br(1); $data['lang']['head'] .= $errormsg; } else { $data['lang']['head'] = $cs_lang['success']; } if (!empty($error) or !isset($_POST['submit'])) { $data['if']['form'] = TRUE; $data['if']['done'] = FALSE; $categories_data = cs_sql_select(__FILE__, 'categories', '*', "categories_mod = 'contact'", 'categories_order ASC, categories_name', 0, 0); foreach ($mail as $key => $value) { $data['mail'][$key] = cs_secure($value); } $data['mail']['categories_id'] = cs_dropdown('categories_id', 'categories_name', $categories_data, $mail['categories_id']); if (!empty($captcha)) { $data['if']['captcha'] = 1; } } else { $data['if']['form'] = FALSE; $data['if']['done'] = TRUE; $categories_data = cs_sql_select(__FILE__, 'categories', 'categories_name', "categories_id = '" . $mail['categories_id'] . "'"); $message = sprintf($cs_lang['mailtxt'], date('d.m.Y'), date('H:i'), $ip, $mail['name'], $mail['firm'], $mail['icq'], $mail['email'], $categories_data['categories_name'], $mail['why'], $mail['text']); settype($mail['icq'], 'integer'); $mail_cells = array('mail_name', 'mail_time', 'mail_ip', 'mail_email', 'mail_icq', 'mail_jabber', 'mail_firm', 'categories_id', 'mail_subject', 'mail_message'); $mail_save = array($mail['name'], cs_time(), $ip, $mail['email'], $mail['icq'], $mail['jabber'], $mail['firm'], $mail['categories_id'], $mail['why'], $mail['text']); cs_sql_insert(__FILE__, 'mail', $mail_cells, $mail_save); cs_cache_delete('count_mail_unread'); cs_mail($cs_contact['def_mail'], $mail['why'], $message, $mail['email']); } $data['captcha']['img'] = cs_html_img('mods/captcha/generate.php?time=' . cs_time()); echo cs_subtemplate(__FILE__, $data, 'contact', 'mail');
function cs_cspnews($all = 0) { $remote_url_secnews = 'http://www.clansphere.net/clansphere/updates.txt'; $remote_url_newsid = 'http://www.clansphere.net/index/news/view/id/'; $timeout = 5; $content = ''; global $cs_lang, $cs_main; $cs_lang = cs_translate('clansphere'); cs_cache_delete('op_clansphere'); $id = empty($_GET['sec_news']) ? 0 : (int) $_GET['sec_news']; $data['if']['one'] = false; $data['if']['all'] = false; $allow_url_fopen = ini_get('allow_url_fopen'); if (empty($allow_url_fopen)) { $error = $cs_lang['need_url_fopen']; } else { if (!empty($id) and empty($all)) { $opt_where = "options_mod = 'clansphere' AND options_name = 'sec_last'"; cs_sql_update(__FILE__, 'options', array('options_value'), array($id), 0, $opt_where); } else { $opt_where = "options_mod = 'clansphere' AND options_name = 'sec_time'"; cs_sql_update(__FILE__, 'options', array('options_value'), array(cs_time()), 0, $opt_where); ini_set("default_socket_timeout", $timeout); $rfp = fopen($remote_url_secnews, 'r'); if (is_resource($rfp)) { stream_set_timeout($rfp, $timeout); $content = fread($rfp, 4096); fclose($rfp); } if (!empty($content)) { $content = str_replace(array("\r", "\n"), '', $content); $news = explode(';', $content); $content = explode('@', $news[0]); if ($content[0] > $cs_main['sec_news']) { $opt_where = "options_mod = 'clansphere' AND options_name = 'sec_news'"; $sec_news = (int) $content[0]; cs_sql_update(__FILE__, 'options', array('options_value'), array($sec_news), 0, $opt_where); } if (empty($all)) { if ($content[0] > $cs_main['sec_last']) { $url = $remote_url_newsid . $content[0]; $data['info']['text'] = htmlentities($content[1], ENT_QUOTES, $cs_main['charset']); $data['info']['view'] = cs_html_link($url, $cs_lang['view']); $data['info']['read'] = cs_link($cs_lang['read'], 'clansphere', 'sec_news', 'sec_news=' . $content[0]); $data['info']['showall'] = cs_link($cs_lang['showall'], 'clansphere', 'sec_news'); $data['if']['one'] = true; $data['if']['all'] = false; return cs_subtemplate(__FILE__, $data, 'clansphere', 'news'); } } else { $data['if']['one'] = false; $data['if']['all'] = true; $count = count($news) - 1; for ($run = 0; $run < $count; $run++) { $content = explode("@", $news[$run]); $data['infos'][$run]['text'] = cs_secure($content[1]); $url = $remote_url_newsid . $content[0]; $data['infos'][$run]['view'] = cs_html_link($url, $cs_lang['view']); } return cs_subtemplate(__FILE__, $data, 'clansphere', 'news'); } } } } }
cs_sql_update(__FILE__, 'metatags', $def_cell, $def_cont, 0, $opt_where . "'keywords'"); $def_cont = array($_POST['language'], $active_language); cs_sql_update(__FILE__, 'metatags', $def_cell, $def_cont, 0, $opt_where . "'language'"); $def_cont = array($_POST['author'], $active_author); cs_sql_update(__FILE__, 'metatags', $def_cell, $def_cont, 0, $opt_where . "'author'"); $def_cont = array($_POST['designer'], $active_designer); cs_sql_update(__FILE__, 'metatags', $def_cell, $def_cont, 0, $opt_where . "'designer'"); $def_cont = array($_POST['publisher'], $active_publisher); cs_sql_update(__FILE__, 'metatags', $def_cell, $def_cont, 0, $opt_where . "'publisher'"); $def_cont = array($_POST['robots'], '1'); cs_sql_update(__FILE__, 'metatags', $def_cell, $def_cont, 0, $opt_where . "'robots'"); $def_cont = array($_POST['distribution'], '1'); cs_sql_update(__FILE__, 'metatags', $def_cell, $def_cont, 0, $opt_where . "'distribution'"); $data['head']['action'] = $cs_lang['metatags']; $data['link']['continue'] = cs_url('clansphere', 'system'); cs_cache_delete('metatags'); cs_redirect($cs_lang['success'], 'clansphere', 'system'); } } else { $sel = 'selected="selected"'; $select = 'metatags_id, metatags_name, metatags_content'; $where = ''; $order = 'metatags_name'; $cs_metatags = cs_sql_select(__FILE__, 'metatags', $select, $where, $order, 0, 0); $count_metatags = count($cs_metatags); for ($run = 0; $run < $count_metatags; $run++) { $data['metatags'][$cs_metatags[$run]['metatags_name']] = $cs_metatags[$run]['metatags_content']; } $data['selected']['robots_all'] = $data['metatags']['robots'] != 'index,follow' ? '' : $sel; $data['selected']['robots_no'] = $data['metatags']['robots'] == 'index,follow' ? '' : $sel; $data['selected']['distribution_global'] = $data['metatags']['distribution'] != 'global' ? '' : $sel;
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('joinus'); $cs_get = cs_get('id,agree,cancel'); $joinus_id = empty($cs_get['id']) ? 0 : $cs_get['id']; if (isset($cs_get['agree'])) { cs_sql_delete(__FILE__, 'joinus', $joinus_id); cs_cache_delete('count_joinus'); cs_redirect($cs_lang['del_true_join'], 'joinus'); } if (isset($cs_get['cancel'])) { cs_redirect($cs_lang['del_false'], 'joinus'); } $joinus = cs_sql_select(__FILE__, 'joinus', 'joinus_name', 'joinus_id = ' . $cs_get['id'], 0, 0, 1); if (!empty($joinus)) { $data = array(); $data['head']['body'] = sprintf($cs_lang['remove_entry'], $cs_lang['mod_name'], $joinus['joinus_name']); $data['url']['agree'] = cs_url('joinus', 'remove', 'id=' . $joinus_id . '&agree'); $data['url']['cancel'] = cs_url('joinus', 'remove', 'id=' . $joinus_id . '&cancel'); echo cs_subtemplate(__FILE__, $data, 'joinus', 'remove'); } else { cs_redirect('', 'joinus'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('fightus'); $cs_get = cs_get('id,agree,cancel'); if (isset($cs_get['agree'])) { cs_sql_delete(__FILE__, 'fightus', $cs_get['id']); cs_cache_delete('count_fightus'); cs_redirect($cs_lang['fight_del_true'], 'fightus'); } if (isset($cs_get['cancel'])) { cs_redirect($cs_lang['del_false'], 'fightus'); } $fightus = cs_sql_select(__FILE__, 'fightus', 'fightus_nick', 'fightus_id = ' . $cs_get['id'], 0, 0, 1); if (!empty($fightus)) { $data = array(); $data['head']['body'] = sprintf($cs_lang['remove_entry'], $cs_lang['mod_name'], $fightus['fightus_nick']); $data['url']['agree'] = cs_url('fightus', 'remove', 'id=' . $cs_get['id'] . '&agree'); $data['url']['cancel'] = cs_url('fightus', 'remove', 'id=' . $cs_get['id'] . '&cancel'); echo cs_subtemplate(__FILE__, $data, 'fightus', 'remove'); } else { cs_redirect('', 'fightus'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clansphere'); # clear old cache content to get actual results $languages = cs_checkdirs('lang'); foreach ($languages as $ln) { cs_cache_delete('templates_' . $ln['dir']); } $templates = cs_checkdirs('templates'); $tpl_all = count($templates); $activate = isset($_GET['activate']) ? $_GET['activate'] : 0; $activate = $activate == 'install' ? 0 : $activate; $allow = 0; if (!empty($activate)) { foreach ($templates as $mod) { if ($mod['dir'] == $activate) { $allow++; } } if (!empty($allow)) { $cond = "options_mod = 'clansphere' AND options_name = 'def_tpl' AND options_value = '" . $activate . "'"; $already = cs_sql_count(__FILE__, 'options', $cond); if (!empty($already)) { $allow = 0; } } } $data['if']['done'] = false; if ($account['access_wizard'] == 5) {
foreach ($modules as $mod) { $acc_dir = 'access_' . $mod['dir']; if (array_key_exists($acc_dir, $cs_access) and $mod['dir'] != 'clansphere') { if (!empty($mod['icon'])) { $data['access'][$run]['icon'] = cs_icon($mod['icon']); } else { $data['access'][$run]['icon'] = ''; } $data['access'][$run]['name'] = cs_link($mod['name'], 'modules', 'view', 'dir=' . $mod['dir']); $data['access'][$run]['select'] = cs_html_select(1, $acc_dir); $levels = 0; while ($levels < 6) { $cs_access[$acc_dir] == $levels ? $sel = 1 : ($sel = 0); $data['access'][$run]['select'] .= cs_html_option($levels . ' - ' . $cs_lang['lev_' . $levels], $levels, $sel); $levels++; } $data['access'][$run]['select'] .= cs_html_select(0); $run++; } } $data['access2']['id'] = $access_id; $data['if']['warning'] = $access_id < 6 ? 1 : 0; $data['data']['warning_detail'] = empty($data['if']['warning']) ? '' : $cs_lang['warning_id_' . $access_id]; echo cs_subtemplate(__FILE__, $data, 'access', 'edit'); } else { $access_cells = array_keys($cs_access); $access_save = array_values($cs_access); cs_sql_update(__FILE__, 'access', $access_cells, $access_save, $access_id); cs_cache_delete('access_' . $access_id); cs_redirect($cs_lang['changes_done'], 'access'); }
foreach ($cs_country as $short => $full) { $data['country'][$run]['short'] = $short; $data['country'][$run]['selection'] = $short == $cs_user['users_country'] ? ' selected="selected"' : ''; $data['country'][$run]['full'] = $full; $run++; } echo cs_subtemplate(__FILE__, $data, 'users', 'profile'); } else { settype($cs_user['users_height'], 'integer'); settype($cs_user['users_icq'], 'integer'); $cs_user['users_hidden'] = implode(',', $hidden); if ($cs_user['users_nick'] != $account['users_nick']) { change_nick($account['users_id'], $account['users_nick']); } $users_cells = array_keys($cs_user); $users_save = array_values($cs_user); cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $account['users_id']); cs_cache_delete('navbirth'); cs_cache_delete('nextbirth'); $data['link']['continue'] = cs_url('users', 'home'); $data['lang']['head'] = $cs_lang['profile']; echo cs_subtemplate(__FILE__, $data, 'users', 'done'); if ($account['access_wizard'] == 5) { $wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_prfl' AND options_value = '1'"); if (empty($wizard)) { $data['wizard']['show'] = cs_link($cs_lang['show'], 'wizard', 'roots'); $data['wizard']['task_done'] = cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=prfl&done=1'); echo cs_subtemplate(__FILE__, $data, 'users', 'wizard'); } } }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clansphere'); # clear old cache content to get actual results $languages = cs_checkdirs('lang'); foreach ($languages as $ln) { cs_cache_delete('themes_' . $ln['dir']); } $themes = cs_checkdirs('themes'); $themes_count = count($themes); if (!empty($_GET['activate'])) { foreach ($themes as $try) { if ($try['dir'] == $_GET['activate']) { require_once 'mods/clansphere/func_options.php'; $save['def_theme'] = $_GET['activate']; cs_optionsave('clansphere', $save); $current = $_GET['activate']; } } } $current = empty($current) ? $cs_main['def_theme'] : $current; $data['lang']['body'] = sprintf($cs_lang['themes_listed'], $themes_count); $data['link']['cache'] = cs_url('clansphere', 'cache'); $run = 0; if (empty($themes)) { $data['themes_list'] = ''; } foreach ($themes as $theme) { $data['themes_list'][$run]['name'] = $theme['name'];