• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP fatal_lang_error函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中fatal_lang_error函数的典型用法代码示例。如果您正苦于以下问题:PHP fatal_lang_error函数的具体用法?PHP fatal_lang_error怎么用?PHP fatal_lang_error使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了fatal_lang_error函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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';
}
开发者ID:sk8rdude461,项目名称:moparscape.org-smf,代码行数:26,代码来源:PortalPages.php


示例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');
    }
}
开发者ID:sk8rdude461,项目名称:moparscape.org-smf,代码行数:25,代码来源:Subs-PortalAdmin.php


示例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']);
    }
}
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:34,代码来源:Help.php


示例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);
}
开发者ID:VBGAMER45,项目名称:SMFMods,代码行数:35,代码来源:Printpage.php


示例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);
     }
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:11,代码来源:Likes.controller.php


示例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']();
}
开发者ID:abdulhadikaryana,项目名称:kebudayaan,代码行数:9,代码来源:Xml.php


示例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']();
}
开发者ID:norv,项目名称:EosAlpha,代码行数:9,代码来源:Xml.php


示例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');
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:67,代码来源:Stats.controller.php


示例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']();
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:11,代码来源:Xml.php


示例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']);
}
开发者ID:nikop,项目名称:SMF-Arcade,代码行数:52,代码来源:ArcadeArena.php


示例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();
}
开发者ID:ahrasis,项目名称:Related-Topics,代码行数:57,代码来源:RelatedTopics.php


示例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);
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:54,代码来源:ModerateAttachments.controller.php


示例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);
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:20,代码来源:Xml.controller.php


示例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;
}
开发者ID:KeiroD,项目名称:Elkarte,代码行数:23,代码来源:AdminDebug.subs.php


示例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');
}
开发者ID:norv,项目名称:EosAlpha,代码行数:47,代码来源:Subs-Drafts.php


示例16: action_quickhelp

 /**
  * Show boxes with more detailed help on items, when the user clicks on their help icon.
  * It handles both administrative or user help.
  * Data: $_GET['help'] parameter, it holds what string to display
  * and where to get the string from. ($helptxt or $txt)
  * It is accessed via ?action=quickhelp;help=?.
  *
  * @uses ManagePermissions language file, if the help starts with permissionhelp.
  * @uses Help template, 'popup' sub-template.
  */
 public function action_quickhelp()
 {
     global $txt, $helptxt, $context, $scripturl;
     if (!isset($_GET['help']) || !is_string($_GET['help'])) {
         fatal_lang_error('no_access', false);
     }
     if (!isset($helptxt)) {
         $helptxt = array();
     }
     $help_str = Util::htmlspecialchars($_GET['help']);
     // Load the admin help language file and template.
     loadLanguage('Help');
     // Load permission specific help
     if (substr($help_str, 0, 14) == 'permissionhelp') {
         loadLanguage('ManagePermissions');
     }
     // Load our template
     loadTemplate('Help');
     // Allow addons to load their own language file here.
     call_integration_hook('integrate_quickhelp');
     // Set the page title to something relevant.
     $context['page_title'] = $context['forum_name'] . ' - ' . $txt['help'];
     // Only show the 'popup' sub-template, no layers.
     Template_Layers::getInstance()->removeAll();
     $context['sub_template'] = 'popup';
     $helps = explode('+', $help_str);
     $context['help_text'] = '';
     // Find what to display: the string will be in $helptxt['help'] or in $txt['help]
     foreach ($helps as $help) {
         if (isset($helptxt[$help])) {
             $context['help_text'] .= $helptxt[$help];
         } elseif (isset($txt[$help])) {
             $context['help_text'] .= $txt[$help];
         } else {
             // nothing :(
             $context['help_text'] .= $help;
         }
     }
     // Link to the forum URL, and include session id.
     if (preg_match('~%([0-9]+\\$)?s\\?~', $context['help_text'], $match)) {
         $context['help_text'] = sprintf($context['help_text'], $scripturl, $context['session_id'], $context['session_var']);
     }
 }
开发者ID:KeiroD,项目名称:Elkarte,代码行数:53,代码来源:Help.controller.php


示例17: Main

 /**
  *
  */
 public static function Main()
 {
     global $context, $scripturl, $txt, $sourcedir, $modSettings;
     // Do we have permission?
     isAllowedTo('arcade_view');
     // Load Arcade
     self::loadArcade('normal');
     // Fatal error if Arcade is disabled
     if (empty($modSettings['arcadeEnabled'])) {
         fatal_lang_error('arcade_disabled', false);
     }
     // Information for actions (file, function, [permission])
     $subActions = array('arena' => array('ArcadeArena.php', 'ArcadeMatchList'), 'newMatch' => array('ArcadeArena.php', 'ArcadeNewMatch', 'arcade_create_match'), 'newMatch2' => array('ArcadeArena.php', 'ArcadeNewMatch2', 'arcade_create_match'), 'viewMatch' => array('ArcadeArena.php', 'ArcadeViewMatch'), 'list' => array('ArcadeList.php', 'ArcadeList'), 'suggest' => array('ArcadeList.php', 'ArcadeXMLSuggest'), 'search' => array('ArcadeList.php', 'ArcadeList'), 'rate' => array('ArcadeList.php', 'ArcadeRate'), 'favorite' => array('ArcadeList.php', 'ArcadeFavorite'), 'play' => array('ArcadeGame.php', 'ArcadePlay', 'arcade_play'), 'highscore' => array('ArcadeGame.php', 'ArcadeHighscore'), 'save' => array('ArcadeGame.php', 'ArcadeSave_Guest'), 'stats' => array('ArcadeStats.php', 'ArcadeStatistics'), 'submit' => array('ArcadeGame.php', 'ArcadeSubmit'), 'ibpverify' => array('Submit-ibp.php', 'ArcadeVerifyIBP'), 'ibpsubmit2' => array('ArcadeGame.php', 'ArcadeSubmit'), 'ibpsubmit3' => array('ArcadeGame.php', 'ArcadeSubmit'), 'v2Start' => array('Submit-v2game.php', 'ArcadeV2Start'), 'v2Hash' => array('Submit-v2game.php', 'ArcadeV2Hash'), 'v2Score' => array('Submit-v2game.php', 'ArcadeV2Score'), 'v2Submit' => array('ArcadeGame.php', 'ArcadeSubmit'), 'vbSessionStart' => array('Submit-v3arcade.php', 'ArcadeVbStart'), 'vbPermRequest' => array('Submit-v3arcade.php', 'ArcadeVbPermRequest'), 'vbBurn' => array('ArcadeGame.php', 'ArcadeSubmit'));
     if (empty($modSettings['arcadeArenaEnabled'])) {
         unset($subActions['arena'], $subActions['newMatch'], $subActions['newMatch2'], $subActions['viewMatch']);
     }
     // Fix for broken games which doesn't send sa/do=submit
     if (isset($_POST['game']) && isset($_POST['score']) && !isset($_REQUEST['sa'])) {
         $_REQUEST['sa'] = 'submit';
     } elseif (isset($_REQUEST['game']) && is_numeric($_REQUEST['game']) && !isset($_REQUEST['sa'])) {
         $_REQUEST['sa'] = 'play';
     } elseif (isset($_REQUEST['match']) && is_numeric($_REQUEST['match']) && !isset($_REQUEST['sa'])) {
         $_REQUEST['sa'] = 'viewMatch';
     } elseif (isset($_REQUEST['game']) && isset($_REQUEST['xml']) && !isset($_REQUEST['sa'])) {
         $_REQUEST['sa'] = 'custData';
     }
     $_REQUEST['sa'] = isset($_REQUEST['sa']) && isset($subActions[$_REQUEST['sa']]) ? $_REQUEST['sa'] : 'list';
     $context['arcade_tabs'] = array('title' => $txt['arcade'], 'tabs' => array(array('href' => $scripturl . '?action=arcade', 'title' => $txt['arcade'], 'is_selected' => in_array($_REQUEST['sa'], array('play', 'list', 'highscore', 'submit', 'search')))));
     if (!empty($modSettings['arcadeArenaEnabled'])) {
         $context['arcade_tabs']['tabs'][] = array('href' => $scripturl . '?action=arcade;sa=arena', 'title' => $txt['arcade_arena'], 'is_selected' => in_array($_REQUEST['sa'], array('arena', 'newMatch', 'newMatch2', 'viewMatch')));
     }
     $context['arcade_tabs']['tabs'][] = array('href' => $scripturl . '?action=arcade;sa=stats', 'title' => $txt['arcade_stats'], 'is_selected' => in_array($_REQUEST['sa'], array('stats')));
     if (!in_array($_REQUEST['sa'], array('highscore', 'comment')) && isset($_SESSION['arcade']['highscore'])) {
         unset($_SESSION['arcade']['highscore']);
     }
     // Check permission if needed
     if (isset($subActions[$_REQUEST['sa']][2])) {
         isAllowedTo($subActions[$_REQUEST['sa']][2]);
     }
     require_once $sourcedir . '/' . $subActions[$_REQUEST['sa']][0];
     $subActions[$_REQUEST['sa']][1]();
 }
开发者ID:nikop,项目名称:SMF-Arcade,代码行数:45,代码来源:Arcade.php


示例18: pv_delete

function pv_delete($memID)
{
    global $smcFunc, $context, $user_info;
    checkSession('get');
    if ($context['user']['is_owner'] && !allowedTo('pv_remove_own')) {
        isAllowedTo('pv_remove_any_any');
    } elseif ($user_info['id'] == $member && !allowedTo('pv_remove_any_own')) {
        isAllowedTo('pv_remove_any_any');
    }
    $member = !empty($_REQUEST['member']) ? (int) $_REQUEST['member'] : 0;
    if (empty($member)) {
        fatal_lang_error('pv_no_member', false);
    }
    $smcFunc['db_query']('', '
		DELETE FROM {db_prefix}log_Maximum_visitors
		WHERE id_member = {int:member}
			AND id_profile = {int:profile}
		LIMIT 1', array('member' => $member, 'profile' => $memID));
    redirectexit('action=profile;u=' . $memID . ';pv');
}
开发者ID:snrj,项目名称:smf-maximum-profile,代码行数:20,代码来源:Subs-ProfileVisitors.php


示例19: sportal_admin_state_change

/**
 * Toggles the current state of a block / control
 *
 * - calls sp_changeState to toggle the on/off status
 * - directs back based on type passed
 *
 * @param string $type type of control
 * @param int $id id of the control
 */
function sportal_admin_state_change($type, $id)
{
    if (!in_array($type, array('block', 'category', 'article'))) {
        fatal_lang_error('error_sp_id_empty', false);
    }
    // Toggle the current state
    sp_changeState($type, $id);
    // Based on the type, find our way back
    if ($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 ($type == 'category') {
        redirectexit('action=admin;area=portalarticles;sa=categories');
    } elseif ($type == 'article') {
        redirectexit('action=admin;area=portalarticles;sa=articles');
    } else {
        redirectexit('action=admin;area=portalconfig');
    }
}
开发者ID:emanuele45,项目名称:SimplePortal_ElkArte,代码行数:29,代码来源:PortalAdmin.subs.php


示例20: UltimatePortalEditLangs

function UltimatePortalEditLangs()
{
    global $context, $txt, $sourcedir;
    require_once $sourcedir . '/Subs-UltimatePortal.php';
    if (!empty($_POST['save'])) {
        checkSession('post');
        //Content and File
        $file = trim($_POST['file']);
        $content = trim($_POST['content']);
        //Create Edit Lang File
        CreateSpecificLang($file, $content);
        redirectexit('action=adminportal;area=preferences;sa=lang-maintenance;' . $context['session_var'] . '=' . $context['session_id']);
    }
    if (!empty($_POST['duplicate'])) {
        checkSession('post');
        if (empty($_POST['new_file'])) {
            fatal_lang_error('ultport_error_no_name', false);
        }
        //Content and File
        $file = trim($_POST['file']);
        //Load the original lang
        LoadSpecificLang($file);
        $new_file_name = $_POST['new_file'] . '.php';
        //Create Edit Lang File
        CreateSpecificLang($new_file_name, $context['content']);
        redirectexit('action=adminportal;area=preferences;sa=lang-maintenance;' . $context['session_var'] . '=' . $context['session_id']);
    }
    if (!empty($_POST['editing'])) {
        checkSession('post');
    }
    //If not select the lang file, then redirect the selec lang form
    if (empty($_POST['file'])) {
        redirectexit('action=adminportal;area=preferences;sa=lang-maintenance');
    }
    $context['file'] = stripslashes($_POST['file']);
    $this_file = $context['file'];
    //Load Specific Lang - from Subs-UltimatePortal.php
    LoadSpecificLang($this_file);
    $context['sub_template'] = 'preferences_lang_edit';
    $context['page_title'] = $txt['ultport_admin_lang_maintenance_edit'] . ' - ' . $txt['ultport_preferences_title'];
}
开发者ID:4kstore,项目名称:UltimatePortal-0.4,代码行数:41,代码来源:UltimatePortalCP.php



注:本文中的fatal_lang_error函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP fave_featured_image函数代码示例发布时间:2022-05-15
下一篇:
PHP fatal_exit函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap