本文整理汇总了PHP中theme_linktree函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_linktree函数的具体用法?PHP theme_linktree怎么用?PHP theme_linktree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_linktree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: template_shop_above
function template_shop_above()
{
global $txt, $context, $modSettings, $scripturl;
// Doing nothing? So be it :P
if (!isset($context['shop_do'])) {
$context['shop_do'] = '';
}
// TODO: Simplify the code (for the links) below?
echo '
<!-- The Linktree -->
<table width="100%" cellpadding="3" cellspacing="0"><tr><td valign="bottom">', theme_linktree(), '</td></tr></table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" style="padding-top: 1ex;"><tr>
<td width="180" valign="top" style="width: 26ex; padding-right: 10px; padding-bottom: 10px;">
<table width="100%" cellpadding="4" cellspacing="1" border="0" class="bordercolor">
<tr>
<td class="catbg">', $txt['shop'], ' Stuff</td>
</tr>
<tr class="windowbg2">
<td class="smalltext" style="line-height: 1.3; padding-bottom: 3ex;">
', $context['shop_do'] == 'main' ? '<b>' : '', '<a href="', $scripturl, '?action=shop">', $txt['shop'], ' Home</a>', $context['shop_do'] == 'main' ? '</b>' : '', '<br />';
// Allowed to buy stuff?
if (allowedTo('shop_buy')) {
echo '
', ($context['shop_do'] == 'buy' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=buy">' . $txt['shop_buy'] . '</a>' . ($context['shop_do'] == 'buy' ? '</b>' : '') . '<br />';
}
// The inventory - Everyone can access this!
echo '
', ($context['shop_do'] == 'inv' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=inv">' . $txt['shop_yourinv'] . '</a>' . ($context['shop_do'] == 'inv' ? '</b>' : ''), '<br />';
// Allowed to send money to other people
if (allowedTo('shop_sendmoney')) {
echo '
', ($context['shop_do'] == 'sendmoney' ? '<b>' : '') . '<a href="' . $scripturl . '?action=shop;do=sendmoney">' . $txt['shop_send_money'] . '</a>' . ($context['shop_do'] == 'sendmoney' ? '</b>' : '') . '<br />';
}
// Allowed to send items to other people?
if (allowedTo('shop_senditems')) {
echo '
', $context['shop_do'] == 'senditems' ? '<b>' : '', '<a href="' . $scripturl . '?action=shop;do=senditems">' . $txt['shop_send_item'] . '</a>' . ($context['shop_do'] == 'senditems' ? '</b>' : ''), '<br />';
}
// Allowed to view inventory of others?
if (allowedTo('shop_invother')) {
echo '
', $context['shop_do'] == 'invother' ? '<b>' : '', '<a href="' . $scripturl . '?action=shop;do=invother">' . $txt['shop_invother'] . '</a>' . ($context['shop_do'] == 'invother' ? '</b>' : ''), '<br />';
}
// Allowed to access the bank?
if (allowedTo('shop_bank')) {
echo '
', ($context['shop_do'] == 'bank' ? '<b>' : '') . $modSettings['shopBankEnabled'] ? '<a href="' . $scripturl . '?action=shop;do=bank">' . $txt['shop_bank'] . '</a><br />' : '' . ($context['shop_do'] == 'bank' ? '</b>' : '');
}
// Allowed to access the trade centre?
if (allowedTo('shop_trade')) {
echo '
', ($context['shop_do'] == 'trade' ? '<b>' : '') . $modSettings['shopTradeEnabled'] ? '<a href="' . $scripturl . '?action=shop;do=trade">' . $txt['shop_trade'] . '</a><br />' : '', $context['shop_do'] == 'trade' ? '</b>' : '';
}
echo '
</td>
</tr>
</table>
</td>
<td valign="top">';
}
示例2: template_pm_above
function template_pm_above()
{
global $context, $settings, $options, $txt;
echo '
<div style="padding: 3px;">', theme_linktree(), '</div>';
echo '
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr>
<td width="125" valign="top">
<table border="0" cellpadding="4" cellspacing="1" class="bordercolor" width="100">';
// Loop through every main area - giving a nice section heading.
foreach ($context['pm_areas'] as $section) {
echo '
<tr>
<td class="catbg">', $section['title'], '</td>
</tr>
<tr class="windowbg2">
<td class="smalltext" style="padding-bottom: 2ex;">';
// Each sub area.
foreach ($section['areas'] as $i => $area) {
if (empty($area)) {
echo '<br />';
} elseif (!empty($area['limit_bar'])) {
// !!! Hardcoded colors = bad.
echo '
<br /><br />
<div align="center">
<b>', $txt['pm_capacity'], '</b>
<div align="left" style="border: 1px solid black; height: 7px; width: 100px;">
<div style="border: 0; background-color: ', $context['limit_bar']['percent'] > 85 ? '#A53D05' : ($context['limit_bar']['percent'] > 40 ? '#EEA800' : '#468008'), '; height: 7px; width: ', $context['limit_bar']['bar'], 'px;"></div>
</div>
<span', $context['limit_bar']['percent'] > 90 ? ' style="color: red;"' : '', '>', $context['limit_bar']['text'], '</span>
</div>
<br />';
} else {
if ($i == $context['pm_area']) {
echo '
<b>', $area['link'], empty($area['unread_messages']) ? '' : ' (<b>' . $area['unread_messages'] . '</b>)', '</b><br />';
} else {
echo '
', $area['link'], empty($area['unread_messages']) ? '' : ' (<b>' . $area['unread_messages'] . '</b>)', '<br />';
}
}
}
echo '
</td>
</tr>';
}
echo '
</table>
<br />
</td>
<td valign="top">';
}
示例3: template_main
function template_main()
{
global $context, $settings, $options, $scripturl, $txt;
// Display the table header and linktree.
echo '
<div style="padding: 3px;">', theme_linktree(), '</div>
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder">
<tr class="titlebg">
<td width="30%"><a href="' . $scripturl . '?action=who;start=', $context['start'], ';sort=user', $context['sort_direction'] != 'down' && $context['sort_by'] == 'user' ? '' : ';asc', '">', $txt['who_user'], ' ', $context['sort_by'] == 'user' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
<td style="width: 14ex;"><a href="' . $scripturl . '?action=who;start=', $context['start'], ';sort=time', $context['sort_direction'] == 'down' && $context['sort_by'] == 'time' ? ';asc' : '', '">', $txt['who_time'], ' ', $context['sort_by'] == 'time' ? '<img src="' . $settings['images_url'] . '/sort_' . $context['sort_direction'] . '.gif" alt="" />' : '', '</a></td>
<td>', $txt['who_action'], '</td>
</tr>';
// This is used to alternate the color of the background.
$alternate = true;
// For every member display their name, time and action (and more for admin).
foreach ($context['members'] as $member) {
// $alternate will either be true or false. If it's true, use "windowbg2" and otherwise use "windowbg".
echo '
<tr class="windowbg', $alternate ? '2' : '', '">
<td>';
// Guests don't have information like icq, msn, y!, and aim... and they can't be messaged.
if (!$member['is_guest']) {
echo '
<div style="float: right; width: 14ex;">
', $context['can_send_pm'] ? '<a href="' . $member['online']['href'] . '" title="' . $member['online']['label'] . '">' : '', $settings['use_image_buttons'] ? '<img src="' . $member['online']['image_href'] . '" alt="' . $member['online']['text'] . '" align="middle" />' : $member['online']['text'], $context['can_send_pm'] ? '</a>' : '', '
', $member['icq']['link'], ' ', $member['msn']['link'], ' ', $member['yim']['link'], ' ', $member['aim']['link'], '
</div>';
}
echo '
<span', $member['is_hidden'] ? ' style="font-style: italic;"' : '', '>', $member['is_guest'] ? $member['name'] : '<a href="' . $member['href'] . '" title="' . $txt[92] . ' ' . $member['name'] . '"' . (empty($member['color']) ? '' : ' style="color: ' . $member['color'] . '"') . '>' . $member['name'] . '</a>', '</span>';
if (!empty($member['ip'])) {
echo '
(<a href="' . $scripturl . '?action=trackip;searchip=' . $member['ip'] . '" target="_blank">' . $member['ip'] . '</a>)';
}
echo '
</td>
<td nowrap="nowrap">', $member['time'], '</td>
<td>', $member['action'], '</td>
</tr>';
// Switch alternate to whatever it wasn't this time. (true -> false -> true -> false, etc.)
$alternate = !$alternate;
}
echo '
<tr class="titlebg">
<td colspan="3"><b>', $txt[139], ':</b> ', $context['page_index'], '</td>
</tr>
</table>';
}
示例4: template_body_above
//.........这里部分代码省略.........
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
', $txt['quick_login_dec'], '
<input type="hidden" name="hash_passwrd" value="" />
</div>
</form>';
}
echo '
</td></tr></table>
</div>
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<div style="margin-top: 7px;">
<strong>', $txt['search'], ': </strong><input type="text" name="search" value="" style="width: 190px;" class="input_text" />
<input type="submit" name="submit" value="', $txt['search'], '" style="width: 8ex;" class="button_submit" />
<a href="', $scripturl, '?action=search;advanced">', $txt['search_advanced'], '</a>
<input type="hidden" name="advanced" value="0" />';
// Search within current topic?
if (!empty($context['current_topic'])) {
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
} elseif (!empty($context['current_board'])) {
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
}
echo '
</div>
</form>
</td>
<td style="width: 262px; ', !$context['right_to_left'] ? 'padding-left' : 'padding-right', ': 6px;" valign="top">';
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news'])) {
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif); margin-bottom: 8px;">
<img src="', $settings['lang_images_url'], '/newsbox.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="height: 50px; overflow: auto; padding: 5px;" class="smalltext">', $context['random_news_line'], '</div>
</div>';
}
// The "key stats" box.
echo '
<div class="headertitles" style="width: 260px;"><img src="', $settings['images_url'], '/blank.gif" height="12" alt="" /></div>
<div class="headerbodies" style="width: 260px; position: relative; background-image: url(', $settings['images_url'], '/box_bg.gif);">
<img src="', $settings['lang_images_url'], '/keystats.gif" style="position: absolute; left: -1px; top: -16px;" alt="" />
<div style="', !$context['browser']['is_ie'] ? 'min-height: 35px;' : 'height: 4em;', ' padding: 5px;" class="smalltext">
<strong>', $context['common_stats']['total_posts'], '</strong> ', $txt['posts_made'], ' ', $txt['in'], ' <strong>', $context['common_stats']['total_topics'], '</strong> ', $txt['topics'], ' ', $txt['by'], ' <span style="white-space: nowrap;"><strong>', $context['common_stats']['total_members'], '</strong> ', $txt['members'], '</span><br />
', $txt['latest_member'], ': <strong> ', $context['common_stats']['latest_member']['link'], '</strong>
</div>
</div>';
echo '
</td>
</tr>
</table>
<img id="upshrink" src="', $settings['images_url'], '/upshrink.gif" alt="*" title="', $txt['upshrink_description'], '" style="margin: 2px 2ex 2px 0; display: none;" border="0" />';
// Show the menu here, according to the menu sub template.
template_menu();
// Define the upper_section toggle in JavaScript.
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
aSwappableContainers: [
\'upshrinkHeader\',
\'upshrinkHeader2\'
],
aSwapImages: [
{
sId: \'upshrink\',
srcExpanded: smf_images_url + \'/upshrink.gif\',
altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
srcCollapsed: smf_images_url + \'/upshrink2.gif\',
altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
}
],
oThemeOptions: {
bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
sOptionName: \'collapse_header\',
sSessionVar: ', JavaScriptEscape($context['session_var']), ',
sSessionId: ', JavaScriptEscape($context['session_id']), '
},
oCookieOptions: {
bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
sCookieName: \'upshrink\'
}
});
// ]]></script>';
echo '
</div>';
// The main content should go here. A table is used because IE 6 just can't handle a div.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr>
<td id="bodyarea" style="padding: 1ex 20px 2ex 20px;">';
// Show the navigation tree.
theme_linktree();
}
示例5: template_main
//.........这里部分代码省略.........
<a id="bot"></a><strong>', $txt['pages'], ':</strong> ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . '<a href="#top">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/go_up.gif" alt="' . $txt['go_up'] . '" border="0" align="top" />' : $txt['go_up']) . '</a>' : '', '
</td>
<td align="', !$context['right_to_left'] ? 'right' : 'left', '" style="font-size: smaller;">';
$buttonArray = array();
if ($context['can_reply']) {
$buttonArray[] = '<a href="' . $scripturl . '?action=post;topic=' . $context['current_topic'] . '.' . $context['start'] . ';num_replies=' . $context['num_replies'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/reply.gif" alt="' . $txt['reply'] . '" border="0" />' : $txt['reply']) . '</a>';
}
if ($context['can_mark_notify']) {
$buttonArray[] = '<a href="' . $scripturl . '?action=notify;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_topic'] : $txt['notification_enable_topic']) . '\');">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/' . ($context['is_marked_notify'] ? 'un' : '') . 'notify.gif" alt="' . $txt[$context['is_marked_notify'] ? 'unnotify' : 'notify'] . '" border="0" />' : $txt[$context['is_marked_notify'] ? 'unnotify' : 'notify']) . '</a>';
}
// Another special case, similar to above but reversed. Show "add poll" unless they can't - then show unread here too.
if ($context['can_add_poll']) {
$buttonArray[] = '<a href="' . $scripturl . '?action=editpoll;add;topic=' . $context['current_topic'] . '.' . $context['start'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/addpoll.gif" alt="' . $txt['add_poll'] . '" border="0" />' : $txt['add_poll']) . '</a>';
} elseif ($context['user']['is_logged'] && $settings['show_mark_read']) {
$buttonArray[] = '<a href="' . $scripturl . '?action=markasread;sa=topic;t=' . $context['mark_unread_time'] . ';topic=' . $context['current_topic'] . '.' . $context['start'] . ';' . $context['session_var'] . '=' . $context['session_id'] . '">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/markunread.gif" alt="' . $txt['mark_unread'] . '" border="0" />' : $txt['mark_unread']) . '</a>';
}
if ($context['can_send_topic']) {
$buttonArray[] = '<a href="' . $scripturl . '?action=emailuser;sa=sendtopic;topic=' . $context['current_topic'] . '.0">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/sendtopic.gif" alt="' . $txt['send_topic'] . '" border="0" />' : $txt['send_topic']) . '</a>';
}
$buttonArray[] = '<a href="' . $scripturl . '?action=printpage;topic=' . $context['current_topic'] . '.0" target="_blank" class="new_win">' . ($settings['use_image_buttons'] ? '<img src="' . $settings['lang_images_url'] . '/print.gif" alt="' . $txt['print'] . '" border="0" />' : $txt['print']) . '</a>';
echo implode($context['menu_separator'], $buttonArray);
echo '
</td>
</tr>
</table>
</td>
</tr>
</table>
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>';
if ($settings['linktree_inline']) {
echo '
<td valign="top">', theme_linktree(), '</td> ';
}
echo '
<td valign="top" align="', !$context['right_to_left'] ? 'right' : 'left', '" class="smalltext"> <span class="nav"> ', $context['previous_next'], '</span></td>
</tr>
</table>
<div style="padding-top: 4px; padding-bottom: 4px;" id="moderationbuttons">', theme_show_mod_buttons(), '</div>';
echo '
</form>';
echo '
<div class="righttext" style="margin-bottom: 1ex;" id="display_jump_to"> </div><br />';
if ($context['can_reply'] && !empty($options['display_quick_reply'])) {
echo '
<a id="quickreply"></a>
<table border="0" cellspacing="1" cellpadding="3" class="clear bordercolor" width="100%">
<tr>
<td colspan="2" class="catbg"><a href="javascript:oQuickReply.swap();"><img src="', $settings['images_url'], '/', $options['display_quick_reply'] == 2 ? 'collapse' : 'expand', '.gif" alt="+" border="0" id="quickReplyExpand" /></a> <a href="javascript:oQuickReply.swap();">', $txt['quick_reply'], '</a></td>
</tr>
<tr id="quickReplyOptions"', $options['display_quick_reply'] == 2 ? '' : ' style="display: none"', '>
<td class="windowbg" width="25%" valign="top">', $txt['quick_reply_desc'], $context['is_locked'] ? '<br /><br /><strong>' . $txt['quick_reply_warning'] . '</strong>' : '', '</td>
<td class="windowbg" width="75%" align="center">
', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '', '
<form action="', $scripturl, '?action=post2', empty($context['current_board']) ? '' : ';board=' . $context['current_board'], '" method="post" accept-charset="', $context['character_set'], '" name="postmodify" id="postmodify" onsubmit="submitonce(this);" style="margin: 0;">
<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="subject" value="', $context['response_prefix'], $context['subject'], '" />
<input type="hidden" name="icon" value="xx" />
<input type="hidden" name="from_qr" value="1" />
<input type="hidden" name="notify" value="', $context['is_marked_notify'] || !empty($options['auto_notify']) ? '1' : '0', '" />
<input type="hidden" name="not_approved" value="', !$context['can_reply_approved'], '" />
<input type="hidden" name="goback" value="', empty($options['return_to_post']) ? '0' : '1', '" />
<input type="hidden" name="num_replies" value="', $context['num_replies'], '" />';
// Guests just need more.
示例6: template_body_above
//.........这里部分代码省略.........
if (!empty($context['user']['avatar'])) {
echo '
<p class="avatar">', $context['user']['avatar']['image'], '</p>';
}
/* echo '
<ul class="reset">
<!-- <li class="greeting">', $txt['hello_member_ndt'], ' <span>', $context['user']['name'], '</span></li>
<li><a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a></li>
<li><a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a></li> -->';
*/
// Is the forum in maintenance mode?
if ($context['in_maintenance'] && $context['user']['is_admin']) {
echo '
<li class="notice">', $txt['maintain_mode_on'], '</li>';
}
// Are there any members waiting for approval?
if (!empty($context['unapproved_members'])) {
echo '
<li>', $context['unapproved_members'] == 1 ? $txt['approve_thereis'] : $txt['approve_thereare'], ' <a href="', $scripturl, '?action=admin;area=viewmembers;sa=browse;type=approve">', $context['unapproved_members'] == 1 ? $txt['approve_member'] : $context['unapproved_members'] . ' ' . $txt['approve_members'], '</a> ', $txt['approve_members_waiting'], '</li>';
}
if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
echo '
<li><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></li>';
}
echo '
<!-- <li>', $context['current_time'], '</li> -->
</ul>';
}
// Otherwise they're a guest - this time ask them to either register or login - lazy bums...
/*
elseif (!empty($context['show_login_bar']))
{
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
<form id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
<div class="info">', sprintf($txt['welcome_guest'], $txt['guest_title']), '</div>
<input type="text" name="user" size="10" class="input_text" />
<input type="password" name="passwrd" size="10" class="input_password" />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
<div class="info">', $txt['quick_login_dec'], '</div>';
if (!empty($modSettings['enableOpenID']))
echo '
<br /><input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';
echo '
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}
echo '
</div>
<div class="news normaltext">
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
<input type="hidden" name="advanced" value="0" />';
*/
// Search within current topic?
if (!empty($context['current_topic'])) {
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
} elseif (!empty($context['current_board'])) {
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
}
echo '</form>';
/*
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']))
echo '
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>';
echo '
<!-- </div> -->
<!-- </div> -->
<br class="clear" />';
// Show the menu here, according to the menu sub template.
// template_menu();
echo '
<br class="clear" />
</div>';
*/
// The main content should go here.
echo '
<div id="content_section" class="row panels"><div class="frame">
<div id="main_content_section">';
// Custom banners and shoutboxes should be placed here, before the linktree.
// Show the navigation tree.
theme_linktree();
}
示例7: template_mainview
function template_mainview()
{
global $scripturl, $txt, $settings, $modSettings, $ID_MEMBER, $subcats_linktree, $context;
// To get Permissions text
loadLanguage('Admin');
// See if they can approve links
$a_links = allowedTo('approve_links');
$addlink = allowedTo('add_links');
$m_cats = allowedTo('links_manage_cat');
// Get the Category
if (!empty($_REQUEST['cat'])) {
$cat = (int) $_REQUEST['cat'];
}
echo '
<div style="padding: 3px;">', theme_linktree(), '</div>';
// Check if there was a category
if (empty($cat)) {
// No category found show the links index
echo '<h1 align="center"><strong>', $txt['smflinks_indextitle'], '</strong></h1>';
$ratelink = allowedTo('rate_links');
// List all the catagories
// Get category count
$cat_count = $context['cat_count'];
echo '<table cellspacing="0" cellpadding="10" border="0" align="center" width="90%" class="tborder">
<tr>
<td class="titlebg" colspan="2">', $txt['smflinks_ctitle'], '</td>
<td class="titlebg">', $txt['smflinks_description'], '</td>
<td class="titlebg">', $txt['smflinks_totallinks'], '</td>
', $m_cats ? '<td class="titlebg">' . $txt['smflinks_options'] . '</td>' : '', '
</tr>
';
foreach ($context['catlist'] as $row) {
$totallinks = GetLinkTotals($row['ID_CAT']);
echo '<tr>';
if (empty($row['image'])) {
echo '
<td colspan="2" class="windowbg2">
<a href="', $scripturl, '?action=links;cat=', $row['ID_CAT'], '">', parse_bbc($row['title']), '</a>
</td>
<td class="windowbg2">', parse_bbc($row['description']), '</td>
';
} else {
echo '
<td class="windowbg2">
<a href="', $scripturl, '?action=links;cat=', $row['ID_CAT'], '">
<img src="', $row['image'], '" border="0" alt="" />
</a>
</td>
<td class="windowbg2">
<a href="', $scripturl, '?action=links;cat=', $row['ID_CAT'], '">', parse_bbc($row['title']), '</a>
</td>
<td class="windowbg2">', parse_bbc($row['description']), '</td>
';
}
echo '<td class="windowbg2">', $totallinks, '</td>';
// Show Edit Delete and Order category
if ($m_cats) {
echo '<td class="windowbg2"><a href="', $scripturl, '?action=links;sa=catup;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtup'], '</a> <a href="', $scripturl, '?action=links;sa=catdown;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtdown'], '</a></span> <a href="', $scripturl, '?action=links;sa=catperm;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txt_perm'], '</a> <a href="', $scripturl, '?action=links;sa=editcat;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtedit'], '</a> <a href="', $scripturl, '?action=links;sa=deletecat;cat=', $row['ID_CAT'], ';sesc=', $context['session_id'], '">', $txt['smflinks_txtdel'], '</a></td>';
}
echo '</tr>';
if (!empty($subcats_linktree)) {
echo '<tr class="titlebg">
<td colspan="' . ($m_cats ? '5' : '4') . '"> <span class="smalltext">', $subcats_linktree != '' ? $txt['smflinks_sub_cats'] . $subcats_linktree : '', '</span></td>
</tr>';
}
}
echo '</table>';
// Permissions for Top 5 Rated, Top 5 Hits and Approval
$editlink_own = allowedTo('edit_links_own');
$editlink_any = allowedTo('edit_links_any');
$deletelink_own = allowedTo('delete_links_own');
$deletelink_any = allowedTo('delete_links_any');
echo '<table border="0" cellpadding="0" cellspacing="0" width="90%" align="center">
<tr>
<td width="50%" valign="top">';
// Show Top 5 rated
if (!empty($modSettings['smflinks_setshowtoprate'])) {
echo '<div class="tborder" style="margin: 2%;"><div class="catbg2" align="center">' . $txt['smflinks_topfiverated'] . '</div>';
echo '<table align="center">';
foreach ($context['linkstop5'] as $row) {
echo '<tr>
<td align="center">
<a href="' . $scripturl . '?action=links;sa=visit&id=' . $row['ID_LINK'] . '" target="blank">' . $row['title'] . '</a> ';
echo $txt['smflinks_rating'] . $row['rating'];
if ($editlink_any || $editlink_own && $ID_MEMBER == $row['ID_MEMBER']) {
echo ' <a href="' . $scripturl . '?action=links;sa=editlink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtedit'] . '</a> ';
}
if ($deletelink_any || $deletelink_own && $ID_MEMBER == $row['ID_MEMBER']) {
echo '<a href="' . $scripturl . '?action=links;sa=deletelink&id=' . $row['ID_LINK'] . '">' . $txt['smflinks_txtdel'] . '</a>';
}
echo '</td></tr>';
}
echo '</table>';
echo '</div>';
}
echo '</td>';
// Show Top 5 hits
echo '<td width="50%" valign="top">';
if (!empty($modSettings['smflinks_setshowmostvisited'])) {
echo '<div class="tborder" style="margin: 2%;"><div class="catbg2" align="center">' . $txt['smflinks_topfivevisited'] . '</div>';
//.........这里部分代码省略.........
示例8: template_body_above
//.........这里部分代码省略.........
if (!empty($context['open_mod_reports']) && $context['show_open_reports']) {
echo '
<li><a href="', $scripturl, '?action=moderate;area=reports">', sprintf($txt['mod_reports_waiting'], $context['open_mod_reports']), '</a></li>';
}
echo '
</ul>';
} elseif (!empty($context['show_login_bar'])) {
echo '
<script type="text/javascript" src="', $settings['default_theme_url'], '/scripts/sha1.js"></script>
<form class="windowbg" id="guest_form" action="', $scripturl, '?action=login2" method="post" accept-charset="', $context['character_set'], '" ', empty($context['disable_login_hashing']) ? ' onsubmit="hashLoginPassword(this, \'' . $context['session_id'] . '\');"' : '', '>
', $txt['login_or_register'], '<br />
<input type="text" name="user" size="10" class="input_text" />
<input type="password" name="passwrd" size="10" class="input_password" />
<select name="cookielength">
<option value="60">', $txt['one_hour'], '</option>
<option value="1440">', $txt['one_day'], '</option>
<option value="10080">', $txt['one_week'], '</option>
<option value="43200">', $txt['one_month'], '</option>
<option value="-1" selected="selected">', $txt['forever'], '</option>
</select>
<input type="submit" value="', $txt['login'], '" class="button_submit" /><br />
', $txt['quick_login_dec'];
if (!empty($modSettings['enableOpenID'])) {
echo '
<br />
<input type="text" name="openid_identifier" id="openid_url" size="25" class="input_text openid_login" />';
}
echo '
<input type="hidden" name="hash_passwrd" value="" />
</form>';
}
if ($context['user']['is_logged'] || !empty($context['show_login_bar'])) {
echo '
</div>
</div>';
}
echo '
<div id="news_section" class="titlebg2 clearfix"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<form class="floatright" id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<a href="', $scripturl, '?action=search;advanced" title="', $txt['search_advanced'], '"><img id="advsearch" src="' . $settings['images_url'] . '/filter.gif" align="middle" alt="', $txt['search_advanced'], '" /></a>
<input type="text" name="search" value="" style="width: 190px;" class="input_text" />
<input type="submit" name="submit" value="', $txt['search'], '" style="width: 11ex;" class="button_submit" />
<input type="hidden" name="advanced" value="0" />';
// Search within current topic?
if (!empty($context['current_topic'])) {
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
} elseif (!empty($context['current_board'])) {
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
}
echo '
</form>';
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news'])) {
echo '
<div id="random_news"><h3>', $txt['news'], ':</h3><p>', $context['random_news_line'], '</p></div>';
}
echo '
</div>
</div>';
// Define the upper_section toggle in JavaScript.
echo '
<script type="text/javascript"><!-- // --><![CDATA[
var oMainHeaderToggle = new smc_Toggle({
bToggleEnabled: true,
bCurrentlyCollapsed: ', empty($options['collapse_header']) ? 'false' : 'true', ',
aSwappableContainers: [
\'user_section\',
\'news_section\'
],
aSwapImages: [
{
sId: \'upshrink\',
srcExpanded: smf_images_url + \'/upshrink.gif\',
altExpanded: ', JavaScriptEscape($txt['upshrink_description']), ',
srcCollapsed: smf_images_url + \'/upshrink2.gif\',
altCollapsed: ', JavaScriptEscape($txt['upshrink_description']), '
}
],
oThemeOptions: {
bUseThemeSettings: ', $context['user']['is_guest'] ? 'false' : 'true', ',
sOptionName: \'collapse_header\',
sSessionVar: ', JavaScriptEscape($context['session_var']), ',
sSessionId: ', JavaScriptEscape($context['session_id']), '
},
oCookieOptions: {
bUseCookie: ', $context['user']['is_guest'] ? 'true' : 'false', ',
sCookieName: \'upshrink\'
}
});
// ]]></script>';
// Show the menu here, according to the menu sub template.
template_menu();
// Show the navigation tree.
theme_linktree();
// The main content should go here.
echo '
<div id="bodyarea">';
}
示例9: template_main
function template_main()
{
global $context, $settings, $options, $scripturl, $modSettings, $txt;
echo '
<div style="margin-bottom: 2px;"><a name="top"></a>', theme_linktree(), '</div>';
if (isset($context['boards']) && (!empty($options['show_children']) || $context['start'] == 0)) {
echo '
<div class="tborder" style="margin-bottom: 3ex; ', $context['browser']['needs_size_fix'] && !$context['browser']['is_ie6'] ? ' width: 100%;' : '', '">
<table border="0" width="100%" cellspacing="1" cellpadding="5" class="bordercolor">
<tr>
<td colspan="4" class="catbg">', $txt['parent_boards'], '</td>
</tr>';
foreach ($context['boards'] as $board) {
echo '
<tr>
<td ', !empty($board['children']) ? 'rowspan="2"' : '', ' class="windowbg" width="6%" align="center" valign="top"><a href="', $scripturl, '?action=unread;board=', $board['id'], '.0">';
// If the board is new, show a strong indicator.
if ($board['new']) {
echo '<img src="', $settings['images_url'], '/on.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
} elseif ($board['children_new']) {
echo '<img src="', $settings['images_url'], '/on2.gif" alt="', $txt[333], '" title="', $txt[333], '" />';
} else {
echo '<img src="', $settings['images_url'], '/off.gif" alt="', $txt[334], '" title="', $txt[334], '" />';
}
echo '</a>
</td>
<td class="windowbg2">
<b><a href="', $board['href'], '" name="b', $board['id'], '">', $board['name'], '</a></b><br />
', $board['description'];
// Show the "Moderators: ". Each has name, href, link, and id. (but we're gonna use link_moderators.)
if (!empty($board['moderators'])) {
echo '
<div style="padding-top: 1px;"><small><i>', count($board['moderators']) == 1 ? $txt[298] : $txt[299], ': ', implode(', ', $board['link_moderators']), '</i></small></div>';
}
// Show some basic information about the number of posts, etc.
echo '
</td>
<td class="windowbg" valign="middle" align="center" style="width: 12ex;"><small>
', $board['posts'], ' ', $txt[21], ' <br />
', $board['topics'], ' ', $txt[330], '</small>
</td>
<td class="windowbg2" valign="middle" width="22%"><small>';
/* The board's and children's 'last_post's have:
time, timestamp (a number that represents the time.), id (of the post), topic (topic id.),
link, href, subject, start (where they should go for the first unread post.),
and member. (which has id, name, link, href, username in it.) */
if (!empty($board['last_post']['id'])) {
echo '
<b>', $txt[22], '</b> ', $txt[525], ' ', $board['last_post']['member']['link'], '<br />
', $txt['smf88'], ' ', $board['last_post']['link'], '<br />
', $txt[30], ' ', $board['last_post']['time'];
}
echo '</small>
</td>
</tr>';
// Show the "Child Boards: ". (there's a link_children but we're going to bold the new ones...)
if (!empty($board['children'])) {
// Sort the links into an array with new boards bold so it can be imploded.
$children = array();
/* Each child in each board's children has:
id, name, description, new (is it new?), topics (#), posts (#), href, link, and last_post. */
foreach ($board['children'] as $child) {
$child['link'] = '<a href="' . $child['href'] . '" title="' . ($child['new'] ? $txt[333] : $txt[334]) . ' (' . $txt[330] . ': ' . $child['topics'] . ', ' . $txt[21] . ': ' . $child['posts'] . ')">' . $child['name'] . '</a>';
$children[] = $child['new'] ? '<b>' . $child['link'] . '</b>' : $child['link'];
}
echo '
<tr>
<td colspan="3" class="windowbg', !empty($settings['seperate_sticky_lock']) ? '3' : '', '">
<small><b>', $txt['parent_boards'], '</b>: ', implode(', ', $children), '</small>
</td>
</tr>';
}
}
echo '
</table>
</div>';
}
if (!empty($options['show_board_desc']) && $context['description'] != '') {
echo '
<table width="100%" cellpadding="6" cellspacing="1" border="0" class="tborder" style="padding: 0; margin-bottom: 2ex;">
<tr>
<td class="titlebg2" width="100%" height="24" style="border-top: 0;">
<small>', $context['description'], '</small>
</td>
</tr>
</table>';
}
// Create the button set...
$normal_buttons = array('markread' => array('text' => 'mark_read_short', 'image' => 'markread.gif', 'lang' => true, 'url' => $scripturl . '?action=markasread;sa=board;board=' . $context['current_board'] . '.0;sesc=' . $context['session_id']), 'notify' => array('test' => 'can_mark_notify', 'text' => 125, 'image' => 'notify.gif', 'lang' => true, 'custom' => 'onclick="return confirm(\'' . ($context['is_marked_notify'] ? $txt['notification_disable_board'] : $txt['notification_enable_board']) . '\');"', 'url' => $scripturl . '?action=notifyboard;sa=' . ($context['is_marked_notify'] ? 'off' : 'on') . ';board=' . $context['current_board'] . '.' . $context['start'] . ';sesc=' . $context['session_id']), 'new_topic' => array('test' => 'can_post_new', 'text' => 'smf258', 'image' => 'new_topic.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0'), 'post_poll' => array('test' => 'can_post_poll', 'text' => 'smf20', 'image' => 'new_poll.gif', 'lang' => true, 'url' => $scripturl . '?action=post;board=' . $context['current_board'] . '.0;poll'));
// They can only mark read if they are logged in and it's enabled!
if (!$context['user']['is_logged'] || !$settings['show_mark_read']) {
unset($normal_buttons['markread']);
}
if (!$context['no_topic_listing']) {
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="middletext">', $txt[139], ': ', $context['page_index'], !empty($modSettings['topbottomEnable']) ? $context['menu_separator'] . ' <a href="#bot"><b>' . $txt['topbottom5'] . '</b></a>' : '', '</td>
<td align="right" style="padding-right: 1ex;">
<table cellpadding="0" cellspacing="0">
//.........这里部分代码省略.........
示例10: template_main
function template_main()
{
global $context, $settings, $options, $txt, $scripturl, $modSettings;
// Show the anchor for the top and for the first message. If the first message is new, say so.
echo '
<a name="top"></a>
<a name="msg', $context['first_message'], '"></a>', $context['first_new_message'] ? '<a name="new"></a>' : '';
// Show the linktree as well as the "Who's Viewing" information.
echo '
<table width="100%" cellpadding="3" cellspacing="0">
<tr>
<td valign="bottom">', theme_linktree(), '</td>';
if (!empty($settings['display_who_viewing'])) {
echo '
<td align="center" class="smalltext">';
// Show just numbers...?
if ($settings['display_who_viewing'] == 1) {
echo count($context['view_members']), ' ', count($context['view_members']) == 1 ? $txt['who_member'] : $txt[19];
} else {
echo empty($context['view_members_list']) ? '0 ' . $txt[19] : implode(', ', $context['view_members_list']) . (empty($context['view_num_hidden']) || $context['can_moderate_forum'] ? '' : ' (+ ' . $context['view_num_hidden'] . ' ' . $txt['hidden'] . ')');
}
// Now show how many guests are here too.
echo $txt['who_and'], $context['view_num_guests'], ' ', $context['view_num_guests'] == 1 ? $txt['guest'] : $txt['guests'], $txt['who_viewing_topic'], '</td>';
}
// Show the previous/next links.
echo '
<td valign="bottom" align="right" class="smalltext">
<span class="nav">', $context['previous_next'], '</span>
</td>
</tr>
</table>';
// Show the page index... "Pages: [1]".
echo '
<table width="100%" cellpadding="3" cellspacing="0" border="0" class="tborder" style="border-bottom: 0;">
<tr>
<td align="left" class="catbg" width="100%" height="35">
<table cellpadding="3" cellspacing="0" width="100%">
<tr>
<td>
<b>', $txt[139], ':</b> ', $context['page_index'];
// Show a "go down" link?
if (!empty($modSettings['topbottomEnable'])) {
echo $context['menu_separator'], '<a href="#bot">', $settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/go_down.gif" alt="' . $txt['topbottom5'] . '" border="0" align="top" />' : $txt['topbottom5'], '</a>';
}
echo '
</td>
<td align="right" style="font-size: smaller;">', theme_show_main_buttons(), '</td>
</tr>
</table>
</td>
</tr>
</table>';
// Is this topic also a poll?
if ($context['is_poll']) {
echo '
<table cellpadding="3" cellspacing="0" border="0" width="100%" class="tborder" style="border-bottom: 0;">
<tr class="titlebg">
<td colspan="2" valign="middle" align="left" style="padding-left: 6px;">
<img src="', $settings['images_url'], '/topic/', $context['poll']['is_locked'] ? 'normal_poll_locked' : 'normal_poll', '.gif" alt="" align="top" /> ', $txt['smf43'], '
</td>
</tr>
<tr class="windowbg">
<td width="5%" valign="top"><b>', $txt['smf21'], ':</b></td>
<td>
', $context['poll']['question'];
// Are they not allowed to vote but allowed to view the options?
if ($context['poll']['show_results'] || !$context['allow_vote']) {
echo '
<table>
<tr>
<td style="padding-top: 2ex;">
<table border="0" cellpadding="0" cellspacing="0">';
// Show each option with its corresponding percentage bar.
foreach ($context['poll']['options'] as $option) {
echo '
<tr>
<td', $option['voted_this'] ? ' style="font-weight: bold;"' : '', '>', $option['option'], '</td>', $context['allow_poll_view'] ? '
<td width="7"> </td>
<td nowrap="nowrap">' . $option['bar'] . $option['votes'] . ' (' . $option['percent'] . '%)</td>' : '', '
</tr>';
}
echo '
</table>
</td>
<td valign="bottom" style="padding-left: 15px;">';
// If they are allowed to revote - show them a link!
if ($context['allow_change_vote']) {
echo '
<a href="', $scripturl, '?action=vote;topic=', $context['current_topic'], '.', $context['start'], ';poll=', $context['poll']['id'], ';sesc=', $context['session_id'], '">', $txt['poll_change_vote'], '</a><br />';
}
// If we're viewing the results... maybe we want to go back and vote?
if ($context['poll']['show_results'] && $context['allow_vote']) {
echo '
<a href="', $scripturl, '?topic=', $context['current_topic'], '.', $context['start'], '">', $txt['poll_return_vote'], '</a><br />';
}
// If they're allowed to lock the poll, show a link!
if ($context['poll']['lock']) {
echo '
<a href="', $scripturl, '?action=lockVoting;topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', !$context['poll']['is_locked'] ? $txt['smf30'] : $txt['smf30b'], '</a><br />';
}
//.........这里部分代码省略.........
示例11: template_body_above
//.........这里部分代码省略.........
{
echo '
<div class="statusbar hidethis">
<div class="wrapper">
<h2>Hi Lemon.</h2>
</div>
</div>
';
}
elseif (in_array(9, $user_info['groups']))
{
echo '
<div class="statusbar hidethis">
<div class="wrapper">
<h2>Congratulations on being a Ridiculist.</h2>
</div>
</div>
';
}
elseif (in_array(10, $user_info['groups']))
{
echo '
<div class="statusbar hidethis">
<div class="wrapper">
<h2>I think you are a Paid member.</h2>
</div>
</div>
';
} else {
echo '
<div class="statusbar">
<div class="wrapper">
<h2>You do not yet have posting access.</h2>
<p>As a registered member, you have read-only access to most of the forums. In order to post, you'll need to pay the <a href="http://ballp.it/index.php?action=profile;area=subscriptions">one-time fee</a>.<br /><a href="http://ballp.it/index.php?topic=16.msg28">Why is it ten bucks?</a></p>
</div>
</div>
';
}
echo '
<div id="bar">
<div class="wrapper">
', template_menu(), '
</div>
</div>
<div id="main_body_section">
<div class="wrapper">
<div id="main_content_section">';
// Show the navigation tree.
theme_linktree();
}
示例12: template_search
function template_search()
{
global $context, $settings, $options, $scripturl, $txt;
// Start the submission form for the search!
echo '
<form action="', $scripturl, '?action=mlist;sa=search" method="post" accept-charset="', $context['character_set'], '">';
// Display that link tree...
echo '
<div style="padding: 3px;">', theme_linktree(), '</div>';
// Display links to view all/search.
if (!empty($settings['use_tabs'])) {
echo '
<table cellpadding="0" cellspacing="0" border="0" style="margin-left: 10px;">
<tr>
<td class="mirrortab_first"> </td>';
foreach ($context['sort_links'] as $link) {
if ($link['selected']) {
echo '
<td class="mirrortab_active_first"> </td>
<td valign="top" class="mirrortab_active_back">
<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
</td>
<td class="mirrortab_active_last"> </td>';
} else {
echo '
<td valign="top" class="mirrortab_back">
<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">', $link['label'], '</a>
</td>';
}
}
echo '
<td class="mirrortab_last"> </td>
</tr>
</table>
<div class="tborder">';
} else {
echo '
<div class="bordercolor" style="padding: 1px;">
<div class="titlebg" style="padding: 4px 4px 4px 10px;">';
$links = array();
foreach ($context['sort_links'] as $link) {
$links[] = ($link['selected'] ? '<img src="' . $settings['images_url'] . '/selected.gif" alt=">" /> ' : '') . '<a href="' . $scripturl . '?action=mlist' . (!empty($link['action']) ? ';sa=' . $link['action'] : '') . '">' . $link['label'] . '</a>';
}
echo '
', implode(' | ', $links), '
</div>
</div>
<div class="bordercolor" style="padding: 1px">';
}
// Display the input boxes for the form.
echo '
<div class="windowbg" align="center" style="padding-bottom: 1ex;">
<table width="440" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2" align="left">
<br />
<b>', $txt[582], ':</b> <input type="text" name="search" value="', $context['old_search'], '" size="35" /> <input type="submit" name="submit" value="' . $txt[182] . '" style="margin-left: 20px;" /><br />
<br />
</td>
</tr>
<tr>
<td align="left">
<label for="fields-email"><input type="checkbox" name="fields[]" id="fields-email" value="email" checked="checked" class="check" /> ', $txt['mlist_search_email'], '</label><br />
<label for="fields-messenger"><input type="checkbox" name="fields[]" id="fields-messenger" value="messenger" class="check" /> ', $txt['mlist_search_messenger'], '</label><br />
<label for="fields-group"><input type="checkbox" name="fields[]" id="fields-group" value="group" class="check" /> ', $txt['mlist_search_group'], '</label>
</td>
<td align="left" valign="top">
<label for="fields-name"><input type="checkbox" name="fields[]" id="fields-name" value="name" checked="checked" class="check" /> ', $txt['mlist_search_name'], '</label><br />
<label for="fields-website"><input type="checkbox" name="fields[]" id="fields-website" value="website" class="check" /> ', $txt['mlist_search_website'], '</label>
</td>
</tr>
</table>
</div>
</div>
</form>';
}
示例13: template_body_above
function template_body_above()
{
global $context, $settings, $scripturl, $txt, $user_info, $modSettings;
$alerts = $user_info['notify_count'] > 0 ? $user_info['notify_count'] : '';
$scope = 0;
$search_label = $txt['search_all_boards'];
if (isset($context['current_topic']) && $context['current_topic']) {
$search_label = $txt['search_topic'];
$scope = 2;
} elseif (isset($context['current_board'])) {
$search_label = $txt['search_board'];
$scope = 1;
}
echo '
<div id="__t_script" style="display:none;"></div>
<div id="jsconfirm" style="width:450px;" class="jqmWindow"><div class="jqmWindow_container"><div class="glass jsconfirm title"></div><div class="jsconfirm content blue_container norounded smallpadding mediummargin tinytext"></div><div class="floatright mediummargin"><span class="button default" id="c_yes">Yes</span><span class="button" id="c_no">No</span><span class="button" id="c_ok">Ok</span></div><div class="clear"></div></div></div>
<div id="ajaxbusy" style="display:none;"><img src="', $settings['images_url'], '/ajax-loader.gif" alt="loader" /></div>
<div id="mcard" style="display:none;"><div onclick="mcardClose();" id="mcard_close">X</div><div id="mcard_inner"></div></div>
<div id="wrap" style="max-width:', empty($settings['forum_width']) ? '3000px;' : $settings['forum_width'], ';">
<header>
<div id="header">
<div id="upper_section" class="smalltext">
<div class="floatleft" style="overflow:hidden;max-height:90px;"><img src="', $settings['images_url'], '/logo.png" alt="logo" /></div>
', $context['template_hooks']['global']['header'], '
<div class="clear"></div>
</div>
<div class="notibar">
<div class="notibar right">
<div class="floatright">
<span title="', $txt['font_increase'], '" onclick="setTextSize(textsize + 1,0);return(false);" class="fontinc"> </span>
<span title="', $txt['font_decrease'], '" onclick="setTextSize(textsize - 1,0);return(false);" class="fontdec"> </span>
<span title="', $txt['toggle_font_style'], '" onclick="toggleFontStyle();return(false);" class="fontstyle"> </span>
</div>
<div class="floatright"><a style="', $alerts > 0 ? '' : 'display:none; ', 'position:relative;top:-12px;right:12px;z-index:9999;" id="alerts">', $alerts, '</a></div>
<div class="floatright nowrap" id="notification_target">
<ul class="dropmenu menu compact" id="menu_content">';
foreach ($context['usermenu_buttons'] as $key => $button) {
echo '
<li id="button_', $key, '" class="', isset($button['active_button']) ? 'active' : '', '">', isset($button['link']) ? $button['link'] : '<a class="firstlevel compact" href="' . $button['href'] . '">' . $button['title'] . '</a>';
if (!empty($button['sub_buttons'])) {
echo '
<span onclick="onMenuArrowClick($(this));" style="display:inline-block;" id="_', $key, '" class="m_downarrow compact"> </span>
<ul style="z-index:9000;">';
foreach ($button['sub_buttons'] as $sbutton) {
echo '
<li>', isset($sbutton['link']) ? $sbutton['link'] : '<a href="' . $sbutton['href'] . '"><span>' . $sbutton['title'] . '</span></a>', '
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}
echo '
</ul>
</div>
</div>
<div class="notibar_intro"></div>
</div>
<nav>';
// Show the menu here, according to the menu sub template.
template_menu();
echo '</nav>
<script>
// <![CDATA[
setTextSize(textsize);
// ]]>
</script>
</div></header>';
// The main content should go here.
echo '
<div id="content_section">
<div id="main_content_section">';
// Custom banners and shoutboxes should be placed here, before the linktree.
theme_linktree();
$sidebar_allowed = isset($context['show_sidebar']);
// todo: make this more flexible and define a set of pages where the sidebar can show up
$sidebar_vis = !$user_info['smf_sidebar_disabled'];
if ($sidebar_allowed) {
echo '
<a href="', $context['query_string'], ';sbtoggle" data-class="', $context['sidebar_class'], '" onclick="sbToggle($(this));return(false);" id="sbtoggle" class="', $sidebar_vis ? 'collapse' : 'expand', '"> </a>';
}
// Show the navigation tree.
if (isset($context['can_search']) && !empty($context['can_search'])) {
echo '<div style="position:relative;">
<form onmouseout="return false;" onsubmit="submitSearchBox();" class="floatright" id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="UTF-8">';
// Search within current topic?
echo '
<div id="adv_search" style="width:246px;padding:0;" class="smalltext">
<input style="width:215px;padding-left:26px;margin:0;" onclick="var s_event = arguments[0] || window.event;openAdvSearch(s_event);return(false);" type="text" onfocus="if(!this._haschanged){this.value=\'\'};this._haschanged=true;" name="search" value="', $search_label, '" class="searchfield" />
<br><br><h3 class="bbc_head l2">', $txt['search_by_member'], '</h3>
<div style="text-align:center;margin-bottom:10px;"><input style="width:90%;" class="input_text" type="text" name="userspec" id="userspec" value="*" /></div>
<input class="input_check floatleft" type="checkbox" name="show_complete" id="show_complete" value="1" /> <h3 class="bbc_head l2" style="margin-left:0;">', $txt['search_show_complete_messages'], '</h3><br class="clear">';
if ($scope == 2) {
echo '<div style="padding-left:20px;"><input type="radio" name="type" id="i_topic" class="input_radio" checked="checked" />', $txt['search_topic'], '<br />
<input type="radio" name="type" id="i_board" class="input_radio" />', $txt['search_board'], '<br />
<input type="radio" name="type" id="i_site" class="input_radio" />', $txt['search_all_boards'], '
<input type="hidden" id="s_topic" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" id="s_board" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" /></div>';
//.........这里部分代码省略.........
示例14: template_single_post
//.........这里部分代码省略.........
}
// Is visual verification enabled?
if ($context['require_verification']) {
echo '
<strong>', $txt['verification'], ':</strong>', template_control_verification($context['visual_verification_id'], 'quick_reply'), '<br />';
}
if (isset($context['user']['avatar']['image']) && !empty($context['user']['avatar']['image'])) {
echo '
<div class="floatleft blue_container smallpadding avatar">', $context['user']['avatar']['image'], '
</div>';
}
echo '
<div class="quickReplyContent" style="margin-left:150px;">';
echo $context['is_locked'] ? '<div class="red_container tinytext">' . $txt['quick_reply_warning'] . '</div>' : '', $context['oldTopicError'] ? '<div class="red_container tinytext">' . sprintf($txt['error_old_topic'], $modSettings['oldTopicDays']) . '</div>' : '', '
', $context['can_reply_approved'] ? '' : '<em>' . $txt['wait_for_approval'] . '</em>', '
', !$context['can_reply_approved'] && $context['require_verification'] ? '<br />' : '';
echo '
<textarea id="quickReplyMessage" style="width:99%;" rows="18" name="message" tabindex="', $context['tabindex']++, '"></textarea>';
if ($context['automerge']) {
echo '
<input type="checkbox" name="want_automerge" id="want_automerge" checked="checked" value="1" />', $txt['want_automerge'];
}
echo '
</div>
<div class="righttext padding">
<input type="submit" name="post" value="', $txt['post'], '" onclick="return submitThisOnce(this);" accesskey="s" tabindex="', $context['tabindex']++, '" class="button_submit" />
<input type="submit" name="preview" value="', $txt['go_advanced'], '" onclick="return submitThisOnce(this);" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />
<input type="submit" name="cancel" value="', 'Cancel', '" onclick="return(oQuickReply.cancel());" accesskey="p" tabindex="', $context['tabindex']++, '" class="button_submit" />
</div>
</div>
<br>
</div>';
}
theme_linktree();
// Show the jumpto box, or actually...let Javascript do it.
echo '
<div class="plainbox" id="display_jump_to"> </div>';
$context['inline_footer_script'] .= '
var oQuickReply = new QuickReply({
bDefaultCollapsed: ' . (!empty($options['display_quick_reply']) && $options['display_quick_reply'] == 2 ? 'false' : 'true') . ',
iTopicId: ' . $context['current_topic'] . ',
iStart: ' . $context['start'] . ',
sScriptUrl: smf_scripturl,
sImagesUrl: "' . $settings['images_url'] . '",
sContainerId: "quickReplyOptions",
sImageId: "quickReplyExpand",
sImageCollapsed: "collapse.gif",
sImageExpanded: "expand.gif",
iMarkedForMQ: ' . $context['multiquote_posts_count'] . ',
sJumpAnchor: "quickreplybox",
bEnabled: ' . (!empty($options['display_quick_reply']) ? 'true' : 'false') . '
});
';
if (!empty($options['display_quick_mod']) && $context['can_remove_post']) {
$context['inline_footer_script'] .= '
var oInTopicModeration = new InTopicModeration({
sSelf: \'oInTopicModeration\',
sCheckboxContainerMask: \'in_topic_mod_check_\',
aMessageIds: [\'' . implode('\', \'', $removableMessageIDs) . '\'],
sSessionId: \'' . $context['session_id'] . '\',
sSessionVar: \'' . $context['session_var'] . '\',
sButtonStrip: \'moderationbuttons\',
sButtonStripDisplay: \'moderationbuttons_strip\',
bUseImageButton: false,
bCanRemove: ' . ($context['can_remove_post'] ? 'true' : 'false') . ',
sRemoveButtonLabel: \'' . $txt['quickmod_delete_selected'] . '\',
示例15: template_body_above
//.........这里部分代码省略.........
echo '
<form id="languages_form" action="" method="get" class="floatright">
<select id="language_select" name="language" onchange="this.form.submit()">';
foreach ($context['languages'] as $language) {
echo '
<option value="', $language['filename'], '"', isset($context['user']['language']) && $context['user']['language'] == $language['filename'] ? ' selected="selected"' : '', '>', str_replace('-utf8', '', $language['name']), '</option>';
}
echo '
</select>
<noscript>
<input type="submit" value="', $txt['quick_mod_go'], '" />
</noscript>
</form>';
}
if ($context['allow_search']) {
echo '
<form id="search_form" class="floatright" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="search" name="search" value="" class="input_text"> ';
// Using the quick search dropdown?
$selected = !empty($context['current_topic']) ? 'current_topic' : (!empty($context['current_board']) ? 'current_board' : 'all');
echo '
<select name="search_selection">
<option value="all"', $selected == 'all' ? ' selected' : '', '>', $txt['search_entireforum'], ' </option>';
// Can't limit it to a specific topic if we are not in one
if (!empty($context['current_topic'])) {
echo '
<option value="topic"', $selected == 'current_topic' ? ' selected' : '', '>', $txt['search_thistopic'], '</option>';
}
// Can't limit it to a specific board if we are not in one
if (!empty($context['current_board'])) {
echo '
<option value="board"', $selected == 'current_board' ? ' selected' : '', '>', $txt['search_thisbrd'], '</option>';
}
echo '
<option value="members"', $selected == 'members' ? ' selected' : '', '>', $txt['search_members'], ' </option>
</select>';
// Search within current topic?
if (!empty($context['current_topic'])) {
echo '
<input type="hidden" name="sd_topic" value="', $context['current_topic'], '">';
} elseif (!empty($context['current_board'])) {
echo '
<input type="hidden" name="sd_brd[', $context['current_board'], ']" value="', $context['current_board'], '">';
}
echo '
<input type="submit" name="search2" value="', $txt['search'], '" class="button_submit">
<input type="hidden" name="advanced" value="0">
</form>';
}
echo '
</div>
</div>';
echo '
<!-- Uses a header that scrolls with the text, rather than staying
locked at the top -->
<div class="mdl-layout mdl-js-layout mdl-layout--overlay-drawer-button">
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">', $context['user']['name'], '</span>
<nav class="mdl-navigation">
', template_menu_mdl(), '
</nav>
</div>
<main class="mdl-layout__content">
<div class="page-content">
';
echo '
<div id="header">
<a id="top" href="', $scripturl, '"><img id="hlogo" src="', $settings['theme_url'], '/images/logo.png" alt="' . $context['forum_name_html_safe'] . '"></a>
';
echo '
</div>
<div id="wrapper">
<div id="upper_section">
<div id="inner_section">
<div id="inner_wrap">
<div class="user">
', $context['current_time'], '
</div>';
// Show a random news item? (or you could pick one from news_lines...)
if (!empty($settings['enable_news']) && !empty($context['random_news_line'])) {
echo '
<div class="news">
<h2>', $txt['news'], ': </h2>
<p>', $context['random_news_line'], '</p>
</div>';
}
echo '
<hr class="clear">
</div>';
// Show the menu here, according to the menu sub template, followed by the navigation tree.
template_menu();
theme_linktree();
echo '
</div>
</div>';
// The main content should go here.
echo '
<div id="content_section">
<div id="main_content_section">';
}