<?php // ClanSphere 2010 - www.clansphere.net // $Id$ $cs_lang = cs_translate('gbook'); $cs_post = cs_post('where,start,sort'); $cs_get = cs_get('where,start,sort'); $data = array(); if (!empty($_GET['active'])) { cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('1'), (int) $_GET['active']); cs_redirectmsg($cs_lang['active_done']); } if (!empty($_GET['deactive'])) { cs_sql_update(__FILE__, 'gbook', array('gbook_lock'), array('0'), (int) $_GET['deactive']); cs_redirectmsg($cs_lang['deactive_done']); } $id = empty($cs_get['where']) ? 0 : $cs_get['where']; if (!empty($cs_post['where'])) { $id = $cs_post['where']; } $start = empty($cs_get['start']) ? 0 : $cs_get['start']; if (!empty($cs_post['start'])) { $start = $cs_post['start']; } $sort = empty($cs_get['sort']) ? 1 : $cs_get['sort']; if (!empty($cs_post['sort'])) { $sort = $cs_post['sort']; } $cs_sort[1] = 'gbk.gbook_time DESC'; $cs_sort[2] = 'gbk.gbook_time ASC'; $cs_sort[3] = 'usr.users_email DESC';
function cs_redirect($message, $mod, $action = 'manage', $more = '', $id = 0, $icon = 0) { if ($mod != "install" && $message) { cs_redirectmsg($message, $id, $icon); } $persistent_params = array('xhr', 'xhr_navlists'); $more = explode('#', $more); foreach ($persistent_params as $p) { if (isset($_REQUEST[$p])) { $more[0] .= !empty($more[0]) ? '&' : ''; $more[0] .= $p . '=' . $_REQUEST[$p]; } } $more = implode('#', $more); $more = empty($more) ? 0 : $more; $url = str_replace('&', '&', cs_url($mod, $action, $more)); header('Location: ' . $url); exit; }