本文整理汇总了PHP中makebr函数的典型用法代码示例。如果您正苦于以下问题:PHP makebr函数的具体用法?PHP makebr怎么用?PHP makebr使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了makebr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowSendMessagesPage
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');
}
示例2: bbcode
/**
* 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 <info@2moons.cc>
* @copyright 2012 Jan Kröpke <info@2moons.cc>
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
* @version 1.7.3 (2013-05-19)
* @info $Id: BBCode.php 2640 2013-03-23 19:23:26Z slaver7 $
* @link http://2moons.cc/
*/
function bbcode($text)
{
require_once 'includes/classes/class.BBCode.php';
$bbcode = new BBCode();
$bbcode->addParser('list', 'bbcode_stripcontents');
//Block-Elements
$bbcode->addCode("quote", "callback_replace", "bbcode_quote", array(), "block", array("block"), array('inline', 'link', 'list'));
$bbcode->addCode("align", "callback_replace", "bbcode_align", array(), "block", array("block"), array('inline', 'link', 'list'));
$bbcode->addCode("spoiler", "simple_replace", null, array('start_tag' => '<div class="bbcode_spoiler"><p><b>Spoiler:</b></p><div>', 'end_tag' => '</div></div>'), "block", array("block"), array('inline', 'link', 'list'));
$bbcode->addCode("bg", "usecontent?", "bbcode_background", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("bgcolor", "callback_replace", "bbcode_bgcolor", array(), 'inline', array('block', 'inline', 'link', 'listitem'), array());
//Inline-Elements
$bbcode->addCode("b", "simple_replace", null, array('start_tag' => '<b>', 'end_tag' => '</b>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("i", "simple_replace", null, array('start_tag' => '<i>', 'end_tag' => '</i>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("u", "simple_replace", null, array('start_tag' => '<u>', 'end_tag' => '</u>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("s", "simple_replace", null, array('start_tag' => '<s>', 'end_tag' => '</s>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("size", "callback_replace", "bbcode_size", array(), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("color", "callback_replace", "bbcode_color", array(), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("rouge", "callback_replace", "bbcode_rouge", array('start_tag' => '[rouge]', 'end_tag' => '[/rouge]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("orange", "callback_replace", "bbcode_orange", array('start_tag' => '[orange]', 'end_tag' => '[/orange]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("jaune", "callback_replace", "bbcode_jaune", array('start_tag' => '[jaune]', 'end_tag' => '[/jaune]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("chartreuse", "callback_replace", "bbcode_chartreuse", array('start_tag' => '[chartreuse]', 'end_tag' => '[/chartreuse]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("vert", "callback_replace", "bbcode_vert", array('start_tag' => '[vert]', 'end_tag' => '[/vert]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("cyan", "callback_replace", "bbcode_cyan", array('start_tag' => '[cyan]', 'end_tag' => '[/cyan]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("bleu", "callback_replace", "bbcode_bleu", array('start_tag' => '[bleu]', 'end_tag' => '[/bleu]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("violet", "callback_replace", "bbcode_violet", array('start_tag' => '[violet]', 'end_tag' => '[/violet]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("rose", "callback_replace", "bbcode_rose", array('start_tag' => '[rose]', 'end_tag' => '[/rose]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("gris", "callback_replace", "bbcode_gris", array('start_tag' => '[gris]', 'end_tag' => '[/gris]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("blanc", "callback_replace", "bbcode_blanc", array('start_tag' => '[blanc]', 'end_tag' => '[/blanc]'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
//Link-Elements
$bbcode->addCode("url", "usecontent?", "bbcode_url", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("link", "usecontent?", "bbcode_url", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("mailto", "usecontent?", "bbcode_mailto", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("email", "usecontent?", "bbcode_mailto", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("mail", "usecontent?", "bbcode_mailto", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
//Code-Elements
$bbcode->addCode("code", "usecontent", "bbcode_code", array('php' => false), 'code', array('block'), array('inline', 'link', 'list'));
$bbcode->addCode("php", "usecontent", "bbcode_code", array('php' => true), 'code', array('block'), array('inline', 'link', 'list'));
//List-Elements
$bbcode->addCode("list", "callback_replace", "bbcode_list", array(), "list", array('block', 'listitem'), array('inline', 'link'));
$bbcode->addCode("*", "simple_replace", null, array('start_tag' => '<li>', 'end_tag' => '</li>'), "listitem", array('list'), array());
//Image-Element
$bbcode->addCode("img", "usecontent", "bbcode_img", array(), "image", array('block', 'inline', 'link', 'listitem'), array());
//Flags
$bbcode->setCodeFlag('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL);
$bbcode->setGlobalCaseSensitive(false);
//New-Line-Drops
$bbcode->setCodeFlag('*', 'closetag.before.newline', BBCODE_NEWLINE_DROP);
$bbcode->setCodeFlag('list', 'opentag.before.newline', BBCODE_NEWLINE_DROP);
$bbcode->setCodeFlag('list', 'closetag.before.newline', BBCODE_NEWLINE_DROP);
$codes = array('code', 'php', 'quote', 'spoiler');
$flags = array('opentag.before.newline', 'opentag.after.newline', 'closetag.before.newline', 'closetag.after.newline');
foreach ($codes as $code) {
foreach ($flags as $flag) {
$bbcode->setCodeFlag($code, $flag, BBCODE_NEWLINE_DROP);
}
}
return str_replace('&amp;', '&', makebr($bbcode->parse($text)));
}
示例3: show
function show()
{
$newsResult = $GLOBALS['DATABASE']->query("SELECT date, title, text, user FROM " . NEWS . " ORDER BY id DESC;");
$newsList = array();
while ($newsRow = $GLOBALS['DATABASE']->fetchArray($newsResult)) {
$newsList[] = array('title' => $newsRow['title'], 'from' => t('news_from', _date(t('php_tdformat'), $newsRow['date']), $newsRow['user']), 'text' => makebr($newsRow['text']));
}
$this->assign(array('newsList' => $newsList));
$this->render('page.news.default.tpl');
}
示例4: show
function show()
{
global $LNG;
$sql = "SELECT date, title, text, user FROM %%NEWS%% ORDER BY id DESC;";
$newsResult = Database::get()->select($sql);
$newsList = array();
foreach ($newsResult as $newsRow) {
$newsList[] = array('title' => $newsRow['title'], 'from' => sprintf($LNG['news_from'], _date($LNG['php_tdformat'], $newsRow['date']), $newsRow['user']), 'text' => makebr($newsRow['text']));
}
$this->assign(array('newsList' => $newsList));
$this->display('page.news.default.tpl');
}
示例5: UpdateTicket
private function UpdateTicket($TicketID)
{
global $USER, $db, $LNG;
$text = request_var('text', '', true);
$template = new template();
if (empty($text)) {
exit($template->message($LNG['sendit_error_msg'], "game.php?page=support", 3));
}
$ticket = $db->uniquequery("SELECT text FROM " . SUPP . " WHERE `id` = '" . $TicketID . "';");
$text = $ticket['text'] . '<br><br><hr>' . $USER['username'] . ' schreib am ' . date("d. M Y H:i:s", TIMESTAMP) . '<br><br>' . makebr($text) . '';
$db->query("UPDATE " . SUPP . " SET `text` = '" . $db->sql_escape($text) . "',`status` = '3' WHERE `id` = '" . $db->sql_escape($TicketID) . "';");
$template->message($LNG['sendit_a'], "game.php?page=support", 3);
}
示例6: bbcode
function bbcode($text)
{
require_once ROOT_PATH . 'includes/classes/class.BBCode.' . PHP_EXT;
$bbcode = new BBCode();
$bbcode->addParser('list', 'bbcode_stripcontents');
//Block-Elements
$bbcode->addCode("quote", "callback_replace", "bbcode_quote", array(), "block", array("block"), array('inline', 'link', 'list'));
$bbcode->addCode("align", "callback_replace", "bbcode_align", array(), "block", array("block"), array('inline', 'link', 'list'));
$bbcode->addCode("spoiler", "simple_replace", null, array('start_tag' => '<div class="bbcode_spoiler"><p><b>Spoiler:</b></p><div>', 'end_tag' => '</div></div>'), "block", array("block"), array('inline', 'link', 'list'));
$bbcode->addCode("bg", "usecontent?", "bbcode_background", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("bgcolor", "callback_replace", "bbcode_bgcolor", array(), 'inline', array('block', 'inline', 'link', 'listitem'), array());
//Inline-Elements
$bbcode->addCode("b", "simple_replace", null, array('start_tag' => '<b>', 'end_tag' => '</b>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("i", "simple_replace", null, array('start_tag' => '<i>', 'end_tag' => '</i>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("u", "simple_replace", null, array('start_tag' => '<u>', 'end_tag' => '</u>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("s", "simple_replace", null, array('start_tag' => '<s>', 'end_tag' => '</s>'), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("size", "callback_replace", "bbcode_size", array(), 'inline', array('block', 'inline', 'link', 'listitem'), array());
$bbcode->addCode("color", "callback_replace", "bbcode_color", array(), 'inline', array('block', 'inline', 'link', 'listitem'), array());
//Link-Elements
$bbcode->addCode("url", "usecontent?", "bbcode_url", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("link", "usecontent?", "bbcode_url", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("mailto", "usecontent?", "bbcode_mailto", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("email", "usecontent?", "bbcode_mailto", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
$bbcode->addCode("mail", "usecontent?", "bbcode_mailto", array('usecontent_param' => 'default'), 'link', array('block', 'inline', 'listitem'), array('link'));
//Code-Elements
$bbcode->addCode("code", "usecontent", "bbcode_code", array('php' => false), 'code', array('block'), array('inline', 'link', 'list'));
$bbcode->addCode("php", "usecontent", "bbcode_code", array('php' => true), 'code', array('block'), array('inline', 'link', 'list'));
//List-Elements
$bbcode->addCode("list", "callback_replace", "bbcode_list", array(), "list", array('block', 'listitem'), array('inline', 'link'));
$bbcode->addCode("*", "simple_replace", null, array('start_tag' => '<li>', 'end_tag' => '</li>'), "listitem", array('list'), array());
//Image-Element
$bbcode->addCode("img", "usecontent", "bbcode_img", array(), "image", array('block', 'inline', 'link', 'listitem'), array());
//Flags
$bbcode->setCodeFlag('*', 'closetag', BBCODE_CLOSETAG_OPTIONAL);
$bbcode->setGlobalCaseSensitive(false);
//New-Line-Drops
$bbcode->setCodeFlag('*', 'closetag.before.newline', BBCODE_NEWLINE_DROP);
$bbcode->setCodeFlag('list', 'opentag.before.newline', BBCODE_NEWLINE_DROP);
$bbcode->setCodeFlag('list', 'closetag.before.newline', BBCODE_NEWLINE_DROP);
$codes = array('code', 'php', 'quote', 'spoiler');
$flags = array('opentag.before.newline', 'opentag.after.newline', 'closetag.before.newline', 'closetag.after.newline');
foreach ($codes as $code) {
foreach ($flags as $flag) {
$bbcode->setCodeFlag($code, $flag, BBCODE_NEWLINE_DROP);
}
}
return makebr($bbcode->parse($text));
}
示例7: show
function show()
{
global $LNG;
$newsResult = $GLOBALS['DATABASE']->query("SELECT id, date, title, text, user FROM " . NEWS . " ORDER BY id DESC LIMIT 5;");
$newsList = array();
while ($newsRow = $GLOBALS['DATABASE']->fetchArray($newsResult)) {
$newsList[] = array('id' => $newsRow['id'], 'title' => $newsRow['title'], 'from' => t('news_from', _date(t('php_tdformat'), $newsRow['date']), $newsRow['user']), 'text' => makebr($newsRow['text']), 'date' => _date($LNG['php_tdformat'], $newsRow['date'], $newsRow['user']));
}
$topicsResult = $GLOBALS['DATABASE']->query("SELECT tid, title, last_post, topic_firstpost, title_seo FROM forum_topics WHERE tdelete_time = '0' ORDER BY last_post DESC LIMIT 5;");
$topicsList = array();
while ($topicsRow = $GLOBALS['DATABASE']->fetchArray($topicsResult)) {
$topicsList[] = array('id' => $topicsRow['tid'], 'title' => $topicsRow['title'], 'topic_firstpost' => $topicsRow['topic_firstpost'], 'title_seo' => $topicsRow['title_seo'], 'date' => _date($LNG['php_tdformat'], $topicsRow['last_post'], 1));
}
$this->assign(array('newsList' => $newsList, 'topicsList' => $topicsList));
$this->render('page.about.default.tpl');
}
示例8: show
function show()
{
global $LNG;
$newsResult = $GLOBALS['DATABASE']->query("SELECT id, date, title, text, user, catID FROM " . NEWS . " ORDER BY id DESC;");
$newsList = array();
while ($newsRow = $GLOBALS['DATABASE']->fetchArray($newsResult)) {
$newsList[] = array('id' => $newsRow['id'], 'title' => $newsRow['title'], 'from' => t('news_from', _date(t('php_tdformat'), $newsRow['date']), $newsRow['user']), 'text' => substr($newsRow['text'], 0, 160) . "...", 'date' => _date($LNG['php_tdformat'], $newsRow['date'], $newsRow['user']), 'image' => 'images/' . $newsRow['catID'] . '.jpg');
}
$topicsResult = $GLOBALS['DATABASE']->query("SELECT tid, title, last_post, topic_firstpost, title_seo FROM forum_topics WHERE tdelete_time = '0' ORDER BY last_post DESC LIMIT 5;");
$topicsList = array();
while ($topicsRow = $GLOBALS['DATABASE']->fetchArray($topicsResult)) {
$topicsList[] = array('id' => $topicsRow['tid'], 'title' => $topicsRow['title'], 'topic_firstpost' => $topicsRow['topic_firstpost'], 'title_seo' => $topicsRow['title_seo'], 'date' => _date($LNG['php_tdformat'], $topicsRow['last_post'], 1));
}
$this->assign(array('disclamerAddress' => makebr(Config::get('disclamerAddress')), 'disclamerPhone' => Config::get('disclamerPhone'), 'disclamerMail' => Config::get('disclamerMail'), 'disclamerNotice' => Config::get('disclamerNotice'), 'newsList' => $newsList, 'topicsList' => $topicsList));
$this->render('page.disclamer.default.tpl');
}
示例9: ShowOverviewPage
function ShowOverviewPage()
{
global $CONF, $LNG, $PLANET, $USER, $db, $resource, $UNI;
$PlanetRess = new ResourceUpdate();
$PlanetRess->CalcResource();
$PlanetRess->SavePlanetToDB();
$template = new template();
$template->getplanets();
$AdminsOnline = $AllPlanets = $Moon = array();
foreach ($template->UserPlanets as $ID => $CPLANET) {
if ($ID == $_SESSION['planet'] || $CPLANET['planet_type'] == 3) {
continue;
}
if (!empty($CPLANET['b_building']) && $CPLANET['b_building'] > TIMESTAMP) {
$Queue = explode(';', $CPLANET['b_building_id']);
$CurrBuild = explode(',', $Queue[0]);
$BuildPlanet = $LNG['tech'][$CurrBuild[0]] . " (" . $CurrBuild[1] . ")<br><span style=\"color:#7F7F7F;\">(" . pretty_time($CurrBuild[3] - TIMESTAMP) . ")</span>";
} else {
$BuildPlanet = $LNG['ov_free'];
}
$AllPlanets[] = array('id' => $CPLANET['id'], 'name' => $CPLANET['name'], 'image' => $CPLANET['image'], 'build' => $BuildPlanet);
}
if ($PLANET['id_luna'] != 0) {
$Moon = $db->uniquequery("SELECT `id`, `name` FROM " . PLANETS . " WHERE `id` = '" . $PLANET['id_luna'] . "';");
}
if (!empty($PLANET['b_building'])) {
$Queue = explode(';', $PLANET['b_building_id']);
$CurrBuild = explode(',', $Queue[0]);
$Build = $LNG['tech'][$CurrBuild[0]] . ' (' . $CurrBuild[1] . ')<br><div id="blc">"' . pretty_time($PLANET['b_building'] - TIMESTAMP) . '</div>';
$template->execscript('BuildTime();');
} else {
$Build = $LNG['ov_free'];
}
$OnlineAdmins = $db->query("SELECT `id`,`username` FROM " . USERS . " WHERE `universe` = '" . $UNI . "' AND `onlinetime` >= '" . (TIMESTAMP - 10 * 60) . "' AND `authlevel` > '0';");
while ($AdminRow = $db->fetch_array($OnlineAdmins)) {
$AdminsOnline[$AdminRow['id']] = $AdminRow['username'];
}
$db->free_result($OnlineAdmins);
$template->loadscript('mbContainer.js');
$template->loadscript('overview.js');
$template->execscript('GetFleets(true);');
$template->assign_vars(array('user_rank' => sprintf($LNG['ov_userrank_info'], pretty_number($USER['total_points']), $LNG['ov_place'], $USER['total_rank'], $USER['total_rank'], $LNG['ov_of'], $CONF['users_amount']), 'is_news' => $CONF['OverviewNewsFrame'], 'news' => makebr($CONF['OverviewNewsText']), 'planetname' => $PLANET['name'], 'planetimage' => $PLANET['image'], 'galaxy' => $PLANET['galaxy'], 'system' => $PLANET['system'], 'planet' => $PLANET['planet'], 'buildtime' => $PLANET['b_building'], 'userid' => $USER['id'], 'username' => $USER['username'], 'build' => $Build, 'Moon' => $Moon, 'AllPlanets' => $AllPlanets, 'AdminsOnline' => $AdminsOnline, 'Teamspeak' => GetTeamspeakData(), 'messages' => $USER['new_message'] > 0 ? $USER['new_message'] == 1 ? $LNG['ov_have_new_message'] : sprintf($LNG['ov_have_new_messages'], pretty_number($USER['new_message'])) : false, 'planet_diameter' => pretty_number($PLANET['diameter']), 'planet_field_current' => $PLANET['field_current'], 'planet_field_max' => CalculateMaxPlanetFields($PLANET), 'planet_temp_min' => $PLANET['temp_min'], 'planet_temp_max' => $PLANET['temp_max'], 'ov_news' => $LNG['ov_news'], 'fcm_moon' => $LNG['fcm_moon'], 'ov_server_time' => $LNG['ov_server_time'], 'ov_planet' => $LNG['ov_planet'], 'ov_planetmenu' => $LNG['ov_planetmenu'], 'ov_diameter' => $LNG['ov_diameter'], 'ov_distance_unit' => $LNG['ov_distance_unit'], 'ov_developed_fields' => $LNG['ov_developed_fields'], 'ov_max_developed_fields' => $LNG['ov_max_developed_fields'], 'ov_fields' => $LNG['ov_fields'], 'ov_temperature' => $LNG['ov_temperature'], 'ov_aprox' => $LNG['ov_aprox'], 'ov_temp_unit' => $LNG['ov_temp_unit'], 'ov_to' => $LNG['ov_to'], 'ov_position' => $LNG['ov_position'], 'ov_points' => $LNG['ov_points'], 'ov_events' => $LNG['ov_events'], 'ov_admins_online' => $LNG['ov_admins_online'], 'ov_no_admins_online' => $LNG['ov_no_admins_online'], 'ov_userbanner' => $LNG['ov_userbanner'], 'ov_teamspeak' => $LNG['ov_teamspeak'], 'ov_your_planet' => $LNG['ov_your_planet'], 'ov_coords' => $LNG['ov_coords'], 'ov_planet_name' => $LNG['ov_planet_name'], 'ov_actions' => $LNG['ov_actions'], 'ov_abandon_planet' => $LNG['ov_abandon_planet'], 'ov_planet_rename' => $LNG['ov_planet_rename'], 'ov_planet_rename_action' => $LNG['ov_planet_rename_action'], 'ov_password' => $LNG['ov_password'], 'ov_with_pass' => $LNG['ov_with_pass'], 'ov_security_confirm' => $LNG['ov_security_confirm'], 'ov_security_request' => $LNG['ov_security_request'], 'ov_delete_planet' => $LNG['ov_delete_planet'], 'ov_planet_abandoned' => $LNG['ov_planet_abandoned'], 'path' => PROTOCOL . $_SERVER['HTTP_HOST'] . HTTP_ROOT));
$template->show("overview_body.tpl");
}
示例10: info
function info()
{
global $LNG, $USER;
$id = HTTP::_GP('id', '');
$newsResult = $GLOBALS['DATABASE']->query("SELECT id, date, title, text, catID FROM uni1_jobs WHERE is_active = '1' AND id = '" . $id . "' ;");
$newsList = array();
while ($newsRow = $GLOBALS['DATABASE']->fetchArray($newsResult)) {
$newsList[] = array('id' => $newsRow['id'], 'title' => $newsRow['title'], 'text' => makebr($newsRow['text']), 'date' => _date($LNG['php_tdformat'], $newsRow['date'], $USER), 'image' => 'images/jobs/' . $newsRow['catID'] . '.png');
}
$newsResult1 = $GLOBALS['DATABASE']->query("SELECT id, date, title, text, catID FROM uni1_jobs WHERE is_active = '1' ORDER BY id DESC LIMIT 6;");
$newsList1 = array();
while ($newsRow1 = $GLOBALS['DATABASE']->fetchArray($newsResult1)) {
$newsList1[] = array('id' => $newsRow1['id'], 'title' => $newsRow1['title'], 'text' => makebr($newsRow1['text']), 'date' => _date($LNG['php_tdformat'], $newsRow1['date'], $USER), 'image' => 'images/jobs/' . $newsRow1['catID'] . '.png');
}
$topicsResult = $GLOBALS['DATABASE']->query("SELECT tid, title, last_post, topic_firstpost, title_seo FROM forum_topics WHERE tdelete_time = '0' ORDER BY last_post DESC LIMIT 5;");
$topicsList = array();
while ($topicsRow = $GLOBALS['DATABASE']->fetchArray($topicsResult)) {
$topicsList[] = array('id' => $topicsRow['tid'], 'title' => $topicsRow['title'], 'topic_firstpost' => $topicsRow['topic_firstpost'], 'title_seo' => $topicsRow['title_seo'], 'date' => _date($LNG['php_tdformat'], $topicsRow['last_post'], 1));
}
$this->assign(array('newsList' => $newsList, 'newsList1' => $newsList1, 'topicsList' => $topicsList, 'notif' => 'Jobs', 'info' => '', 'actual_link' => 'http://' . $_SERVER['HTTP_HOST'] . '' . $_SERVER['REQUEST_URI'] . ''));
$this->render('page.jobs.show.tpl');
}
示例11: show
function show()
{
global $LNG;
$id = HTTP::_GP('id', '');
$newsResult = $GLOBALS['DATABASE']->query("SELECT id, date, title, text, catID, user FROM " . NEWS . " WHERE id = '" . $id . "';");
$newsList = array();
while ($newsRow = $GLOBALS['DATABASE']->fetchArray($newsResult)) {
$newsList[] = array('id' => $newsRow['id'], 'title' => $newsRow['title'], 'from' => t('news_from', _date(t('php_tdformat'), $newsRow['date']), $newsRow['user']), 'text' => makebr($newsRow['text']), 'date' => _date($LNG['php_tdformat'], $newsRow['date'], $newsRow['user']), 'image' => 'images/' . $newsRow['catID'] . '.jpg');
}
$topicsResult = $GLOBALS['DATABASE']->query("SELECT tid, title, last_post, topic_firstpost, title_seo FROM forum_topics WHERE tdelete_time = '0' ORDER BY last_post DESC LIMIT 5;");
$topicsList = array();
while ($topicsRow = $GLOBALS['DATABASE']->fetchArray($topicsResult)) {
$topicsList[] = array('id' => $topicsRow['tid'], 'title' => $topicsRow['title'], 'topic_firstpost' => $topicsRow['topic_firstpost'], 'title_seo' => $topicsRow['title_seo'], 'date' => _date($LNG['php_tdformat'], $topicsRow['last_post'], 1));
}
$newsResult1 = $GLOBALS['DATABASE']->query("SELECT id, date, title, text, catID, user FROM " . NEWS . " ORDER BY id DESC LIMIT 5;");
$newsList1 = array();
while ($newsRow1 = $GLOBALS['DATABASE']->fetchArray($newsResult1)) {
$newsList1[] = array('id' => $newsRow1['id'], 'title' => $newsRow1['title'], 'from' => t('news_from', _date(t('php_tdformat'), $newsRow1['date']), $newsRow1['user']), 'text' => makebr($newsRow1['text']), 'date' => _date($LNG['php_tdformat'], $newsRow1['date'], $newsRow1['user']), 'image' => 'images/' . $newsRow1['catID'] . '.jpg');
}
$this->assign(array('topicsList' => $topicsList, 'newsList' => $newsList, 'newsList1' => $newsList1, 'actual_link' => 'http://' . $_SERVER['HTTP_HOST'] . '' . $_SERVER['REQUEST_URI'] . ''));
$this->render('page.news.details.tpl');
}
示例12: exception_handler
function exception_handler($exception)
{
global $CONF;
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">';
echo '<html>';
echo '<head>';
echo '<meta http-equiv="content-type" content="text/html; charset=UTF-8">';
echo '<meta http-equiv="content-script-type" content="text/javascript">';
echo '<meta http-equiv="content-style-type" content="text/css">';
echo '<meta http-equiv="content-language" content="de">';
echo '<title>' . $CONF['game_name'] . ' - FATAL ERROR</title>';
echo '<link rel="shortcut icon" href="./favicon.ico">';
echo '<link rel="stylesheet" type="text/css" href="./styles/theme/' . DEFAULT_THEME . '/formate.css">';
echo '<script type="text/javascript"> ';
echo 'function blockError(){return true;} ';
echo 'window.onerror = blockError; ';
echo '</script>';
echo '</head>';
echo '<body>';
echo '<table width="80%">';
echo '<tr>';
echo '<th>';
echo 'Error:';
echo '</th>';
echo '</tr>';
echo '<tr>';
echo '<td class="left"><b>Message: </b>' . $exception->getMessage() . '<br>';
echo '<b>File: </b>' . $exception->getFile() . '<br>';
echo '<b>Line: </b>' . $exception->getLine() . '<br>';
echo '<b>PHP-Version: </b>' . PHP_VERSION . '<br>';
echo '<b>PHP-API: </b>' . php_sapi_name() . '<br>';
echo '<b>2Moons Version: </b>' . $CONF['VERSION'] . '<br>';
echo '<b>Debug Backtrace:</b><br>' . makebr(str_replace($_SERVER['DOCUMENT_ROOT'], '.', htmlspecialchars($exception->getTraceAsString()))) . '</th>';
echo '</tr>';
echo '</table>';
echo '</body>';
echo '</html>';
exit;
}
示例13: send
function send()
{
global $USER, $LNG;
require_once 'includes/functions/BBCode.php';
$receiverID = HTTP::_GP('id', 0);
$Subject = HTTP::_GP('subject', $LNG['mg_no_subject'], true);
$Message = makebr(HTTP::_GP('text', '', true));
$From = $USER['username'] . ' [' . $USER['galaxy'] . ':' . $USER['system'] . ':' . $USER['planet'] . ']';
if ($USER['message_ban'] == 1 && $USER['message_ban_time'] > TIMESTAMP) {
$this->sendJSON("You have been banned for sending privates messages");
} else {
if (empty($receiverID) || empty($Message) || !isset($_SESSION['messtoken']) || $_SESSION['messtoken'] != md5($USER['id'] . '|' . $receiverID)) {
$this->sendJSON($LNG['mg_error']);
}
unset($_SESSION['messtoken']);
if (empty($Subject)) {
$Subject = $LNG['mg_no_subject'];
}
$healthy = array("madnessogame", "moon-xnova", "corrado-game", "zyperaxgalaxy");
$yummy = array("dark-space", "dark-space", "dark-space", "dark-space");
$newphrase = str_replace($healthy, $yummy, $Message);
$newphrase = bbcode($newphrase);
$cautare = $GLOBALS['DATABASE']->query("SELECT *FROM " . MESSAGES . " where\t`message_sender` = '" . $USER['id'] . "' order by `message_time` DESC LIMIT 10");
$count = 0;
while ($x = $GLOBALS['DATABASE']->fetch_array($cautare)) {
similar_text($x['message_text'], $newphrase, $percent);
if ($percent >= 75) {
$count++;
}
}
if ($count >= 3) {
$GLOBALS['DATABASE']->query("UPDATE " . USERS . " set `message_ban` = '1', `message_ban_time` = " . (TIMESTAMP + 72 * 60 * 60) . " where `id` = '" . $USER['id'] . "';");
$HLM = "INSERT INTO uni1_message_banned SET ";
$HLM .= "`who` = '" . $USER['username'] . "', ";
$HLM .= "`theme` = 'Advertising/Spamming', ";
$HLM .= "`time` = '" . TIMESTAMP . "', ";
$HLM .= "`longer` = '" . (TIMESTAMP + 72 * 60 * 60) . "', ";
$HLM .= "`author` = 'iiNSick', ";
$HLM .= "`universe` = '1', ";
$HLM .= "`email` = 'jeremy.baukens@gmail.com';";
$GLOBALS['DATABASE']->query($HLM);
SendSimpleMessage(1, $USER['id'], TIMESTAMP, 1, $From, $Subject, 'Player ' . $USER['username'] . ' is spamming...');
$this->sendJSON("Message has been sent");
} else {
SendSimpleMessage($receiverID, $USER['id'], TIMESTAMP, 1, $From, $Subject, $newphrase);
$this->sendJSON($LNG['mg_message_send']);
}
}
}
示例14: ShowMessagesPage
function ShowMessagesPage()
{
global $USER, $PLANET, $CONF, $dpath, $LNG, $db;
$MessCategory = request_var('messcat', 0);
$MessPageMode = request_var('mode', '');
$DeleteWhat = request_var('deletemessages', '');
$Send = request_var('send', 0);
$OwnerID = request_var('id', 0);
$Subject = request_var('subject', '', true);
$MessageType = array(0, 1, 2, 3, 4, 5, 15, 50, 99, 100, 999);
$TitleColor = array(0 => '#FFFF00', 1 => '#FF6699', 2 => '#FF3300', 3 => '#FF9900', 4 => '#773399', 5 => '#009933', 15 => '#6495ed', 50 => '#666600', 99 => '#007070', 100 => '#ABABAB', 999 => '#CCCCCC');
$template = new template();
switch ($MessPageMode) {
case 'write':
$template->page_header();
$template->page_footer();
$OwnerRecord = $db->uniquequery("SELECT a.galaxy, a.system, a.planet, b.username, b.id_planet FROM " . PLANETS . " as a, " . USERS . " as b WHERE b.id = '" . $OwnerID . "' AND a.id = b.id_planet;");
if (!$OwnerRecord) {
$template->message($LNG['mg_error'], false, 0, true);
}
if ($Send) {
$Owner = $OwnerID;
$Message = makebr(request_var('text', '', true));
$From = $USER['username'] . ' [' . $USER['galaxy'] . ':' . $USER['system'] . ':' . $USER['planet'] . ']';
SendSimpleMessage($OwnerID, $USER['id'], '', 1, $From, $Subject, $Message);
exit($LNG['mg_message_send']);
}
$template->assign_vars(array('mg_send_new' => $LNG['mg_send_new'], 'mg_send_to' => $LNG['mg_send_to'], 'mg_send' => $LNG['mg_send'], 'mg_message' => $LNG['mg_message'], 'mg_characters' => $LNG['mg_characters'], 'mg_subject' => $LNG['mg_subject'], 'mg_empty_text' => $LNG['mg_empty_text'], 'subject' => empty($Subject) ? $LNG['mg_no_subject'] : $Subject, 'id' => $OwnerID, 'username' => $OwnerRecord['username'], 'galaxy' => $OwnerRecord['galaxy'], 'system' => $OwnerRecord['system'], 'planet' => $OwnerRecord['planet']));
$template->show("message_send_form.tpl");
break;
default:
$PlanetRess = new ResourceUpdate();
$PlanetRess->CalcResource();
$PlanetRess->SavePlanetToDB();
$template->loadscript('message.js');
$template->page_header();
$template->page_topnav();
$template->page_leftmenu();
$template->page_planetmenu();
$template->page_footer();
$UsrMess = $db->query("SELECT `message_type`, `message_unread` FROM " . MESSAGES . " WHERE `message_owner` = '" . $USER['id'] . "' OR `message_type` = '50';");
$GameOps = $db->query("SELECT `username`, `email` FROM " . USERS . " WHERE `authlevel` != '0' ORDER BY `username` ASC;");
$MessOut = $db->uniquequery("SELECT COUNT(*) as count FROM " . MESSAGES . " WHERE message_sender = '" . $USER['id'] . "';");
while ($Ops = $db->fetch_array($GameOps)) {
$OpsList[] = array('username' => $Ops['username'], 'email' => $Ops['email']);
}
$db->free_result($GameOps);
while ($CurMess = $db->fetch_array($UsrMess)) {
$UnRead[$CurMess['message_type']] += $CurMess['message_unread'];
$TotalMess[$CurMess['message_type']] += 1;
}
$db->free_result($UsrMess);
$UnRead[50] += $USER['new_gmessage'];
$UnRead[100] = is_array($UnRead) ? array_sum($UnRead) : 0;
$TotalMess[100] = is_array($TotalMess) ? array_sum($TotalMess) - $TotalMess[50] : 0;
$TotalMess[999] = $MessOut['count'];
foreach ($TitleColor as $MessageID => $MessageColor) {
$MessageList[$MessageID] = array('color' => $MessageColor, 'unread' => !empty($UnRead[$MessageID]) ? $UnRead[$MessageID] : 0, 'total' => !empty($TotalMess[$MessageID]) ? $TotalMess[$MessageID] : 0, 'lang' => $LNG['mg_type'][$MessageID]);
}
$template->assign_vars(array('MessageList' => $MessageList, 'OpsList' => $OpsList, 'mg_overview' => $LNG['mg_overview'], 'mg_game_operators' => $LNG['mg_game_operators']));
$template->show("message_overview.tpl");
break;
}
}
示例15: __construct
//.........这里部分代码省略.........
}
if ($sort2 == 1) {
$sort .= " DESC;";
} elseif ($sort2 == 2) {
$sort .= " ASC;";
}
$listuser = $db->query("SELECT DISTINCT u.id, u.username,u.galaxy, u.system, u.planet, u.ally_register_time, u.onlinetime, u.ally_rank_id, s.total_points FROM `" . USERS . "` as u LEFT JOIN " . STATPOINTS . " as s ON s.`stat_type` = '1' AND s.`id_owner` = u.`id` WHERE ally_id = '" . $USER['ally_id'] . "'" . $sort . ";");
} else {
$listuser = $db->query("SELECT DISTINCT u.id, u.username,u.galaxy, u.system, u.planet, u.ally_register_time, u.onlinetime, u.ally_rank_id, s.total_points FROM `" . USERS . "` as u LEFT JOIN " . STATPOINTS . " as s ON s.`stat_type` = '1' AND s.`id_owner` = u.`id` WHERE `ally_id` = '" . $USER['ally_id'] . "';");
}
while ($UserRow = $db->fetch_array($listuser)) {
if ($ally['ally_owner'] == $UserRow['id']) {
$UserRow['ally_range'] = $ally['ally_owner_range'] == '' ? $LNG['al_founder_rank_text'] : $ally['ally_owner_range'];
} elseif ($UserRow['ally_rank_id'] != 0) {
$UserRow['ally_range'] = $ally_ranks[$UserRow['ally_rank_id'] - 1]['name'];
} else {
$UserRow['ally_range'] = $LNG['al_new_member_rank_text'];
}
$Memberlist[] = array('id' => $UserRow['id'], 'username' => $UserRow['username'], 'galaxy' => $UserRow['galaxy'], 'system' => $UserRow['system'], 'planet' => $UserRow['planet'], 'register_time' => date(TDFORMAT, $UserRow['ally_register_time']), 'points' => pretty_number($UserRow['total_points']), 'range' => $UserRow['ally_range'], 'onlinetime' => floor((TIMESTAMP - $UserRow['onlinetime']) / 60));
}
if (count($Memberlist) != $ally['ally_members']) {
$db->query("UPDATE " . ALLIANCE . " SET `ally_members`='" . count($Memberlist) . "' WHERE `id`='" . $ally['id'] . "';");
}
$template->assign_vars(array('Memberlist' => $Memberlist, 'sort' => $sort2 == 1 ? 2 : 1, 'seeonline' => $USER['rights']['memberlist_on'], 'al_users_list' => sprintf($LNG['al_users_list'], count($Memberlist)), 'al_num' => $LNG['al_num'], 'al_back' => $LNG['al_back'], 'al_message' => $LNG['al_message'], 'al_member' => $LNG['al_member'], 'al_position' => $LNG['al_position'], 'al_points' => $LNG['al_points'], 'al_coords' => $LNG['al_coords'], 'al_member_since' => $LNG['al_member_since'], 'al_estate' => $LNG['al_estate'], 'al_memberlist_on' => $LNG['al_memberlist_on'], 'al_memberlist_off' => $LNG['al_memberlist_off'], 'al_memberlist_min' => $LNG['al_memberlist_min']));
$template->show("alliance_memberslist.tpl");
break;
case 'circular':
if (!$USER['rights']['roundmail']) {
redirectTo("game.php?page=alliance");
}
if ($action == "send") {
$r = request_var('r', 0);
$subject = request_var('subject', '', true);
$text = makebr(request_var('text', '', true));
$sq = $r == 0 ? $db->query("SELECT id, username FROM " . USERS . " WHERE `ally_id` = '" . $USER['ally_id'] . "';") : $db->query("SELECT id, username FROM " . USERS . " WHERE `ally_id` = '" . $USER['ally_id'] . "' AND `ally_rank_id` = '" . $r . "';");
$list = '';
$title = $LNG['al_circular_alliance'] . $ally['ally_tag'];
$text = sprintf($LNG['al_circular_front_text'], $USER['username']) . "<br>" . $text;
while ($u = $db->fetch_array($sq)) {
SendSimpleMessage($u['id'], $USER['id'], '', 2, $title, $subject, $text);
$list .= "\n" . $u['username'];
}
exit($LNG['al_circular_sended'] . $list);
}
$RangeList[] = $LNG['al_all_players'];
if (is_array($ally_ranks)) {
foreach ($ally_ranks as $id => $array) {
$RangeList[$id + 1] = $array['name'];
}
}
$template->assign_vars(array('RangeList' => $RangeList, 'al_circular_send_ciruclar' => $LNG['al_circular_send_ciruclar'], 'al_circular_reset' => $LNG['al_circular_reset'], 'al_receiveral_message' => $LNG['al_receiveral_message'], 'al_circular_send_submit' => $LNG['al_circular_send_submit'], 'al_characters' => $LNG['al_characters'], 'al_receiver' => $LNG['al_receiver'], 'mg_subject' => $LNG['mg_subject'], 'mg_no_subject' => $LNG['mg_no_subject'], 'mg_empty_text' => $LNG['mg_empty_text']));
$template->show("alliance_circular.tpl");
break;
case 'admin':
if (!$USER['rights']['admin']) {
exit(redirectTo("game.php?page=alliance"));
}
switch ($edit) {
case 'rights':
if (!$USER['rights']['righthand']) {
exit(redirectTo("game.php?page=alliance"));
}
$rankname = request_var('newrangname', '', UTF8_SUPPORT);
$pid = $_POST['id'];
$d = request_var('d', 1337);
if (!empty($rankname)) {