function cs_login_cookies($userid = 0, $use_old_hash = 0) { global $account, $cs_main; $lifetime = empty($userid) ? 1 : $cs_main['cookie']['lifetime']; $thistime = empty($userid) ? '' : cs_time(); $thishash = empty($use_old_hash) ? '' : $use_old_hash; if (!empty($userid) and empty($use_old_hash)) { $pattern = '1234567890abcdefghijklmnpqrstuvwxyz'; for ($i = 0; $i < 34; $i++) { $thishash .= $pattern[rand(0, 34)]; } $cells = array('users_cookietime', 'users_cookiehash'); $content = array($thistime, $thishash); cs_sql_update(__FILE__, 'users', $cells, $content, $userid, 0, 0); } elseif (!empty($userid) and $use_old_hash == true) { $thistime = $account['users_cookietime']; $thishash = $account['users_cookiehash']; if (empty($thistime) or empty($thishash)) { cs_login_cookies($userid); return true; } } setcookie('cs_userid', $userid, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']); setcookie('cs_cookietime', $thistime, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']); setcookie('cs_cookiehash', $thishash, $lifetime, $cs_main['cookie']['path'], $cs_main['cookie']['domain']); }
function fetch_pm_period($array, $value) { $loop = count($array); for ($run = 0; $run < $loop; $run++) { if (empty($periods)) { $i = 0; $daynum = -1; $weekstart = 1 - 1; $timestamp = cs_days(); $timestamp = $timestamp + 3600; $periods = array('today' => $timestamp); while ($daynum != $weekstart and $i++ < 7) { $timestamp -= 86400; $daynum = date('w', $timestamp); if ($i == 1) { $periods['yesterday'] = $timestamp; } else { $periods[strtolower(date('l', $timestamp))] = $timestamp; } } $periods['last_week'] = $timestamp -= 7 * 86400; $periods['2_weeks_ago'] = $timestamp -= 7 * 86400; $periods['3_weeks_ago'] = $timestamp -= 7 * 86400; $periods['last_month'] = $timestamp -= 28 * 86400; } $periodtime2 = cs_time(); foreach ($periods as $periodname => $periodtime) { if ($array[$run][$value] >= $periodtime and $array[$run][$value] <= $periodtime2) { $periodtime2 = $periodtime; $array[$run]['period'] = $periodname; } } if (empty($array[$run]['period'])) { $array[$run]['period'] = 'older'; } } return $array; }
$query = "SELECT user_id,ts,event,message FROM userlog WHERE event!=5 AND user_id={$id} ORDER BY ts DESC"; // echo "Q: $query<br>"; $logs = pg_safe_exec($query); echo "<TABLE border=1 WIDTH=100% cellspacing=0 cellpadding=2 BGCOLOR=#" . $cTheme->table_bgcolor . ">"; echo "<tr><td colspan=3><H2>Log messages (last 5)</H2><a href=\"viewlogs.php?uid=" . $id . "\">View All</a></td></tr>"; echo "<tr bgcolor=#" . $cTheme->table_headcolor . "><td><font color=#" . $cTheme->table_headtextcolor . ">Time</font></td><td><font color=#" . $cTheme->table_headtextcolor . ">Event</font></td><td><font color=#" . $cTheme->table_headtextcolor . ">Message</font></td></tr>"; if (pg_numrows($logs) != 0) { if (pg_numrows($logs) >= 5) { $max = 5; } else { $max = pg_numrows($logs); } for ($row = 0; $row < $max; $row++) { $log = pg_fetch_object($logs, $row); echo "<tr><td>"; echo cs_time($log->ts) . " [" . $log->ts . "]</td><td>"; if ($log->event > count($user_events) || $log->event == 0) { echo "(old)</td><td>"; } else { echo $type[$log->event] . "</td><td>"; } if ($admin < SHOW_IP_LEVEL) { echo htmlentities(remove_ip($log->message, 2)) . "</td></tr>\n"; } else { echo htmlentities($log->message) . "</td></tr>\n"; } } echo "</table>"; } else { echo "There are no log messages for this user\n<br><br>"; }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('users'); $five_min = cs_time() - 300; $select = 'users_id, users_nick, users_country, users_active, users_invisible, users_picture'; $invisible = $account['access_users'] > 4 ? '' : " AND users_invisible = '0'"; $upcome = "users_laston > " . $five_min . " AND users_active = '1'" . $invisible; $order = 'users_laston DESC'; $cs_users = cs_sql_select(__FILE__, 'users', $select, $upcome, $order, 0, 8); $data = array(); if (empty($cs_users)) { $data['lang']['no_users'] = $cs_lang['no_data']; echo cs_subtemplate(__FILE__, $data, 'users', 'no_users'); } else { $count_users = count($cs_users); for ($run = 0; $run < $count_users; $run++) { if (!empty($cs_users[$run]['users_picture'])) { $data['users'][$run]['picture'] = 'uploads/users/' . $cs_users[$run]['users_picture']; } else { $data['users'][$run]['picture'] = 'symbols/users/no_pic.png'; } if (empty($invisible) and !empty($cs_users[$run]['users_invisible'])) { $data['users'][$run]['nick'] = cs_html_italic(1) . $cs_users[$run]['users_nick'] . cs_html_italic(0); } else { $data['users'][$run]['nick'] = $cs_users[$run]['users_nick']; } $data['users'][$run]['url'] = cs_url('users', 'view', 'id=' . $cs_users[$run]['users_id']); } echo cs_subtemplate(__FILE__, $data, 'users', 'navonline_pic');
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('board'); $cs_usertime = cs_sql_select(__FILE__, 'users', 'users_readtime', "users_id = '" . $account["users_id"] . "'"); $cs_readtime = cs_time() - $cs_usertime['users_readtime']; $from = 'threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id'; $conditions = "frm.board_access <= '" . $account['access_board'] . "' AND frm.board_pwd = ''"; $cs_count = cs_sql_count(__FILE__, $from, $conditions); $start = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0; $data['lang']['count'] = $cs_count; $data['pages']['list'] = cs_pages('board', 'active', $cs_count, $start); $from = "threads thr INNER JOIN {pre}_board frm ON frm.board_id = thr.board_id INNER JOIN {pre}_categories cat ON cat.categories_id = frm.categories_id INNER JOIN {pre}_users usr ON thr.threads_last_user = usr.users_id LEFT JOIN {pre}_read red ON thr.threads_id = red.threads_id AND red.users_id = '" . $account['users_id'] . "'"; $select = 'thr.threads_id AS threads_id, thr.threads_headline AS threads_headline, thr.threads_view AS threads_view, thr.threads_comments AS threads_comments, thr.threads_important AS threads_important, thr.threads_close AS threads_close, thr.threads_last_time AS threads_last_time, usr.users_id AS users_id, usr.users_nick AS users_nick, usr.users_active AS users_active, red.read_since AS read_since'; $order = 'thr.threads_view DESC, thr.threads_last_time DESC'; $cs_threads = cs_sql_select(__FILE__, $from, $select, $conditions, $order, $start, $account['users_limit']); if (empty($cs_threads)) { $data['if']['not_active'] = true; $data['if']['active'] = false; } else { $data['if']['not_active'] = false; $data['if']['active'] = true; $run = 0; foreach ($cs_threads as $thread) { if (empty($thread['threads_comments'])) { include_once 'mods/board/repair.php'; $thread['threads_comments'] = cs_threads_comments($thread['threads_id']); } $icon = 'post_'; $tid = $thread['threads_id'];
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('games'); require_once 'mods/categories/functions.php'; $files = cs_files(); $options = cs_sql_option(__FILE__, 'games'); $img_filetypes = array('image/gif' => 'gif'); $games_error = 0; $games_form = 1; if (empty($_POST['datum_month']) or empty($_POST['datum_day']) or empty($_POST['datum_year'])) { $games_release = cs_date('unix', cs_time(), 0, 1, 'Y-m-d'); } else { $games_release = $_POST['datum_year'] . '-' . $_POST['datum_month'] . '-' . $_POST['datum_day']; } $symbol = empty($_POST['symbol']) ? '' : $_POST['symbol']; $games_name = ''; $games_version = ''; $games_creator = ''; $games_url = ''; $categories_id = empty($_POST['categories_id']) ? 0 : $_POST['categories_id']; $games_usk = empty($_POST['games_usk']) ? '' : $_POST['games_usk']; $errormsg = ''; if (!empty($_POST['games_name'])) { $games_name = $_POST['games_name']; } else { $errormsg .= $cs_lang['name_error'] . cs_html_br(1); $games_error++; } $categories_id = empty($_POST['categories_name']) ? $categories_id : cs_categories_create('games', $_POST['categories_name']);
<?php $cs_lang = cs_translate('medals'); $data = array(); if (isset($_POST['submit'])) { $medals_id = $_POST['medals_id']; if (!empty($_POST['users_nick'])) { $users_nick = cs_sql_escape($_POST['users_nick']); $users_id = cs_sql_select(__FILE__, 'users', 'users_id', "users_nick = '{$users_nick}'", 0, 0, 1); if ($users_id > 0) { $insertion = array('medals_id' => $medals_id, 'users_id' => $users_id['users_id'], 'medalsuser_date' => cs_time()); cs_sql_insert(__FILE__, 'medalsuser', array_keys($insertion), array_values($insertion)); cs_redirect($cs_lang['create_done'], 'medals', 'user', 'where=' . $medals_id); } else { cs_redirect($cs_lang['user_not_found'], 'medals', 'user', 'where=' . $medals_id); } } } else { $medals_id = $_GET['where']; } if (isset($_GET['delete'])) { $medalsuser_id = cs_sql_escape($_GET['delete']); cs_sql_delete(__FILE__, 'medalsuser', $medalsuser_id); cs_redirect($cs_lang['del_true'], 'medals', 'user', 'where=' . $medals_id); } $start = empty($_GET['start']) ? 0 : $_GET['start']; $cs_sort[1] = 'md.medalsuser_date DESC'; $cs_sort[2] = 'md.medalsuser_date ASC'; $cs_sort[3] = 'usr.users_nick DESC'; $cs_sort[4] = 'usr.users_nick ASC'; $sort = empty($_GET['sort']) ? 1 : $_GET['sort'];
$tmp_res = pg_fetch_object($res1, $x); echo "<tr>\n"; if ($admin >= $min_lvl || $nrw_lvl > 0) { echo "<td><a href=\"remove_f.php?id=" . $tmp_res->id . "\">Delete</a></td>"; } if ($tmp_res->user_name != "") { echo "<td>" . $tmp_res->user_name . "</td>"; } else { echo "<td><font color=#" . $cTheme->main_warnmsg . ">N/A</font></td>"; } if ($tmp_res->email != "") { echo "<td>" . $tmp_res->email . "</td>"; } else { echo "<td><font color=#" . $cTheme->main_warnmsg . ">N/A</font></td>"; } echo "<td>" . cs_time($tmp_res->created_ts) . "</td>"; echo "<td>" . $tmp_res->set_by . "</td>"; echo "<td>" . $tmp_res->reason . "</td>"; echo "<td>" . $tmp_res->id . "</td>"; echo "</tr>\n"; } echo "</table>\n"; } else { echo "<b>No record found matching your query.</b>\n"; } echo "<br><br>\n"; } echo "For CService Admins use <b>ONLY</b>."; ?> </body> </html>
$imprint = empty($cs_main['rte_html']) ? $_POST['imprint'] : cs_abcode_inhtml($_POST['imprint'], 'add'); } if (!isset($_POST['submit']) and file_exists($filename)) { $imprint = explode("{laststandbreak}", $content); } if (isset($_POST['submit'])) { $imp_form = 0; $data['if']['done'] = TRUE; $data['if']['form'] = FALSE; $data['if']['wizzard'] = FALSE; if (file_exists($filename)) { cs_unlink('imprint', 'imprint.txt'); } $fp = fopen($filename, "w"); chmod($filename, 0777); $imp_time = cs_time(); $content = $imp_time; $content .= '{laststandbreak}'; $content .= $imprint; # set stream encoding if possible to avoid converting issues if (function_exists('stream_encoding')) { stream_encoding($fp, $cs_main['charset']); } fwrite($fp, $content); chmod($filename, 0755); fclose($fp); if ($account['access_wizard'] == 5) { $wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_cont' AND options_value = '1'"); if (empty($wizard)) { $data['if']['wizzard'] = TRUE; }
$row = pg_fetch_object($res, $i); if (!((int) $row->flags & 1) && !((int) $row->flags & 2)) { // pgsql '&' operator fixed display (!) $bm_count++; $ts = time(); $ls = $row->last_seen; $t_val = $ts - $ls; $t_dur = abs($t_val); $the_duration = drake_duration($t_dur); echo "<tr><td><a href=\"../users.php?id=" . $row->user_id . "\" target=users>" . $row->user_name . "</a></td>" . "<td><a href=\"../channels.php?id=" . $row->channel_id . "\" target=channels>" . $row->channel_name . "</a></td>"; if (($row->flags & MIA_TAG_FLAG) == MIA_TAG_FLAG) { echo "<td><input type=button onClick=\"untag(" . (int) $row->channel_id . ",'" . md5((int) $row->channel_id . CRC_SALT_0016) . "')\" value=\"UnTag\"></td>"; } else { echo "<td><input type=button onClick=\"tagreview(" . (int) $row->channel_id . ",'" . md5((int) $row->channel_id . CRC_SALT_0016) . "')\" value=\"Tag as reviewed\"></td>"; } echo "<td>" . cs_time($row->last_seen) . " ({$the_duration})</td>" . "</tr>\n"; } } echo "</table><h3>\n"; if ($bm_count == 0) { echo "No More Missing Managers"; } if ($bm_count == 1) { echo $bm_count . " Missing Manager"; } if ($bm_count > 1) { echo $bm_count . " Missing Managers"; } echo "</h3>"; ?> <script language="JavaScript">
} else { $xr = pg_safe_exec("SELECT * FROM complaints_threads WHERE reply_text!='' AND complaint_ref='" . (int) $dao->id . "' ORDER BY reply_ts DESC LIMIT 1"); // select last reply with a public reply into it if ($xo = pg_fetch_object($xr)) { $dats = $xo->reply_ts; $la_type = 1; // assume last action is admin if ($xo->reply_by == 0) { $la_type = 0; } // if the last reply_by is 0, (user), .. last action is user } else { $dats = $dao->reviewed_ts; $la_type = 0; } echo cs_time($dats); } echo "\n"; echo "next-action-awaited:\t\t"; if ($dao->status > 2) { echo "none (ticket is CLOSED)\n"; } else { if ($la_type == 0) { echo "Pending CService Admin reply\n"; } if ($la_type == 1) { echo "Pending your reply (check the URL in the mail you received to do so)\n"; } } echo "</font></pre>\n"; } else {
function cs_content_append($content) { global $account, $cs_main; if (!empty($cs_main['sec_remote']) and $account['access_clansphere'] > 4 and ($cs_main['sec_news'] > $cs_main['sec_last'] or cs_time() - $cs_main['sec_time'] > 9000)) { require_once 'mods/clansphere/sec_func.php'; $content = cs_cspnews() . $content; } if (($cs_main['action'] == 'manage' or $cs_main['action'] == 'create' or $cs_main['action'] == 'options') and isset($account['access_' . $cs_main['mod']]) and $account['access_' . $cs_main['mod']] >= 3) { require_once 'mods/clansphere/admin_menu.php'; $content = cs_admin_menu() . $content; } if ($account['access_clansphere'] > 3 and file_exists('install.php') and !file_exists('.git')) { $content = cs_subtemplate(__FILE__, array(), 'clansphere', 'del_install') . $content; } return $content; }
$data['register']['nick'] = $register['nick']; $data['register']['password'] = $register['password']; $data['register']['email'] = $register['email']; $data['register']['send_mail'] = $register['send_mail']; $data['register']['languages'] = ''; $data['checked']['newsletter'] = empty($register['newsletter']) ? '' : 'checked'; $data['checked']['email'] = empty($register['send_mail']) ? '' : 'checked'; foreach ($languages as $lang) { $lang['name'] == $register['lang'] ? $sel = 1 : ($sel = 0); $data['register']['languages'] .= cs_html_option($lang['name'], $lang['name'], $sel); } $data['if']['captcha'] = 0; if (empty($op_users['def_register']) or $op_users['def_register'] == '2') { if (!empty($captcha)) { $data['if']['captcha'] = 1; $data['captcha']['img'] = cs_html_img('mods/captcha/generate.php?time=' . cs_time()); } } if (empty($op_users['def_register']) or $op_users['def_register'] == '2') { if ($op_users['def_register'] != '2') { $data['if']['reg_mail'] = 1; } else { $data['if']['reg_mail'] = 0; } echo cs_subtemplate(__FILE__, $data, 'users', 'register_code'); } else { echo cs_subtemplate(__FILE__, $data, 'users', 'register_mail'); } } else { $code_id = generate_code(30); // 30 Zeichen lang
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('events'); $data = array(); require_once 'mods/categories/functions.php'; $cs_events['events_name'] = ''; $cs_events['categories_id'] = 0; $cs_events['events_time'] = cs_time(); $cs_events['events_venue'] = ''; $cs_events['events_url'] = ''; $cs_events['events_more'] = ''; $cs_events['events_close'] = 0; $cs_events['events_cancel'] = 0; $cs_events['events_guestsmin'] = ''; $cs_events['events_guestsmax'] = ''; $cs_events['events_needage'] = ''; $_POST['events_multix'] = empty($_POST['events_multix']) ? '' : $_POST['events_multix']; $_POST['events_multi'] = empty($_POST['events_multi']) ? '' : $_POST['events_multi']; if (isset($_POST['submit'])) { $cs_events['categories_id'] = empty($_POST['categories_name']) ? $_POST['categories_id'] : cs_categories_create('events', $_POST['categories_name']); $cs_events['events_name'] = $_POST['events_name']; $cs_events['events_venue'] = $_POST['events_venue']; $cs_events['events_url'] = $_POST['events_url']; $cs_events['events_more'] = empty($cs_main['rte_html']) ? $_POST['events_more'] : cs_abcode_inhtml($_POST['events_more'], 'add'); $cs_events['events_time'] = cs_datepost('time', 'unix'); $cs_events['events_close'] = isset($_POST['events_close']) ? $_POST['events_close'] : 0; $cs_events['events_cancel'] = isset($_POST['events_cancel']) ? $_POST['events_cancel'] : 0; $cs_events['events_guestsmin'] = !empty($_POST['events_guestsmin']) ? $_POST['events_guestsmin'] : ''; $cs_events['events_guestsmax'] = !empty($_POST['events_guestsmax']) ? $_POST['events_guestsmax'] : '';
$blah = "_"; } $mmsg = $mmsg . "3) " . $blah . "_ Other (see below **)\n"; $mmsg = $mmsg . "\n"; if ($reason == "resign") { $mmsg = $mmsg . "* :\n" . str_replace("\\'", "'", $resignreason) . "\n\n"; } if ($reason == "other") { $mmsg = $mmsg . "** :\n" . str_replace("\\'", "'", $otherreason) . "\n\n"; } $mmsg = $mmsg . "\n"; $mmsg = $mmsg . "________________________________\n"; $mmsg = $mmsg . "Purge Request\n"; $mmsg = $mmsg . NETWORK_NAME . " Channel Service\n"; $mmsg = $mmsg . "version 03012001\n"; $mmsg = $mmsg . "Sent by [" . cl_ip() . "] at " . cs_time(time()) . " (user's timezone)\n"; $email = $user->email; if (!file_exists("../testnet")) { mail($purge_at_email, "Purge Request via WEB", $mmsg, "From: " . $_POST["email"] . "\nReply-To: " . $_POST["email"] . "\nX-Mailer: " . NETWORK_NAME . " Channel Service"); } else { echo "<h3>Testnet : dumping mail</h3>\n"; echo str_replace("\n", "<br>", $mmsg); } /* make the user can re-port in 10 days. */ pg_safe_exec("UPDATE users SET post_forms=(now()::abstime::int4+86400*10) WHERE id=" . $user_id); echo "<h2>"; echo "Please allow 3-5 days for your request to be processed.\n"; echo "</h2>\n"; echo "</body></html>\n\n"; die; }
$wars['status']['yes'] = $sel; } if ($select['players_status'] == 'maybe') { $wars['status']['maybe'] = $sel; } if ($select['players_status'] == 'no') { $wars['status']['no'] = $sel; } $wars['status']['players_id'] = $select['players_id']; $wars['status']['wars_id'] = $wars_id; $wars['lang']['submit'] = empty($in_list) ? $cs_lang['confirm'] : $cs_lang['edit']; } else { $players_id = (int) $_POST['players_id']; $wars_id = (int) $_POST['wars_id']; $status = $_POST['players_status']; $time = cs_time(); if (empty($in_list)) { $cells = array('wars_id', 'users_id', 'players_status', 'players_time'); $values = array($wars_id, $account['users_id'], $status, $time); cs_sql_insert(__FILE__, 'players', $cells, $values); } else { $cells = array('players_status', 'players_time'); $values = array($status, $time); cs_sql_update(__FILE__, 'players', $cells, $values, $players_id); } cs_redirect($cs_lang['success'], 'wars', 'view', 'id=' . $wars_id); } } } } echo cs_subtemplate(__FILE__, $wars, 'wars', 'view');
$data['match']['team1_name'] = $cs_match['squad1_name']; $data['match']['team2_name'] = $cs_match['squad2_name']; } else { $data['match']['team1_name'] = $cs_match['user1_nick']; $data['match']['team2_name'] = $cs_match['user2_nick']; } $data['match']['team1_id'] = $cs_match['squad1_id']; $data['match']['team2_id'] = $cs_match['squad2_id']; echo cs_subtemplate(__FILE__, $data, 'cups', 'enter_result'); } else { /* we got the result */ $cs_cups['cupmatches_winner'] = (int) $_POST['cupmatches_winner']; $cs_cups['cupmatches_score1'] = (int) $_POST['cupmatches_score1']; $cs_cups['cupmatches_score2'] = (int) $_POST['cupmatches_score2']; $cs_cups['cupmatches_accepted' . $team] = '1'; $cs_cups['cupmatches_accepted_time' . $team] = cs_time(); $error = ''; /* check if the winner is one of the teams */ if (!in_array($cs_cups['cupmatches_winner'], array($cs_match['squad1_id'], $cs_match['squad2_id']))) { $error .= cs_html_br(1) . $cs_lang['no_winner']; } if (empty($error)) { $cells = array_keys($cs_cups); $values = array_values($cs_cups); cs_sql_update(__FILE__, 'cupmatches', $cells, $values, $cupmatches_id); // clear datacache if (function_exists('cs_datacache_load')) { cs_datacache_clear('cups'); } cs_redirect($cs_lang['result_successful'], 'cups', 'center'); } else {
<hr> <?php if ($user->verificationdata == "") { echo "<h2>\n"; echo "You need to have verification information set.<br>\n"; echo "Try <a href=\"../users.php?id=" . $user_id . "\">clicking here</a><br>\n"; echo "<a href=\"javascript:history.go(-1);\">Go Back</a><br>\n"; echo "</h2>\n"; echo "</body>\n</html>\n\n"; die; } if ($user->post_forms != "" && $user->post_forms > 0) { $curr = time(); if ($user->post_forms > $curr) { echo "<h2>\n"; echo "You will be able to post another FORM on " . cs_time($user->post_forms) . ".<br>\n"; echo "Please <a href=\"../users.php?id=" . $user_id . "\">click here</a><br>\n"; echo "</h2>\n"; echo "</body>\n</html>\n\n"; die; } else { if ($user->post_forms == 666) { echo "<h2>\n"; echo "You can't post FORMs, because your account has been locked for FORMs.<br>\n"; echo "Please <a href=\"../users.php?id=" . $user_id . "\">click here</a><br>\n"; echo "</h2>\n"; echo "</body>\n</html>\n\n"; die; } } }
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'); }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('awards'); $cs_awards['users_id'] = $account['users_id']; $now = cs_time(); $awards_year = isset($_POST['datum_year']) ? $_POST['datum_year'] : cs_date('unix', $now, 0, 1, 'Y'); $awards_month = isset($_POST['datum_month']) ? $_POST['datum_month'] : cs_date('unix', $now, 0, 1, 'm'); $awards_day = isset($_POST['datum_day']) ? $_POST['datum_day'] : cs_date('unix', $now, 0, 1, 'd'); $cs_awards['awards_time'] = $awards_year . '-' . $awards_month . '-' . $awards_day; $cs_awards['games_id'] = isset($_POST['games_id']) ? (int) $_POST['games_id'] : 0; $cs_awards['awards_rank'] = isset($_POST['awards_rank']) ? (int) $_POST['awards_rank'] : 0; $cs_awards['awards_event'] = isset($_POST['awards_event']) ? $_POST['awards_event'] : ''; $cs_awards['awards_event_url'] = isset($_POST['awards_event_url']) ? $_POST['awards_event_url'] : ''; $cs_awards['squads_id'] = isset($_POST['squads_id']) ? (int) $_POST['squads_id'] : 0; $error = 0; $errormsg = ''; settype($cs_awards['awards_rank'], 'integer'); if (isset($_POST['submit'])) { $awards_check_time = str_replace('-', '', $cs_awards['awards_time']); if ($awards_check_time <= '000') { $error++; $errormsg .= $cs_lang['no_date'] . cs_html_br(1); } if (empty($cs_awards['awards_event'])) { $error++; $errormsg .= $cs_lang['no_event'] . cs_html_br(1); } if (empty($cs_awards['awards_event_url'])) { $error++;
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('events'); $cs_get = cs_get('catid'); $cs_option = cs_sql_option(__FILE__, 'events'); $from = 'events evs INNER JOIN {pre}_categories cat ON evs.categories_id = cat.categories_id'; $select = 'evs.events_id AS events_id, evs.events_name AS events_name, evs.events_time AS events_time'; $upcome = 'evs.events_time > ' . cs_time() . ' AND cat.categories_access <= ' . $account['access_events']; if (!empty($cs_get['catid'])) { $upcome .= ' AND cat.categories_id = ' . $cs_get['catid']; } $cs_events = cs_sql_select(__FILE__, $from, $select, $upcome, 'evs.events_time', 0, $cs_option['max_navnext']); $events_loop = count($cs_events); $data = array(); if (empty($cs_events)) { echo $cs_lang['no_events']; } else { for ($run = 0; $run < $events_loop; $run++) { $data['events'][$run]['date'] = cs_date('unix', $cs_events[$run]['events_time'], 1); $data['events'][$run]['name'] = cs_secure($cs_events[$run]['events_name']); $data['events'][$run]['link'] = cs_url('events', 'view', 'id=' . $cs_events[$run]['events_id']); } echo cs_subtemplate(__FILE__, $data, 'events', 'navnext'); }
$error++; $errormsg .= $cs_lang['no_text'] . cs_html_br(1); } $exists = cs_sql_count(__FILE__, 'boardreport', "threads_id = " . (int) $tid . " AND comments_id = " . (int) $cid); if (!empty($exists)) { $error++; $errormsg .= $cs_lang['report_exists'] . cs_html_br(1); } } if (!empty($error)) { $data['lang']['body'] = $errormsg; } elseif (!isset($_POST['submit'])) { $data['lang']['body'] = $cs_lang['fill_out_all_fields']; } else { $data['lang']['body'] = $cs_lang['report_success']; } if (!empty($error) or !isset($_POST['submit'])) { $data['action']['form'] = cs_url('board', 'report'); $data['report']['tid'] = $tid; $data['report']['cid'] = $cid; } else { $report_cells = array('threads_id', 'comments_id', 'users_id', 'boardreport_time', 'boardreport_text'); $report_save = array($tid, $cid, $account['users_id'], cs_time(), $report); cs_sql_insert(__FILE__, 'boardreport', $report_cells, $report_save); cs_cache_delete('count_boardreport'); require_once 'mods/notifymods/functions.php'; $users_nick = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $account['users_id']); notifymods_mail('board', $account['users_id'], array($users_nick['users_nick'], $cs_thread['threads_headline'], $report)); cs_redirect($cs_lang['report_success'], 'board', 'thread', 'where=' . $tid); } echo cs_subtemplate(__FILE__, $data, 'board', 'report');
$gallery_id = $cs_post['id']; } settype($gallery_id, 'integer'); $edit = cs_sql_select(__FILE__, 'usersgallery', '*', "usersgallery_id = '" . (int) $gallery_id . "'"); $cs_option = cs_sql_option(__FILE__, 'gallery'); $gallery_count_reset = 0; $new_time = 0; if (isset($_POST['submit'])) { $edit['usersgallery_titel'] = $_POST['gallery_titel']; $edit['folders_id'] = empty($_POST['folders_name']) ? $_POST['folders_id'] : make_folders_create('usersgallery', $_POST['folders_name'], $account['users_id']); $edit['usersgallery_access'] = $_POST['gallery_access']; $edit['usersgallery_status'] = $_POST['gallery_status']; $edit['usersgallery_description'] = $_POST['gallery_description']; $edit['usersgallery_vote'] = isset($_POST['gallery_vote']) ? $_POST['gallery_vote'] : 0; if (!empty($_POST['new_time'])) { $edit['usersgallery_time'] = cs_time(); } if (!empty($_POST['gallery_count_reset'])) { $edit['usersgallery_count'] = 0; } $error = ''; if ($edit['users_id'] != $account['users_id'] and $account['access_usersgallery'] < 4) { $error .= $cs_lang['not_own'] . cs_html_br(1); } if (empty($edit['usersgallery_titel'])) { $error .= $cs_lang['no_titel'] . cs_html_br(1); } if (empty($edit['folders_id'])) { $error .= $cs_lang['no_cat'] . cs_html_br(1); } }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('count'); $data = array('count' => array()); $geton = cs_time() - 300; $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start']; $where = "count_time > '" . $geton . "'"; $counte_online = cs_sql_count(__FILE__, 'count', $where); $data['online']['online'] = $counte_online; $data['head']['pages'] = cs_pages('count', 'online', $counte_online, $start); $cs_counter = cs_sql_select(__FILE__, 'count', 'count_time, count_location', "count_time >= '" . $geton . "'", 'count_id DESC', $start, $account['users_limit']); $counte_loop = count($cs_counter); for ($run = 0; $run < $counte_loop; $run++) { $data['count'][$run]['count_time'] = cs_date('unix', $cs_counter[$run]['count_time'], 1); $data['count'][$run]['count_location'] = cs_secure($cs_counter[$run]['count_location']); } echo cs_subtemplate(__FILE__, $data, 'count', 'online');
$cs_lang = cs_translate('install'); $error = empty($cs_db['last_error']) ? 'Unknown' : $cs_db['last_error']; $msg = 'Error: ' . $error . cs_html_br(2) . 'Query: ' . $old_query . cs_html_br(4); $msg .= cs_link($cs_lang['remove_and_again'], 'install', 'sql', 'lang=' . $account['users_lang'] . '&uninstall=1'); die(cs_error_internal('sql', $msg)); } if (!empty($_REQUEST['uninstall'])) { $sql_uninstall = file_get_contents('uninstall.sql'); $sql_array = preg_split("=;[\n\r]+=", $sql_uninstall); foreach ($sql_array as $sql_query) { cs_sql_query(__FILE__, $sql_query); } cs_redirect('', 'install', 'sql', 'lang=' . $account['users_lang']); } $sql_install = file_get_contents('install.sql'); $sql_install = str_replace('{time}', cs_time(), $sql_install); $sql_install = str_replace('{def_lang}', $account['users_lang'], $sql_install); $sql_install = str_replace('{guest}', $cs_lang['guest'], $sql_install); $sql_install = str_replace('{community}', $cs_lang['community'], $sql_install); $sql_install = str_replace('{member}', $cs_lang['member'], $sql_install); $sql_install = str_replace('{orga}', $cs_lang['orga'], $sql_install); $sql_install = str_replace('{admin}', $cs_lang['admin'], $sql_install); if ($cs_db['hash'] == 'md5') { $sec_pwd = md5('admin'); } elseif ($cs_db['hash'] == 'sha1') { $sec_pwd = sha1('admin'); } $sql_install = str_replace('{pwd}', $sec_pwd, $sql_install); $sql_install = cs_sql_replace($sql_install); $sql_array = preg_split("=;[\n\r]+=", $sql_install); foreach ($sql_array as $sql_query) {
if (!empty($check['boardmods_modpanel']) or $account['access_board'] == 5) { $acc_mod = 1; } $head = cs_link($cs_lang['board'], 'board', 'list', 'normalb') . ' -> '; $head .= cs_link($cs_thread['categories_name'], 'board', 'list', 'where=' . $cs_thread['categories_id'], 'normalb') . ' -> '; $head .= cs_link($cs_thread['board_name'], 'board', 'listcat', 'where=' . $cs_thread['board_id'], 'normalb'); $data['head']['boardlinks'] = $head; $bv['boardvotes_question'] = ''; $cs_board_opt = cs_sql_option(__FILE__, 'board'); $max_size = $cs_board_opt['file_size']; $filetypes = explode(',', $cs_board_opt['file_types']); $board['board_id'] = $board_id; $board['users_id'] = $account['users_id']; $board['threads_last_user'] = $account['users_id']; $board['threads_time'] = cs_time(); $board['threads_last_time'] = cs_time(); $board['threads_headline'] = ''; $board['threads_text'] = ''; $board['threads_important'] = 0; $board['threads_close'] = 0; $votes = 0; if (isset($_POST['submit']) or isset($_POST['preview']) or isset($_POST['new_votes']) or isset($_POST['election']) or isset($_POST['files+']) or isset($_POST['new_file'])) { $board['threads_headline'] = $_POST['threads_headline']; $board['threads_text'] = $_POST['threads_text']; if (!empty($acc_mod)) { $board['threads_important'] = isset($_POST['threads_important']) ? $_POST['threads_important'] : 0; $board['threads_close'] = isset($_POST['threads_close']) ? $account['users_id'] : 0; } $bv['boardvotes_access'] = isset($_POST['votes_access']) ? $_POST['votes_access'] : '0'; $bv['boardvotes_question'] = isset($_POST['votes_question']) ? $_POST['votes_question'] : ''; $bv['boardvotes_several'] = isset($_POST['votes_several']) ? '1' : '0';
if (empty($search)) { $cs_gallery_pic['users_id'] = $account['users_id']; $cs_gallery_pic['gallery_name'] = $name; $cs_gallery_pic['gallery_status'] = isset($_POST['gallery_status']) ? $_POST['gallery_status'] : 0; $cs_gallery_pic['gallery_access'] = isset($_POST['gallery_access']) ? $_POST['gallery_access'] : 0; $cs_gallery_pic['gallery_watermark'] = $_POST['gallery_watermark']; if (!empty($_POST['gallery_watermark'])) { $watermark_pos = $_POST['watermark_pos']; $watermark_trans = $_POST['gallery_watermark_trans']; $cs_gallery_pic['gallery_watermark_pos'] = $watermark_pos . '|--@--|' . $watermark_trans; } $extension = strlen(strrchr($name, ".")); $file = strlen($name); $filename = substr($name, 0, $file - $extension); $cs_gallery_pic['gallery_titel'] = $filename; $cs_gallery_pic['gallery_time'] = cs_time(); $gallery_cells = array_keys($cs_gallery_pic); $gallery_save = array_values($cs_gallery_pic); cs_sql_insert(__FILE__, 'gallery', $gallery_cells, $gallery_save); } $data['pics'][$run]['img'] = cs_html_img('mods/gallery/image.php?picname=' . $name); $data['pics'][$run]['name'] = $name; } } } cs_redirect($cs_lang['create_done'], 'gallery'); } if (!isset($_POST['submit_1'])) { if (!isset($_POST['submit']) or !empty($error)) { $data['if']['start'] = TRUE; }
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('clansphere'); $timezone = $account['users_timezone'] / 3600; $zonename = $timezone >= 0 ? 'UTC +' . $timezone : 'UTC ' . $timezone; $dst = ''; if (empty($account['users_dstime']) and date('I', cs_time()) != '0' or $account['users_dstime'] == 'on') { $dst = ' [' . $cs_lang['dstime'] . ']'; } echo cs_date('unix', cs_time(), 1) . ' ' . $cs_lang['using'] . ' ' . $zonename . $dst;
<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('history'); $data = array(); $data['if']['preview'] = FALSE; if (isset($_POST['submit']) or isset($_POST['preview'])) { $history['history_text'] = empty($cs_main['rte_html']) ? $_POST['history_text'] : cs_abcode_inhtml($_POST['history_text'], 'add'); $history['history_time'] = cs_time(); $history['users_id'] = $account['users_id']; $error = ''; if (empty($history['history_text'])) { $error .= $cs_lang['no_text'] . cs_html_br(1); } } else { $history['history_text'] = ''; $history['history_time'] = ''; $history['users_id'] = 0; } if (!isset($_POST['submit']) and !isset($_POST['preview'])) { $data['head']['body'] = $cs_lang['body']; } elseif (!empty($error)) { $data['head']['body'] = $error; } elseif (isset($_POST['preview'])) { $data['head']['body'] = $cs_lang['preview']; } if (isset($_POST['preview']) and empty($error)) { $data['if']['preview'] = TRUE; $data['preview']['date'] = cs_date('unix', $history['history_time'], 1); $cs_user = cs_sql_select(__FILE__, 'users', 'users_nick, users_active', "users_id = '" . $history['users_id'] . "'");
$cs_computers['computers_memory'] = ''; $cs_computers['computers_processors'] = ''; $cs_computers['computers_graphics'] = ''; $cs_computers['computers_sounds'] = ''; $cs_computers['computers_harddisks'] = ''; $cs_computers['computers_drives'] = ''; $cs_computers['computers_screens'] = ''; $cs_computers['computers_interfaces'] = ''; $cs_computers['computers_networks'] = ''; $cs_computers['computers_more'] = ''; } if (!isset($_POST['submit'])) { $data['head']['body'] = $cs_lang['body_create']; } elseif (!empty($error)) { $data['head']['body'] = $error; } if (!empty($error) or !isset($_POST['submit'])) { foreach ($cs_computers as $key => $value) { $data['com'][$key] = cs_secure($value); } $data['com']['referer'] = empty($_SERVER['HTTP_REFERER']) ? 'center' : $_SERVER['HTTP_REFERER']; echo cs_subtemplate(__FILE__, $data, 'computers', 'create'); } else { $cs_computers['computers_since'] = cs_time(); $computers_cells = array_keys($cs_computers); $computers_save = array_values($cs_computers); cs_sql_insert(__FILE__, 'computers', $computers_cells, $computers_save); #$referrer = strpos($_POST['referer'],'manage') === false ? 'center' : 'manage'; $referrer = $account['access_computers'] < 3 ? 'center' : 'manage'; cs_redirect($cs_lang['create_done'], 'computers', $referrer); }