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

PHP isBrowser函数代码示例

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

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



在下文中一共展示了isBrowser函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: template_select_boards

/**
 * Dropdown usable to select a board
 *
 * @param string $name
 * @param string $label
 * @param string $extra
 * @param boolean $all
 */
function template_select_boards($name, $label = '', $extra = '', $all = false)
{
    global $context, $txt;
    if (!empty($label)) {
        echo '
	<label for="', $name, '">', $label, ' </label>';
    }
    echo '
	<select name="', $name, '" id="', $name, '" ', $extra, ' >';
    if ($all) {
        echo '
		<option value="">', $txt['icons_edit_icons_all_boards'], '</option>';
    }
    foreach ($context['categories'] as $category) {
        echo '
		<optgroup label="', $category['name'], '">';
        foreach ($category['boards'] as $board) {
            echo '
			<option value="', $board['id'], '"', !empty($board['selected']) ? ' selected="selected"' : '', !empty($context['current_board']) && $board['id'] == $context['current_board'] && $context['boards_current_disabled'] ? ' disabled="disabled"' : '', '>', $board['child_level'] > 0 ? str_repeat('&#8195;', $board['child_level'] - 1) . '&#8195;' . (isBrowser('ie8') ? '&#187;' : '&#10148;') : '', $board['name'], '</option>';
        }
        echo '
		</optgroup>';
    }
    echo '
	</select>';
}
开发者ID:kode54,项目名称:hydrogenaudio-elkarte-theme,代码行数:34,代码来源:GenericHelpers.template.php


示例2: iCalDownload

/**
 * This function offers up a download of an event in iCal 2.0 format.
 *
 * follows the conventions in RFC5546 http://tools.ietf.org/html/rfc5546
 * sets events as all day events since we don't have hourly events
 * will honor and set multi day events
 * sets a sequence number if the event has been modified
 *
 * @todo .... allow for week or month export files as well?
 */
function iCalDownload()
{
    global $smcFunc, $sourcedir, $forum_version, $context, $modSettings, $webmaster_email, $mbname;
    // You can't export if the calendar export feature is off.
    if (empty($modSettings['cal_export'])) {
        fatal_lang_error('calendar_export_off', false);
    }
    // Goes without saying that this is required.
    if (!isset($_REQUEST['eventid'])) {
        fatal_lang_error('no_access', false);
    }
    // This is kinda wanted.
    require_once $sourcedir . '/Subs-Calendar.php';
    // Load up the event in question and check it exists.
    $event = getEventProperties($_REQUEST['eventid']);
    if ($event === false) {
        fatal_lang_error('no_access', false);
    }
    // Check the title isn't too long - iCal requires some formatting if so.
    $title = str_split($event['title'], 30);
    foreach ($title as $id => $line) {
        if ($id != 0) {
            $title[$id] = ' ' . $title[$id];
        }
        $title[$id] .= "\n";
    }
    // Format the dates.
    $datestamp = date('Ymd\\THis\\Z', time());
    $datestart = $event['year'] . ($event['month'] < 10 ? '0' . $event['month'] : $event['month']) . ($event['day'] < 10 ? '0' . $event['day'] : $event['day']);
    // Do we have a event that spans several days?
    if ($event['span'] > 1) {
        $dateend = strtotime($event['year'] . '-' . ($event['month'] < 10 ? '0' . $event['month'] : $event['month']) . '-' . ($event['day'] < 10 ? '0' . $event['day'] : $event['day']));
        $dateend += ($event['span'] - 1) * 86400;
        $dateend = date('Ymd', $dateend);
    }
    // This is what we will be sending later
    $filecontents = '';
    $filecontents .= 'BEGIN:VCALENDAR' . "\n";
    $filecontents .= 'METHOD:PUBLISH' . "\n";
    $filecontents .= 'PRODID:-//SimpleMachines//SMF ' . (empty($forum_version) ? 2.0 : strtr($forum_version, array('SMF ' => ''))) . '//EN' . "\n";
    $filecontents .= 'VERSION:2.0' . "\n";
    $filecontents .= 'BEGIN:VEVENT' . "\n";
    $filecontents .= 'ORGANIZER;CN="' . $event['realname'] . '":MAILTO:' . $webmaster_email . "\n";
    $filecontents .= 'DTSTAMP:' . $datestamp . "\n";
    $filecontents .= 'DTSTART;VALUE=DATE:' . $datestart . "\n";
    // more than one day
    if ($event['span'] > 1) {
        $filecontents .= 'DTEND;VALUE=DATE:' . $dateend . "\n";
    }
    // event has changed? advance the sequence for this UID
    if ($event['sequence'] > 0) {
        $filecontents .= 'SEQUENCE:' . $event['sequence'] . "\n";
    }
    $filecontents .= 'SUMMARY:' . implode('', $title);
    $filecontents .= 'UID:' . $event['eventid'] . '@' . str_replace(' ', '-', $mbname) . "\n";
    $filecontents .= 'END:VEVENT' . "\n";
    $filecontents .= 'END:VCALENDAR';
    // Send some standard headers.
    ob_end_clean();
    if (!empty($modSettings['enableCompressedOutput'])) {
        @ob_start('ob_gzhandler');
    } else {
        ob_start();
    }
    // Send the file headers
    header('Pragma: ');
    header('Cache-Control: no-cache');
    if (!isBrowser('gecko')) {
        header('Content-Transfer-Encoding: binary');
    }
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 525600 * 60) . ' GMT');
    header('Last-Modified: ' . gmdate('D, d M Y H:i:s', time()) . 'GMT');
    header('Accept-Ranges: bytes');
    header('Connection: close');
    header('Content-Disposition: attachment; filename="' . $event['title'] . '.ics"');
    if (empty($modSettings['enableCompressedOutput'])) {
        header('Content-Length: ' . $smcFunc['strlen']($filecontents));
    }
    // This is a calendar item!
    header('Content-Type: text/calendar');
    // Chuck out the card.
    echo $filecontents;
    // Off we pop - lovely!
    obExit(false);
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:95,代码来源:Calendar.php


示例3: template_results


//.........这里部分代码省略.........
                    echo '
							<input type="checkbox" name="topics[]" value="', $topic['id'], '" class="input_check" />';
                } else {
                    if ($topic['quick_mod']['remove']) {
                        echo '
							<a href="', $scripturl, '?action=quickmod;actions%5B', $topic['id'], '%5D=remove;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_remove.png" style="width: 16px;" alt="', $txt['remove_topic'], '" title="', $txt['remove_topic'], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock']) {
                        echo '
							<a href="', $scripturl, '?action=quickmod;actions%5B', $topic['id'], '%5D=lock;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_lock.png" style="width: 16px;" alt="', $txt[$topic['is_locked'] ? 'set_unlock' : 'set_lock'], '" title="', $txt[$topic['is_locked'] ? 'set_unlock' : 'set_lock'], '" /></a>';
                    }
                    if ($topic['quick_mod']['lock'] || $topic['quick_mod']['remove']) {
                        echo '
							<br />';
                    }
                    if ($topic['quick_mod']['sticky']) {
                        echo '
							<a href="', $scripturl, '?action=quickmod;actions%5B', $topic['id'], '%5D=sticky;', $context['session_var'], '=', $context['session_id'], '" onclick="return confirm(\'', $txt['quickmod_confirm'], '\');"><img src="', $settings['images_url'], '/icons/quick_sticky.png" style="width: 16px;" alt="', $txt[$topic['is_sticky'] ? 'set_nonsticky' : 'set_sticky'], '" title="', $txt[$topic['is_sticky'] ? 'set_nonsticky' : 'set_sticky'], '" /></a>';
                    }
                    if ($topic['quick_mod']['move']) {
                        echo '
							<a href="', $scripturl, '?action=movetopic;topic=', $topic['id'], '.0"><img src="', $settings['images_url'], '/icons/quick_move.png" style="width: 16px;" alt="', $txt['move_topic'], '" title="', $txt['move_topic'], '" /></a>';
                    }
                }
                echo '
						</p>';
            }
            echo '
					</li>';
        }
    }
    echo '
				</ul>';
    // If we have results show a page index
    if (!empty($context['topics'])) {
        template_pagesection();
    }
    // Quick moderation enabled, then show an action area
    if (!empty($context['topics']) && !empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1) {
        echo '
				<div class="search_controls floatright">
					<div class="additional_row">
						<select class="qaction" name="qaction"', $context['can_move'] ? ' onchange="this.form.move_to.disabled = (this.options[this.selectedIndex].value != \'move\');"' : '', '>
							<option value="">&nbsp;</option>';
        foreach ($context['qmod_actions'] as $qmod_action) {
            if ($context['can_' . $qmod_action]) {
                echo '
							<option value="' . $qmod_action . '">' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;', $txt['quick_mod_' . $qmod_action] . '</option>';
            }
        }
        echo '
						</select>';
        // Show a list of boards they can move the topic to.
        if ($context['can_move']) {
            echo '
						<span id="quick_mod_jump_to">&nbsp;</span>';
        }
        echo '
						<input type="hidden" name="redirect_url" value="', $scripturl . '?action=search;sa=results;params=' . $context['params'], '" />
						<input class="button_submit" type="submit" value="', $txt['quick_mod_go'], '" onclick="return document.forms.topicForm.qaction.value != \'\' &amp;&amp; confirm(\'', $txt['quickmod_confirm'], '\');" />

					</div>
				</div>';
        echo '
				<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '" />
			</form>';
    }
    // Show a jump to box for easy navigation.
    echo '
			<div class="floatright" id="search_jump_to">&nbsp;</div>';
    if (!empty($options['display_quick_mod']) && $options['display_quick_mod'] == 1 && !empty($context['topics']) && $context['can_move']) {
        addInlineJavascript('
		aJumpTo[aJumpTo.length] = new JumpTo({
			sContainerId: "quick_mod_jump_to",
			sClassName: "qaction",
			sJumpToTemplate: "%dropdown_list%",
			sCurBoardName: "' . $context['jump_to']['board_name'] . '",
			sBoardChildLevelIndicator: "&#8195;",
			sBoardPrefix: "' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;",
			sCatClass: "jump_to_header",
			sCatPrefix: "",
			bNoRedirect: true,
			bDisabled: true,
			sCustomName: "move_to"
		});', true);
    }
    addInlineJavascript('
		aJumpTo[aJumpTo.length] = new JumpTo({
			sContainerId: "search_jump_to",
			sJumpToTemplate: "<label class=\\"smalltext\\" for=\\"%select_id%\\">' . $context['jump_to']['label'] . ':<" + "/label> %dropdown_list%",
			iCurBoardId: 0,
			iCurBoardChildLevel: 0,
			sCurBoardName: "' . $context['jump_to']['board_name'] . '",
			sBoardChildLevelIndicator: "&#8195;",
			sBoardPrefix: "' . (isBrowser('ie8') ? '&#187;' : '&#10148;') . '&nbsp;",
			sCatClass: "jump_to_header",
			sCatPrefix: "",
			sGoButtonLabel: "' . $txt['quick_mod_go'] . '"
		});', true);
}
开发者ID:kode54,项目名称:hydrogenaudio-elkarte-theme,代码行数:101,代码来源:Search.template.php


示例4: html_to_bbc

/**
 * !!!Compatibility!!!
 *
 * This is not directly required any longer, but left for mod usage
 *
 * The harder one - wysiwyg to BBC!
 *
 * @param string $text
 * @return string
 */
function html_to_bbc($text)
{
    global $modSettings, $scripturl, $context;
    $db = database();
    // Replace newlines with spaces, as that's how browsers usually interpret them.
    $text = preg_replace("~\\s*[\r\n]+\\s*~", ' ', $text);
    // Though some of us love paragraphs, the parser will do better with breaks.
    $text = preg_replace('~</p>\\s*?<p~i', '</p><br /><p', $text);
    $text = preg_replace('~</p>\\s*(?!<)~i', '</p><br />', $text);
    // Safari/webkit wraps lines in Wysiwyg in <div>'s.
    if (isBrowser('webkit')) {
        $text = preg_replace(array('~<div(?:\\s(?:[^<>]*?))?' . '>~i', '</div>'), array('<br />', ''), $text);
    }
    // If there's a trailing break get rid of it - Firefox tends to add one.
    $text = preg_replace('~<br\\s?/?' . '>$~i', '', $text);
    // Remove any formatting within code tags.
    if (strpos($text, '[code') !== false) {
        $text = preg_replace('~<br\\s?/?' . '>~i', '#elk_br_spec_grudge_cool!#', $text);
        $parts = preg_split('~(\\[/code\\]|\\[code(?:=[^\\]]+)?\\])~i', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
        // Only mess with stuff outside [code] tags.
        for ($i = 0, $n = count($parts); $i < $n; $i++) {
            // Value of 2 means we're inside the tag.
            if ($i % 4 == 2) {
                $parts[$i] = strip_tags($parts[$i]);
            }
        }
        $text = strtr(implode('', $parts), array('#elk_br_spec_grudge_cool!#' => '<br />'));
    }
    // Remove scripts, style and comment blocks.
    $text = preg_replace('~<script[^>]*[^/]?' . '>.*?</script>~i', '', $text);
    $text = preg_replace('~<style[^>]*[^/]?' . '>.*?</style>~i', '', $text);
    $text = preg_replace('~\\<\\!--.*?-->~i', '', $text);
    $text = preg_replace('~\\<\\!\\[CDATA\\[.*?\\]\\]\\>~i', '', $text);
    // Do the smileys ultra first!
    preg_match_all('~<img\\s+[^<>]*?id="*smiley_\\d+_([^<>]+?)[\\s"/>]\\s*[^<>]*?/*>(?:\\s)?~i', $text, $matches);
    if (!empty($matches[0])) {
        // Easy if it's not custom.
        if (empty($modSettings['smiley_enable'])) {
            $smileysfrom = array('>:D', ':D', '::)', '>:(', ':)', ';)', ';D', ':(', ':o', '8)', ':P', '???', ':-[', ':-X', ':-*', ':\'(', ':-\\', '^-^', 'O0', 'C:-)', '0:)');
            $smileysto = array('evil.gif', 'cheesy.gif', 'rolleyes.gif', 'angry.gif', 'smiley.gif', 'wink.gif', 'grin.gif', 'sad.gif', 'shocked.gif', 'cool.gif', 'tongue.gif', 'huh.gif', 'embarrassed.gif', 'lipsrsealed.gif', 'kiss.gif', 'cry.gif', 'undecided.gif', 'azn.gif', 'afro.gif', 'police.gif', 'angel.gif');
            foreach ($matches[1] as $k => $file) {
                $found = array_search($file, $smileysto);
                // Note the weirdness here is to stop double spaces between smileys.
                if ($found) {
                    $matches[1][$k] = '-[]-elk_smily_start#|#' . htmlspecialchars($smileysfrom[$found]) . '-[]-elk_smily_end#|#';
                } else {
                    $matches[1][$k] = '';
                }
            }
        } else {
            // Load all the smileys.
            $names = array();
            foreach ($matches[1] as $file) {
                $names[] = $file;
            }
            $names = array_unique($names);
            if (!empty($names)) {
                $request = $db->query('', '
					SELECT code, filename
					FROM {db_prefix}smileys
					WHERE filename IN ({array_string:smiley_filenames})', array('smiley_filenames' => $names));
                $mappings = array();
                while ($row = $db->fetch_assoc($request)) {
                    $mappings[$row['filename']] = htmlspecialchars($row['code']);
                }
                $db->free_result($request);
                foreach ($matches[1] as $k => $file) {
                    if (isset($mappings[$file])) {
                        $matches[1][$k] = '-[]-elk_smily_start#|#' . $mappings[$file] . '-[]-elk_smily_end#|#';
                    }
                }
            }
        }
        // Replace the tags!
        $text = str_replace($matches[0], $matches[1], $text);
        // Now sort out spaces
        $text = str_replace(array('-[]-elk_smily_end#|#-[]-elk_smily_start#|#', '-[]-elk_smily_end#|#', '-[]-elk_smily_start#|#'), ' ', $text);
    }
    // Only try to buy more time if the client didn't quit.
    if (connection_aborted() && $context['server']['is_apache']) {
        @apache_reset_timeout();
    }
    $parts = preg_split('~(<[A-Za-z]+\\s*[^<>]*?style="?[^<>"]+"?[^<>]*?(?:/?)>|</[A-Za-z]+>)~', $text, -1, PREG_SPLIT_DELIM_CAPTURE);
    $replacement = '';
    $stack = array();
    foreach ($parts as $part) {
        if (preg_match('~(<([A-Za-z]+)\\s*[^<>]*?)style="?([^<>"]+)"?([^<>]*?(/?)>)~', $part, $matches) === 1) {
            // If it's being closed instantly, we can't deal with it...yet.
            if ($matches[5] === '/') {
                continue;
//.........这里部分代码省略.........
开发者ID:ahrasis,项目名称:tools,代码行数:101,代码来源:legacyBBC.php


示例5: template_viewmodreport

/**
 * View the details of a moderation report
 */
function template_viewmodreport()
{
    global $context, $scripturl, $txt;
    echo '
					<div id="modcenter">
						<form action="', $scripturl, '?action=moderate;area=reports;report=', $context['report']['id'], '" method="post" accept-charset="UTF-8">
							<h3 class="category_header">
								', sprintf($txt['mc_viewmodreport'], $context['report']['message_link'], $context['report']['author']['link']), '
							</h3>
							<div class="windowbg2">
								<p class="warningbox">', sprintf($txt['mc_modreport_summary'], $context['report']['num_reports'], $context['report']['last_updated']), '</p>
								<div class="content">
									', $context['report']['body'], '
								</div>
								<ul class="quickbuttons">
									<li class="listlevel1">
										<a class="linklevel1 close_button" href="', $scripturl, '?action=moderate;area=reports;close=', (int) (!$context['report']['closed']), ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '">', $context['report']['closed'] ? $txt['mc_reportedp_open'] : $txt['mc_reportedp_close'], '</a>
									</li>
									<li class="listlevel1">
										<a class="linklevel1 ignore_button" href="', $scripturl, '?action=moderate;area=reports;ignore=', (int) (!$context['report']['ignore']), ';rid=', $context['report']['id'], ';', $context['session_var'], '=', $context['session_id'], '" ', !$context['report']['ignore'] ? 'onclick="return confirm(' . JavaScriptEscape($txt['mc_reportedp_ignore_confirm']) . ');"' : '', '>', $context['report']['ignore'] ? $txt['mc_reportedp_unignore'] : $txt['mc_reportedp_ignore'], '</a>
									</li>
								</ul>
							</div>
							<h3 class="category_header">', $txt['mc_modreport_whoreported_title'], '</h3>';
    foreach ($context['report']['comments'] as $comment) {
        echo '
							<div class="windowbg">
								<div class="content">
									<p class="smalltext">', sprintf($txt['mc_modreport_whoreported_data'], $comment['member']['link'] . (empty($comment['member']['id']) && !empty($comment['member']['ip']) ? ' (' . $comment['member']['ip'] . ')' : ''), $comment['time']), '</p>
									<p>', $comment['message'], '</p>
								</div>
							</div>';
    }
    echo '
							<h3 class="category_header">', $txt['mc_modreport_mod_comments'], '</h3>
							<div class="windowbg2">
								<div class="content">';
    if (empty($context['report']['mod_comments'])) {
        echo '
									<p class="successbox">', $txt['mc_modreport_no_mod_comment'], '</p>';
    }
    foreach ($context['report']['mod_comments'] as $comment) {
        echo '<p>', $comment['member']['link'], ': ', $comment['message'], ' <em class="smalltext">(', $comment['time'], ')</em></p>';
    }
    echo '
									<textarea rows="2" cols="60" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 60%; min-width: 60%' : 'width: 100%') . ';" name="mod_comment"></textarea>
									<div class="submitbutton">
										<input type="submit" name="add_comment" value="', $txt['mc_modreport_add_mod_comment'], '" class="button_submit" />
									</div>
								</div>
							</div>';
    template_show_list('moderation_actions_list');
    echo '
							<input type="hidden" name="', $context['session_var'], '" value="', $context['session_id'], '" />
						</form>
					</div>';
}
开发者ID:kode54,项目名称:hydrogenaudio-elkarte-theme,代码行数:60,代码来源:ModerationCenter.template.php


示例6: template_html_above

/**
 * The main sub template above the content.
 */
function template_html_above()
{
    global $context, $settings, $scripturl, $txt, $modSettings;
    // Show right to left and the character set for ease of translating.
    echo '<!DOCTYPE html>
<html ', $context['right_to_left'] ? ' dir="rtl"' : '', '>
<head>
	<title>', $context['page_title_html_safe'], '</title>';
    // Tell IE to render the page in standards not compatibility mode. really for ie >= 8
    // Note if this is not in the first 4k, its ignored, thats why its here
    if (isBrowser('ie')) {
        echo '
	<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />';
    }
    // load in any css from mods or themes so they can overwrite if wanted
    template_css();
    // Save some database hits, if a width for multiple wrappers is set in admin.
    if (!empty($settings['forum_width'])) {
        echo '
	<style>
		#wrapper, .frame {
			width: ', $settings['forum_width'], ';
		}
	</style>';
    }
    // Quick and dirty testing of RTL horrors. Remove before production build.
    //echo '
    //<link rel="stylesheet" href="', $settings['theme_url'], '/css/rtl.css?alp21" />';
    // RTL languages require an additional stylesheet.
    if ($context['right_to_left']) {
        echo '
		<link rel="stylesheet" href="', $settings['theme_url'], '/css/rtl.css?alp21" />';
        if (!empty($context['theme_variant'])) {
            echo '
		<link rel="stylesheet" href="', $settings['theme_url'], '/css/rtl', $context['theme_variant'], '.css?alp21" />';
        }
    }
    echo '
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="viewport" content="width=device-width" />
	<meta name="description" content="', $context['page_title_html_safe'], '" />', !empty($context['meta_keywords']) ? '
	<meta name="keywords" content="' . $context['meta_keywords'] . '" />' : '';
    // Please don't index these Mr Robot.
    if (!empty($context['robot_no_index'])) {
        echo '
	<meta name="robots" content="noindex" />';
    }
    // Present a canonical url for search engines to prevent duplicate content in their indices.
    if (!empty($context['canonical_url'])) {
        echo '
	<link rel="canonical" href="', $context['canonical_url'], '" />';
    }
    // Show all the relative links, such as help, search, contents, and the like.
    echo '
	<link rel="help" href="', $scripturl, '?action=help" />
	<link rel="contents" href="', $scripturl, '" />', $context['allow_search'] ? '
	<link rel="search" href="' . $scripturl . '?action=search" />' : '';
    // If RSS feeds are enabled, advertise the presence of one.
    if (!empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged'])) {
        echo '
	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['rss'], '" href="', $scripturl, '?type=rss2;action=.xml" />
	<link rel="alternate" type="application/rss+xml" title="', $context['forum_name_html_safe'], ' - ', $txt['atom'], '" href="', $scripturl, '?type=atom;action=.xml" />';
    }
    // If we're viewing a topic, these should be the previous and next topics, respectively.
    if (!empty($context['links']['next'])) {
        echo '<link rel="next" href="', $context['links']['next'], '" />';
    } else {
        if (!empty($context['current_topic'])) {
            echo '<link rel="next" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=next" />';
        }
    }
    if (!empty($context['links']['prev'])) {
        echo '<link rel="prev" href="', $context['links']['prev'], '" />';
    } else {
        if (!empty($context['current_topic'])) {
            echo '<link rel="prev" href="', $scripturl, '?topic=', $context['current_topic'], '.0;prev_next=prev" />';
        }
    }
    // If we're in a board, or a topic for that matter, the index will be the board's index.
    if (!empty($context['current_board'])) {
        echo '
	<link rel="index" href="', $scripturl, '?board=', $context['current_board'], '.0" />';
    }
    // load in any javascript files from mods and themes
    template_javascript();
    // Output any remaining HTML headers. (from mods, maybe?)
    echo $context['html_headers'];
    // A little help for our friends
    echo '
	<!--[if lt IE 9]>
		<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->';
    echo '
</head>
<body id="', $context['browser_body_id'], '" class="action_', !empty($context['current_action']) ? htmlspecialchars($context['current_action']) : (!empty($context['current_board']) ? 'messageindex' : (!empty($context['current_topic']) ? 'display' : 'home')), !empty($context['current_board']) ? ' board_' . htmlspecialchars($context['current_board']) : '', '">';
}
开发者ID:ahrasis,项目名称:themes,代码行数:99,代码来源:index.template.php


示例7: action_coppa

 /**
  * This function will display the contact information for the forum, as well a form to fill in.
  * Accessed by action=coppa
  */
 public function action_coppa()
 {
     global $context, $modSettings, $txt;
     loadLanguage('Login');
     loadTemplate('Register');
     // No User ID??
     if (!isset($_GET['member'])) {
         fatal_lang_error('no_access', false);
     }
     // Get the user details...
     require_once SUBSDIR . '/Members.subs.php';
     $member = getBasicMemberData((int) $_GET['member'], array('authentication' => true));
     // If doesn't exist or not pending coppa
     if (empty($member) || $member['is_activated'] != 5) {
         fatal_lang_error('no_access', false);
     }
     if (isset($_GET['form'])) {
         // Some simple contact stuff for the forum.
         $context['forum_contacts'] = (!empty($modSettings['coppaPost']) ? $modSettings['coppaPost'] . '<br /><br />' : '') . (!empty($modSettings['coppaFax']) ? $modSettings['coppaFax'] . '<br />' : '');
         $context['forum_contacts'] = !empty($context['forum_contacts']) ? $context['forum_name_html_safe'] . '<br />' . $context['forum_contacts'] : '';
         // Showing template?
         if (!isset($_GET['dl'])) {
             // Shortcut for producing underlines.
             $context['ul'] = '<u>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</u>';
             Template_Layers::getInstance()->removeAll();
             $context['sub_template'] = 'coppa_form';
             $context['page_title'] = replaceBasicActionUrl($txt['coppa_form_title']);
             $context['coppa_body'] = str_replace(array('{PARENT_NAME}', '{CHILD_NAME}', '{USER_NAME}'), array($context['ul'], $context['ul'], $member['member_name']), replaceBasicActionUrl($txt['coppa_form_body']));
         } else {
             // The data.
             $ul = '                ';
             $crlf = "\r\n";
             $data = $context['forum_contacts'] . $crlf . $txt['coppa_form_address'] . ':' . $crlf . $txt['coppa_form_date'] . ':' . $crlf . $crlf . $crlf . replaceBasicActionUrl($txt['coppa_form_body']);
             $data = str_replace(array('{PARENT_NAME}', '{CHILD_NAME}', '{USER_NAME}', '<br>', '<br />'), array($ul, $ul, $member['member_name'], $crlf, $crlf), $data);
             // Send the headers.
             header('Connection: close');
             header('Content-Disposition: attachment; filename="approval.txt"');
             header('Content-Type: ' . (isBrowser('ie') || isBrowser('opera') ? 'application/octetstream' : 'application/octet-stream'));
             header('Content-Length: ' . count($data));
             echo $data;
             obExit(false);
         }
     } else {
         $context += array('page_title' => $txt['coppa_title'], 'sub_template' => 'coppa');
         $context['coppa'] = array('body' => str_replace('{MINIMUM_AGE}', $modSettings['coppaAge'], replaceBasicActionUrl($txt['coppa_after_registration'])), 'many_options' => !empty($modSettings['coppaPost']) && !empty($modSettings['coppaFax']), 'post' => empty($modSettings['coppaPost']) ? '' : $modSettings['coppaPost'], 'fax' => empty($modSettings['coppaFax']) ? '' : $modSettings['coppaFax'], 'phone' => empty($modSettings['coppaPhone']) ? '' : str_replace('{PHONE_NUMBER}', $modSettings['coppaPhone'], $txt['coppa_send_by_phone']), 'id' => $_GET['member']);
     }
 }
开发者ID:Ralkage,项目名称:Elkarte,代码行数:51,代码来源:Register.controller.php


示例8: template_groupMembership

function template_groupMembership()
{
    global $context, $settings, $options, $scripturl, $modSettings, $txt;
    // The main containing header.
    echo '
		<form action="', $scripturl, '?action=profile;area=groupmembership;save" method="post" accept-charset="', $context['character_set'], '" name="creator" id="creator">
			<div class="cat_bar">
				<h3 class="catbg">
					<img src="', $settings['images_url'], '/icons/profile_sm.png" alt="" class="icon" />', $txt['profile'], '
				</h3>
			</div>
			<p class="description">', $txt['groupMembership_info'], '</p>';
    // Do we have an update message?
    if (!empty($context['update_message'])) {
        echo '
			<div class="infobox">
				', $context['update_message'], '.
			</div>';
    }
    // Requesting membership to a group?
    if (!empty($context['group_request'])) {
        echo '
			<div class="groupmembership">
				<div class="cat_bar">
					<h3 class="catbg">', $txt['request_group_membership'], '</h3>
				</div>
				<div class="roundframe">
					', $txt['request_group_membership_desc'], ':
					<textarea name="reason" rows="4" style="' . (isBrowser('is_ie8') ? 'width: 635px; max-width: 99%; min-width: 99%' : 'width: 99%') . ';"></textarea>
					<div class="righttext" style="margin: 0.5em 0.5% 0 0.5%;">
						<input type="hidden" name="gid" value="', $context['group_request']['id'], '" />
						<input type="submit" name="req" value="', $txt['submit_request'], '" class="button_submit" />
					</div>
				</div>
			</div>';
    } else {
        echo '
			<table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
				<thead>
					<tr class="catbg">
						<th class="first_th" scope="col" ', $context['can_edit_primary'] ? ' colspan="2"' : '', '>', $txt['current_membergroups'], '</th>
						<th class="last_th" scope="col"></th>
					</tr>
				</thead>
				<tbody>';
        $alternate = true;
        foreach ($context['groups']['member'] as $group) {
            echo '
					<tr class="', $alternate ? 'windowbg' : 'windowbg2', '" id="primdiv_', $group['id'], '">';
            if ($context['can_edit_primary']) {
                echo '
						<td width="4%">
							<input type="radio" name="primary" id="primary_', $group['id'], '" value="', $group['id'], '" ', $group['is_primary'] ? 'checked="checked"' : '', ' onclick="highlightSelected(\'primdiv_' . $group['id'] . '\');" ', $group['can_be_primary'] ? '' : 'disabled="disabled"', ' class="input_radio" />
						</td>';
            }
            echo '
						<td>
							<label for="primary_', $group['id'], '"><strong>', empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>', '</strong>', !empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : '', '</label>
						</td>
						<td width="15%" class="righttext">';
            // Can they leave their group?
            if ($group['can_leave']) {
                echo '
							<a href="' . $scripturl . '?action=profile;save;u=' . $context['id_member'] . ';area=groupmembership;' . $context['session_var'] . '=' . $context['session_id'] . ';gid=' . $group['id'] . ';', $context[$context['token_check'] . '_token_var'], '=', $context[$context['token_check'] . '_token'], '">' . $txt['leave_group'] . '</a>';
            }
            echo '
						</td>
					</tr>';
            $alternate = !$alternate;
        }
        echo '
				</tbody>
			</table>';
        if ($context['can_edit_primary']) {
            echo '
			<div class="padding righttext">
				<input type="submit" value="', $txt['make_primary'], '" class="button_submit" />
			</div>';
        }
        // Any groups they can join?
        if (!empty($context['groups']['available'])) {
            echo '
			<br />
			<table border="0" width="100%" cellspacing="0" cellpadding="4" class="table_grid">
				<thead>
					<tr class="catbg">
						<th class="first_th" scope="col">
							', $txt['available_groups'], '
						</th>
						<th class="last_th" scope="col"></th>
					</tr>
				</thead>
				<tbody>';
            $alternate = true;
            foreach ($context['groups']['available'] as $group) {
                echo '
					<tr class="', $alternate ? 'windowbg' : 'windowbg2', '">
						<td>
							<strong>', empty($group['color']) ? $group['name'] : '<span style="color: ' . $group['color'] . '">' . $group['name'] . '</span>', '</strong>', !empty($group['desc']) ? '<br /><span class="smalltext">' . $group['desc'] . '</span>' : '', '
						</td>
//.........这里部分代码省略.........
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:101,代码来源:Profile.template.php


示例9: BookOfUnknown

function BookOfUnknown()
{
    global $context;
    if (strpos($_GET['action'], 'mozilla') !== false && !isBrowser('gecko')) {
        redirectexit('http://www.getfirefox.com/');
    } elseif (strpos($_GET['action'], 'mozilla') !== false) {
        redirectexit('about:mozilla');
    }
    echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"', $context['right_to_left'] ? ' dir="rtl"' : '', '>
	<head>
		<title>The Book of Unknown, ', @$_GET['verse'] == '2:18' ? '2:18' : '4:16', '</title>
		<style type="text/css">
			em
			{
				font-size: 1.3em;
				line-height: 0;
			}
		</style>
	</head>
	<body style="background-color: #444455; color: white; font-style: italic; font-family: serif;">
		<div style="margin-top: 12%; font-size: 1.1em; line-height: 1.4; text-align: center;">';
    if (@$_GET['verse'] == '2:18') {
        echo '
			Woe, it was that his name wasn\'t <em>known</em>, that he came in mystery, and was recognized by none.&nbsp;And it became to be in those days <em>something</em>.&nbsp; Something not yet <em id="unknown" name="[Unknown]">unknown</em> to mankind.&nbsp; And thus what was to be known the <em>secret project</em> began into its existence.&nbsp; Henceforth the opposition was only <em>weary</em> and <em>fearful</em>, for now their match was at arms against them.';
    } else {
        echo '
			And it came to pass that the <em>unbelievers</em> dwindled in number and saw rise of many <em>proselytizers</em>, and the opposition found fear in the face of the <em>x</em> and the <em>j</em> while those who stood with the <em>something</em> grew stronger and came together.&nbsp; Still, this was only the <em>beginning</em>, and what lay in the future was <em id="unknown" name="[Unknown]">unknown</em> to all, even those on the right side.';
    }
    echo '
		</div>
		<div style="margin-top: 2ex; font-size: 2em; text-align: right;">';
    if (@$_GET['verse'] == '2:18') {
        echo '
			from <span style="font-family: Georgia, serif;"><strong><a href="http://www.unknownbrackets.com/about:unknown" style="color: white; text-decoration: none; cursor: text;">The Book of Unknown</a></strong>, 2:18</span>';
    } else {
        echo '
			from <span style="font-family: Georgia, serif;"><strong><a href="http://www.unknownbrackets.com/about:unknown" style="color: white; text-decoration: none; cursor: text;">The Book of Unknown</a></strong>, 4:16</span>';
    }
    echo '
		</div>
	</body>
</html>';
    obExit(false);
}
开发者ID:Glyph13,项目名称:SMF2.1,代码行数:45,代码来源:Karma.php


示例10: action_browse

    /**
     * List all members who are awaiting approval / activation, sortable on different columns.
     *
     * What it does:
     * - It allows instant approval or activation of (a selection of) members.
     * - Called by ?action=admin;area=viewmembers;sa=browse;type=approve
     * or ?action=admin;area=viewmembers;sa=browse;type=activate.
     * - The form submits to ?action=admin;area=viewmembers;sa=approve.
     * - Requires the moderate_forum permission.
     *
     * @uses the admin_browse sub template of the ManageMembers template.
     */
    public function action_browse()
    {
        global $txt, $context, $scripturl, $modSettings;
        // Not a lot here!
        $context['page_title'] = $txt['admin_members'];
        $context['sub_template'] = 'admin_browse';
        $context['browse_type'] = isset($_REQUEST['type']) ? $_REQUEST['type'] : (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 1 ? 'activate' : 'approve');
        if (isset($context['tabs'][$context['browse_type']])) {
            $context['tabs'][$context['browse_type']]['is_selected'] = true;
        }
        // Allowed filters are those we can have, in theory.
        $context['allowed_filters'] = $context['browse_type'] == 'approve' ? array(3, 4, 5) : array(0, 2);
        $context['current_filter'] = isset($_REQUEST['filter']) && in_array($_REQUEST['filter'], $context['allowed_filters']) && !empty($context['activation_numbers'][$_REQUEST['filter']]) ? (int) $_REQUEST['filter'] : -1;
        // Sort out the different sub areas that we can actually filter by.
        $context['available_filters'] = array();
        foreach ($context['activation_numbers'] as $type => $amount) {
            // We have some of these...
            if (in_array($type, $context['allowed_filters']) && $amount > 0) {
                $context['available_filters'][] = array('type' => $type, 'amount' => $amount, 'desc' => isset($txt['admin_browse_filter_type_' . $type]) ? $txt['admin_browse_filter_type_' . $type] : '?', 'selected' => $type == $context['current_filter']);
            }
        }
        // If the filter was not sent, set it to whatever has people in it!
        if ($context['current_filter'] == -1 && !empty($context['available_filters'][0]['amount'])) {
            $context['current_filter'] = $context['available_filters'][0]['type'];
            $context['available_filters'][0]['selected'] = true;
        }
        // This little variable is used to determine if we should flag where we are looking.
        $context['show_filter'] = $context['current_filter'] != 0 && $context['current_filter'] != 3 || count($context['available_filters']) > 1;
        // The columns that can be sorted.
        $context['columns'] = array('id_member' => array('label' => $txt['admin_browse_id']), 'member_name' => array('label' => $txt['admin_browse_username']), 'email_address' => array('label' => $txt['admin_browse_email']), 'member_ip' => array('label' => $txt['admin_browse_ip']), 'date_registered' => array('label' => $txt['admin_browse_registered']));
        // Are we showing duplicate information?
        if (isset($_GET['showdupes'])) {
            $_SESSION['showdupes'] = (int) $_GET['showdupes'];
        }
        $context['show_duplicates'] = !empty($_SESSION['showdupes']);
        // Determine which actions we should allow on this page.
        if ($context['browse_type'] == 'approve') {
            // If we are approving deleted accounts we have a slightly different list... actually a mirror ;)
            if ($context['current_filter'] == 4) {
                $context['allowed_actions'] = array('reject' => $txt['admin_browse_w_approve_deletion'], 'ok' => $txt['admin_browse_w_reject']);
            } else {
                $context['allowed_actions'] = array('ok' => $txt['admin_browse_w_approve'], 'okemail' => $txt['admin_browse_w_approve'] . ' ' . $txt['admin_browse_w_email'], 'require_activation' => $txt['admin_browse_w_approve_require_activate'], 'reject' => $txt['admin_browse_w_reject'], 'rejectemail' => $txt['admin_browse_w_reject'] . ' ' . $txt['admin_browse_w_email']);
            }
        } elseif ($context['browse_type'] == 'activate') {
            $context['allowed_actions'] = array('ok' => $txt['admin_browse_w_activate'], 'okemail' => $txt['admin_browse_w_activate'] . ' ' . $txt['admin_browse_w_email'], 'delete' => $txt['admin_browse_w_delete'], 'deleteemail' => $txt['admin_browse_w_delete'] . ' ' . $txt['admin_browse_w_email'], 'remind' => $txt['admin_browse_w_remind'] . ' ' . $txt['admin_browse_w_email']);
        }
        // Create an option list for actions allowed to be done with selected members.
        $allowed_actions = '
				<option selected="selected" value="">' . $txt['admin_browse_with_selected'] . ':</option>
				<option value="" disabled="disabled">' . str_repeat('&#8212;', strlen($txt['admin_browse_with_selected'])) . '</option>';
        // ie8 fonts don't have the glyph coverage we desire
        $arrow = isBrowser('ie8') ? '&#187;&nbsp;' : '&#10148;&nbsp;';
        foreach ($context['allowed_actions'] as $key => $desc) {
            $allowed_actions .= '
				<option value="' . $key . '">' . $arrow . $desc . '</option>';
        }
        // Setup the Javascript function for selecting an action for the list.
        $javascript = '
			function onSelectChange()
			{
				if (document.forms.postForm.todo.value == "")
					return;

				var message = "";';
        // We have special messages for approving deletion of accounts - it's surprisingly logical - honest.
        if ($context['current_filter'] == 4) {
            $javascript .= '
				if (document.forms.postForm.todo.value.indexOf("reject") != -1)
					message = "' . $txt['admin_browse_w_delete'] . '";
				else
					message = "' . $txt['admin_browse_w_reject'] . '";';
        } else {
            $javascript .= '
				if (document.forms.postForm.todo.value.indexOf("delete") != -1)
					message = "' . $txt['admin_browse_w_delete'] . '";
				else if (document.forms.postForm.todo.value.indexOf("reject") != -1)
					message = "' . $txt['admin_browse_w_reject'] . '";
				else if (document.forms.postForm.todo.value == "remind")
					message = "' . $txt['admin_browse_w_remind'] . '";
				else
					message = "' . ($context['browse_type'] == 'approve' ? $txt['admin_browse_w_approve'] : $txt['admin_browse_w_activate']) . '";';
        }
        $javascript .= '
				if (confirm(message + " ' . $txt['admin_browse_warn'] . '"))
					document.forms.postForm.submit();
			}';
        $listOptions = array('id' => 'approve_list', 'items_per_page' => $modSettings['defaultMaxMembers'], 'base_href' => $scripturl . '?action=admin;area=viewmembers;sa=browse;type=' . $context['browse_type'] . (!empty($context['show_filter']) ? ';filter=' . $context['current_filter'] : ''), 'default_sort_col' => 'date_registered', 'get_items' => array('file' => SUBSDIR . '/Members.subs.php', 'function' => 'list_getMembers', 'params' => array('is_activated = {int:activated_status}', array('activated_status' => $context['current_filter']), $context['show_duplicates'])), 'get_count' => array('file' => SUBSDIR . '/Members.subs.php', 'function' => 'list_getNumMembers', 'params' => array('is_activated = {int:activated_status}', array('activated_status' => $context['current_filter']))), 'columns' => array('id_member' => array('header' => array('value' => $txt['member_id']), 'data' => array('db' => 'id_member'), 'sort' => array('default' => 'id_member', 'reverse' => 'id_member DESC')), 'user_name' => array('header' => array('value' => $txt['username']), 'data' => array('sprintf' => array('format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=profile;u=%1$d">%2$s</a>', 'params' => array('id_member' => false, 'member_name' => false))), 'sort' => array('default' => 'member_name', 'reverse' => 'member_name DESC')), 'email' => array('header' => array('value' => $txt['email_address']), 'data' => array('sprintf' => array('format' => '<a href="mailto:%1$s">%1$s</a>', 'params' => array('email_address' => true))), 'sort' => array('default' => 'email_address', 'reverse' => 'email_address DESC')), 'ip' => array('header' => array('value' => $txt['ip_address']), 'data' => array('sprintf' => array('format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=trackip;searchip=%1$s">%1$s</a>', 'params' => array('member_ip' => false))), 'sort' => array('default' => 'INET_ATON(member_ip)', 'reverse' => 'INET_ATON(member_ip) DESC')), 'hostname' => array('header' => array('value' => $txt['hostname']), 'data' => array('function' => create_function('$rowData', '
							return host_from_ip($rowData[\'member_ip\']);
//.........这里部分代码省略.........
开发者ID:KeiroD,项目名称:Elkarte,代码行数:101,代码来源:ManageMembers.controller.php


示例11: template_groupMembership


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP isCaptchaEnabled函数代码示例发布时间:2022-05-15
下一篇:
PHP isBlocked函数代码示例发布时间: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