1
Installation Problems / Re: Musiconia Theme Shop Button
« on: March 03, 2008, 12:04:07 am »
// The purpose of this code is to fix the height of overflow: auto div blocks, because IE can't figure it out for itself.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix.className == "code" || codeFix.className == "post" || codeFix.className == "signature") && codeFix.offsetHeight < 20)
codeFix.style.height = (codeFix.offsetHeight + 20) + "px";
}
}';
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if (codeFix.className == "code" && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0))
codeFix.style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix.currentStyle.overflow == "auto" && (codeFix.currentStyle.height == "" || codeFix.currentStyle.height == "auto") && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0) && (codeFix.offsetHeight != 0 || codeFix.className == "code"))
codeFix.style.height = (codeFix.offsetHeight + 36) + "px";
}
if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
echo '
// ]]></script>';
}
echo '
</div></td></tr></table>
</td>
<td width="29" background="', $settings['images_url'], '/bc_rightBG.gif"><img src="', $settings['images_url'], '/spacer.gif" width="29" height="1" alt="" /></td>
</tr>
<tr>
<td width="28" height="29"><img src="', $settings['images_url'], '/bc_bottomLeft.gif" width="28" height="29" alt="" /></td>
<td width="100%" height="29" background="', $settings['images_url'], '/bc_bottomBG.gif"><img src="', $settings['images_url'], '/spacer.gif" width="1" height="29" alt="" /></td>
<td width="29" height="29"><img src="', $settings['images_url'], '/bc_bottomRight.gif" width="29" height="29" alt="" /></td>
</tr>
</table>';
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</div>
</body></html>';
}
// If the user is logged in, display stuff like their new messages, etc...
function theme_newestlink()
{
global $context, $settings, $options, $scripturl, $txt;
if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> | <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a>';
}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;
echo '<div class="nav-tree" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;text-align:center;">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav-tree">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' » ';
}
echo '</div>';
}
//Show a linktree (this one is a vB look alike, vB clone is below).
function theme_linktree2()
{
global $context, $settings, $options;
// Folder style or inline? Inline has a smaller font.
echo '<span class="nav-tree" style="font-size: smaller;">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show pretty folder
if ($link_num == 0)
{
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
}
else if ($link_num == 1)
{
echo '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
}
else
{
echo '» ';
}
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav-tree">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
if ($link_num == 0)
{
echo '<br />';
}
}
echo '</span>';
}
// Show a linktree (vB Clone). This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree3()
{
global $context, $settings, $options;
// Folder style or inline? Inline has a smaller font.
echo '<span class="nav-tree">';
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
if (($link_num == count($context['linktree']) - 1) && count($context['linktree'])>1)
echo '<br />
<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav-tree">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num < count($context['linktree']) - 2)
echo ' » ';
}
echo '</span>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}
// Show the start of the tab section.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>';
// Show the [home] button.
echo '
<td class="main-navigation"><a href="', $scripturl, '">' , $txt[103] , '</a></td>';
// Show the [help] button.
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></td>';
// How about the [search] button?
if ($context['allow_search'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=search" onClick="return overlay(this, \'subcontent\',\'bottom\')">' , $txt[182] , '<img src="', $settings['images_url'], '/search_down.gif" width="10" height="10" /></a>
<!--Do not remove outer most DIV tag with id="subcontent"-->
<DIV id="subcontent" style="position:absolute; border: 2px solid #3d3d3d; background-color: white; width: 210px; padding: 2px; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">Quick Search</td>
</tr>
<tr>
<td height="26" align="left" valign="middle" class="windowbg">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<input type="text" name="search" value="" style="width: 150px;" />
<input type="submit" name="submit" value="GO" />
<input type="hidden" name="advanced" value="0" />';
// Search within current topic?
if (!empty($context['current_topic']['allow_search']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board
.
elseif (!empty($context['current_board']['allow_search']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
if ($context['allow_search'])
echo '
</form></td>
</tr>
<tr>
<td height="20" align="center" valign="middle" class="windowbg"><a href="', $scripturl, '?action=search;advanced">Advanced Search</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a href="#" onClick="overlayclose(\'subcontent\'); return false">[Close]</a></div>
</DIV>
</td>';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></td>';
// The [calendar]!
if ($context['allow_calendar'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></td>';
// the [member] list button
if ($context['allow_memberlist'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></td>';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></td>';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></td>';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></td>';
// How about the [quick links] button?
if ($context['user']['is_logged'])
echo '
<td class="main-navigation"><a href="', $scripturl, '#quicklinks" onClick="return overlay(this, \'quicklinks\',\'bottomright\')">Quick Links<img src="', $settings['images_url'], '/search_down.gif" width="10" height="10" /></a>
<!--Do not remove outer most DIV tag with id="quicklinks"-->
<DIV id="quicklinks" style="position:absolute; border: 2px solid #3d3d3d; background-color: white; width: 150px; padding: 2px; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">Quick Links</td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=unread">New Posts</a></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=unreadreplies">New Replies</a></td>
</tr>
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">User Settings</td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=profile">View Profile</a></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=profile;u=', $context['user']['id'], ';sa=account">Account Settings</a></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=profile;u=', $context['user']['id'], ';sa=forumProfile">Edit Profile</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a href="#" onClick="overlayclose(\'quicklinks\'); return false">[Close]</a></div>
</DIV>
</td>';
// The end of tab section.
echo '
</tr>
</table>';
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;
// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
$button_strip[$key] = $buttons[$key];
}
if (empty($button_strip))
return '<td> </td>';
echo '
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '"> </td>
<td height="40" valign="middle" class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' ', $button_strip) , '</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '"> </td>';
}
?>
I hope you can help me.
echo '
<script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[';
// Unfortunately, Safari does not have a "getComputedStyle" implementation yet, so we have to just do it to code...
if ($context['browser']['is_safari'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if ((codeFix.className == "code" || codeFix.className == "post" || codeFix.className == "signature") && codeFix.offsetHeight < 20)
codeFix.style.height = (codeFix.offsetHeight + 20) + "px";
}
}';
elseif ($context['browser']['is_firefox'])
echo '
window.addEventListener("load", smf_codeFix, false);
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = 0; i < codeFix.length; i++)
{
if (codeFix.className == "code" && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0))
codeFix.style.overflow = "scroll";
}
}';
else
echo '
var window_oldOnload = window.onload;
window.onload = smf_codeFix;
function smf_codeFix()
{
var codeFix = document.getElementsByTagName ? document.getElementsByTagName("div") : document.all.tags("div");
for (var i = codeFix.length - 1; i > 0; i--)
{
if (codeFix.currentStyle.overflow == "auto" && (codeFix.currentStyle.height == "" || codeFix.currentStyle.height == "auto") && (codeFix.scrollWidth > codeFix.clientWidth || codeFix.clientWidth == 0) && (codeFix.offsetHeight != 0 || codeFix.className == "code"))
codeFix.style.height = (codeFix.offsetHeight + 36) + "px";
}
if (window_oldOnload)
{
window_oldOnload();
window_oldOnload = null;
}
}';
echo '
// ]]></script>';
}
echo '
</div></td></tr></table>
</td>
<td width="29" background="', $settings['images_url'], '/bc_rightBG.gif"><img src="', $settings['images_url'], '/spacer.gif" width="29" height="1" alt="" /></td>
</tr>
<tr>
<td width="28" height="29"><img src="', $settings['images_url'], '/bc_bottomLeft.gif" width="28" height="29" alt="" /></td>
<td width="100%" height="29" background="', $settings['images_url'], '/bc_bottomBG.gif"><img src="', $settings['images_url'], '/spacer.gif" width="1" height="29" alt="" /></td>
<td width="29" height="29"><img src="', $settings['images_url'], '/bc_bottomRight.gif" width="29" height="29" alt="" /></td>
</tr>
</table>';
// The following will be used to let the user know that some AJAX process is running
echo '
<div id="ajax_in_progress" style="display: none;', $context['browser']['is_ie'] && !$context['browser']['is_ie7'] ? 'position: absolute;' : '', '">', $txt['ajax_in_progress'], '</div>
</div>
</body></html>';
}
// If the user is logged in, display stuff like their new messages, etc...
function theme_newestlink()
{
global $context, $settings, $options, $scripturl, $txt;
if ($context['user']['is_logged'])
{
echo '
<a href="', $scripturl, '?action=unread">', $txt['unread_since_visit'], '</a> | <a href="', $scripturl, '?action=unreadreplies">', $txt['show_unread_replies'], '</a>';
}
// Otherwise they're a guest - send them a lovely greating...
else
echo $txt['welcome_guest'];
}
// Show a linktree. This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree()
{
global $context, $settings, $options;
echo '<div class="nav-tree" style="font-size: smaller; margin-bottom: 2ex; margin-top: 2ex;text-align:center;">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav-tree">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num != count($context['linktree']) - 1)
echo ' » ';
}
echo '</div>';
}
//Show a linktree (this one is a vB look alike, vB clone is below).
function theme_linktree2()
{
global $context, $settings, $options;
// Folder style or inline? Inline has a smaller font.
echo '<span class="nav-tree" style="font-size: smaller;">';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show pretty folder
if ($link_num == 0)
{
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
}
else if ($link_num == 1)
{
echo '<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
}
else
{
echo '» ';
}
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav-tree">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
if ($link_num == 0)
{
echo '<br />';
}
}
echo '</span>';
}
// Show a linktree (vB Clone). This is that thing that shows "My Community | General Category | General Discussion"..
function theme_linktree3()
{
global $context, $settings, $options;
// Folder style or inline? Inline has a smaller font.
echo '<span class="nav-tree">';
echo '<img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
// Each tree item has a URL and name. Some may have extra_before and extra_after.
foreach ($context['linktree'] as $link_num => $tree)
{
// Show something before the link?
if (isset($tree['extra_before']))
echo $tree['extra_before'];
if (($link_num == count($context['linktree']) - 1) && count($context['linktree'])>1)
echo '<br />
<img src="' . $settings['images_url'] . '/icons/linktree_side.gif" alt="|-" border="0" /><img src="' . $settings['images_url'] . '/icons/folder_open.gif" alt="+" border="0" /> ';
// Show the link, including a URL if it should have one.
echo '<b>', $settings['linktree_link'] && isset($tree['url']) ? '<a href="' . $tree['url'] . '" class="nav-tree">' . $tree['name'] . '</a>' : $tree['name'], '</b>';
// Show something after the link...?
if (isset($tree['extra_after']))
echo $tree['extra_after'];
// Don't show a separator for the last one.
if ($link_num < count($context['linktree']) - 2)
echo ' » ';
}
echo '</span>';
}
// Show the menu up top. Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;
// Work out where we currently are.
$current_action = 'home';
if (in_array($context['current_action'], array('admin', 'ban', 'boardrecount', 'cleanperms', 'detailedversion', 'dumpdb', 'featuresettings', 'featuresettings2', 'findmember', 'maintain', 'manageattachments', 'manageboards', 'managecalendar', 'managesearch', 'membergroups', 'modlog', 'news', 'optimizetables', 'packageget', 'packages', 'permissions', 'pgdownload', 'postsettings', 'regcenter', 'repairboards', 'reports', 'serversettings', 'serversettings2', 'smileys', 'viewErrorLog', 'viewmembers')))
$current_action = 'admin';
if (in_array($context['current_action'], array('search', 'admin', 'calendar', 'profile', 'mlist', 'register', 'login', 'help', 'pm')))
$current_action = $context['current_action'];
if ($context['current_action'] == 'search2')
$current_action = 'search';
if ($context['current_action'] == 'theme')
$current_action = isset($_REQUEST['sa']) && $_REQUEST['sa'] == 'pick' ? 'profile' : 'admin';
// Are we using right-to-left orientation?
if ($context['right_to_left'])
{
$first = 'last';
$last = 'first';
}
else
{
$first = 'first';
$last = 'last';
}
// Show the start of the tab section.
echo '
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>';
// Show the [home] button.
echo '
<td class="main-navigation"><a href="', $scripturl, '">' , $txt[103] , '</a></td>';
// Show the [help] button.
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=help">' , $txt[119] , '</a></td>';
// How about the [search] button?
if ($context['allow_search'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=search" onClick="return overlay(this, \'subcontent\',\'bottom\')">' , $txt[182] , '<img src="', $settings['images_url'], '/search_down.gif" width="10" height="10" /></a>
<!--Do not remove outer most DIV tag with id="subcontent"-->
<DIV id="subcontent" style="position:absolute; border: 2px solid #3d3d3d; background-color: white; width: 210px; padding: 2px; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">Quick Search</td>
</tr>
<tr>
<td height="26" align="left" valign="middle" class="windowbg">
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="margin: 0;">
<input type="text" name="search" value="" style="width: 150px;" />
<input type="submit" name="submit" value="GO" />
<input type="hidden" name="advanced" value="0" />';
// Search within current topic?
if (!empty($context['current_topic']['allow_search']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';
// If we're on a certain board, limit it to this board
![Wink ;)](http://smfshop.com/forum/Smileys/alive/wink.gif)
elseif (!empty($context['current_board']['allow_search']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
if ($context['allow_search'])
echo '
</form></td>
</tr>
<tr>
<td height="20" align="center" valign="middle" class="windowbg"><a href="', $scripturl, '?action=search;advanced">Advanced Search</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a href="#" onClick="overlayclose(\'subcontent\'); return false">[Close]</a></div>
</DIV>
</td>';
// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=admin">' , $txt[2] , '</a></td>';
// The [calendar]!
if ($context['allow_calendar'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a></td>';
// the [member] list button
if ($context['allow_memberlist'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a></td>';
// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=login">' , $txt[34] , '</a></td>';
// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=register">' , $txt[97] , '</a></td>';
// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo '
<td class="main-navigation"><a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a></td>';
// How about the [quick links] button?
if ($context['user']['is_logged'])
echo '
<td class="main-navigation"><a href="', $scripturl, '#quicklinks" onClick="return overlay(this, \'quicklinks\',\'bottomright\')">Quick Links<img src="', $settings['images_url'], '/search_down.gif" width="10" height="10" /></a>
<!--Do not remove outer most DIV tag with id="quicklinks"-->
<DIV id="quicklinks" style="position:absolute; border: 2px solid #3d3d3d; background-color: white; width: 150px; padding: 2px; display:none">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">Quick Links</td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=unread">New Posts</a></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=unreadreplies">New Replies</a></td>
</tr>
<tr>
<td class="catbg" height="20" align="left" valign="middle" style="color:#ffffff;">User Settings</td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=profile">View Profile</a></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=profile;u=', $context['user']['id'], ';sa=account">Account Settings</a></td>
</tr>
<tr>
<td height="20" align="left" valign="middle" class="windowbg"><a href="', $scripturl, '?action=profile;u=', $context['user']['id'], ';sa=forumProfile">Edit Profile</a></td>
</tr>
</table>
<div align="right" style="font-size:10px;"><a href="#" onClick="overlayclose(\'quicklinks\'); return false">[Close]</a></div>
</DIV>
</td>';
// The end of tab section.
echo '
</tr>
</table>';
}
// Generate a strip of buttons.
function template_button_strip($button_strip, $direction = 'top', $force_reset = false, $custom_td = '')
{
global $settings, $buttons, $context, $txt, $scripturl;
// Create the buttons...
foreach ($button_strip as $key => $value)
{
if (isset($value['test']) && empty($context[$value['test']]))
{
unset($button_strip[$key]);
continue;
}
elseif (!isset($buttons[$key]) || $force_reset)
$buttons[$key] = '<a href="' . $value['url'] . '" ' .( isset($value['custom']) ? $value['custom'] : '') . '>' . $txt[$value['text']] . '</a>';
$button_strip[$key] = $buttons[$key];
}
if (empty($button_strip))
return '<td> </td>';
echo '
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'last' : 'first' , '"> </td>
<td height="40" valign="middle" class="', $direction == 'top' ? 'main' : 'mirror', 'tab_back">', implode(' ', $button_strip) , '</td>
<td class="', $direction == 'top' ? 'main' : 'mirror', 'tab_' , $context['right_to_left'] ? 'first' : 'last' , '"> </td>';
}
?>
I hope you can help me.