本文整理汇总了PHP中message_die函数的典型用法代码示例。如果您正苦于以下问题:PHP message_die函数的具体用法?PHP message_die怎么用?PHP message_die使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了message_die函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add_log
function add_log()
{
global $db, $userdata, $lang, $user_ip;
$args = func_get_args();
$mode = array_shift($args);
$reportee_id = $mode == LOG_USER ? intval(array_shift($args)) : '';
$forum_id = $mode == LOG_MOD ? intval(array_shift($args)) : '';
$topic_id = $mode == LOG_MOD ? intval(array_shift($args)) : '';
$action = array_shift($args);
$data = !sizeof($args) ? '' : $db->sql_escape(serialize($args));
switch ($mode) {
case LOG_ADMIN:
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, log_ip, log_time, log_operation, log_data)
VALUES (' . LOG_ADMIN . ', ' . $userdata['user_id'] . ", '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
break;
case LOG_MOD:
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, forum_id, topic_id, log_ip, log_time, log_operation, log_data)
VALUES (' . LOG_MOD . ', ' . $userdata['user_id'] . ", {$forum_id}, {$topic_id}, '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
break;
case LOG_USER:
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, reportee_id, log_ip, log_time, log_operation, log_data)
VALUES (' . LOG_USERS . ', ' . $userdata['user_id'] . ", {$reportee_id}, '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
break;
case LOG_CRITICAL:
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, log_ip, log_time, log_operation, log_data)
VALUES (' . LOG_CRITICAL . ', ' . $userdata['user_id'] . ", '{$user_ip}', " . time() . ", '{$action}', '{$data}')";
break;
default:
return;
}
if (!$db->sql_query($sql)) {
message_die(GENERAL_ERROR, $lang['Error_Logs_Table'], '', __LINE__, __FILE__, $sql);
}
return;
}
示例2: _achievement
function _achievement($l_key)
{
global $lang;
$message = $lang[$l_key] . '<br /><br />' . sprintf($lang['qp_click_return_config'], '<a href="' . append_sid($this->requester . $this->ext) . '">', '</a>') . '<br /><br />' . sprintf($lang['Click_return_admin_index'], '<a href="' . append_sid('index.' . $this->ext . '?pane=right') . '">', '</a>');
message_die(GENERAL_MESSAGE, $message);
return;
}
示例3: get_integration_settings
function get_integration_settings($set_admin_defaults = FALSE)
{
global $db, $wpuAbs;
$config_fields = get_db_schema();
$wpSettings = array();
if ($wpuAbs->ver == 'PHPBB3') {
foreach ($config_fields as $var_name => $field_name) {
if ($wpuAbs->config('wpu_' . $field_name) !== FALSE) {
$wpSettings[$var_name] = $wpuAbs->config('wpu_' . $field_name);
//unset($GLOBALS['config']['wpu_'.$field_name]);
} elseif ($set_admin_defaults) {
$wpSettings[$var_name] = set_default($var_name);
}
}
return $wpSettings;
}
$sql = 'SELECT * FROM ' . WP_INT_TABLE . ' LIMIT 1';
if (!($result = $db->sql_query($sql))) {
//db error -- die
message_die(GENERAL_ERROR, $lang['WP_DBErr_Retrieve'], __LINE__, __FILE__, $sql);
return FALSE;
}
if (!$db->sql_numrows($result)) {
// table not populated yet
return FALSE;
} else {
$row = $db->sql_fetchrow($result);
$fullFieldSet = get_db_schema();
foreach ($fullFieldSet as $var_name => $field_name) {
$wpSettings[$var_name] = $row[$field_name];
}
}
}
示例4: array
function &getServiceInstance($name, $servicedir = NULL)
{
global $dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist, $dbtype;
static $instances = array();
static $db;
if (!isset($db)) {
require_once dirname(__FILE__) . '/../includes/db/' . $dbtype . '.php';
$db = new sql_db();
$db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbpersist);
if (!$db->db_connect_id) {
message_die(CRITICAL_ERROR, "Could not connect to the database", $db);
}
}
if (!isset($instances[$name])) {
if (isset($serviceoverrules[$name])) {
$name = $serviceoverrules[$name];
}
if (!class_exists($name)) {
if (!isset($servicedir)) {
$servicedir = dirname(__FILE__) . '/';
}
require_once $servicedir . strtolower($name) . '.php';
}
$instances[$name] = call_user_func(array($name, 'getInstance'), $db);
}
return $instances[$name];
}
示例5: send
public function send()
{
$user_id = $this->in->get('user', 0);
if ($user_id < 1) {
$this->core->message($this->user->lang('error_user_not_found'), $this->user->lang('error'), 'red');
} elseif ($this->in->get('body') == '' || $this->in->get('subject') == '') {
$this->core->message($this->user->lang('adduser_send_mail_error_fields'), $this->user->lang('error'), 'red');
} else {
$strEmail = $this->pdh->get('user', 'email', array($user_id, true));
$blnPrivacyCheck = $this->pdh->get('user', 'check_privacy', array($user_id, 'userprofile_email'));
//Permission to send
if ($blnPrivacyCheck && strlen($strEmail)) {
$options = array('template_type' => 'input');
//Set E-Mail-Options
$this->mail->SetOptions($options);
$status = $this->mail->SendMail($this->pdh->get('user', 'email', array($user_id)), $this->user->data['user_email'], $this->in->get('subject'), $this->in->get('body'));
if ($status) {
$this->core->message($this->user->lang('adduser_send_mail_suc'), $this->user->lang('success'), 'green');
$this->tpl->add_js("jQuery.FrameDialog.closeDialog();");
} else {
$this->core->message($this->user->lang('error_email_send'), $this->user->lang('error'), 'red');
}
} else {
message_die($this->user->lang('noauth'), $this->user->lang('noauth_default_title'), 'access_denied');
}
}
}
示例6: validate_email
function validate_email($email)
{
global $lang;
if ($email != '') {
if (preg_match('/^[a-z0-9&\'\\.\\-_\\+]+@[a-z0-9\\-]+\\.([a-z0-9\\-]+\\.)*?[a-z]+$/is', $email)) {
$sql = "SELECT ban_email\n\t\t\t\tFROM " . BANLIST_TABLE;
if ($result = DB()->sql_query($sql)) {
if ($row = DB()->sql_fetchrow($result)) {
do {
$match_email = str_replace('*', '.*?', $row['ban_email']);
if (preg_match('/^' . $match_email . '$/is', $email)) {
DB()->sql_freeresult($result);
return array('error' => true, 'error_msg' => $lang['Email_banned']);
}
} while ($row = DB()->sql_fetchrow($result));
}
}
DB()->sql_freeresult($result);
$sql = "SELECT user_email\n\t\t\t\tFROM " . USERS_TABLE . "\n\t\t\t\tWHERE user_email = '" . str_replace("\\'", "''", $email) . "'";
if (!($result = DB()->sql_query($sql))) {
message_die(GENERAL_ERROR, "Couldn't obtain user email information.", "", __LINE__, __FILE__, $sql);
}
if ($row = DB()->sql_fetchrow($result)) {
return array('error' => true, 'error_msg' => $lang['Email_taken']);
}
DB()->sql_freeresult($result);
return array('error' => false, 'error_msg' => '');
}
}
return array('error' => true, 'error_msg' => $lang['Email_invalid']);
}
示例7: createTables
function createTables()
{
global $wowdb, $roster_conf, $wordings;
// Declare tables needed for RaidTracker
$create_nodes = 'CREATE TABLE `' . GATHERER_TABLE . '` (
`id` int(11) NOT NULL auto_increment,
`number` int(15) NOT NULL,
`nodeNumber` int(11) NOT NULL,
`map` varchar(25) NOT NULL,
`nodeType` varchar(25) NOT NULL,
`continent` int(3) NOT NULL,
PRIMARY KEY (`id`),
KEY `number` (`number`)
) ENGINE=MyISAM;';
// Create tables declared above
$tables = 0;
if ($wowdb->query($create_nodes) or die_quietly($wowdb->error(), 'Database Error', basename(__FILE__), __LINE__, $create_nodes)) {
$tables += 1;
}
if ($tables == 1) {
print message_die('All tables successfully added<br /><br /><a href="' . $script_filename . '">Finish installation</a>', 'Installation Successful', 'syellow');
} else {
print message_die('Install failed<br /><br />Please copy the contents of the SQL log and make a post in the Gather Sub-forum at WoWRoster.net', 'Install Error');
}
}
示例8: __construct
public function __construct()
{
global $template, $db, $board_config, $phpbb_seo, $lang;
global $rcs, $get, $qte;
$template->assign_vars(array('MARQUEE_TOPIC' => str_replace("%s", $board_config['topics_on_index'], $lang['marquee_topic'])));
if (!($result = $db->sql_query($this->getFetchSql(), false, 'topics_recent_'))) {
message_die(GENERAL_ERROR, 'Could not query recent posts marquee information', '', __LINE__, __FILE__);
}
if ($rows = $db->sql_fetchrowset($result)) {
$db->sql_freeresult($result);
}
$topics = count($rows) <= $board_config['topics_on_index'] ? count($rows) : $board_config['topics_on_index'];
for ($i = 0; $i < $topics; ++$i) {
$topic = $rows[$i];
$mar_title = $topic["topic_title"];
// www.phpBB-SEO.com SEO TOOLKIT BEGIN
if (!isset($phpbb_seo->seo_url['topic'][$topic['topic_id']])) {
$phpbb_seo->seo_url['topic'][$topic['topic_id']] = $phpbb_seo->format_url($mar_title);
}
// www.phpBB-SEO.com SEO TOOLKIT END
$mar_url = $get->url('viewtopic', array(POST_TOPIC_URL => $topic["topic_id"]));
$mar_user = $topic["username"];
$pic = pic_for_topic($topic);
if ($board_config['allow_smilies']) {
$topic["topic_title"] = smilies_pass($topic["topic_title"]);
}
$topic_title = $topic['topic_title'];
$qte->attr($topic_title, $topic['topic_attribute']);
$template->assign_block_vars('marqueerow', array('FOLD_URL' => $pic, 'TOPIC_TITLE' => $topic_title, 'TOPIC_URL' => $get->url('viewtopic', array(POST_TOPIC_URL => $topic["topic_id"]), true), 'POST_URL' => $get->url('viewtopic', array('p' => $topic["post_id"]), true) . '#' . $topic["post_id"], 'STYLE' => $rcs->get_colors($topic), 'USERNAME' => $topic["username"], 'USER_PROF' => $get->url('userlist', array('mode' => 'viewprofile', POST_USERS_URL => $topic["user_id"]), true), 'POST_DATE' => create_date($board_config['default_dateformat'], $topic["post_time"], $board_config['board_timezone'])));
}
}
示例9: send
function send()
{
if ($x)
{
message_die();
}
}
示例10: recup_infos_cat
function recup_infos_cat()
{
global $db, $phpEx;
$liste_cat = array();
$sql = 'SELECT arcade_catid, arcade_parent, arcade_cattitle, arcade_icone, arcade_catorder, arcade_nbelmt
FROM ' . AREABB_CATEGORIES_TABLE . '
WHERE salle=' . $this->id_salle . '
ORDER BY arcade_catorder';
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, "Impossible d'accéder à la tables des catégories", '', __LINE__, __FILE__, $sql);
}
$i = 0;
while ($row = $db->sql_fetchrow($result)) {
$liste_cat[$i]['lien'] = append_sid(NOM_ARCADE . '.' . $phpEx . '?salle=' . $this->id_salle . '&cid=' . $row['arcade_catid']);
$liste_cat[$i]['nbre_jeux'] = $row['arcade_nbelmt'];
$liste_cat[$i]['titre'] = $row['arcade_cattitle'];
$liste_cat[$i]['id'] = $row['arcade_catid'];
$liste_cat[$i]['icone'] = $row['arcade_icone'];
$liste_cat[$i]['parent'] = $row['arcade_parent'];
$liste_cat[$i]['order'] = $row['arcade_catorder'];
$i++;
}
$this->liste_cat = $liste_cat;
$this->nbre_categorie = sizeof($liste_cat);
}
示例11: parse
public static function parse($input)
{
if (trim($input->head->gameinfo->game) == 'Runes of Magic' and register('config')->get('default_game') != 'rom' or trim($input->head->gameinfo->game) == 'World of Warcraft' and register('config')->get('default_game') != 'wow') {
message_die(register('user')->lang('wrong_game'));
}
$lang = trim($input->head->gameinfo->language);
#$this->rli->add_data['log_lang'] = substr($lang, 0, 2);
$xml = $input->raiddata;
$data = array();
foreach ($xml->zones->children() as $zone) {
$data['zones'][] = array(trim($zone->name), (int) trim($zone->enter), (int) trim($zone->leave), (int) trim($zone->difficulty));
}
foreach ($xml->bosskills->children() as $bosskill) {
$data['bosses'][] = array(trim($bosskill->name), (int) trim($bosskill->time), (int) trim($bosskill->difficulty));
}
foreach ($xml->members->children() as $xmember) {
$name = trim($xmember->name);
$note = isset($xmember->note) ? trim($xmember->note) : '';
$data['members'][] = array($name, trim($xmember->class), trim($xmember->race), trim($xmember->level), $note);
foreach ($xmember->times->children() as $time) {
$attrs = $time->attributes();
$type = (string) $attrs['type'];
$extra = isset($attrs['extra']) ? (string) $attrs['extra'] : '';
$data['times'][] = array($name, (int) $time, $type, $extra);
}
}
foreach ($xml->items->children() as $xitem) {
$cost = isset($xitem->cost) ? trim($xitem->cost) : '';
$id = isset($xitem->itemid) ? trim($xitem->itemid) : '';
$data['items'][] = array(trim($xitem->name), trim($xitem->member), $cost, (int) $id, (int) trim($xitem->time));
}
return $data;
}
示例12: duplicate_attachment_pm
function duplicate_attachment_pm($switch_attachment, $original_privmsg_id, $new_privmsg_id)
{
global $privmsg, $folder;
if (($privmsg['privmsgs_type'] == PRIVMSGS_NEW_MAIL || $privmsg['privmsgs_type'] == PRIVMSGS_UNREAD_MAIL) && $folder == 'inbox' && intval($switch_attachment) == 1) {
$sql = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE privmsgs_id = ' . $original_privmsg_id;
if (!($result = DB()->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Couldn\'t query Attachment Table', '', __LINE__, __FILE__, $sql);
}
if (DB()->num_rows($result) > 0) {
$rows = DB()->sql_fetchrowset($result);
$num_rows = DB()->num_rows($result);
for ($i = 0; $i < $num_rows; $i++) {
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' (attach_id, post_id, privmsgs_id, user_id_1, user_id_2)
VALUES ( ' . $rows[$i]['attach_id'] . ', ' . $rows[$i]['post_id'] . ', ' . $new_privmsg_id . ', ' . $rows[$i]['user_id_1'] . ', ' . $rows[$i]['user_id_2'] . ')';
if (!($result = DB()->sql_query($sql))) {
message_die(GENERAL_ERROR, 'Couldn\'t store Attachment for sent Private Message', '', __LINE__, __FILE__, $sql);
}
}
$sql = "UPDATE " . PRIVMSGS_TABLE . "\n\t\t\t\tSET privmsgs_attachment = 1\n\t\t\t\tWHERE privmsgs_id = " . $new_privmsg_id;
if (!DB()->sql_query($sql)) {
message_die(GENERAL_ERROR, 'Unable to update Private Message Table.', '', __LINE__, __FILE__, $sql);
}
}
}
}
示例13: display
public function display()
{
if ($this->in->get('page', '')) {
if (is_numeric($this->in->get('page', ''))) {
$id = $this->in->get('page', '');
} else {
$id = $this->pdh->get('pages', 'alias_to_page', array($this->in->get('page', '')));
}
} else {
message_die($this->user->lang('info_invalid_id'), $this->user->lang('info_invalid_id_title'));
}
if (!$this->pdh->get('pages', 'page_exists', array($id))) {
message_die($this->user->lang('info_invalid_id'), $this->user->lang('info_invalid_id_title'));
}
if (!$this->pdh->get('pages', 'check_visibility', array($id))) {
message_die($this->user->lang('noauth_u_information_view'), $this->user->lang('noauth_default_title'));
}
$content = $this->pdh->get('pages', 'content', array($id));
$arrHooks = $this->hooks->process('pages_parse', array('text' => $content), true);
$content = $arrHooks['text'];
$myRatings = array('1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', '7' => '7', '8' => '8', '9' => '9', '10' => '10');
$users_voted = $this->pdh->get('pages', 'voters', array($id));
$u_has_voted = !$users_voted[$this->user->data['user_id']] ? false : true;
$this->tpl->assign_vars(array('PAGE_ID' => $id, 'INFO_PAGE_CONTENT' => $this->bbcode->parse_shorttags(xhtml_entity_decode($content)), 'INFO_PAGE_TITLE' => sanitize($this->pdh->get('pages', 'title', array($id))), 'EDITED' => $this->pdh->get('pages', 'edit_date', array($id)) ? $this->user->lang('info_edit_user') . $this->pdh->get('user', 'name', array($this->pdh->get('pages', 'edit_user', array($id)))) . $this->user->lang('info_edit_date') . $this->time->user_date($this->pdh->get('pages', 'edit_date', array($id)), false, false, true) : '', 'S_IS_ADMIN' => $this->user->check_auth('a_pages_man', false), 'STAR_RATING' => $this->pdh->get('pages', 'voting', array($id)) == '1' ? $this->jquery->StarRating('info_vote', $myRatings, 'pages.php' . $this->SID . '&page=' . sanitize($id) . '&mode=vote', $this->pdh->get('pages', 'rating', array($id)), $u_has_voted) : ''));
//Comment-System
if ($this->pdh->get('pages', 'comments', array($id)) == '1') {
$this->comments->SetVars(array('attach_id' => $id, 'page' => 'custompages', 'auth' => 'a_pages_man'));
$this->tpl->assign_vars(array('COMMENTS' => $this->comments->Show()));
}
$this->core->set_vars(array('page_title' => sanitize($this->pdh->get('pages', 'title', array($id))), 'template_file' => 'pages.html', 'description' => substr(strip_tags($this->bbcode->remove_embeddedMedia($this->bbcode->remove_shorttags(xhtml_entity_decode($content)))), 0, 250), 'image' => register('socialplugins')->getFirstImage(xhtml_entity_decode($content)), 'display' => true));
}
示例14: display
public function display()
{
if (!$this->data || $this->data['url'] == '') {
message_die('URL not found');
} else {
$sop = parse_url($this->data['url']);
$sop = $sop['host'] == $this->env->server_name ? true : false;
$output = '<div id="wrapper">';
if (!$sop) {
$output .= '<!--[IF IE]>
<iframe id="boardframe" src="' . $this->data['url'] . '" allowtransparency="true" height="' . $this->data['height'] . '" width="100%" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
<![if ! IE]><!-->
<iframe id="boardframe" src="' . $this->data['url'] . '" height="' . $this->data['height'] . '" width="100%" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
<!--><![ENDIF]><![ENDIF]-->';
} else {
$this->CreateDynamicIframeJS();
$output .= '<!--[IF IE]>
<iframe id="boardframe" src="' . $this->data['url'] . '" allowtransparency="true" width="100%" height="' . $this->data['height'] . '" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0"></iframe>
<![if ! IE]><!-->
<iframe id="boardframe" src="' . $this->data['url'] . '" width="100%" scrolling="no" marginwidth="0" marginheight="0" height="' . $this->data['height'] . '" frameborder="0" vspace="0" hspace="0"></iframe>
<!--><![ENDIF]><![ENDIF]-->';
}
$output .= '</div>';
$this->tpl->assign_vars(array('BOARD_OUPUT' => $output));
}
$this->core->set_vars(array('page_title' => isset($this->data['title']) ? $this->data['title'] : 'Wrapper', 'page_body' => isset($this->data['window']) && $this->data['window'] == 4 ? 'full' : '', 'template_file' => 'wrapper.html', 'display' => true));
}
示例15: generate_smilies_row
function generate_smilies_row()
{
global $db, $board_config, $template;
$max_smilies = 24;
switch (SQL_LAYER) {
case 'mssql':
$sql = 'SELECT TOP ' . $max_smilies . ' min(emoticon) AS emoticon,
min(code) AS code, smile_url
FROM ' . SMILIES_TABLE . '
GROUP BY [smile_url]';
break;
default:
$sql = 'SELECT emoticon, code, smile_url
FROM ' . SMILIES_TABLE . '
GROUP BY smile_url
ORDER BY smilies_id LIMIT ' . $max_smilies;
break;
}
if (!($result = $db->sql_query($sql))) {
message_die(GENERAL_ERROR, "Couldn't retrieve smilies list", '', __LINE__, __FILE__, $sql);
}
$smilies_count = $db->sql_numrows($result);
$smilies_data = $db->sql_fetchrowset($result);
for ($i = 0; $i < $smilies_count; $i++) {
$template->assign_block_vars('quick_reply.smilies', array('CODE' => $smilies_data[$i]['code'], 'URL' => $board_config['smilies_path'] . '/' . $smilies_data[$i]['smile_url'], 'DESC' => $smilies_data[$i]['emoticon']));
}
}