本文整理汇总了PHP中output_message函数的典型用法代码示例。如果您正苦于以下问题:PHP output_message函数的具体用法?PHP output_message怎么用?PHP output_message使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了output_message函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckKey
function CheckKey()
{
global $user, $DB, $Account;
if (isset($_GET['key'])) {
if (isset($_GET['id'])) {
$lock = $DB->selectCell("SELECT `locked` FROM account WHERE id='" . $_GET['id'] . "'");
if ($user['id'] > 0 && $lock == 0) {
output_message('info', 'Your account is already active!');
} else {
$check_key = $Account->isValidActivationKey($_GET['key']);
if ($check_key != FALSE) {
if ($_GET['id'] == $check_key) {
$DB->query("UPDATE account SET locked=0 WHERE id='" . $_GET['id'] . "' LIMIT 1");
$DB->query("UPDATE account_extend SET activation_code=NULL WHERE account_id='" . $_GET['id'] . "' LIMIT 1");
output_message('success', '<b>Account successfully activated! You may now log into the server and play.</b>');
} else {
output_message('error', 'This Activation Key does not belong to this account id!');
}
} else {
output_message('error', 'Not a valid activation key.');
}
}
}
}
}
示例2: addLink
function addLink()
{
global $DB, $Core, $lang;
$DB->query("INSERT INTO mw_menu_items(\r\n\t\t`menu_id`,\r\n\t\t`link_title`,\r\n\t\t`link`,\r\n\t\t`guest_only`,\r\n\t\t`account_level`)\r\n\t VALUES(\r\n\t\t'" . $_POST['menu_id'] . "', \r\n\t\t'" . $_POST['link_title'] . "', \r\n\t\t'" . $_POST['link'] . "', \r\n\t\t'" . $_POST['guest_only'] . "', \r\n\t\t'" . $_POST['account_level'] . "')\r\n\t");
$Core->clearCache();
output_message('success', $lang['link_add_success']);
}
示例3: databaseErrorHandler
function databaseErrorHandler($message, $info)
{
if (!error_reporting()) {
return;
}
output_message('alert', "SQL Error: {$message}<br><pre>" . print_r($info, true) . "</pre>");
}
示例4: delNews
function delNews($idzz)
{
global $DB, $Core;
$DB->query("DELETE FROM `mw_news` WHERE `id`='{$idzz}'");
$Core->clearCache();
output_message('success', 'Deleted News Item.');
}
示例5: addFaq
function addFaq()
{
global $DB, $Core, $lang;
$DB->query("INSERT INTO mw_faq(\r\n\t\t`question`,\r\n\t\t`answer`)\r\n\t VALUES(\r\n\t\t'" . $_POST['question'] . "', \r\n\t\t'" . $_POST['answer'] . "'\r\n\t\t)\r\n\t");
$Core->clearCache();
output_message('success', $lang['faq_add_success']);
}
示例6: changeName
function changeName()
{
global $Config, $DB, $lang, $user;
include 'core/SDL/class.character.php';
$Character = new Character();
if (empty($_POST['newname'])) {
output_message('error', $lang['char_rename_newname']);
return FALSE;
}
if ($Config->get('module_charrename') == 0) {
output_message('error', 'Nice try hacking, but not good enough.');
return FALSE;
}
if ($user['web_points'] >= $Config->get('module_charrename_pts')) {
if ($Character->checkNameExists($_POST['newname']) == FALSE) {
if ($Character->isOnline($_POST['id']) == FALSE) {
if ($Character->setName($_POST['id'], $_POST['newname']) == TRUE) {
$DB->query("UPDATE `mw_account_extend` SET \n\t\t\t\t\t\t`web_points`=(`web_points` - " . $Config->get('module_charrename_pts') . "), \n\t\t\t\t\t\t`points_spent`=(`points_spent` + " . $Config->get('module_charrename_pts') . ") \n\t\t\t\t\t WHERE `account_id` = " . $user['id'] . " LIMIT 1");
output_message('success', $lang['char_rename_success'] . ' Redirecting...<meta http-equiv=refresh content="3;url=?p=account&sub=rename">');
}
} else {
output_message('validation', $lang['char_is_online']);
}
} else {
output_message('validation', $lang['char_name_exists']);
}
} else {
output_message('validation', $lang['not_enough_points']);
}
}
示例7: process
function process()
{
global $lang, $DB, $Account;
if ($_POST['retr_login'] && $_POST['retr_email'] && $_POST['secretq1'] && $_POST['secretq2'] && $_POST['secreta1'] && $_POST['secreta2']) {
//set return as true - we will make false if something is wrong
$return = TRUE;
/*Check 1*/
$username = strip_if_magic_quotes($_POST['retr_login']);
if (check_for_symbols($username, 1) == TRUE) {
$return = FALSE;
} else {
if ($DB->selectRow("SELECT * FROM `account` WHERE username='" . $username . "'") == false) {
$username == FALSE;
$return = FALSE;
} else {
$d = $DB->selectRow("SELECT * FROM `account` WHERE username='" . $username . "'");
$username =& $d['id'];
$username_name =& $d['username'];
$email =& $d['email'];
$posted_email =& $_POST['retr_email'];
/*Check 2*/
if ($email != $posted_email) {
$return = FALSE;
}
}
}
$secreta1 =& $_POST['secreta1'];
$secreta2 =& $_POST['secreta2'];
/*Check 3*/
if (check_for_symbols($_POST['secreta1']) || check_for_symbols($_POST['secreta2'])) {
$return = FALSE;
}
if ($return == FALSE) {
output_message('error', $lang['restore_pass_fail'] . '<meta http-equiv=refresh content="3;url=index.php?p=account&sub=restore">');
} elseif ($return == TRUE) {
$rp_sq1 = strip_if_magic_quotes($_POST['secretq1']);
$rp_sq2 = strip_if_magic_quotes($_POST['secretq2']);
$rp_sa1 = strip_if_magic_quotes($_POST['secreta1']);
$rp_sa2 = strip_if_magic_quotes($_POST['secreta2']);
$we = $DB->selectRow("SELECT account_id FROM `mw_account_extend` WHERE account_id='" . $username . "' AND secret_q1='" . $rp_sq1 . "' AND secret_q2='" . $rp_sq2 . "' AND secret_a1='" . $rp_sa1 . "' AND secret_a2='" . $rp_sa2 . "'");
if ($we !== FALSE) {
$pas = random_string(7);
$c_pas = $Account->sha_password($username_name, $pas);
$DB->query("UPDATE `account` SET sha_pass_hash='" . $c_pas . "' WHERE id='" . $username . "'");
$DB->query("UPDATE `account` SET sessionkey=NULL WHERE id='" . $username . "'");
output_message('success', $lang['restore_pass_success'] . '<br /> New password: ' . $pas);
} else {
output_message('error', $lang['restore_pass_fail'] . '<meta http-equiv=refresh content="3;url=index.php?n=account&sub=restore">');
}
}
} else {
output_message('error', $lang['restore_pass_fail'] . '<meta http-equiv=refresh content="3;url=index.php?p=account&sub=restore">');
echo "<br />";
}
}
示例8: clearLogFile
function clearLogFile()
{
global $lang;
$handle = fopen('core/logs/error_log.txt', 'w+');
if ($handle) {
fclose($handle);
output_message('success', $lang['error_log_cleared'] . '<meta http-equiv=refresh content="3;url=?p=admin&sub=errorlog">');
} else {
output_message('error', 'Unable to open the errorlog!');
}
}
示例9: index
public function index()
{
output_message('success', 'testing');
output_message('warning', 'testing');
output_message('error', 'testing');
output_message('info', 'testing');
// Get news posts
$data['news'] = $this->news->get_news_posts();
// Load the page, and we are done :)
$this->load->view('index', $data);
}
示例10: saveConfig
function saveConfig()
{
global $Config, $lang;
foreach ($_POST as $item => $val) {
$key = explode('__', $item);
if ($key[0] == 'cfg') {
$Config->set($key[1], $val);
}
}
$Config->Save();
output_message('success', $lang['cache_settings_saved'] . '<meta http-equiv=refresh content="3;url=?p=admin&sub=cache">');
}
示例11: log_action
public static function log_action($action, $message = "")
{
$path_to_logs = SITE_ROOT . DS . 'logs';
$log = $path_to_logs . DS . "log.txt";
$new = file_exists($log) ? false : true;
if ($handle = fopen($log, 'a')) {
$timestamp = strftime("%Y-%m-%d %H:%M:%S", time());
$content = "{$timestamp} | {$action}: {$message}\n";
fwrite($handle, $content);
fclose($handle);
if ($new) {
chmod($log, 0755);
}
} else {
output_message("Log file is not writable.");
}
}
示例12: confirmPayment
function confirmPayment()
{
global $DB, $user, $lang;
$pay = $DB->selectRow("SELECT * FROM `mw_donate_transactions` WHERE `account`='" . $user['id'] . "' AND `item_given`='0' LIMIT 1");
if ($pay == FALSE) {
output_message('validation', $lang['donate_no_trans']);
echo '<br /><br /><center><b><u>Redirecting...</u></b></center> <meta http-equiv=refresh content="8;url=?p=donate">';
} else {
if ($pay['payment_status'] == 'Completed') {
$item = $DB->selectRow("SELECT * FROM `mw_donate_packages` WHERE `id`='" . $pay['item_number'] . "'");
if ($item['cost'] > $pay['amount']) {
output_message('error', $lang['donate_not_face_value']);
} else {
$DB->query("UPDATE `mw_donate_transactions` SET `item_given`='1' WHERE `account`='" . $user['id'] . "' AND `id`='" . $pay['id'] . "' LIMIT 1");
$DB->query("UPDATE `mw_account_extend` SET \r\n\t\t\t\t\t`web_points` = (`web_points` + " . $item['points'] . "),\r\n\t\t\t\t\t`points_earned` = (`points_earned` + " . $item['points'] . "),\r\n\t\t\t\t\t`total_donations` = (`total_donations` + " . $pay['amount'] . ")\r\n\t\t\t\t WHERE `account_id`='" . $user['id'] . "'");
output_message('success', $lang['donate_points_given']);
}
} else {
output_message('warning', $lang['donate_status_not_complete']);
}
}
}
示例13: reCustomize
function reCustomize()
{
global $Config, $DB, $lang, $user;
include 'core/SDL/class.character.php';
$Character = new Character();
if ($Config->get('module_charcustomize') == 0) {
output_message('error', 'Nice try hacking, but not good enough.');
return FALSE;
}
// Check to see the user has enough points
if ($user['web_points'] >= $Config->get('module_charcustomize_pts')) {
if ($Character->setCustomize($_POST['id']) == TRUE) {
$DB->query("UPDATE `mw_account_extend` SET \n\t\t\t\t`web_points`=(`web_points` - " . $Config->get('module_charcustomize_pts') . "), \n\t\t\t\t`points_spent`=(`points_spent` + " . $Config->get('module_charcustomize_pts') . ") \n\t\t\t WHERE `account_id` = " . $user['id'] . " LIMIT 1");
output_message('success', $lang['char_recustomize_success']);
echo "<br /><br />";
} else {
output_message('warning', $lang['char_recustomize_already_set']);
echo "<br /><br />";
}
} else {
output_message('validation', $lang['not_enough_points']);
}
}
示例14: saveConfig
function saveConfig()
{
global $lang;
$conffile = "config/config-protected.php";
$build = '';
$build .= "<?php\n";
$build .= "\$db = array(\n";
$build .= "'db_host' => '" . $_POST['db_host'] . "',\n";
$build .= "'db_port' => '" . $_POST['db_port'] . "',\n";
$build .= "'db_username' => '" . $_POST['db_username'] . "',\n";
$build .= "'db_password' => '" . $_POST['db_password'] . "',\n";
$build .= "'db_name' => '" . $_POST['db_name'] . "',\n";
$build .= "'db_encoding' => 'utf8',\n";
$build .= ");\n";
$build .= "?>";
if (is_writeable($conffile)) {
$openconf = fopen($conffile, 'w+');
fwrite($openconf, $build);
fclose($openconf);
output_message('success', $lang['config_updated_successfully']);
} else {
output_message('error', 'Couldn\'t open main-config.php for editing, it must be writable by webserver! <br /><a href="javascript: history.go(-1)">Go back, and try again.</a>');
}
}
示例15: redirect_to
<?php
if (!isset($_SESSION['user_id'])) {
redirect_to(SITE_URL . DS . 'login' . DS);
}
require_once INCLUDES . DS . 'header.inc.php';
?>
<div id="content">
<?php
echo output_message($session->message);
?>
<h2>contexts<br />
<span>@<?php
echo stripslashes($page3);
?>
</h2>
<ul id="items">
<?php
$mit = new Task();
?>
<?php
$i = 1;
foreach ($contexts as $context) {
$mit = Task::find_by_id($context->task_id);
if ($mit->archived != 1) {
?>
<li class="<?php
if ($mit->completed == 1) {
echo 'dull';