本文整理汇总了PHP中fatal_lang_error函数的典型用法代码示例。如果您正苦于以下问题:PHP fatal_lang_error函数的具体用法?PHP fatal_lang_error怎么用?PHP fatal_lang_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了fatal_lang_error函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sportal_pages
function sportal_pages()
{
global $smcFunc, $context, $txt, $scripturl, $sourcedir, $user_info;
loadTemplate('PortalPages');
$page_id = !empty($_REQUEST['page']) ? $_REQUEST['page'] : 0;
if (is_numeric($page_id)) {
$page_id = (int) $page_id;
} else {
$page_id = $smcFunc['htmlspecialchars']($page_id, ENT_QUOTES);
}
$context['SPortal']['page'] = sportal_get_pages($page_id, true, true);
if (empty($context['SPortal']['page']['id'])) {
fatal_lang_error('error_sp_page_not_found', false);
}
$context['SPortal']['page']['style'] = sportal_parse_style('explode', $context['SPortal']['page']['style'], true);
if (empty($_SESSION['last_viewed_page']) || $_SESSION['last_viewed_page'] != $context['SPortal']['page']['id']) {
$smcFunc['db_query']('', '
UPDATE {db_prefix}sp_pages
SET views = views + 1
WHERE id_page = {int:current_page}', array('current_page' => $context['SPortal']['page']['id']));
$_SESSION['last_viewed_page'] = $context['SPortal']['page']['id'];
}
$context['linktree'][] = array('url' => $scripturl . '?page=' . $page_id, 'name' => $context['SPortal']['page']['title']);
$context['page_title'] = $context['SPortal']['page']['title'];
$context['sub_template'] = 'view_page';
}
示例2: sportal_admin_state_change
function sportal_admin_state_change()
{
checkSession('get');
if (!empty($_REQUEST['block_id'])) {
$id = (int) $_REQUEST['block_id'];
} elseif (!empty($_REQUEST['category_id'])) {
$id = (int) $_REQUEST['category_id'];
} elseif (!empty($_REQUEST['article_id'])) {
$id = (int) $_REQUEST['article_id'];
} else {
fatal_lang_error('error_sp_id_empty', false);
}
changeState($_REQUEST['type'], $id);
if ($_REQUEST['type'] == 'block') {
$sides = array(1 => 'left', 2 => 'top', 3 => 'bottom', 4 => 'right');
$list = !empty($_GET['redirect']) && isset($sides[$_GET['redirect']]) ? $sides[$_GET['redirect']] : 'list';
redirectexit('action=admin;area=portalblocks;sa=' . $list);
} elseif ($_REQUEST['type'] == 'category') {
redirectexit('action=admin;area=portalarticles;sa=categories');
} elseif ($_REQUEST['type'] == 'article') {
redirectexit('action=admin;area=portalarticles;sa=articles');
} else {
redirectexit('action=admin;area=portalconfig');
}
}
示例3: ShowAdminHelp
function ShowAdminHelp()
{
global $txt, $helptxt, $context, $scripturl;
if (!isset($_GET['help']) || !is_string($_GET['help'])) {
fatal_lang_error('no_access', false);
}
if (!isset($helptxt)) {
$helptxt = array();
}
// Load the admin help language file and template.
loadLanguage('Help');
// Permission specific help?
if (isset($_GET['help']) && substr($_GET['help'], 0, 14) == 'permissionhelp') {
loadLanguage('ManagePermissions');
}
loadTemplate('Help');
// Set the page title to something relevant.
$context['page_title'] = $context['forum_name'] . ' - ' . $txt['help'];
// Don't show any template layers, just the popup sub template.
$context['template_layers'] = array();
$context['sub_template'] = 'popup';
// What help string should be used?
if (isset($helptxt[$_GET['help']])) {
$context['help_text'] = $helptxt[$_GET['help']];
} elseif (isset($txt[$_GET['help']])) {
$context['help_text'] = $txt[$_GET['help']];
} else {
$context['help_text'] = $_GET['help'];
}
// Does this text contain a link that we should fill in?
if (preg_match('~%([0-9]+\\$)?s\\?~', $context['help_text'], $match)) {
$context['help_text'] = sprintf($context['help_text'], $scripturl, $context['session_id'], $context['session_var']);
}
}
示例4: PrintTopic
function PrintTopic()
{
global $db_prefix, $topic, $txt, $scripturl, $context;
global $board_info;
if (empty($topic)) {
fatal_lang_error(472, false);
}
// Get the topic starter information.
$request = db_query("\n\t\tSELECT m.posterTime, IFNULL(mem.realName, m.posterName) AS posterName\n\t\tFROM {$db_prefix}messages AS m\n\t\t\tLEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)\n\t\tWHERE m.ID_TOPIC = {$topic}\n\t\tORDER BY ID_MSG\n\t\tLIMIT 1", __FILE__, __LINE__);
if (mysql_num_rows($request) == 0) {
fatal_lang_error('smf232');
}
$row = mysql_fetch_assoc($request);
mysql_free_result($request);
// Lets "output" all that info.
loadTemplate('Printpage');
$context['template_layers'] = array('print');
$context['board_name'] = $board_info['name'];
$context['category_name'] = $board_info['cat']['name'];
$context['poster_name'] = $row['posterName'];
$context['post_time'] = timeformat($row['posterTime'], false);
// Split the topics up so we can print them.
$request = db_query("\n\t\tSELECT subject, posterTime, body, IFNULL(mem.realName, posterName) AS posterName\n\t\tFROM {$db_prefix}messages AS m\n\t\t\tLEFT JOIN {$db_prefix}members AS mem ON (mem.ID_MEMBER = m.ID_MEMBER)\n\t\tWHERE ID_TOPIC = {$topic}\n\t\tORDER BY ID_MSG", __FILE__, __LINE__);
$context['posts'] = array();
while ($row = mysql_fetch_assoc($request)) {
// Censor the subject and message.
censorText($row['subject']);
censorText($row['body']);
$context['posts'][] = array('subject' => $row['subject'], 'member' => $row['posterName'], 'time' => timeformat($row['posterTime'], false), 'timestamp' => forum_time(true, $row['posterTime']), 'body' => parse_bbc($row['body'], 'print'));
if (!isset($context['topic_subject'])) {
$context['topic_subject'] = $row['subject'];
}
}
mysql_free_result($request);
}
示例5: pre_dispatch
/**
* Entry point function for likes, permission checks, just makes sure its on
*/
public function pre_dispatch()
{
global $modSettings;
// If likes are disabled, we don't go any further
if (empty($modSettings['likes_enabled'])) {
fatal_lang_error('feature_disabled', true);
}
}
示例6: XMLhttpMain
function XMLhttpMain()
{
loadTemplate('Xml');
$sub_actions = array('jumpto' => array('function' => 'GetJumpTo'), 'messageicons' => array('function' => 'ListMessageIcons'));
if (!isset($_REQUEST['sa'], $sub_actions[$_REQUEST['sa']])) {
fatal_lang_error('no_access', false);
}
$sub_actions[$_REQUEST['sa']]['function']();
}
示例7: XMLhttpMain
function XMLhttpMain()
{
loadTemplate('Xml');
$sub_actions = array('jumpto' => array('function' => 'GetJumpTo'), 'messageicons' => array('function' => 'ListMessageIcons'), 'mcard' => array('function' => 'GetMcard'), 'givelike' => array('function' => 'HandleLikeRequest'), 'mpeek' => array('function' => 'TopicPeek'), 'tags' => array('function' => 'TagsActionDispatcher'), 'whoposted' => array('function' => 'WhoPosted'), 'prefix' => array('function' => 'InlinePrefixActions'), 'collapse' => array('function' => 'AjaxCollapseCategory'), 'sidebar' => array('function' => 'GetSidebarContent'), 'togglesb' => array('function' => '_ToggleSideBar'), 'tzoffset' => array('function' => 'SetGuestTZOffset'));
if (!isset($_REQUEST['sa'], $sub_actions[$_REQUEST['sa']])) {
fatal_lang_error('no_access', false);
}
$sub_actions[$_REQUEST['sa']]['function']();
}
示例8: action_stats
/**
* Display some useful/interesting board statistics.
*
* What it does:
* - Gets all the statistics in order and puts them in.
* - Uses the Stats template and language file. (and main sub template.)
* - Requires the view_stats permission.
* - Accessed from ?action=stats.
*
* @uses Stats language file
* @uses Stats template, statistics sub template
*/
public function action_stats()
{
global $txt, $scripturl, $modSettings, $context;
// You have to be able to see these
isAllowedTo('view_stats');
// Page disabled - redirect them out
if (empty($modSettings['trackStats'])) {
fatal_lang_error('feature_disabled', true);
}
if (!empty($_REQUEST['expand'])) {
$context['robot_no_index'] = true;
$month = (int) substr($_REQUEST['expand'], 4);
$year = (int) substr($_REQUEST['expand'], 0, 4);
if ($year > 1900 && $year < 2200 && $month >= 1 && $month <= 12) {
$_SESSION['expanded_stats'][$year][] = $month;
}
} elseif (!empty($_REQUEST['collapse'])) {
$context['robot_no_index'] = true;
$month = (int) substr($_REQUEST['collapse'], 4);
$year = (int) substr($_REQUEST['collapse'], 0, 4);
if (!empty($_SESSION['expanded_stats'][$year])) {
$_SESSION['expanded_stats'][$year] = array_diff($_SESSION['expanded_stats'][$year], array($month));
}
}
// Just a lil' help from our friend :P
require_once SUBSDIR . '/Stats.subs.php';
// Handle the XMLHttpRequest.
if (isset($_REQUEST['xml'])) {
// Collapsing stats only needs adjustments of the session variables.
if (!empty($_REQUEST['collapse'])) {
obExit(false);
}
$context['sub_template'] = 'stats';
getDailyStats('YEAR(date) = {int:year} AND MONTH(date) = {int:month}', array('year' => $year, 'month' => $month));
$context['yearly'][$year]['months'][$month]['date'] = array('month' => sprintf('%02d', $month), 'year' => $year);
return;
}
// Stats it is
loadLanguage('Stats');
loadTemplate('Stats');
loadJavascriptFile('stats.js');
// Build the link tree......
$context['linktree'][] = array('url' => $scripturl . '?action=stats', 'name' => $txt['stats_center']);
// Prepare some things for the template page
$context['page_title'] = $context['forum_name'] . ' - ' . $txt['stats_center'];
$context['sub_template'] = 'statistics';
// These are the templates that will be used to render the statistics
$context['statistics_callbacks'] = array('general_statistics', 'top_statistics');
// Call each area of statics to load our friend $context
$this->loadGeneralStatistics();
$this->loadTopStatistics();
$this->loadMontlyActivity();
// Custom stats (just add a template_layer or another callback to add it to the page!)
call_integration_hook('integrate_forum_stats');
}
示例9: XMLhttpMain
function XMLhttpMain()
{
loadTemplate('Xml');
$sub_actions = array('jumpto' => array('function' => 'GetJumpTo'), 'messageicons' => array('function' => 'ListMessageIcons'), 'corefeatures' => array('function' => 'EnableCoreFeatures'), 'previews' => array('function' => 'RetrievePreview'));
// Easy adding of sub actions
call_integration_hook('integrate_xmlhttp', array(&$sub_actions));
if (!isset($_REQUEST['sa'], $sub_actions[$_REQUEST['sa']])) {
fatal_lang_error('no_access', false);
}
$sub_actions[$_REQUEST['sa']]['function']();
}
示例10: ArcadeViewMatch
function ArcadeViewMatch()
{
global $scripturl, $txt, $db_prefix, $context, $smcFunc, $user_info;
if (empty($_REQUEST['match'])) {
fatal_lang_error('match_not_found', false);
}
loadMatch((int) $_REQUEST['match']);
// Delete Match
if (isset($_REQUEST['delete']) && $context['can_edit_match']) {
checkSession('get');
deleteMatch($context['match']['id']);
redirectexit('action=arcade;sa=arena');
} elseif (isset($_GET['start']) && $context['can_start_match']) {
checkSession('get');
$smcFunc['db_query']('', '
UPDATE {db_prefix}arcade_matches
SET num_players = current_players
WHERE id_match = {int:match}', array('match' => $context['match']['id']));
matchUpdateStatus($context['match']['id']);
redirectexit('action=arcade;sa=viewMatch;match=' . $context['match']['id']);
} elseif (isset($_REQUEST['leave']) && ($context['can_leave'] || $context['can_decline'])) {
checkSession('get');
// It's starter leaving, delete whole match
if ($user_info['id'] == $context['match']['starter']) {
deleteMatch($context['match']['id']);
redirectexit('action=arcade;sa=arena');
} else {
matchRemovePlayers($context['match']['id'], array($user_info['id']));
}
redirectexit('action=arcade;sa=viewMatch;match=' . $context['match']['id']);
} elseif (isset($_REQUEST['kick']) && !empty($context['match']['players'][$_REQUEST['player']]['can_kick'])) {
checkSession('get');
matchRemovePlayers($context['match']['id'], array($_REQUEST['player']));
redirectexit('action=arcade;sa=viewMatch;match=' . $context['match']['id']);
} elseif (isset($_REQUEST['join']) && $context['can_join_match']) {
checkSession('get');
matchAddPlayers($context['match']['id'], array($user_info['id'] => 1));
redirectexit('action=arcade;sa=viewMatch;match=' . $context['match']['id']);
} elseif (isset($_REQUEST['join']) && $context['can_accept']) {
checkSession('get');
matchUpdatePlayers($context['match']['id'], array($user_info['id']), 1);
redirectexit('action=arcade;sa=viewMatch;match=' . $context['match']['id']);
}
// Layout
loadTemplate('ArcadeArena');
$context['template_layers'][] = 'arcade_arena_view_match';
$context['sub_template'] = 'arcade_arena_view_match';
$context['page_title'] = sprintf($txt['arcade_arena_view_match_title'], $context['match']['name']);
// Add Arena to link tree
$context['linktree'][] = array('url' => $scripturl . '?action=arcade;sa=arena', 'name' => $txt['arcade_arena']);
$context['linktree'][] = array('url' => $scripturl . '?action=arcade;sa=viewMatch;match=' . $context['match']['id'], 'name' => $context['match']['name']);
}
示例11: RelatedTopicsAdminBuildIndex
/**
* Related Topics
*
* @package RelatedTopics
* @author Niko Pahajoki http://madjoki.com/
* @version 1.5
* @license http://madjoki.com/smf-mods/license/ New-BSD
*/
function RelatedTopicsAdminBuildIndex()
{
global $smcFunc, $scripturl, $modSettings, $context, $txt;
loadTemplate('Admin');
loadLanguage('Admin');
if (!isset($context['relatedClass']) && !initRelated()) {
fatal_lang_error('no_methods_selected');
}
$context['step'] = empty($_REQUEST['step']) ? 0 : (int) $_REQUEST['step'];
if ($context['step'] == 0) {
// Clear caches
foreach ($context['relatedClass'] as $class) {
$class->recreateIndexTables();
}
$smcFunc['db_query']('', '
DELETE FROM {db_prefix}related_topics');
}
$request = $smcFunc['db_query']('', '
SELECT MAX(id_topic)
FROM {db_prefix}topics');
list($max_topics) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
// How many topics to do per page load?
$perStep = 150;
$last = $context['step'] + $perStep;
// Search for topic ids between first and last which are not in ignored boards
$request = $smcFunc['db_query']('', '
SELECT t.id_topic
FROM {db_prefix}topics AS t
WHERE t.id_topic > {int:start}
AND t.id_topic <= {int:last}' . (!empty($context['rt_ignore']) ? '
AND t.id_board NOT IN({array_int:ignored})' : ''), array('start' => $context['step'], 'last' => $last, 'ignored' => $context['rt_ignore']));
$topics = array();
while ($row = $smcFunc['db_fetch_assoc']($request)) {
$topics[] = $row['id_topic'];
}
$smcFunc['db_free_result']($request);
// Update topics
relatedUpdateTopics($topics, true);
if ($last >= $max_topics) {
redirectexit('action=admin;area=relatedtopics;sa=methods');
}
$context['sub_template'] = 'not_done';
$context['continue_get_data'] = '?action=admin;area=relatedtopics;sa=buildIndex;step=' . $last;
$context['continue_percent'] = round(100 * ($last / $max_topics));
$context['continue_post_data'] = '';
$context['continue_countdown'] = '2';
obExit();
}
示例12: action_attachapprove
/**
* Called from a mouse click,
* works out what we want to do with attachments and actions it.
* Accessed by ?action=attachapprove
*/
public function action_attachapprove()
{
global $user_info;
// Security is our primary concern...
checkSession('get');
// If it approve or delete?
$is_approve = !isset($_GET['sa']) || $_GET['sa'] != 'reject' ? true : false;
$attachments = array();
require_once SUBSDIR . '/ManageAttachments.subs.php';
// If we are approving all ID's in a message , get the ID's.
if ($_GET['sa'] == 'all' && !empty($_GET['mid'])) {
$id_msg = (int) $_GET['mid'];
$attachments = attachmentsOfMessage($id_msg);
} elseif (!empty($_GET['aid'])) {
$attachments[] = (int) $_GET['aid'];
}
if (empty($attachments)) {
fatal_lang_error('no_access', false);
}
// @todo nb: this requires permission to approve posts, not manage attachments
// Now we have some ID's cleaned and ready to approve, but first - let's check we have permission!
$allowed_boards = !empty($user_info['mod_cache']['ap']) ? $user_info['mod_cache']['ap'] : boardsAllowedTo('approve_posts');
if ($allowed_boards == array(0)) {
$approve_query = '';
} elseif (!empty($allowed_boards)) {
$approve_query = ' AND m.id_board IN (' . implode(',', $allowed_boards) . ')';
} else {
$approve_query = ' AND 0';
}
// Validate the attachments exist and have the right approval state.
$attachments = validateAttachments($attachments, $approve_query);
// Set up a return link based off one of the attachments for this message
$attach_home = attachmentBelongsTo($attachments[0]);
$redirect = 'topic=' . $attach_home['id_topic'] . '.msg' . $attach_home['id_msg'] . '#msg' . $attach_home['id_msg'];
if (empty($attachments)) {
fatal_lang_error('no_access', false);
}
// Finally, we are there. Follow through!
if ($is_approve) {
// Checked and deemed worthy.
approveAttachments($attachments);
} else {
removeAttachments(array('id_attach' => $attachments, 'do_logging' => true));
}
// We approved or removed, either way we reset those numbers
cache_put_data('num_menu_errors', null, 900);
// Return to the topic....
redirectexit($redirect);
}
示例13: action_index
/**
* Main dispatcher for action=xmlhttp.
*
* @see Action_Controller::action_index()
*/
public function action_index()
{
loadTemplate('Xml');
require_once SUBSDIR . '/Action.class.php';
$subActions = array('jumpto' => array('controller' => $this, 'function' => 'action_jumpto'), 'messageicons' => array('controller' => $this, 'function' => 'action_messageicons'), 'groupicons' => array('controller' => $this, 'function' => 'action_groupicons'), 'corefeatures' => array('controller' => $this, 'function' => 'action_corefeatures', 'permission' => 'admin_forum'), 'profileorder' => array('controller' => $this, 'function' => 'action_profileorder', 'permission' => 'admin_forum'), 'messageiconorder' => array('controller' => $this, 'function' => 'action_messageiconorder', 'permission' => 'admin_forum'), 'smileyorder' => array('controller' => $this, 'function' => 'action_smileyorder', 'permission' => 'admin_forum'), 'boardorder' => array('controller' => $this, 'function' => 'action_boardorder', 'permission' => 'manage_boards'), 'parserorder' => array('controller' => $this, 'function' => 'action_parserorder', 'permission' => 'admin_forum'));
// Easy adding of xml sub actions with integrate_xmlhttp
$action = new Action('xmlhttp');
$subAction = $action->initialize($subActions);
// Act a bit special for XML, probably never see it anyway :P
if (empty($subAction)) {
fatal_lang_error('no_access', false);
}
// Off we go then, (it will check permissions)
$action->dispatch($subAction);
}
示例14: adminInfoFile
/**
* Get the admin info file from the database
*
* @param string $filename
*
* @return array
*/
function adminInfoFile($filename)
{
$db = database();
$file = array();
$request = $db->query('', '
SELECT data, filetype
FROM {db_prefix}admin_info_files
WHERE filename = {string:current_filename}
LIMIT 1', array('current_filename' => $filename));
if ($db->num_rows($request) == 0) {
fatal_lang_error('admin_file_not_found', true, array($filename));
}
list($file['file_data'], $file['filetype']) = $db->fetch_row($request);
$db->free_result($request);
return $file;
}
示例15: saveDraft
/**
* Save a new draft, or update an existing draft.
*/
function saveDraft()
{
global $smcFunc, $topic, $board, $user_info, $options;
if (!isset($_REQUEST['draft']) || $user_info['is_guest'] || empty($options['use_drafts'])) {
return false;
}
$msgid = isset($_REQUEST['msg']) ? $_REQUEST['msg'] : 0;
// Clean up what we may or may not have
$subject = isset($_POST['subject']) ? $_POST['subject'] : '';
$message = isset($_POST['message']) ? $_POST['message'] : '';
$icon = isset($_POST['icon']) ? preg_replace('~[\\./\\\\*:"\'<>]~', '', $_POST['icon']) : 'xx';
// Sanitise what we do have
$subject = commonAPI::htmltrim(commonAPI::htmlspecialchars($subject));
$message = commonAPI::htmlspecialchars($message, ENT_QUOTES);
preparsecode($message);
if (commonAPI::htmltrim(commonAPI::htmlspecialchars($subject)) === '' && commonAPI::htmltrim(commonAPI::htmlspecialchars($_POST['message']), ENT_QUOTES) === '') {
fatal_lang_error('empty_draft', false);
}
// Hrm, so is this a new draft or not?
if (isset($_REQUEST['draft_id']) && (int) $_REQUEST['draft_id'] > 0 || $msgid) {
$_REQUEST['draft_id'] = (int) $_REQUEST['draft_id'];
$id_cond = $msgid ? ' 1=1 ' : ' id_draft = {int:draft} ';
$id_sel = $msgid ? ' AND id_msg = {int:message} ' : ' AND id_board = {int:board} AND id_topic = {int:topic} ';
// Does this draft exist?
smf_db_query('
UPDATE {db_prefix}drafts
SET subject = {string:subject},
body = {string:body},
updated = {int:post_time},
icon = {string:post_icon},
smileys = {int:smileys_enabled},
is_locked = {int:locked},
is_sticky = {int:sticky}
WHERE ' . $id_cond . '
AND id_member = {int:member}
' . $id_sel . '
LIMIT 1', array('draft' => $_REQUEST['draft_id'], 'board' => $board, 'topic' => $topic, 'message' => $msgid, 'member' => $user_info['id'], 'subject' => $subject, 'body' => $message, 'post_time' => time(), 'post_icon' => $icon, 'smileys_enabled' => !isset($_POST['ns']) ? 1 : 0, 'locked' => !empty($_POST['lock_draft']) ? 1 : 0, 'sticky' => isset($_POST['sticky']) ? 1 : 0));
if (smf_db_affected_rows() != 0) {
return $_REQUEST['draft_id'];
}
}
smf_db_insert('insert', '{db_prefix}drafts', array('id_board' => 'int', 'id_topic' => 'int', 'id_msg' => 'int', 'id_member' => 'int', 'subject' => 'string', 'body' => 'string', 'updated' => 'int', 'icon' => 'string', 'smileys' => 'int', 'is_locked' => 'int', 'is_sticky' => 'int'), array($board, $topic, $msgid, $user_info['id'], $subject, $message, time(), $icon, !isset($_POST['ns']) ? 1 : 0, !empty($_POST['lock_draft']) ? 1 : 0, isset($_POST['sticky']) ? 1 : 0), array('id_draft'));
return smf_db_insert_id('{db_prefix}drafts');
}