Ejemplo n.º 1
0
function ShowTeamspeakPage()
{
    global $CONF, $LNG;
    if ($_POST) {
        if (isset($_POST['ts_on']) && $_POST['ts_on'] == 'on') {
            $CONF['ts_modon'] = 1;
        } else {
            $CONF['ts_modon'] = 0;
        }
        $CONF['ts_server'] = request_var('ts_ip', '');
        $CONF['ts_tcpport'] = request_var('ts_tcp', 0);
        $CONF['ts_udpport'] = request_var('ts_udp', 0);
        $CONF['ts_timeout'] = request_var('ts_to', 0);
        $CONF['ts_version'] = request_var('ts_v', 0);
        update_config('ts_timeout', $CONF['ts_timeout']);
        update_config('ts_modon', $CONF['ts_modon']);
        update_config('ts_server', $CONF['ts_server']);
        update_config('ts_tcpport', $CONF['ts_tcpport']);
        update_config('ts_udpport', $CONF['ts_udpport']);
        update_config('ts_version', $CONF['ts_version']);
    }
    $template = new template();
    $template->page_header();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_server_id' => $LNG['ts_server_id'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version']));
    $template->show('adm/TeamspeakPage.tpl');
}
Ejemplo n.º 2
0
/**
 *  2Moons
 *  Copyright (C) 2012 Jan Kröpke
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package 2Moons
 * @author Jan Kröpke <*****@*****.**>
 * @copyright 2012 Jan Kröpke <*****@*****.**>
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.7.2 (2013-03-18)
 * @info $Id$
 * @link http://2moons.cc/
 */
function ShowIndexPage()
{
    global $LNG;
    $template = new template();
    $template->assign_vars(array('game_name' => Config::get()->game_name, 'adm_cp_title' => $LNG['adm_cp_title']));
    $template->display('adm/ShowIndexPage.tpl');
}
Ejemplo n.º 3
0
function ShowPaybonusPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('bonus_button' => $CONF['bonus_button'], 'academy_bonus' => $CONF['academy_bonus'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'cosmonaute' => $CONF['cosmonaute'], 'fleetconf' => $CONF['fleetconf'], 'new_year' => $CONF['new_year']);
        $purchase_bonus = $_POST['percent'];
        $academy_bonus = $_POST['academy_bonus'];
        $bonus_button = $_POST['bonus_button'];
        $premium = $_POST['premium'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $fleetconf = isset($_POST['fleetconf']) && $_POST['fleetconf'] == 'on' ? 1 : 0;
        $cosmonaute = isset($_POST['cosmonaute']) && $_POST['cosmonaute'] == 'on' ? 1 : 0;
        $new_year = isset($_POST['new_year']) && $_POST['new_year'] == 'on' ? 1 : 0;
        $purchase_bonus_timer = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('bonus_button' => $bonus_button, 'academy_bonus' => $academy_bonus, 'premium' => $premium, 'stardust_bonus' => $stardust_bonus, 'purchase_bonus' => $purchase_bonus, 'purchase_bonus_timer' => $purchase_bonus_timer, 'fleetconf' => $fleetconf, 'cosmonaute' => $cosmonaute, 'new_year' => $new_year);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('academy_bonus' => $CONF['academy_bonus'], 'cosmonaute' => $CONF['cosmonaute'], 'new_year' => $CONF['new_year'], 'bonus_button' => $CONF['bonus_button'], 'fleetconf' => $CONF['fleetconf'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'bonus_next_active' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? $CONF['purchase_bonus_timer'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['purchase_bonus_timer']) : 0));
    $template->show('paybonus.tpl');
}
Ejemplo n.º 4
0
 function show($view, $loc, $title = '')
 {
     $template = new template('imagemanagermodule', $view, $loc);
     $uilevel = 99;
     // MAX
     if (exponent_sessions_isset("uilevel")) {
         $uilevel = exponent_sessions_get("uilevel");
     }
     $template->assign('show', defined('SELECTOR') || $uilevel > UILEVEL_PREVIEW ? 1 : 0);
     if (!defined('SYS_FILES')) {
         include_once BASE . 'subsystems/files.php';
     }
     $directory = 'files/imagemanagermodule/' . $loc->src;
     if (!file_exists(BASE . $directory)) {
         $err = exponent_files_makeDirectory($directory);
         if ($err != SYS_FILES_SUCCESS) {
             $template->assign('noupload', 1);
             $template->assign('uploadError', $err);
         }
     }
     global $db;
     $location = serialize($loc);
     if (!isset($_SESSION['image_cache'][$location])) {
         $items = $db->selectObjects("imagemanageritem", "location_data='" . serialize($loc) . "'");
         $_SESSION['image_cache'][$location] = $items;
     } else {
         $items = $_SESSION['image_cache'][$location];
     }
     $files = $db->selectObjectsIndexedArray("file", "directory='{$directory}'");
     $template->assign('items', $items);
     $template->assign('files', $files);
     $template->assign('moduletitle', $title);
     $template->register_permissions(array('administrate', 'post', 'edit', 'delete'), $loc);
     $template->output();
 }
Ejemplo n.º 5
0
function ShowSendMessagesPage()
{
    global $USER, $LNG, $db;
    if ($_GET['mode'] == 'send') {
        switch ($USER['authlevel']) {
            case AUTH_MOD:
                $color = 'yellow';
                break;
            case AUTH_OPS:
                $color = 'skyblue';
                break;
            case AUTH_ADM:
                $color = 'red';
                break;
        }
        $Subject = makebr(request_var('subject', '', true));
        $Message = makebr(request_var('text', '', true));
        if (!empty($Message) && !empty($Subject)) {
            require_once ROOT_PATH . 'includes/functions/BBCode.php';
            $Time = TIMESTAMP;
            $From = '<span style="color:' . $color . ';">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
            $Subject = '<span style="color:' . $color . ';">' . $Subject . '</span>';
            $Message = '<span style="color:' . $color . ';font-weight:bold;">' . bbcode($Message) . '</span>';
            SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0, $_SESSION['adminuni']);
            $db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1', `new_message` = `new_message` + '1' WHERE `universe` = '" . $_SESSION['adminuni'] . "';");
            exit($LNG['ma_message_sended']);
        } else {
            exit($LNG['ma_subject_needed']);
        }
    }
    $template = new template();
    $template->assign_vars(array('mg_empty_text' => $LNG['mg_empty_text'], 'ma_subject' => $LNG['ma_subject'], 'ma_none' => $LNG['ma_none'], 'ma_message' => $LNG['ma_message'], 'ma_send_global_message' => $LNG['ma_send_global_message'], 'ma_characters' => $LNG['ma_characters'], 'button_submit' => $LNG['button_submit']));
    $template->show('adm/SendMessagesPage.tpl');
}
Ejemplo n.º 6
0
function ShowTeamspeakPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if ($_POST) {
        $config_before = array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        Config::update($config_after);
        $GLOBALS['DATABASE']->query("UPDATE " . CRONJOBS . " SET isActive = " . $ts_modon . ", `lock` = NULL, nextTime = 0 WHERE name = 'teamspeak';");
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval']));
    $template->show('TeamspeakPage.tpl');
}
Ejemplo n.º 7
0
function message($mes, $dest = "", $time = "3", $topnav = false, $menu = true)
{
    require_once ROOT_PATH . 'includes/classes/class.template.php';
    $template = new template();
    $template->message($mes, $dest, $time, !$topnav);
    exit;
}
Ejemplo n.º 8
0
 public function __construct()
 {
     global $CONF, $dpath, $LNG, $db, $USER, $PLANET;
     $mode = request_var('mode', '');
     $msg = request_var('msg', '', true);
     $ctype = request_var('chat_type', '');
     $MessageID = request_var('id', 0);
     switch ($mode) {
         case "delete":
             $this->DelMeassageFromChat($MessageID);
             break;
         case "send":
             $this->SetMeassageInChat($ctype, $msg);
             break;
         case "call":
             $this->GetMessages($ctype);
             break;
         default:
             $template = new template();
             $template->execscript("showMessage();setInterval(showMessage, 10000);");
             $template->loadscript("chat.js");
             if (empty($ctype)) {
                 $PlanetRess = new ResourceUpdate();
                 $PlanetRess->CalcResource();
                 $PlanetRess->SavePlanetToDB();
             } else {
                 $template->isPopup(true);
             }
             $template->assign_vars(array('ctype' => $ctype, 'chat_send' => $LNG['chat_send'], 'chat_disc' => $LNG['chat_disc'], 'chat_message' => $LNG['chat_message'], 'chat_bbcode' => $LNG['chat_bbcode'], 'chat_fontcolor' => $LNG['chat_fontcolor'], 'chat_color_white' => $LNG['chat_color_white'], 'chat_color_blue' => $LNG['chat_color_blue'], 'chat_color_yellow' => $LNG['chat_color_yellow'], 'chat_color_green' => $LNG['chat_color_green'], 'chat_color_pink' => $LNG['chat_color_pink'], 'chat_color_red' => $LNG['chat_color_red'], 'chat_color_orange' => $LNG['chat_color_orange'], 'chat_notext' => $LNG['chat_notext'], 'chat_request_url' => $LNG['chat_request_url'], 'chat_request_url_desc' => $LNG['chat_request_url_desc']));
             $template->show("chat_overview.tpl");
             break;
     }
 }
Ejemplo n.º 9
0
/**
 *  2Moons
 *  Copyright (C) 2012 Jan Kröpke
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package 2Moons
 * @author Jan Kröpke <*****@*****.**>
 * @copyright 2012 Jan Kröpke <*****@*****.**>
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.7.3 (2013-05-19)
 * @info $Id: ShowMenuPage.php 2632 2013-03-18 19:05:14Z slaver7 $
 * @link http://2moons.cc/
 */
function ShowMenuPage()
{
    global $USER;
    $template = new template();
    $template->assign_vars(array('supportticks' => $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . TICKETS . " WHERE universe = " . $_SESSION['adminuni'] . " AND status = 0;")));
    $template->show('ShowMenuPage.tpl');
}
Ejemplo n.º 10
0
 function show($view, $loc = null, $title = '')
 {
     $template = new template('loginmodule', $view, $loc);
     $template->assign('title', $title);
     if (pathos_sessions_loggedIn()) {
         global $user, $db;
         $template->assign('loggedin', 1);
         $template->assign('user', $user);
         // Generate display name as username if the first and last name fields are blank.
         $display_name = $user->firstname . ' ' . $user->lastname;
         if (trim($display_name) == '') {
             $display_name = $user->username;
         }
         $template->assign('displayname', $display_name);
         // Need to check for groups and whatnot
         if ($db->countObjects('groupmembership', 'member_id=' . $user->id . ' AND is_admin=1')) {
             $template->assign('is_group_admin', 1);
         } else {
             $template->assign('is_group_admin', 0);
         }
     } else {
         $template->assign("loggedin", 0);
     }
     $template->output($view);
 }
Ejemplo n.º 11
0
function ShowChatConfigPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_allowdelmes' => $CONF['chat_allowdelmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname']);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname'], 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
Ejemplo n.º 12
0
function run()
{
    global $layout;
    global $DB;
    global $website;
    global $theme;
    $out = '';
    switch ($_REQUEST['act']) {
        case "copy_from_template_zones":
            // return template sections and (textarea) properties for a content id
            $template = new template();
            $template->load($_REQUEST['template']);
            $zones = array();
            for ($ts = 0; $ts < count($template->sections); $ts++) {
                $title = $theme->t($template->sections[$ts]['name']);
                if ($title == '#main#') {
                    $title = t(238, 'Main content');
                }
                $zones[] = array('type' => 'section', 'code' => $template->sections[$ts]['code'], 'title' => $title);
            }
            for ($ps = 0; $ps < count($template->properties); $ps++) {
                // ignore non-textual properties
                if (!in_array($template->properties[$ps]->type, array("text", "textarea", "rich_textarea"))) {
                    continue;
                }
                $zones[] = array('type' => 'property', 'code' => $template->properties[$ps]->id, 'title' => $theme->t($template->properties[$ps]->name));
            }
            echo json_encode($zones);
            core_terminate();
            break;
    }
}
Ejemplo n.º 13
0
function dok_link_song_album($VARS, $update, $theme_path)
{
    if (!is_numeric($VARS['id']) || $VARS['id'] < 1) {
        $VARS['id'] = 0;
    }
    $res = mysql_query('select * from ' . dok_tn('song') . ' where id = ' . $VARS['id']);
    if (!mysql_numrows($res)) {
        $t = dok_error_template(MSG_ERR_SONG_NOT_FOUND);
        return array($t, MSG_TITLE_ADD_SONG_ALBUM);
    }
    $song = mysql_fetch_array($res);
    /**	$res = dok_oquery('select distinct(album_id) as aid from '.dok_tn('rel_song_album').' where song_id = '.$song['id']);
    	$current_albums = $res->fetch_col_array('aid');
    	$where = '';
    	if ( sizeof($current_albums) )	$where = ' where id not in('.implode(',',$current_albums).')';*/
    $where = '';
    $res = mysql_query('select id, name from ' . dok_tn('album') . $where . ' order by name');
    $a_select = '';
    while ($row = mysql_fetch_array($res)) {
        $a_select .= '<option value="' . $row['id'] . '"';
        if ($_SESSION['song_select_album'] == $row['id']) {
            $a_select .= ' selected';
        }
        $a_select .= '>' . $row['name'] . '</option>';
    }
    $t = new template($theme_path);
    $t->set_file('page', 'song_album_link.tpl');
    $t->set_var(dok_song_format($song));
    $t->set_var('ALBUM_SELECT', $a_select);
    $t->set_var('SONG_ID', $song['id']);
    return array($t, MSG_TITLE_ADD_SONG_ALBUM);
}
Ejemplo n.º 14
0
 function display_form($template = false)
 {
     global $CONFIG, $Sql, $LANG, $Session;
     $note = !empty($_POST['note']) ? numeric($_POST['note']) : 0;
     $path_redirect = $this->path . sprintf(str_replace('&amp;', '&', $this->script_path), 0);
     if ($this->_note_loaded()) {
         if (!is_object($template) || strtolower(get_class($template)) != 'template') {
             $template = new template('framework/note.tpl');
         }
         ###########################Insertion##############################
         if (!empty($_POST['valid_note'])) {
             if (!empty($note)) {
                 $this->add($note);
             }
             redirect($path_redirect);
         } else {
             ###########################Affichage##############################
             $row_note = $Sql->query_array(PREFIX . $this->sql_table, 'users_note', 'nbrnote', 'note', "WHERE id = '" . $this->idprov . "'", __LINE__, __FILE__);
             $select = '<option value="-1" selected="selected">' . $LANG['note'] . '</option>';
             for ($i = 0; $i <= $this->notation_scale; $i++) {
                 $select .= '<option value="' . $i . '">' . $i . '</option>';
             }
             ### Notation Ajax ###
             $row_note['note'] = round($row_note['note'] / 0.25) * 0.25;
             $l_note = ($this->options & NOTE_DISPLAY_NOTE) !== 0 ? '<strong>' . $LANG['note'] . ':</strong>&nbsp;' : '';
             $display = ($this->options & NOTE_DISPLAY_BLOCK) !== 0 ? 'block' : 'inline';
             $width = ($this->options & NOTE_DISPLAY_BLOCK) !== 0 ? 'width:' . $this->notation_scale * 16 . 'px;margin:auto;' : '';
             $ajax_note = '<div style="' . $width . 'display:none" id="note_stars' . $this->idprov . '" onmouseout="out_div(' . $this->idprov . ', array_note[' . $this->idprov . '])" onmouseover="over_div()">';
             for ($i = 1; $i <= $this->notation_scale; $i++) {
                 $star_img = 'stars.png';
                 if ($row_note['note'] < $i) {
                     $decimal = $i - $row_note['note'];
                     if ($decimal >= 1) {
                         $star_img = 'stars0.png';
                     } elseif ($decimal >= 0.75) {
                         $star_img = 'stars1.png';
                     } elseif ($decimal >= 0.5) {
                         $star_img = 'stars2.png';
                     } else {
                         $star_img = 'stars3.png';
                     }
                 }
                 $ajax_note .= '<a href="javascript:send_note(' . $this->idprov . ', ' . $i . ', \'' . $Session->get_token() . '\')" onmouseover="select_stars(' . $this->idprov . ', ' . $i . ');"><img src="../templates/' . get_utheme() . '/images/' . $star_img . '" alt="" class="valign_middle" id="n' . $this->idprov . '_stars' . $i . '" /></a>';
             }
             if (($this->options & NOTE_NODISPLAY_NBRNOTES) !== 0) {
                 $ajax_note .= '</div> <span id="noteloading' . $this->idprov . '"></span>';
             } else {
                 $ajax_note .= '</div> <span id="noteloading' . $this->idprov . '"></span> <div style="display:' . $display . '" id="nbrnote' . $this->idprov . '">(' . $row_note['nbrnote'] . ' ' . ($row_note['nbrnote'] > 1 ? strtolower($LANG['notes']) : strtolower($LANG['note'])) . ')</div>';
             }
             $template->assign_vars(array('C_JS_NOTE' => !defined('HANDLE_NOTE'), 'ID' => $this->idprov, 'NOTE_MAX' => $this->notation_scale, 'SELECT' => $select, 'NOTE' => $l_note . '<span id="note_value' . $this->idprov . '">' . ($row_note['nbrnote'] > 0 ? '<strong>' . $row_note['note'] . '</strong>' : '<em>' . $LANG['no_note'] . '</em>') . '</span>' . $ajax_note, 'ARRAY_NOTE' => 'array_note[' . $this->idprov . '] = \'' . $row_note['note'] . '\';', 'DISPLAY' => $display, 'L_AUTH_ERROR' => addslashes($LANG['e_auth']), 'L_ALERT_ALREADY_VOTE' => addslashes($LANG['already_vote']), 'L_ALREADY_VOTE' => '', 'L_NOTE' => addslashes($LANG['note']), 'L_NOTES' => addslashes($LANG['notes']), 'L_VALID_NOTE' => $LANG['valid_note']));
         }
         if (!defined('HANDLE_NOTE')) {
             define('HANDLE_NOTE', true);
         }
         return $template->parse(TEMPLATE_STRING_MODE);
     } else {
         global $Errorh;
         $Errorh->handler('e_unexist_page', E_USER_REDIRECT);
     }
 }
Ejemplo n.º 15
0
function ShowVoucherPage()
{
    global $LNG, $USER;
    $template = new template();
    if ($_GET['mode'] == 'delete' && !empty($_GET['i'])) {
        //delete an entry
        $GLOBALS['DATABASE']->query("DELETE from `uni1_reward` where `rewardId` = " . $GLOBALS['DATABASE']->sql_escape($_GET['i']) . " ;");
        $template->message("Voucher Code deleted");
        die;
    }
    if ($_POST) {
        $SQL = "";
        foreach ($_POST as $key => $value) {
            $SQL .= "'" . $value . "',";
        }
        $SQL = substr($SQL, 0, -1);
        $GLOBALS['DATABASE']->query("INSERT INTO `uni1_reward` VALUES (NULL," . $SQL . ");");
        $template->message("Voucher Added");
        die;
    }
    $AllVouchers = array();
    $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_reward` ;");
    if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
        while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
            $AllVouchers[] = $x;
        }
    }
    $template->assign_vars(array('AllVouchers' => $AllVouchers));
    $template->show('VoucherEditor.tpl');
}
Ejemplo n.º 16
0
function ShowInformationPage()
{
    global $LNG, $CONF, $USER;
    if (file_exists(ini_get('error_log'))) {
        $Lines = count(file(ini_get('error_log')));
    } else {
        $Lines = 0;
    }
    try {
        $dateTimeZoneServer = new DateTimeZone(Config::get('timezone'));
    } catch (Exception $e) {
        $dateTimeZoneServer = new DateTimeZone(date_default_timezone_get());
    }
    try {
        $dateTimeZoneUser = new DateTimeZone($USER['timezone']);
    } catch (Exception $e) {
        $dateTimeZoneUser = new DateTimeZone(date_default_timezone_get());
    }
    try {
        $dateTimeZonePHP = new DateTimeZone(ini_get('date.timezone'));
    } catch (Exception $e) {
        $dateTimeZonePHP = new DateTimeZone(date_default_timezone_get());
    }
    $dateTimeServer = new DateTime("now", $dateTimeZoneServer);
    $dateTimeUser = new DateTime("now", $dateTimeZoneUser);
    $dateTimePHP = new DateTime("now", $dateTimeZonePHP);
    $template = new template();
    $template->assign_vars(array('info_information' => sprintf($LNG['info_information'], 'http://tracker.2moons.cc/'), 'info' => $_SERVER['SERVER_SOFTWARE'], 'vPHP' => PHP_VERSION, 'vAPI' => PHP_SAPI, 'vGame' => Config::get('VERSION'), 'vMySQLc' => $GLOBALS['DATABASE']->getVersion(), 'vMySQLs' => $GLOBALS['DATABASE']->getServerVersion(), 'root' => $_SERVER['SERVER_NAME'], 'gameroot' => $_SERVER['SERVER_NAME'] . str_replace('/admin.php', '', $_SERVER['PHP_SELF']), 'json' => function_exists('json_encode') ? 'Ja' : 'Nein', 'bcmath' => extension_loaded('bcmath') ? 'Ja' : 'Nein', 'curl' => extension_loaded('curl') ? 'Ja' : 'Nein', 'browser' => $_SERVER['HTTP_USER_AGENT'], 'safemode' => ini_get('safe_mode') ? 'Ja' : 'Nein', 'memory' => ini_get('memory_limit'), 'suhosin' => ini_get('suhosin.request.max_value_length') ? 'Ja' : 'Nein', 'log_errors' => ini_get('log_errors') ? 'Aktiv' : 'Inaktiv', 'errorlog' => ini_get('error_log'), 'errorloglines' => $Lines, 'php_tz' => $dateTimePHP->getOffset() / 3600, 'conf_tz' => $dateTimeServer->getOffset() / 3600, 'user_tz' => $dateTimeUser->getOffset() / 3600));
    $template->show('ShowInformationPage.tpl');
}
Ejemplo n.º 17
0
 /**
  * Returns the html output if login failed or redirects to patients if login was successful.
  *
  * @return string Html output.
  */
 public function getOutput()
 {
     $attempt = isset($_POST['username']) && isset($_POST['password']);
     $success = false;
     if ($attempt) {
         $success = $this->validateLogin();
     }
     $tpl = new \template("login/login");
     if ($attempt) {
         if ($success) {
             $_SESSION['login'] = new \DateTime();
             $_SESSION['user'] = $_POST['username'];
             $_SESSION['userId'] = \dbConn::querySingle("SELECT userId FROM :prefix:user WHERE email = :0", $_POST['username']);
             $_SESSION['isAdmin'] = $this->isAdmin();
             $_SESSION['username'] = \dbConn::querySingle("SELECT CONCAT(CONCAT(firstname, ' '), lastname) AS name \n                                                                FROM :prefix:user WHERE email = :0", $_POST['username']);
             if ($_SESSION['isAdmin']) {
                 header("location: " . ROOT . "patients");
             } else {
                 header("location: " . ROOT . "mypatients");
             }
             die;
         } else {
             $tpl->insert("result", new \template("login/failed"));
         }
     }
     return $tpl->getOutput();
 }
Ejemplo n.º 18
0
function ShowDisclamerPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('disclamerAddress' => $config->disclamerAddress, 'disclamerPhone' => $config->disclamerPhone, 'disclamerMail' => $config->disclamerMail, 'disclamerNotice' => $config->disclamerNotice);
        $disclaimerAddress = HTTP::_GP('disclaimerAddress', '', true);
        $disclaimerPhone = HTTP::_GP('disclaimerPhone', '', true);
        $disclaimerMail = HTTP::_GP('disclaimerMail', '', true);
        $disclaimerNotice = HTTP::_GP('disclaimerNotice', '', true);
        $config_after = array('disclamerAddress' => $disclaimerAddress, 'disclamerPhone' => $disclaimerPhone, 'disclamerMail' => $disclaimerMail, 'disclamerNotice' => $disclaimerNotice);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 5;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->loadscript('../base/jquery.autosize-min.js');
    $template->execscript('$(\'textarea\').autosize();');
    $template->assign_vars(array('disclaimerAddress' => $config->disclamerAddress, 'disclaimerPhone' => $config->disclamerPhone, 'disclaimerMail' => $config->disclamerMail, 'disclaimerNotice' => $config->disclamerNotice, 'se_server_parameters' => $LNG['mu_disclaimer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclaimerAddress' => $LNG['se_disclaimerAddress'], 'se_disclaimerPhone' => $LNG['se_disclaimerPhone'], 'se_disclaimerMail' => $LNG['se_disclaimerMail'], 'se_disclaimerNotice' => $LNG['se_disclaimerNotice']));
    $template->show('DisclamerConfigBody.tpl');
}
Ejemplo n.º 19
0
function ShowMultiIPPage()
{
    global $LNG;
    switch ($_GET['action']) {
        case 'known':
            $GLOBALS['DATABASE']->query("INSERT INTO " . MULTI . " SET userID = " . (int) $_GET['id'] . ";");
            HTTP::redirectTo("admin.php?page=multiips");
            break;
        case 'unknown':
            $GLOBALS['DATABASE']->query("DELETE FROM " . MULTI . " WHERE userID = " . (int) $_GET['id'] . ";");
            HTTP::redirectTo("admin.php?page=multiips");
            break;
    }
    $Query = $GLOBALS['DATABASE']->query("SELECT id, username, email, register_time, onlinetime, user_lastip, IFNULL(multiID, 0) as isKnown FROM " . USERS . " LEFT JOIN " . MULTI . " ON userID = id WHERE `universe` = '" . Universe::getEmulated() . "' AND user_lastip IN (SELECT user_lastip FROM " . USERS . " WHERE `universe` = '" . Universe::getEmulated() . "' GROUP BY user_lastip HAVING COUNT(*)>1) ORDER BY user_lastip, id ASC;");
    $IPs = array();
    while ($Data = $GLOBALS['DATABASE']->fetch_array($Query)) {
        if (!isset($IPs[$Data['user_lastip']])) {
            $IPs[$Data['user_lastip']] = array();
        }
        $Data['register_time'] = _date($LNG['php_tdformat'], $Data['register_time']);
        $Data['onlinetime'] = _date($LNG['php_tdformat'], $Data['onlinetime']);
        $IPs[$Data['user_lastip']][$Data['id']] = $Data;
    }
    $template = new template();
    $template->assign_vars(array('multiGroups' => $IPs));
    $template->show('MultiIPs.tpl');
}
Ejemplo n.º 20
0
 function page()
 {
     $user = $this->f3->get("user");
     $tmpl = new \template("template.twig");
     $tmpl->page = array("section" => "about", "sub_section" => "about", "template" => "about", "meta" => array("title" => "Directory | About Us"), "css" => "", "js" => "");
     $tmpl->output();
 }
Ejemplo n.º 21
0
function action_default()
{
    global $config;
    $data = getData();
    $data = fillInDefaults($data);
    $playText = "Play";
    $pageTitle = "WebMP3";
    if ($data["play"]) {
        $pageTitle = $data['track'] . " - " . $data['title'];
        $playText = "Stop";
    }
    $muteText = "Mute";
    if ($data["mute"]) {
        $muteText = "Unmute";
    }
    list($remMin, $remSec, $remaining, $stream, $started) = getRemaining($data);
    $pre = "-";
    if ($stream) {
        $pre = "";
    }
    $data = brokerPlugin("main_page_loading", $data);
    $t = new template();
    $t->main("include/templates/webmp3.tpl");
    $t->code(array("version" => "WebMP3 " . $WEBMP3_VERSION, "pageTitle" => htmlspecialchars($pageTitle, ENT_QUOTES, "UTF-8"), "volume" => getVolume(), "repeat" => $data["repeat"], "quiet" => $data["quiet"], "muteText" => $muteText, "mute" => $data["mute"], "playText" => $playText, "play" => $data["play"], "pause" => $data["pause"], "artist" => htmlspecialchars($data["artist"], ENT_QUOTES, "UTF-8"), "album" => htmlspecialchars($data["album"], ENT_QUOTES, "UTF-8"), "track" => $data["track"], "title" => htmlspecialchars($data["title"], ENT_QUOTES, "UTF-8"), "token" => $data["token"], "partymode" => $data["partymode"], "pre" => $pre, "remMin" => $remMin, "remSec" => $remSec, "remaining" => $remaining, "stream" => $stream, "started" => $started));
    $temp = $t->return_template();
    print $temp;
}
Ejemplo n.º 22
0
function ShowFlyingFleetPage()
{
    global $LNG;
    $id = HTTP::_GP('id', 0);
    if (!empty($id)) {
        $lock = HTTP::_GP('lock', 0);
        $GLOBALS['DATABASE']->query("UPDATE " . FLEETS . " SET `fleet_busy` = '" . $lock . "' WHERE `fleet_id` = '" . $id . "' AND `fleet_universe` = '" . Universe::getEmulated() . "';");
        $SQL = $lock == 0 ? "NULL" : "'ADM_LOCK'";
        $GLOBALS['DATABASE']->query("UPDATE " . FLEETS_EVENT . " SET `lock` = " . $SQL . " WHERE `fleetID` = " . $id . ";");
    }
    $orderBy = "fleet_id";
    $fleetResult = $GLOBALS['DATABASE']->query("SELECT \n\tfleet.*,\n\tevent.`lock`,\n\tCOUNT(event.fleetID) as error,\n\tpstart.name as startPlanetName,\n\tptarget.name as targetPlanetName,\n\tustart.username as startUserName,\n\tutarget.username as targetUserName,\n\tacs.name as acsName\n\tFROM " . FLEETS . " fleet\n\tLEFT JOIN " . FLEETS_EVENT . " event ON fleetID = fleet_id\n\tLEFT JOIN " . PLANETS . " pstart ON pstart.id = fleet_start_id\n\tLEFT JOIN " . PLANETS . " ptarget ON ptarget.id = fleet_end_id\n\tLEFT JOIN " . USERS . " ustart ON ustart.id = fleet_owner\n\tLEFT JOIN " . USERS . " utarget ON utarget.id = fleet_target_owner\n\tLEFT JOIN " . AKS . " acs ON acs.id = fleet_group\n\tWHERE fleet_universe = " . Universe::getEmulated() . "\n\tGROUP BY event.fleetID\n\tORDER BY " . $orderBy . ";");
    $FleetList = array();
    while ($fleetRow = $GLOBALS['DATABASE']->fetch_array($fleetResult)) {
        $shipList = array();
        $shipArray = array_filter(explode(';', $fleetRow['fleet_array']));
        foreach ($shipArray as $ship) {
            $shipDetail = explode(',', $ship);
            $shipList[$shipDetail[0]] = $shipDetail[1];
        }
        $FleetList[] = array('fleetID' => $fleetRow['fleet_id'], 'lock' => !empty($fleetRow['lock']), 'count' => $fleetRow['fleet_amount'], 'error' => !$fleetRow['error'], 'ships' => $shipList, 'state' => $fleetRow['fleet_mess'], 'starttime' => _date($LNG['php_tdformat'], $fleetRow['start_time'], $USER['timezone']), 'arrivaltime' => _date($LNG['php_tdformat'], $fleetRow['fleet_start_time'], $USER['timezone']), 'stayhour' => round(($fleetRow['fleet_end_stay'] - $fleetRow['fleet_start_time']) / 3600), 'staytime' => $fleetRow['fleet_start_time'] !== $fleetRow['fleet_end_stay'] ? _date($LNG['php_tdformat'], $fleetRow['fleet_end_stay'], $USER['timezone']) : 0, 'endtime' => _date($LNG['php_tdformat'], $fleetRow['fleet_end_time'], $USER['timezone']), 'missionID' => $fleetRow['fleet_mission'], 'acsID' => $fleetRow['fleet_group'], 'acsName' => $fleetRow['acsName'], 'startUserID' => $fleetRow['fleet_owner'], 'startUserName' => $fleetRow['startUserName'], 'startPlanetID' => $fleetRow['fleet_start_id'], 'startPlanetName' => $fleetRow['startPlanetName'], 'startPlanetGalaxy' => $fleetRow['fleet_start_galaxy'], 'startPlanetSystem' => $fleetRow['fleet_start_system'], 'startPlanetPlanet' => $fleetRow['fleet_start_planet'], 'startPlanetType' => $fleetRow['fleet_start_type'], 'targetUserID' => $fleetRow['fleet_target_owner'], 'targetUserName' => $fleetRow['targetUserName'], 'targetPlanetID' => $fleetRow['fleet_end_id'], 'targetPlanetName' => $fleetRow['targetPlanetName'], 'targetPlanetGalaxy' => $fleetRow['fleet_end_galaxy'], 'targetPlanetSystem' => $fleetRow['fleet_end_system'], 'targetPlanetPlanet' => $fleetRow['fleet_end_planet'], 'targetPlanetType' => $fleetRow['fleet_end_type'], 'resource' => array(901 => $fleetRow['fleet_resource_metal'], 902 => $fleetRow['fleet_resource_crystal'], 903 => $fleetRow['fleet_resource_deuterium'], 921 => $fleetRow['fleet_resource_darkmatter']));
    }
    $GLOBALS['DATABASE']->free_result($fleetResult);
    $template = new template();
    $template->assign_vars(array('FleetList' => $FleetList));
    $template->show('FlyingFleetPage.tpl');
}
Ejemplo n.º 23
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowTechTreePage()
{
    global $resource, $requeriments, $LNG, $reslist, $USER, $PLANET;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $RequeriList = array();
    foreach ($LNG['tech'] as $Element => $ElementName) {
        if (in_array($Element, $reslist['dmfunc'])) {
            continue;
        }
        if (!isset($resource[$Element])) {
            $TechTreeList[] = $ElementName;
        } else {
            $RequeriList = array();
            if (isset($requeriments[$Element])) {
                foreach ($requeriments[$Element] as $RegID => $RedCount) {
                    $RequeriList[$Element][] = array('id' => $RegID, 'count' => $RedCount, 'own' => isset($PLANET[$resource[$RegID]]) ? $PLANET[$resource[$RegID]] : $USER[$resource[$RegID]]);
                }
            }
            $TechTreeList[] = array('id' => $Element, 'name' => $ElementName, 'need' => $RequeriList);
        }
    }
    $template->assign_vars(array('TechTreeList' => $TechTreeList, 'tt_requirements' => $LNG['tt_requirements'], 'LNG' => $LNG['tech'], 'tt_lvl' => $LNG['tt_lvl']));
    $template->show("techtree_overview.tpl");
}
Ejemplo n.º 24
0
function ShowChatConfigPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_allowdelmes' => $config->chat_allowdelmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname, 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
Ejemplo n.º 25
0
function search_content_handler(&$sm)
{
    $um =& $sm->get_url_manager();
    if ($um->isset_param('search_do_advanced')) {
        require_once VIVVO_FS_INSTALL_ROOT . 'lib/vivvo/core/Articles.class.php';
        $params = Articles_list::get_search_params_from_url($sm);
        unset($params['pg']);
        if ($um->isset_param('search_archive')) {
            $params['search_archive'] = 1;
        }
        $params['search_do_advanced'] = true;
        $params = strtr(rtrim(base64_encode(serialize($params)), '='), '+/', '-_');
        //$params = rtrim($params, '=');
        if ($um->isset_param('search_archive')) {
            header('Location:' . make_proxied_url('archive/index.html?search_options=' . $params));
        } else {
            header('Location:' . make_proxied_url('index.html?search_options=' . $params));
        }
        exit;
    }
    $template = $sm->get_template();
    $template->set_template_file(VIVVO_FS_TEMPLATE_ROOT . VIVVO_TEMPLATE_DIR . 'frame/default.tpl');
    $content_template = new template($sm, $template);
    $content_template->set_template_file(VIVVO_FS_TEMPLATE_ROOT . VIVVO_TEMPLATE_DIR . 'system/advanced_search.tpl');
    $template->assign('PAGE_CONTENT', $content_template->get_output());
}
Ejemplo n.º 26
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowOverviewPage()
{
    global $LNG, $USER, $CONF;
    $Message = array();
    if ($USER['authlevel'] >= AUTH_ADM) {
        if (file_exists(ROOT_PATH . 'install.php')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'install.php');
        }
        if (file_exists(ROOT_PATH . 'install.sql')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'install.sql');
        }
        if (is_writable(ROOT_PATH . 'includes/config.php')) {
            $Message[] = $LNG['ow_config_file_writable'];
        }
        if (!is_writable(ROOT_PATH . 'includes')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'includes');
        }
        if (!is_writable(ROOT_PATH . 'raports')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'raports');
        }
        if ($CONF['user_valid'] == 1 && (empty($CONF['smtp_host']) || empty($CONF['smtp_port']) || empty($CONF['smtp_user']) || empty($CONF['smtp_pass']))) {
            $Message[] = $LNG['ow_smtp_errors'];
        }
    }
    $template = new template();
    $template->assign_vars(array('ow_none' => $LNG['ow_none'], 'ow_overview' => $LNG['ow_overview'], 'ow_welcome_text' => $LNG['ow_welcome_text'], 'ow_credits' => $LNG['ow_credits'], 'ow_special_thanks' => $LNG['ow_special_thanks'], 'ow_translator' => $LNG['ow_translator'], 'ow_proyect_leader' => $LNG['ow_proyect_leader'], 'ow_support' => $LNG['ow_support'], 'ow_title' => $LNG['ow_title'], 'ow_forum' => $LNG['ow_forum'], 'ow_donate' => $LNG['ow_donate'], 'Messages' => $Message, 'date' => date('m\\_Y', TIMESTAMP)));
    $template->show('adm/OverviewBody.tpl');
}
Ejemplo n.º 27
0
function ShowNewsPage()
{
    global $LNG, $USER;
    if ($_GET['action'] == 'send') {
        $edit_id = HTTP::_GP('id', 0);
        $title = $GLOBALS['DATABASE']->sql_escape(HTTP::_GP('title', '', true));
        $text = $GLOBALS['DATABASE']->sql_escape(HTTP::_GP('text', '', true));
        $query = $_GET['mode'] == 2 ? "INSERT INTO " . NEWS . " (`id` ,`user` ,`date` ,`title` ,`text`) VALUES ( NULL , '" . $USER['username'] . "', '" . TIMESTAMP . "', '" . $title . "', '" . $text . "');" : "UPDATE " . NEWS . " SET `title` = '" . $title . "', `text` = '" . $text . "', `date` = '" . TIMESTAMP . "' WHERE `id` = '" . $edit_id . "' LIMIT 1;";
        $GLOBALS['DATABASE']->query($query);
    } elseif ($_GET['action'] == 'delete' && isset($_GET['id'])) {
        $GLOBALS['DATABASE']->query("DELETE FROM " . NEWS . " WHERE `id` = '" . HTTP::_GP('id', 0) . "';");
    }
    $query = $GLOBALS['DATABASE']->query("SELECT * FROM " . NEWS . " ORDER BY id ASC");
    while ($u = $GLOBALS['DATABASE']->fetch_array($query)) {
        $NewsList[] = array('id' => $u['id'], 'title' => $u['title'], 'date' => _date($LNG['php_tdformat'], $u['date'], $USER['timezone']), 'user' => $u['user'], 'confirm' => sprintf($LNG['nws_confirm'], $u['title']));
    }
    $template = new template();
    if ($_GET['action'] == 'edit' && isset($_GET['id'])) {
        $News = $GLOBALS['DATABASE']->getFirstRow("SELECT id, title, text FROM " . NEWS . " WHERE id = '" . $GLOBALS['DATABASE']->sql_escape($_GET['id']) . "';");
        $template->assign_vars(array('mode' => 1, 'nws_head' => sprintf($LNG['nws_head_edit'], $News['title']), 'news_id' => $News['id'], 'news_title' => $News['title'], 'news_text' => $News['text']));
    } elseif ($_GET['action'] == 'create') {
        $template->assign_vars(array('mode' => 2, 'nws_head' => $LNG['nws_head_create']));
    }
    $template->assign_vars(array('NewsList' => $NewsList, 'button_submit' => $LNG['button_submit'], 'nws_total' => sprintf($LNG['nws_total'], count($NewsList)), 'nws_news' => $LNG['nws_news'], 'nws_id' => $LNG['nws_id'], 'nws_title' => $LNG['nws_title'], 'nws_date' => $LNG['nws_date'], 'nws_from' => $LNG['nws_from'], 'nws_del' => $LNG['nws_del'], 'nws_create' => $LNG['nws_create'], 'nws_content' => $LNG['nws_content']));
    $template->show('NewsPage.tpl');
}
 function index($params)
 {
     $tpl = new template("includes/v");
     $tpl->load("filters.html", true, true);
     $tpl->setv("formtitle", "Работа с почтовыми фильтрами");
     $tpl->show();
 }
Ejemplo n.º 29
0
function ShowClearCachePage()
{
    global $LNG;
    ClearCache();
    $template = new template();
    $template->show('clearcache.tpl');
}
Ejemplo n.º 30
0
function ShowModVersionPage()
{
    global $LNG, $USER;
    $MVC = array();
    $Files = scandir(ROOT_PATH . 'includes/functions/mvc/');
    foreach ($Files as $File) {
        if (substr($File, 0, 4) == 'mvc_') {
            require ROOT_PATH . 'includes/functions/mvc/' . $File;
        }
    }
    foreach ($MVC as &$Mod) {
        $Mod['description'] = $Mod['description'][$USER['lang']];
        $Update = @simplexml_load_file($Mod['update']);
        $Update = $Update->{$Mod}['tag'];
        if (version_compare($Mod['version'], $Update->version, '<')) {
            $Mod['update'] = colorRed($LNG['mvc_update_yes']);
            $Mod['udetails'] = array('version' => $Update->version, 'date' => $Update->date, 'download' => $Update->download, 'announcement' => $Update->announcement);
        } else {
            $Mod['update'] = colorGreen($LNG['mvc_update_no']);
            $Mod['udetails'] = false;
        }
    }
    $template = new template();
    $template->assign_vars(array('MVC' => $MVC, 'mvc_title' => $LNG['mvc_title'], 'mvc_author' => $LNG['mvc_author'], 'mvc_version' => $LNG['mvc_version'], 'mvc_link' => $LNG['mvc_link'], 'mvc_update_version' => $LNG['mvc_update_version'], 'mvc_update_date' => $LNG['mvc_update_date'], 'mvc_announcement' => $LNG['mvc_announcement'], 'mvc_download' => $LNG['mvc_download'], 'mvc_desc' => $LNG['mvc_desc']));
    $template->show('adm/ModVersionPage.tpl');
}