Advertisement:
Advertise With Us!

Author Topic: Moving the top search  (Read 2306 times)

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Moving the top search
« on: July 27, 2012, 02:32:37 PM »
I using 2.02 and basically the curve theme with some minor edits.
I attached a pic in case you need to look at what I was trying to accomplish.
Looking for affordable, reliable hosting.

Offline Orangine

  • Full Member
  • ***
  • Posts: 660
  • Gender: Female
Re: Moving the top search
« Reply #1 on: July 27, 2012, 02:36:46 PM »
in vanilla Curve, this is the place (index.template.php):
Quote
   // the upshrink image, right-floated
   echo '
         <img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';
   echo '
         ', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '<>', '
      <>
      <div id="upper_section" class="middletext"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
         <div class="user">';

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #2 on: July 27, 2012, 02:47:44 PM »
I just got rid of that lol

But I didn't see anything in there about search just the upshrink and smf logo.

this is all I found in the index.template

Code: [Select]
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
Looking for affordable, reliable hosting.

Offline Orangine

  • Full Member
  • ***
  • Posts: 660
  • Gender: Female
Re: Moving the top search
« Reply #3 on: July 27, 2012, 02:52:14 PM »
I just showed you where to put it, the corresponding form code is just beneath:
Code: [Select]
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />&nbsp;
<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'], '" />';
// 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>';

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #4 on: July 27, 2012, 02:56:38 PM »
sorry not good at coding so it should look something like this maybe


Code: [Select]
function template_body_above()
{
global $context, $settings, $options, $scripturl, $txt, $modSettings;

echo !empty($settings['forum_width']) ? '
<div id="wrapper" style="width: ' . $settings['forum_width'] . '">' : '', '
<div id="header"><div class="frame">
<div id="top_section">

</div>
                 <form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />&nbsp;
<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'], '" />';
// 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>';
<div id="upper_section" class="middletext"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
<div class="user">';
Looking for affordable, reliable hosting.

Offline Orangine

  • Full Member
  • ***
  • Posts: 660
  • Gender: Female
Re: Moving the top search
« Reply #5 on: July 27, 2012, 03:01:31 PM »
in vanilla index.template.php find:
Code: [Select]
   // the upshrink image, right-floated
   echo '
         <img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';
   echo '
         ', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="floatright">' . $settings['site_slogan'] . '<>', '
      <>
      <div id="upper_section" class="middletext"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
         <div class="user">';

   // If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
   {
      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...

and replace with:
Code: [Select]
   // the upshrink image, right-floated
   echo '
         <img id="upshrink" src="', $settings['images_url'], '/upshrink.png" alt="*" title="', $txt['upshrink_description'], '" style="display: none;" />';
   echo '
         <form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />&nbsp;
<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'], '" />';
// 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'], '" />
</form>
 
      <div id="upper_section" class="middletext"', empty($options['collapse_header']) ? '' : ' style="display: none;"', '>
         <div class="user">';

   // If the user is logged in, display stuff like their name, new messages, etc.
   if ($context['user']['is_logged'])
   {
      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...

you might need some additional styling tho

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #6 on: July 27, 2012, 03:03:02 PM »
Thank you I will try that thank you
Looking for affordable, reliable hosting.

Offline Orangine

  • Full Member
  • ***
  • Posts: 660
  • Gender: Female
Re: Moving the top search
« Reply #7 on: July 27, 2012, 03:04:05 PM »
no problem, if you're stuck come back and ask more questions :)

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #8 on: July 27, 2012, 03:12:42 PM »
That didn't work, moved everything to the left and the bottom of the forum got larger lol
Looking for affordable, reliable hosting.

Offline Orangine

  • Full Member
  • ***
  • Posts: 660
  • Gender: Female
Re: Moving the top search
« Reply #9 on: July 27, 2012, 03:16:44 PM »
to quote myself:
Quote
you might need some additional styling tho

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #10 on: July 27, 2012, 03:28:20 PM »
lol that was right on the money :D
But I don't know what or where to start :P
Looking for affordable, reliable hosting.

Offline Orangine

  • Full Member
  • ***
  • Posts: 660
  • Gender: Female
Re: Moving the top search
« Reply #11 on: July 27, 2012, 04:00:49 PM »
I'd say you should start with Firebug for Firefox, search in index.css which lines are responsible for styling the search box and change them accordingly.
If you're new to the CSS world, this would be a good place to start

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #12 on: July 27, 2012, 06:01:03 PM »
I wish I understood what you mean, I have tried Firebug and many other things and still can't figure it out.
Looking for affordable, reliable hosting.

Offline rocknroller

  • SMF Hero
  • ******
  • Posts: 1,558
  • Gender: Male
  • Justice has been served!
    • boris.jenicek on Facebook
    • Online Igrice
Re: Moving the top search
« Reply #13 on: July 27, 2012, 06:25:27 PM »
just try add this to your index.css

#search_form
{float:right;}
 in index.template.php you said that you find code below. it is just beginning of search form, this is FORM tag where is opened and must be </form> where is closed. and when you find it after </form> add <br style="clear:both;" /> 
I don't have my laptop right now to test this, so make backup before you try it,

Code: [Select]
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">


<br style="clear:both;" />

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #14 on: July 27, 2012, 09:33:19 PM »
Sorry been away from the pc, do I add the
#search_form
{float:right;}

to the bottom of the index.css

also another quick question  ;D
do I put the <br style="clear:both;" />

</form>;
before the ; or after it.
« Last Edit: July 27, 2012, 09:52:48 PM by CrazieGrafix »
Looking for affordable, reliable hosting.

Offline rocknroller

  • SMF Hero
  • ******
  • Posts: 1,558
  • Gender: Male
  • Justice has been served!
    • boris.jenicek on Facebook
    • Online Igrice
Re: Moving the top search
« Reply #15 on: July 28, 2012, 03:17:13 AM »
after, but that will function only if search code is before user section.

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #16 on: July 28, 2012, 09:24:05 AM »
I guess the search was after the user section since it didn't work. Thank you though for trying to help out.
Looking for affordable, reliable hosting.

Offline AllanD

  • Full Member
  • ***
  • Posts: 453
  • Gender: Male
  • It's All Good
    • KnD Hosting
Re: Moving the top search
« Reply #17 on: July 28, 2012, 03:59:08 PM »
Sorry for double post just wanted to mark this solved.

Thank you both for all the help.
Looking for affordable, reliable hosting.