Backstage - OOC Forums

General Discussion => Web Development and Site Suggestions => Topic started by: Ché Biko on 16 Sep 2013, 09:09

Title: Seperate Did you know?/Search bar
Post by: Ché Biko on 16 Sep 2013, 09:09
I quite like the Did you know bar with all the fiction and RP trivia, but I don't like that I have to expand the entire section with my avatar and logged in time et cetera to see it.
I would prefer it if that bar is seperated from the section it is now part of.
Title: Re: Seperate Did you know?/Search bar
Post by: Steffanie Saissore on 16 Sep 2013, 13:29
I believe that that is part of the actual code for SMF; depending on the theme you choose, the "Did you know" will display in different spots.  The site I had been playing around with, in the default theme, it appears to the right of the screen near the top.
Title: Re: Seperate Did you know?/Search bar
Post by: Havohej on 20 Sep 2013, 06:35
Could be changed... given access to a faster pc.  Also, :effort:

It's a pita, so without either overwhelming support for the request or a billion ISK, I probably won't do it.   Maybe Misan?  vOv
Title: Re: Seperate Did you know?/Search bar
Post by: Niraia on 20 Sep 2013, 11:49
Had a few mins to spare, enjoy!

In /Themes/backnblack205/index.template.php:

1. Delete the following:
Code: [Select]
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: 140px;" class="input_text" />&nbsp;
<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'], '" />';
// If we're on a certain board, limit it to this board ;).
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>';

2. Immediately below where you deleted this, you'll see two closing div tags being echoed. Remove one of them.

3. Add the following directly below that echo.
Code: [Select]
echo '
<div id="news_section" class="titlebg2 tborder 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: 140px;" class="input_text" />&nbsp;
<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'], '" />';
// If we're on a certain board, limit it to this board ;).
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>';

4. Right below where you pasted that, you'll see some javascript. In the "aSwappableContainers" array, remove "news_section", so this :
Code: [Select]
aSwappableContainers: [
\'user_section\',
\'news_section\'
],
Becomes this:
Code: [Select]
aSwappableContainers: [
\'user_section\'
],