Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Brettflan on February 14, 2009, 02:34:48 PM

Title: Search Focus Dropdown
Post by: Brettflan on February 14, 2009, 02:34:48 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1634)

This mod adds a dropdown to the search field at the top of the page, similar to the one on the official SMF community forum.
When viewing a topic, the dropdown options will be "this topic" (default), "this board", "entire forum", or "Google".
When viewing a board, the dropdown options will be "this board" (default), "entire forum", or "Google".
On any other page, the dropdown options will be "entire forum" (default) or "Google".

The "Google" site-search option can be disabled in the Admin panel by going to Forum->Search->Settings and unchecking the new option there. Similarly, there is another option to enable "Bing" site-search in the same place.
You will also see a list of all your forum's boards there for possible inclusion in the dropdown as choices. These board choices will shown everywhere, just above the "entire forum" option. You can use this to add your "FAQ" or "Support" board (or whatever you like) to the dropdown for easy searching from anywhere in the forum.

Other than English, language strings are also provided for these languages: Brazilian Portuguese, French, German, Italian, Romanian, Russian, Spanish, Turkish.


Note: since support for SMF 2.0 RC1 was removed with version 1.6.0, 1.54 is still available (http://wimbli.com/smf/search_focus_dropdown_1.54_(OLD).zip) with support for it. Though honestly, if you're still running 2.0 RC1, your forum has been outdated for nearly two years now.


Changelog
version 1.6.1:version 1.6.0:version 1.54:version 1.53:version 1.52:version 1.51:version 1.5:version 1.44:version 1.43:version 1.42:version 1.41:version 1.4:version 1.31:version 1.3:version 1.2:version 1.1:
Title: Re: Search Focus Dropdown
Post by: edi67 on February 14, 2009, 05:22:02 PM
Great let me try it

Work perfectly thx

Italian language
// Search field scope mod
$txt['search_scope_topic'] = 'In questo topic';
$txt['search_scope_board'] = 'In questa sezione';
$txt['search_scope_all'] = 'In Tutto il forum';
Title: Re: Search Focus Dropdown
Post by: Chandy on February 14, 2009, 07:14:10 PM
Thx man :) !

Portuguese Brazil language
// Search field scope mod

$txt['search_scope_topic'] = 'Neste tópico';
$txt['search_scope_board'] = 'Nesta seção';
$txt['search_scope_all'] = 'Tudo no forum';

Title: Re: Search Focus Dropdown
Post by: NHWD on February 14, 2009, 10:19:23 PM
please make this mod compatible to 1.1.8!
Title: Re: Search Focus Dropdown
Post by: Brettflan on February 14, 2009, 10:26:39 PM
Quote from: CL0WNER on February 14, 2009, 10:19:23 PM
please make this mod compatible to 1.1.8!
I'll see what I can do. It will be a few days though until I have time to make an installation of 1.1.8 and work on it.
Title: Re: Search Focus Dropdown
Post by: chrisb on February 15, 2009, 12:28:08 AM
also would like to see it for 1.1.8
Title: Re: Search Focus Dropdown
Post by: blondeamon on February 15, 2009, 04:11:02 PM
Perfect....we look forward to it for 1.1.8
Title: Re: Search Focus Dropdown
Post by: timned88 on February 15, 2009, 07:41:38 PM
i have this installed but i am not seeing any functionality.  do i need to activate it in the admin panel or did something goof?
2.0RC1.


disregard....  cache needed to be cleared.
Title: Re: Search Focus Dropdown
Post by: Mo786 on February 15, 2009, 09:32:11 PM
Also waiting for 1.1.8 support. Thanks :)
Title: Re: Search Focus Dropdown
Post by: Brettflan on February 16, 2009, 07:59:08 PM
OK, version 1.2 is now released with support for SMF 1.1.8. It also includes Italian and Brazilian Portuguese language support thanks to edi67 and Chandy.
Title: Re: Search Focus Dropdown
Post by: Kimmie on February 19, 2009, 12:55:59 PM
I have two custom themes and normally I do not have a problem manually editing them however, I seem to be haivng difficulty installing this to their index.template.php files (none of the code that the parser says to look for is in either of them). I was wondering if you could take a look and see what the issue could be because I have no idea where to put this code. Thanks :)


(this is for my benefit so I know which one is which - 19.12 is for remix theme and 23.55 is for Brk theme)
Title: Re: Search Focus Dropdown
Post by: Brettflan on February 19, 2009, 07:59:30 PM
The best way to find the place to edit in index.template.php is to find $txt[182] (SMF 1.1.x) or $txt['search'] (SMF 2.0).
The changes basically consist of moving the submit button to the end of the form (so it shows after the dropdown) and swapping out code within that "if... elseif" code block to add the dropdown on board and topic views.
Title: Re: Search Focus Dropdown
Post by: cybergeneral on March 11, 2009, 07:04:32 AM
I'm using the theme Reference with version 2.0, but when I install the package it says will fail to "index.template" the theme Reference20b.
In fact I install and does not show the Search Focus on the pages.
Can you help?

my forum: www.lgcookiebr.com
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 11, 2009, 07:32:03 AM
Quote from: cybergeneral on March 11, 2009, 07:04:32 AM
I'm using the theme Reference with version 2.0, but when I install the package it says will fail to "index.template" the theme Reference20b.
In fact I install and does not show the Search Focus on the pages.
Can you help?

my forum: www.lgcookiebr.com (http://www.lgcookiebr.com)
Just at a glance I don't even see a search form (normally in the upper right of the page) on your site as a guest. If that search form is visible for users, that's fine, but otherwise the mod will do nothing anyway since that's the form it modifies.

I can't directly support installation of the mod to all possible themes, but I can point you in the right direction. For your theme, edit the index.template.php and find the text "$txt['search']" for your starting point.
To see roughly what needs to be done, you can view the mod listing (http://custom.simplemachines.org/mods/index.php?mod=1634), and to the right you'll see "Manual Install Instructions for SMF". Submit that form, and refer to the change listed under "./Themes/default/index.template.php" on the resulting page.

The important change is to replace the code which looks like this:
// 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'], '" />';

With this:
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />
<select name="search_scope">
<option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
<option value="board">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';
// 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'], '" />
<select name="search_scope">
<option value="board" selected="selected">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';

That will add in the dropdown as needed on board views and topic views.

The only other real change I made to that file is to move the submit button so that it shows up after the dropdown rather than in front of it, but that's just a cosmetic change and not actually necessary.
Title: Re: Search Focus Dropdown
Post by: AlenNS on March 11, 2009, 09:47:31 PM
I don't see any change. Even after clearing cache.

Now I see. On Simple Portal and board view there is no dropdown. :)
Title: Re: Search Focus Dropdown
Post by: pinoypetfinder on March 24, 2009, 10:44:17 PM
hi, i havent' update my forum to 1.1.8, where can i download this mod for 1.1.7 ?
[i haven't update because i'm too lazy to update all my installed mods just yet :/]
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 24, 2009, 10:50:06 PM
Quote from: pinoypetfinder on March 24, 2009, 10:44:17 PM
hi, i havent' update my forum to 1.1.8, where can i download this mod for 1.1.7 ?
[i haven't update because i'm too lazy to update all my installed mods just yet :/]

I don't plan to backport the mod to older versions of SMF.
However, you're welcome to try applying the 1.1.8 mod changes to see if they will work directly in 1.1.7 without any changes. Maybe, maybe not.
Title: Re: Search Focus Dropdown
Post by: KameL on April 06, 2009, 09:45:08 PM
Here is the spanish, spanish-latin and spanish-utf8 translation:
//SEARCH FOCUS DROPDOWN
$txt['search_scope_topic'] = 'Este tema';
$txt['search_scope_board'] = 'Este sub-foro';
$txt['search_scope_all'] = 'Todo el foro';
//FIN SEARCH FOCUS DROPDOWN
Title: Re: Search Focus Dropdown
Post by: Chit-Chat ChatterBox Boss on May 16, 2009, 01:55:43 PM
I installed this but see no changes. Any ideas?
Title: Re: Search Focus Dropdown
Post by: Brettflan on May 16, 2009, 09:35:16 PM
Quote from: Chit-Chat ChatterBox Boss on May 16, 2009, 01:55:43 PM
I installed this but see no changes. Any ideas?

Is it possibly related to the quoted post below?

Quote from: AlenNS on March 11, 2009, 09:47:31 PM
I don't see any change. Even after clearing cache.

Now I see. On Simple Portal and board view there is no dropdown. :)

If not, it might be a while before I can help you further... I just had a major house fire a couple of days ago and everything is basically helter skelter.
Title: Re: Search Focus Dropdown
Post by: Chit-Chat ChatterBox Boss on May 16, 2009, 09:45:59 PM
No it just acts like I never installed it (as far as appearing next to the search box.
Title: Re: Search Focus Dropdown
Post by: Brettflan on May 20, 2009, 12:05:13 AM
What other mods do you have installed?
Title: Re: Search Focus Dropdown
Post by: Chit-Chat ChatterBox Boss on May 20, 2009, 12:24:29 AM
everything says it installs perfect. Is there a setting to turn it on? I use 2.0 RC1

and i have too many mods  :D over 50  :o
Title: Re: Search Focus Dropdown
Post by: Brettflan on May 20, 2009, 02:34:15 AM
Quote from: Chit-Chat ChatterBox Boss on May 20, 2009, 12:24:29 AM
everything says it installs perfect. Is there a setting to turn it on? I use 2.0 RC1
There's no setting for it, it should simply work. Note that the dropdown does only show when viewing a board or a topic, nowhere else (as it doesn't apply anywhere else).

Do you have any mods installed which you can think of that would affect anything in that area with the search box and news section?
Title: Re: Search Focus Dropdown
Post by: Chit-Chat ChatterBox Boss on May 20, 2009, 03:04:24 AM
Got it to work thanks!
Title: Re: Search Focus Dropdown
Post by: Eclipse16V on May 31, 2009, 05:58:52 AM
Nice Mod

Here in German

// Search focus dropdown MOD
$txt['search_scope_topic'] = 'Dieses Thema';
$txt['search_scope_board'] = 'Dieses Forum';
$txt['search_scope_all'] = 'Gesamtes Forum';
Title: Re: Search Focus Dropdown
Post by: Brettflan on May 31, 2009, 02:56:32 PM
Version 1.3 is now released with support for SMF 1.1.9 and 2.0RC1-1. It also includes Spanish and German language support thanks to KameL and Eclipse16V.
Title: Re: Search Focus Dropdown
Post by: FragaCampos on June 02, 2009, 02:21:40 PM
Hello there.
Thanks for this mod.

I would like to install it, but my template doesn't have the correct strings in index.template.php

I tried to play a little with the code, but to no avail.

My search field looks like this:

echo '<br><br>';
echo '<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="text-align: right; padding: 0; margin: 0;">
<a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
<input type="text" name="search" value=""  />
<input type="submit" name="submit" value="', $txt[182], '" />
<input type="hidden" name="advanced" value="0" />';

echo '</form>';
echo '</td></tr></table>';
echo '</div>';



Any clues on how to fix this?
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 03, 2009, 08:04:20 AM
Quote from: FragaCampos on June 02, 2009, 02:21:40 PM
Hello there.
Thanks for this mod.

I would like to install it, but my template doesn't have the correct strings in index.template.php

I tried to play a little with the code, but to no avail.

My search field looks like this:

   echo '<br><br>';
   echo '<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '" style="text-align: right; padding: 0; margin: 0;">
       <a href="', $scripturl, '?action=search;advanced"><img src="'.$settings['images_url'].'/filter.gif" align="middle" style="margin: 0 1ex;" alt="" /></a>
       <input type="text" name="search" value=""  />
       <input type="submit" name="submit" value="', $txt[182], '" />
       <input type="hidden" name="advanced" value="0" />';
   
   echo '</form>';
   echo '</td></tr></table>';
   echo '</div>';



Any clues on how to fix this?

It looks like that form is set to only do general searches; it's probably a pretty old theme which has been updated only partially to keep up with changing SMF versions. I'm assuming you're using SMF 1.1.8 or 1.1.9?

No guarantees it will work, but you might try replacing this:
       <input type="text" name="search" value=""  />
       <input type="submit" name="submit" value="', $txt[182], '" />

with this:
       <input type="text" name="search" value=""  />';

        // Search within current topic?
        if (!empty($context['current_topic']))
            echo '
            <input type="hidden" name="topic" value="', $context['current_topic'], '" />
            <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />
            <select name="search_scope">
                <option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
                <option value="board">', $txt['search_scope_board'], '</option>
                <option value="all">', $txt['search_scope_all'], '</option>
            </select>';

        // 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'], '" />
            <select name="search_scope">
                <option value="board" selected="selected">', $txt['search_scope_board'], '</option>
                <option value="all">', $txt['search_scope_all'], '</option>
            </select>';

       echo '
       <input type="submit" name="submit" value="', $txt[182], '" />
Title: Re: Search Focus Dropdown
Post by: FragaCampos on June 03, 2009, 10:17:17 AM
Thanks for your help.

No, it didn't work. I received a blank page with "syntax error, unexpected '/'"

I'm using SMF 1.1.9 and my template is a NewDef by Bloc.
You can see it following my signature.
Title: Re: Search Focus Dropdown
Post by: Gladman on June 09, 2009, 01:20:18 PM
Brettflan,
QuoteNote that the dropdown does only show when viewing a board or a topic, nowhere else (as it doesn't apply anywhere else).
Don't you gonna spread it to all the forum (main page, personal messages page, e.t.c)?
I think it would be good ;)
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 10, 2009, 01:13:00 AM
Quote from: Gladman on June 09, 2009, 01:20:18 PM
Brettflan,
QuoteNote that the dropdown does only show when viewing a board or a topic, nowhere else (as it doesn't apply anywhere else).
Don't you gonna spread it to all the forum (main page, personal messages page, e.t.c)?
I think it would be good ;)
That wouldn't serve much purpose; the in-topic and in-board searches only make sense to even give an option for when they are applicable. How would an in-topic or in-board search work if you're not viewing a topic or not within a board on the forum?
Besides, the mod really just takes advantage of capabilities already in SMF and makes them more accessible. I'd like to keep it as simple and to the point as possible. The Personal Messages area does have search capabilities in SMF 2.0, but I think it works well enough the way it's already set up.
Title: Re: Search Focus Dropdown
Post by: imno007 on June 27, 2009, 06:21:46 PM
Okay, sorry, but I get real nervous messing with code like this, after too many experieces f my boards going "poof" after some supposedly minor change. This is the code in my index temple where you say to search  for "$txt['search']":

Quote// How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action=='search' || $context['browser']['is_ie4']) ? '' : '' , '
      <li class="' , $current_action == 'search' ? 'current' : '' , '"><a href="', $scripturl, '?action=search">' , $txt['search'] , '</a></li>';

And that's it. Can you tell me please exactly what I should replace this with?

TIA!
Title: Re: Search Focus Dropdown
Post by: kat on June 27, 2009, 06:26:16 PM
Brettflan... Do you think you could get that mod installed, here? ;)
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 28, 2009, 01:21:16 AM
Quote from: imno007 on June 27, 2009, 06:21:46 PM
Okay, sorry, but I get real nervous messing with code like this, after too many experieces f my boards going "poof" after some supposedly minor change. This is the code in my index temple where you say to search  for "$txt['search']":

Quote// How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action=='search' || $context['browser']['is_ie4']) ? '' : '' , '
      <li class="' , $current_action == 'search' ? 'current' : '' , '"><a href="', $scripturl, '?action=search">' , $txt['search'] , '</a></li>';

And that's it. Can you tell me please exactly what I should replace this with?

TIA!

What theme and what version of SMF do you have?
Title: Re: Search Focus Dropdown
Post by: imno007 on June 30, 2009, 12:14:47 PM
Quote from: Brettflan on June 28, 2009, 01:21:16 AM
Quote from: imno007 on June 27, 2009, 06:21:46 PM
Okay, sorry, but I get real nervous messing with code like this, after too many experieces f my boards going "poof" after some supposedly minor change. This is the code in my index temple where you say to search  for "$txt['search']":

Quote// How about the [search] button?
   if ($context['allow_search'])
      echo ($current_action=='search' || $context['browser']['is_ie4']) ? '' : '' , '
      <li class="' , $current_action == 'search' ? 'current' : '' , '"><a href="', $scripturl, '?action=search">' , $txt['search'] , '</a></li>';

And that's it. Can you tell me please exactly what I should replace this with?

TIA!

What theme and what version of SMF do you have?


I'm using the Kani 2.0 theme with  SMF 2.0 RC1-1.
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 30, 2009, 11:27:10 PM
OK, since that's not a free theme I can't check it. The $txt['search'] you found however is a different instance of it. Search for it again as part of an input control, like so:

<input type="submit" name="submit" value="', $txt['search'], '" style="width: 11ex;" />
Title: Re: Search Focus Dropdown
Post by: imno007 on July 06, 2009, 10:32:56 PM
Quote from: Brettflan on June 30, 2009, 11:27:10 PM
OK, since that's not a free theme I can't check it. The $txt['search'] you found however is a different instance of it. Search for it again as part of an input control, like so:

<input type="submit" name="submit" value="', $txt['search'], '" style="width: 11ex;" />

No, the only instance of ''$txt['search']'' I can find is the one I listed above. Could it possibly be somewhere else besides 'index.template.php' ?
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 07, 2009, 09:32:03 PM
Not likely. Hmm, does the search form have the usual button with the text "Search" on it? That's what $txt['search'] contains, so if it has some other text/image for the search button, that might not show up there.

So... other things you might try to search for in the vicinity: search_form or name="search" or search2.
Title: Re: Search Focus Dropdown
Post by: imno007 on July 14, 2009, 03:04:15 PM
Quote from: Brettflan on July 07, 2009, 09:32:03 PM
Not likely. Hmm, does the search form have the usual button with the text "Search" on it? That's what $txt['search'] contains, so if it has some other text/image for the search button, that might not show up there.

So... other things you might try to search for in the vicinity: search_form or name="search" or search2.

Hi, the theme has a search button on the top menu but not the usual blank input field with 'search' next to it - the quick search. Of the other searches you suggested, I found only 'search2' in this block:

Quote// 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', 'admin2', 'calendar', 'profile', 'mlist', 'register', 'login', 'logout', 'help', 'pm')))
      $current_action = $context['current_action'];
   if ($context['current_action'] == 'search2')
      $current_action = 'search';
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 14, 2009, 04:31:34 PM
That theme's search form must be designed completely differently from the default theme then.

Since your theme is a commercial one, I don't know whether it would be legal for you to provide the index.template.php file from it. At this point, however, I don't see any other way forward.
Title: Re: Search Focus Dropdown
Post by: imno007 on July 15, 2009, 01:08:01 PM
I don't know either, but I'm attaching it here. Let me know once you have it and I'll delete it. Thank you.
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 15, 2009, 02:15:13 PM
OK, downloaded it.... well, that explains it. There is no search form in your index.template.php file. I'm assuming the theme author moved it to a different .template.php file, but I have no way of knowing where.

You might try searching for some of the previous strings I had you look for within other theme files. Personally, that's a job I'd use a tool like Search&Replace (http://www.funduc.com/search_replace.htm) for.
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 16, 2009, 04:52:02 PM
How-To make wieved SEARCH FOCUS DROPDOWN on first forum page with search in google or entire forum or somewhere else?
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 16, 2009, 09:12:49 PM
That depends... do you already have search set up to use Google? Is it from a different mod, or what?
Either way, it would take a moderate amount of extra work to get it set up.
Title: Re: Search Focus Dropdown
Post by: imno007 on July 16, 2009, 10:35:27 PM
Quote from: Brettflan on July 15, 2009, 02:15:13 PM
OK, downloaded it.... well, that explains it. There is no search form in your index.template.php file. I'm assuming the theme author moved it to a different .template.php file, but I have no way of knowing where.

You might try searching for some of the previous strings I had you look for within other theme files. Personally, that's a job I'd use a tool like Search&Replace (http://www.funduc.com/search_replace.htm) for.

It doesn't appear to exist. I checked every single file in the theme and couldn't find another single instance of "search" anywhere, besides css display. Must be something he's done in JS, which is beyond me. Thanks for looking at it, though.
Title: Re: Search Focus Dropdown
Post by: 4Kstore on July 16, 2009, 11:34:31 PM
perfect mod! thanks!
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 17, 2009, 11:55:38 AM
Quote from: aPTyPuK on July 16, 2009, 04:52:02 PM
How-To make wieved SEARCH FOCUS DROPDOWN on first forum page with search in google or entire forum or somewhere else?
Quote from: Brettflan on July 16, 2009, 09:12:49 PM
That depends... do you already have search set up to use Google? Is it from a different mod, or what?
Either way, it would take a moderate amount of extra work to get it set up.
I don't have any search mods except SEARCH FOCUS DROPDOWN. I talk about search from first forum page, how make it viewed in there? And add search box in search in users stuff? Please give me a code for it. 8)
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 17, 2009, 01:05:26 PM
Quote from: aPTyPuK on July 17, 2009, 11:55:38 AM
Quote from: aPTyPuK on July 16, 2009, 04:52:02 PM
How-To make wieved SEARCH FOCUS DROPDOWN on first forum page with search in google or entire forum or somewhere else?
Quote from: Brettflan on July 16, 2009, 09:12:49 PM
That depends... do you already have search set up to use Google? Is it from a different mod, or what?
Either way, it would take a moderate amount of extra work to get it set up.
I don't have any search mods except SEARCH FOCUS DROPDOWN. I talk about search from first forum page, how make it viewed in there? And add search box in search in users stuff? Please give me a code for it. 8)

It's not showing up on your forum index? Are you using the Simple Portal addon? If so, apparently it removes the search form from the index. There were a couple of people earlier who found that to be the case.
I don't know what you're referring to when you say you want a search box in "users stuff". Personal Messages? Member List?
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 17, 2009, 04:11:40 PM
No, im not install any portal mods, i have SMF 1.1.9
and mods
1. Search Focus Dropdown 1.3
2. Enhanced Quick Reply Box 2.0.2
3. Spoiler Tag 0.6b
4. Auto Merge Double Post 1.2
5. cbi, 1.0 1.0a
6. Users Online Today Mod 1.4.0
but default language russian utf-8.
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 17, 2009, 06:14:03 PM
Hmm... could you provide a link to the forum, or a screenshot of what exactly you're talking about?
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 17, 2009, 07:58:07 PM
i send link to your PM ;)
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 18, 2009, 06:05:23 AM
here default theme index.template.php
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 18, 2009, 03:36:01 PM
Ah, sorry, I'm not always firing on all cylinders lately; too much stuff going on. I checked your file and saw that the mod is installed fine on it. However, I then realized that your forum is exhibiting normal behavior for the mod. I must be losing it. :P
There isn't supposed to be a dropdown on the index page, since searches from there can only be for the "entire forum". Topic searches and board searches don't apply since you're not inside a board or topic; you're at the index.
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 18, 2009, 08:14:52 PM
Whether but, there is what a way to make for example as at this forum, that search box was active on all pages including main?
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 18, 2009, 08:55:01 PM
Quote from: aPTyPuK on July 18, 2009, 08:14:52 PM
Whether but, there is what a way to make for example as at this forum, that search box was active on all pages including main?

It makes sense for the forum here because they have other content hooked in (Modifications, Themes, Online Manual).
Answer me this then, what would be the purpose of a dropdown with only one option ("Entire forum")?

EDIT: though, if you do have other options you want to add in like that for you own forum, feel free. Just edit the dropdown code to include more options in it (the code added to index.template.php), add in another case there to have it show the dropdown on the index, and add in some code to the block added to Search.php to handle the new options however you see fit.
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 18, 2009, 11:02:25 PM
As example can you post some useful code for search box? Some for users or something else? 8)
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 20, 2009, 06:04:03 AM
Quote from: aPTyPuK on July 18, 2009, 11:02:25 PM
As example can you post some useful code for search box? Some for users or something else? 8)

If I had a useful example, I'd probably just add it in to the mod. However, if you just need some reference, then...

Among the dropdown options for topics:
                    <option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
                    <option value="board">', $txt['search_scope_board'], '</option>
                    <option value="all">', $txt['search_scope_all'], '</option>

and boards:
                    <option value="board" selected="selected">', $txt['search_scope_board'], '</option>
                    <option value="all">', $txt['search_scope_all'], '</option>

You could add another option, like so, to both of the above:
                    <option value="askjeeves">Ask Jeeves</option>

If you wanted the dropdown to show up on the index, you could add in the following right after the if...elseif block which determines if it's within a board or topic:
    // We must be on a page other than within a board or topic, such as the index
    else
        echo '
                <select name="search_scope">
                    <option value="all" selected="selected">', $txt['search_scope_all'], '</option>
                    <option value="askjeeves">Ask Jeeves</option>
                </select>';


You would then need to add in code to Search.php to handle the new option, similar to this:
    if ($s_scope == "askjeeves")
    {    //if they chose "Ask Jeeves", redirect the user's browser appropriately
        ob_end_clean();
        header( 'HTTP/1.1 302 Found' );
        header( 'Status: 302 Found' );
        header( 'Location: http://www.askjeeves.com/?q=' . urlencode($_REQUEST['search']) );
        exit();
    }

The above is appropriately designed, but (as far as I know) is nonworking; I didn't bother checking the real Ask Jeeves query method and just made up the query style in the above askjeeves.com URL.

If you need more help than that, I can only recommend you take some time to learn basic PHP (http://tizag.com/phpT/) before trying to mess around with it.
Title: Re: Search Focus Dropdown
Post by: apTyaH on July 20, 2009, 03:28:28 PM
Brettflan , its practically that needs to know. Biggest thanks ! (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.simplemachines.ru%2FSmileys%2FSMF_Smilies%2Fafro.gif&hash=ba85507a2add4c7f985333110cfef6fc71a347fb)
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 06, 2009, 06:09:11 PM
Minor update: installation support for SMF 1.1.10 and 2.0RC1.2.
See the mod link in the first post.
Title: Re: Search Focus Dropdown
Post by: kai920 on August 06, 2009, 09:09:19 PM
Quote from: Brettflan on August 06, 2009, 06:09:11 PM
Minor update: installation support for SMF 1.1.10 and 2.0RC1.2.
See the mod link in the first post.

Thanks Brett. If your mod was already working on my 2.0 RC1.2, do I need to update?
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 06, 2009, 09:14:10 PM
There's no need, the only changes were to allow installation/uninstallation on those newer versions. Nothing within the mod itself was changed.
Title: Re: Search Focus Dropdown
Post by: kai920 on August 06, 2009, 10:31:34 PM
Sounds great. Thanks!
Title: Re: Search Focus Dropdown
Post by: plusev on August 13, 2009, 02:30:53 PM
Can the mod be extended to work on article pages SP 2.2.3 or custom pages generated or the Dozen page mod? I have lots of content thats not in the forum that would be great for search focus.

Thx, +EV
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2009, 04:18:19 PM
Quote from: plusev on August 13, 2009, 02:30:53 PM
Can the mod be extended to work on article pages SP 2.2.3 or custom pages generated or the Dozen page mod? I have lots of content thats not in the forum that would be great for search focus.

Thx, +EV

With a bit of work, sure. I posted a rough outline of how to do something like that back here (http://www.simplemachines.org/community/index.php?topic=293057.msg2167895#msg2167895).
Title: Hungraian translation
Post by: hustreamload on September 18, 2009, 12:23:03 AM
$txt['search_scope_topic'] = 'Keresés a topikban';
$txt['search_scope_board'] = 'Keresés a témában';
$txt['search_scope_all'] = 'Keresés a teljes fórumban';
Title: Re: Search Focus Dropdown
Post by: hustreamload on September 18, 2009, 01:26:22 AM
Hi there,

I've tried several modifications with our forums default theme "Implied", but couldnt make visible Search Dropdown.
I've read through all your previous hints, but as I'm not professional, with no success. With the SMF default theme everything works all right.
So Brettflan, pls. help me. 

The easiest way I can post you the index.template.php of implied, and the access to our forum.
Thnks in advance.
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 18, 2009, 02:40:06 AM
I checked your site but it appears to require an account to see anything in the actual forum. I tried registering but the CAPTCHA image wasn't showing up and the audio clip for it just played the same thing each time ("FTRFD", which didn't work).
To be clear, you should normally  only see the dropdown on board views and topic views, not the index page. Since you use Simple Portal (which I have no experience with), I don't think it will show up on board views either; somebody else mentioned earlier in the topic that the Simple Portal removes the search box completely from board views.
Title: Re: Search Focus Dropdown
Post by: hustreamload on September 18, 2009, 05:22:41 AM
Thnx.

I've sent you a user acc and pass for viewing ur forum in PM.
Though we have Simple portal, in theme SMF Deafult everything works OK, also with simple portal.

User/pass with default theme Implied:

User/pass with SMF Default Theme:

At the top of the site, under the main buttons click on "Magyar Streamload Fórum - Hungarian Streamload Forum " to see the forum. If you login as piamat, you will see the SMF Default theme, and in any borad and topic you can see the Search Dropdown. In Implied nothing.....
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 18, 2009, 05:34:51 AM
OK, got it, you can remove that login info.
It does appear that the "Implied" theme has the search boxes completely removed for whatever reason. Based on that, I don't really know what to tell you other than to contact the theme author about it. If the search boxes actually existed, I could probably help you with integration.

EDIT: otherwise, their may be some option in Simple Portal to add the search box back in as a module or something; I say this from having briefly worked with a couple of other CMS systems, but again I have no experience with Simple Portal or how its admin interface works.
Title: Re: Search Focus Dropdown
Post by: hustreamload on September 18, 2009, 06:06:54 AM
Thnx a lot.

In that case I try to ask both team. When we find any solution, I will write about it also here.
Title: Re: Search Focus Dropdown
Post by: Joker™ on October 24, 2009, 02:25:13 PM
bro ur mod works g8 on default theme

but when i put ni-life theme

http://custom.simplemachines.org/themes/index.php?lemma=1822

that one i cant see modifications ur saying in index.template.php........

plz have a look at my problem

thanx in advance
Title: Re: Search Focus Dropdown
Post by: Brettflan on October 24, 2009, 02:57:10 PM
Quote from: sid2varun on October 24, 2009, 02:25:13 PM
bro ur mod works g8 on default theme

but when i put ni-life theme

http://custom.simplemachines.org/themes/index.php?lemma=1822 (http://custom.simplemachines.org/themes/index.php?lemma=1822)

that one i cant see modifications ur saying in index.template.php........

plz have a look at my problem

thanx in advance
I just checked the demo site for that theme and it doesn't appear to have a search box at the top at all. So, nothing is there to be modified.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 16, 2009, 12:07:48 AM
Released version 1.4:
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 19, 2009, 09:02:55 AM
Released version 1.41:
Basically, the dropdown was showing below the search box on those 3 themes, which looked odd. It now shows to the right of the search box in those themes.
That'll teach me not to double check before release; it displayed correctly on the RC2 Charter releases of those themes, but not the RC2 Public releases. Oops.  :P

So, if you're not using any of those 3 themes, don't bother updating. If you are using one or more of them, you should uninstall the 1.4 version of the mod and then install the new 1.41.
Title: Re: Search Focus Dropdown
Post by: Captain351 on December 02, 2009, 04:46:50 PM
You need to update the package for 1.1.11
Title: Re: Search Focus Dropdown
Post by: Brettflan on December 02, 2009, 10:03:42 PM
Released version 1.42:
In other words, not a necessary download unless you're installing on 1.1.11.
Title: Re: Search Focus Dropdown
Post by: rexusdiablos on January 26, 2010, 06:50:25 AM
I've installed this on 2.0 RC2 but there is no effect. The dropdown does not appear on my board list, my topic list or the actuals threads.

I'm customizing a copy of the Curve theme. All the files checked and installed 'successfully' so what might the problem be?

I have the following mods installed:
Karma Description Mod
TopicCountOnDisplay
cb1, 1.0
Last Post On Memberlist
Last Active On Memberlist
Footnotes

Title: Re: Search Focus Dropdown
Post by: Brettflan on January 26, 2010, 07:28:23 AM
Did you install it to your customized copy of the Curve theme (I assume it's separate from the main Curve theme)?
Title: Re: Search Focus Dropdown
Post by: rexusdiablos on January 26, 2010, 08:55:52 AM
Quote from: Brettflan on January 26, 2010, 07:28:23 AM
Did you install it to your customized copy of the Curve theme (I assume it's separate from the main Curve theme)?

It works on the topic list and thread pages when I switch the forum theme back to SMF Default Theme - Curve.

What can I do to determine what theme it installs on? Do I need to manually parse it?
Title: Re: Search Focus Dropdown
Post by: rexusdiablos on January 26, 2010, 08:58:35 AM
Also, is their a way of getting a dropdown on the main board for a list of board categories?
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 26, 2010, 09:14:28 AM
When you install it, you should see at the bottom "Install to other themes", which has SMF try to apply the Default theme changes to other themes.

EDIT:
Quote from: rexusdiablos on January 26, 2010, 08:58:35 AM
Also, is their a way of getting a dropdown on the main board for a list of board categories?
Something like that should be pretty easy, but it doesn't seem to have anything to do with this mod.
Title: Re: Search Focus Dropdown
Post by: rexusdiablos on January 26, 2010, 09:20:34 AM
Thanks, didn't notice that option.

Is there any way of getting a dropdown on the board list page for:

> board categories
> entire forum
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 26, 2010, 10:06:13 AM
It's... possible, certainly, but I don't plan on adding that feature. It would take quite a bit more work for what seems to be small benefit to me.
Title: Re: Search Focus Dropdown
Post by: rexusdiablos on January 28, 2010, 07:14:20 PM
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.pspsps.tv%2Fsad_kitten.jpg&hash=3320aacf5a8bdfbd5c47afcf36e2f21c2d7d0201)
Title: Re: Search Focus Dropdown
Post by: Jesus Friends on February 09, 2010, 11:51:32 PM
Hey ... great job Man
Many thanks ...

Here is Arabic Language  O:)

$txt['search_scope_topic'] = 'الموضوع الحالي';
$txt['search_scope_board'] = 'القسم الحالي';
$txt['search_scope_all'] = 'المنتدى كاملاً';


Oops  ??? I think I came too late ... but better than nothing  ;)
Title: Re: Search Focus Dropdown
Post by: Membre on March 07, 2010, 03:10:24 PM
Very nice mod, works great.
Title: Re: Search Focus Dropdown
Post by: Ryoki on March 07, 2010, 05:47:36 PM
Nicely done!
The mod works well without any problems.  :)
Title: Re: Search Focus Dropdown
Post by: Eclipse16V on March 15, 2010, 02:15:10 AM
Nice Mod

Please update it for SMF 2.0RC3  ;)

Thanks
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 15, 2010, 07:37:25 AM
No worries, I'll be updating it within the next few days.
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 17, 2010, 07:48:34 AM
Released version 1.43:

In other words, not a necessary download unless you're installing on 2.0 RC3.
Title: Re: Search Focus Dropdown
Post by: TheListener on March 17, 2010, 05:59:44 PM
The mod install with no errors.

However I don't see any difference with the search bar.

Using Curvemavi theme on RC3

www.mkaware.co.uk


Edit: Found out what I was doing wrong.
Title: Re: Search Focus Dropdown
Post by: villasg on March 18, 2010, 01:59:25 PM
i forgot to upload before (11/2009) when i install successful this beuty modification

greek-utf8

<file name="$languagedir/Modifications.greek-utf8.php" error="skip">
<operation>
<search position="end" />
<add><![CDATA[

// Search focus dropdown mod
$txt['search_scope_topic'] = 'Αυτό τό topic';
$txt['search_scope_board'] = 'Αυτό τό board';
$txt['search_scope_all'] = 'Όλο τό forum';]]></add>
</operation>
</file>


Thanks
Title: Re: Search Focus Dropdown
Post by: thesicilian on March 27, 2010, 05:34:00 PM
I've been trying to install on 1.1.11 with no joy, getting this: -

Install Actions
Installations actions for "Search Focus Dropdown":
The package you are trying to download or install is either corrupt or not compatible with this version of SMF. 


Any ideas?
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 27, 2010, 06:44:23 PM
Hmm, yeah, my mistake. Somehow 1.1.11 installation support got lost in the last update. It's fixed now, so download it again.

Sorry about that.
Title: Re: Search Focus Dropdown
Post by: Kat9119 on March 31, 2010, 11:56:07 PM
Works great on my 1.1.11 thanks!
Title: Re: Search Focus Dropdown
Post by: Joker™ on April 01, 2010, 02:05:52 AM
nice mod ... with the help of code i made it working on silent wave also ;)

http://custom.simplemachines.org/themes/index.php?lemma=326

g8 thanx to mod author
Title: Re: Search Focus Dropdown
Post by: eismann on April 03, 2010, 11:54:34 AM
Very great Mod!

I also added Google Search to it.

You can see it here in my German LX Forum (http://www.300c-forum.de)

How can I open the Search by Google in an extra window..?

Best regards
Title: Re: Search Focus Dropdown
Post by: Brettflan on April 03, 2010, 12:18:50 PM
Quote from: eismann on April 03, 2010, 11:54:34 AM
How can I open the Search by Google in an extra window..?

Hmm. Since you would want only the Google search to open in a new window, you should be able to use Javascript to change the target of the form to a new window when Google is selected in the list, and change the target back when anything else in the list is selected.
Title: Re: Search Focus Dropdown
Post by: eismann on April 03, 2010, 01:06:52 PM
Where could I change it to Javascript..?
Title: Re: Search Focus Dropdown
Post by: Brettflan on April 03, 2010, 02:12:48 PM
Google something like "javascript form target" and you should find articles describing that sort of thing.
Title: Re: Search Focus Dropdown
Post by: Spacecadet on June 09, 2010, 05:54:13 PM
I installed the "Search Focus Dropdown" and It is not working properly. I found the code and know there is something wrong but I don't know how to fix it, can anyone help please. Here is the code.

<form id="search_form" style="margin: 0;" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />&nbsp;';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />
<select name="search_scope" id="search_scope">
<option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
<option value="board">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';
// 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'], '" />
<select name="search_scope" id="search_scope">
<option value="board" selected="selected">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';

echo '
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
<input type="hidden" name="advanced" value="0" />
</form>';
Title: Re: Search Focus Dropdown
Post by: Joker™ on June 09, 2010, 05:56:02 PM
Quote from: Spacecadet on June 09, 2010, 05:54:13 PM
I installed the "Search Focus Dropdown" and It is not working properly. I found the code and know there is something wrong but I don't know how to fix it, can anyone help please. Here is the code.

<form id="search_form" style="margin: 0;" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input type="text" name="search" value="" class="input_text" />&nbsp;';

// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />
<select name="search_scope" id="search_scope">
<option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
<option value="board">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';
// 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'], '" />
<select name="search_scope" id="search_scope">
<option value="board" selected="selected">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';

echo '
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
<input type="hidden" name="advanced" value="0" />
</form>';



would be much better if u tell the author what problem are you facing , i mean what is not working properly
Title: Re: Search Focus Dropdown
Post by: Spacecadet on June 09, 2010, 05:59:57 PM
The drop down menu is not there. It looks like it always did.
Title: Re: Search Focus Dropdown
Post by: adbrad on June 09, 2010, 06:06:36 PM
you have to be in a board or topic for it to show up
Title: Re: Search Focus Dropdown
Post by: Spacecadet on June 09, 2010, 06:10:58 PM
Oh crap! I'm an idiot!
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 09, 2010, 11:07:25 PM
That seems to be a common source of confusion... maybe I should just add in a dropdown for the index as well which has only the one entry ("Entire forum")? I could see that being a source of confusion as well, though. Hmm.
Title: Re: Search Focus Dropdown
Post by: adbrad on June 10, 2010, 03:29:11 AM
i think that would be an improvement as it shows on every page on this forum a lot of webmasters will be more used to seeing it that way
Title: Re: Search Focus Dropdown
Post by: knightofdoom on June 10, 2010, 06:11:01 AM
Thanks does it work?
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 10, 2010, 06:52:21 AM
Quote from: knightofdoom on June 10, 2010, 06:11:01 AM
Thanks does it work?

What, the mod package? Yes.
Title: Re: Search Focus Dropdown
Post by: knightofdoom on June 10, 2010, 06:58:37 AM
Thanks cheers
Title: Re: Search Focus Dropdown
Post by: Shannar on June 14, 2010, 06:48:38 AM
Why mod don't find anything on child boards? How I can fix it?
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 14, 2010, 06:59:55 AM
Quote from: Shannar on June 14, 2010, 06:48:38 AM
Why mod don't find anything on child boards?

As far as I know, that's just how in-board searches work. They search the board you're in, not child boards.

Quote from: Shannar on June 14, 2010, 06:48:38 AM
How I can fix it?

I guess you could dig into the code and add in that functionality.  :P
Seriously though, I guess I could potentially add something like that in, though I wouldn't want to change the way the default option works since that's expected behavior. Perhaps a new dropdown option, "This board and child boards"? That reads a bit long though, and would stretch out the width of the dropdown box quite a bit, which wouldn't really be good. So, I'm not so hot on the idea.
Title: Re: Search Focus Dropdown
Post by: Shannar on June 14, 2010, 07:22:15 AM
Quote from: Brettflan on June 14, 2010, 06:59:55 AM
I guess you could dig into the code and add in that functionality.  :P

I try, but bad understood code.  :-\

Quote from: Brettflan on June 14, 2010, 06:59:55 AM
Perhaps a new dropdown option, "This board and child boards"?

Maybe. How about "This board (full)" or else? And if user switch "Show child boards on every page inside boards, not just the first." -- then use this option as default?
Title: Re: Search Focus Dropdown
Post by: Bugo on June 17, 2010, 12:57:18 PM
if ($s_scope == "all")
{ //if searching "entire forum", remove the board+category links already added to the linktree
array_pop($context['linktree']);
array_pop($context['linktree']);
}

There is two identical lines - so it should be?
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 17, 2010, 03:41:09 PM
Quote from: Bugo on June 17, 2010, 12:57:18 PM
There is two identical lines - so it should be?
Yes. It's removing two entries from the linktree.
Title: Re: Search Focus Dropdown
Post by: Joker™ on June 26, 2010, 06:16:33 AM
bro i want to add google search also in ur mod.this is the code in using at my site for google search, but i have seperate area to enter text to make google search , i would like to merge it with ur mod.


// Google Search your site Start
echo'
<div>
<form method="get" action="http://www.google.com/search" target="_blank">
<img alt="animedk.net" src="'.$settings['default_theme_url'].'/images/google.gif" width="61" height="24" align="middle" />
<input type="hidden" name="sitesearch" value="', str_replace("/index.php", "", $scripturl), '" />
<input type="text" name="q" size="41" maxlength="255" value="" />
</form>

</div>';


like on smf we have option 'Entire site' which takes us to google search , i would like it as 'Google Search' and will take users to google search.
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 26, 2010, 04:22:21 PM
A guy added it earlier, you might get in contact with him.
http://www.simplemachines.org/community/index.php?topic=293057.msg2567481#msg2567481


Actually though, I was already thinking of going ahead and adding Google site search in the dropdown for the next version, with an option in the Admin panel to not show it. I'll probably have time to do that in a few days or so, but no promises.


EDIT: OK, I decided to rework and clean up the mod package while I was at it, and it's taken longer than I expected. Current target for release is some time late next week, since I'm heading off on a short vacation tomorrow.
Title: Re: Search Focus Dropdown
Post by: Joker™ on July 02, 2010, 04:23:49 AM
Quote from: Brettflan on June 26, 2010, 04:22:21 PM
A guy added it earlier, you might get in contact with him.
http://www.simplemachines.org/community/index.php?topic=293057.msg2567481#msg2567481


Actually though, I was already thinking of going ahead and adding Google site search in the dropdown for the next version, with an option in the Admin panel to not show it. I'll probably have time to do that in a few days or so, but no promises.


EDIT: OK, I decided to rework and clean up the mod package while I was at it, and it's taken longer than I expected. Current target for release is some time late next week, since I'm heading off on a short vacation tomorrow.

no reply from his side. plz have a look at my request after u vacations :)
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 09, 2010, 12:25:20 PM
Released version 1.5:
The "Google" site-search option can be disabled in the Admin panel by going to Forum->Search->Settings and unchecking the new option there.

Title: Re: Search Focus Dropdown
Post by: Bugo on July 09, 2010, 12:46:14 PM
Updated russian translation
Title: Re: Search Focus Dropdown
Post by: Joker™ on July 09, 2010, 04:02:02 PM
Quote from: Brettflan on July 09, 2010, 12:25:20 PM
Released version 1.5:

  • rewrite of mod to clean up the code and reduce the chance of conflicts with other mods during uninstallation
  • dropdown is now shown on every page
  • new "Google" search option which does a Google site-search for your domain; this option can be disabled in the Admin panel

The "Google" site-search option can be disabled in the Admin panel by going to Forum->Search->Settings and unchecking the new option there.



awesome , thanks alot :D
Title: Re: Search Focus Dropdown
Post by: ~DS~ on July 09, 2010, 04:03:39 PM
Kudos to the author.  8)
Title: Re: Search Focus Dropdown
Post by: searchgr on July 09, 2010, 05:54:53 PM
Thank you
Title: Re: Search Focus Dropdown
Post by: Eclipse16V on July 13, 2010, 04:05:13 PM
Here the new German:

$txt['search_focus_topic'] = 'Dieses Thema';
$txt['search_focus_board'] = 'Dieses Forum';
$txt['search_focus_all'] = 'Gesamtes Forum';
$txt['search_focus_google'] = 'Google';
$txt['search_focus_enable_google'] = 'Erlaube die Google Suche als Zusätzliche Opdtion im Dropdown Menü.';
Title: Re: Search Focus Dropdown
Post by: Eclipse16V on July 13, 2010, 04:24:47 PM
Is it possible which one with googles for search googles AdSense code use can? What there do I have to change? I think times in the Search.php or?
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 14, 2010, 02:51:05 AM
Quote from: Eclipse16V on July 13, 2010, 04:24:47 PM
Is it possible which one with googles for search googles AdSense code use can? What there do I have to change? I think times in the Search.php or?

Yeah, you can probably modify this line added to Search.php as needed:
header( 'Location: http://www.google.com/search?q=' . urlencode($_REQUEST['search']) . '&sitesearch=' . $site_domain );

I don't use AdSense so I'm not sure what would actually be involved.
Title: Re: Search Focus Dropdown
Post by: Churada on August 06, 2010, 08:36:46 AM
I see from the first page that this doesn't show up in Simple Portal, as is indeed the case on my board (2 RC3).
Is there any way to enable it on a board that uses Simple Portal?
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 06, 2010, 12:01:12 PM
AFAIK, Simple Portal completely removes the search form and just leaves the Search page instead. If you knew what you were doing, you might be able to edit the theme to add that search form back; then again, there's probably some reason the Simple Portal team removed it. I'm not sure what that reason might be, since I don't (currently) use Simple Portal.
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 11, 2010, 07:42:57 AM
Sorry to disturb you again , i was trying to make that how search url appear as

yourforumlink.com/?action=search2;search=your search item name


achieved it on simple search here
http://www.simplemachines.org/community/index.php?topic=357785.msg2739675#msg2739675

Just finding it difficult how to achieve it with your mod.If you have time please look at this , as i think it's quite useful feature .
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 11, 2010, 08:21:13 AM
Quote from: Joker™ on August 11, 2010, 07:42:57 AM
Sorry to disturb you again , i was trying to make that how search url appear as

yourforumlink.com/?action=search2;search=your search item name


achieved it on simple search here
http://www.simplemachines.org/community/index.php?topic=357785.msg2739675#msg2739675

Just finding it difficult how to achieve it with your mod.If you have time please look at this , as i think it's quite useful feature .

The way you're doing it, it appears that your search.php is discarding all other form data besides the search terms (originally "search", changed to "query" for some reason in your version). Have it pass on the rest of the data and it should work fine.
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 11, 2010, 08:36:19 AM
Quote from: Brettflan on August 11, 2010, 08:21:13 AM
The way you're doing it, it appears that your search.php is discarding all other form data besides the search terms (originally "search", changed to "query" for some reason in your version). Have it pass on the rest of the data and it should work fine.
when i search with option "this board" it is searching the whole site , and not the specified code , that happens with posts too.
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 11, 2010, 10:25:47 AM
Quote from: Joker™ on August 11, 2010, 08:36:19 AM
Quote from: Brettflan on August 11, 2010, 08:21:13 AM
The way you're doing it, it appears that your search.php is discarding all other form data besides the search terms (originally "search", changed to "query" for some reason in your version). Have it pass on the rest of the data and it should work fine.
when i search with option "this board" it is searching the whole site , and not the specified code , that happens with posts too.

Exactly. It does that because you're discarding all of that other form data, as I said.
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 13, 2010, 01:30:48 AM
Quote from: Brettflan on August 11, 2010, 08:21:13 AM
The way you're doing it, it appears that your search.php is discarding all other form data besides the search terms (originally "search", changed to "query" for some reason in your version).
if that change is not made then search doesn't occur.

QuoteHave it pass on the rest of the data and it should work fine.
Can you put some more light on it ?
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2010, 02:38:05 AM
When you submit an HTML form, valid data from all of the form elements is passed on. If the form is using GET (method="get"), all of that data is passed on visibly in the URL, which is of course what you want in this case. If the form is using POST (method="post"), all of the form data is passed on in the HTTP request sent to the server instead of being tacked onto the URL. If you want to monitor POST data, there are various tools you can use. I use the Firefox extension "Live HTTP Headers", though the Firebug extension also allows that. I believe the "Web Developer" extension also allows it, but I've never tried using it for that.
As for what the exact data is, simply look within the <form> for <input>, <select>, <checkbox>, and so forth (http://www.w3.org/TR/html401/interact/forms.html).
Basically, once you've figured out all of the various data that can potentially be submitted (by monitoring the HTTP headers for all possible submissions, checking over the contents of the form itself, or a combination of the two), you'll need to piece together a GET version of the URL.

Actually though, I don't suppose you really need to know all of the data, if you're smart about it in PHP...
Here, a quick example based on your code posted in the other thread, something like this (you'll need to revert your name="search"->name="query" change so that text element is back to the original name "search"):
<?php
//Path to SSI.php
require(dirname(__FILE__) . '/SSI.php');

$redir 'action=search2';

foreach (
$_POST as $var => $val)
$redir .= ';' urlencode(stripslashes($var)) . '=' urlencode(stripslashes($val));

redirectexit($redir);
?>


That should work for what you're after, though I haven't tested it.
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 13, 2010, 03:11:37 AM
Quote from: Brettflan on August 13, 2010, 02:38:05 AM
When you submit an HTML form, valid data from all of the form elements is passed on. If the form is using GET (method="get"), all of that data is passed on visibly in the URL, which is of course what you want in this case. If the form is using POST (method="post"), all of the form data is passed on in the HTTP request sent to the server instead of being tacked onto the URL. If you want to monitor POST data, there are various tools you can use. I use the Firefox extension "Live HTTP Headers", though the Firebug extension also allows that. I believe the "Web Developer" extension also allows it, but I've never tried using it for that.
As for what the exact data is, simply look within the <form> for <input>, <select>, <checkbox>, and so forth (http://www.w3.org/TR/html401/interact/forms.html).
Basically, once you've figured out all of the various data that can potentially be submitted (by monitoring the HTTP headers for all possible submissions, checking over the contents of the form itself, or a combination of the two), you'll need to piece together a GET version of the URL.
That was really helpful .

I tried the code and changed the name="query" -> name="search" , but still it seems to search whole site and not a specific board or post.
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2010, 03:25:04 AM
Can you provide a non-working link which it outputs, for reference?
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 13, 2010, 03:28:36 AM
In my test site, i went in Board "A" , and searched for -> Test

Same name post is in Board "B" also

the search output url is

http://localhost/rc3/index.php?action=search2;search=test;search_focus=board;submit=Search;advanced=0;brd=

Also in result both test posts of Board "A" and "B" were shown , and i just made search for Board "A" post.
Title: Re: Search Focus Dropdown
Post by: Aportadordelmix on August 13, 2010, 03:56:21 AM
db_setting.php?

installation manual


themes/default/db_setting.php??

sources/db_setting.php?
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2010, 04:11:23 AM
Quote from: Joker™ on August 13, 2010, 03:28:36 AM
In my test site, i went in Board "A" , and searched for -> Test

Same name post is in Board "B" also

the search output url is

http://localhost/rc3/index.php?action=search2;search=test;search_focus=board;submit=Search;advanced=0;brd=

Also in result both test posts of Board "A" and "B" were shown , and i just made search for Board "A" post.

OK, I think the "brd" value is being parsed out as an array and getting lost. Try this then:

<?php
//Path to SSI.php
require(dirname(__FILE__) . '/SSI.php');

$redir 'action=search2';

foreach (
$_POST as $var => $val)
{
if( is_array($val) )
foreach ($val as $vala => $valb)
$redir .= ';' urlencode(stripslashes($var)) . '[' urlencode(stripslashes($vala)) . ']=' urlencode(stripslashes($valb));
else
$redir .= ';' urlencode(stripslashes($var)) . '=' urlencode(stripslashes($val));
}

redirectexit($redir);

?>



Quote from: Aportadordelmix on August 13, 2010, 03:56:21 AM
db_setting.php?
installation manual

themes/default/db_setting.php??

sources/db_setting.php?

I'm going to go out on a limb and assume you're asking what to do with db_setting.php when manually installing... if that's what you're asking, it should be extracted to your root SMF directory and run once from there (http://www.yourforum.com/forum_path/db_setting.php), then deleted. It adds the default value for the "enable Google choice or not" admin option.
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 13, 2010, 04:16:35 AM
Quote from: Brettflan on August 13, 2010, 04:11:23 AM
OK, I think the "brd" value is being parsed out as an array and getting lost. Try this then:

<?php
//Path to SSI.php
require(dirname(__FILE__) . '/SSI.php');

$redir 'action=search2';

foreach (
$_POST as $var => $val)
{
if( is_array($val) )
foreach ($val as $vala => $valb)
$redir .= ';' urlencode(stripslashes($var)) . '[' urlencode(stripslashes($vala)) . ']=' urlencode(stripslashes($valb));
else
$redir .= ';' urlencode(stripslashes($var)) . '=' urlencode(stripslashes($val));
}

redirectexit($redir);

?>


awesome worked , perfectly in simple search.Advance search is still redirecting to ?action=search2
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 13, 2010, 04:28:42 AM
Also can't we trim the search url a bit

From this to:
http://localhost/rc3/index.php?action=search2;search=test;search_focus=all;submit=Search;advanced=0

This:
http://localhost/rc3/index.php?action=search2;search=test
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2010, 04:45:52 AM
Quote from: Joker™ on August 13, 2010, 04:16:35 AM
awesome worked , perfectly in simple search.Advance search is still redirecting to ?action=search2

I'm guessing you haven't set the advanced search form to point at your new search.php.

Quote from: Joker™ on August 13, 2010, 04:28:42 AM
Also can't we trim the search url a bit

From this to:
http://localhost/rc3/index.php?action=search2;search=test;search_focus=all;submit=Search;advanced=0

This:
http://localhost/rc3/index.php?action=search2;search=test

The "search_focus" value is necessary, unless set to "all"; you could add a special case to not add it in that instance if you really wanted. Likewise you could add a special case for the "submit" value which (I think) is always unnecessary, as well as a special case for "advanced" to not be added only if it's set to 0.
Title: Re: Search Focus Dropdown
Post by: Joker™ on August 13, 2010, 06:02:04 AM
Quote from: Brettflan on August 13, 2010, 04:45:52 AM
I'm guessing you haven't set the advanced search form to point at your new search.php.
kk , will search for code to change.
Title: Re: Search Focus Dropdown
Post by: Aportadordelmix on August 13, 2010, 09:02:41 AM
when I go to my root


I get this


QuoteDatabase changes are complete!


http://aportesydescargas.com.ar/foro/db_setting.php
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2010, 04:43:40 PM
Quote from: Joker™ on August 13, 2010, 06:02:04 AM
Quote from: Brettflan on August 13, 2010, 04:45:52 AM
I'm guessing you haven't set the advanced search form to point at your new search.php.
kk , will search for code to change.
Just at a glance, it should be at the top of Search.template.php (default theme).


Quote from: Aportadordelmix on August 13, 2010, 09:02:41 AM
when I go to my root
I get this
QuoteDatabase changes are complete!
http://aportesydescargas.com.ar/foro/db_setting.php

That's a success message, so it's done. You can delete it safely now and never need to run it again. You should be able to manually install the rest of the mod and have it work with no problem.
Title: Re: Search Focus Dropdown
Post by: Aportadordelmix on August 13, 2010, 04:46:25 PM
yes.


Can you see him work on my forum?
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2010, 05:34:49 PM
Quote from: Aportadordelmix on August 13, 2010, 04:46:25 PM
yes.

Can you see him work on my forum?

Your profile link? Yes, I see it in the upper right corner area. I tested it briefly with topic and board searches and it worked fine, as well as the Google search.
I see you're using SimplePortal, so congratulations on getting it working there. You're the first I've seen who managed that.  :)
Title: Re: Search Focus Dropdown
Post by: Aportadordelmix on August 13, 2010, 05:49:15 PM
Quote from: Brettflan on August 13, 2010, 05:34:49 PM
Quote from: Aportadordelmix on August 13, 2010, 04:46:25 PM
yes.

Can you see him work on my forum?

Your profile link? Yes, I see it in the upper right corner area. I tested it briefly with topic and board searches and it worked fine, as well as the Google search.
I see you're using SimplePortal, so congratulations on getting it working there. You're the first I've seen who managed that.  :)

Does the modification I made to simpleportal?
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 13, 2010, 05:51:53 PM
Quote from: Aportadordelmix on August 13, 2010, 05:49:15 PM
Does the modification I made to simpleportal?

I don't quite understand what your question is, but as I said above it appears to be working fine.
Title: Re: Search Focus Dropdown
Post by: -=[Vyorel]=- on September 30, 2010, 07:29:55 PM
Nice man! :o

Romanian translate

$txt['search_focus_topic'] = 'In acest subiect';
$txt['search_focus_board'] = 'In aceasta sectiune';
$txt['search_focus_all'] = 'In tot forumul';

$txt['search_focus_google'] = 'Google';

$txt['search_focus_enable_google'] = 'Activeaza cautare pe Google in optiunea derulanta';
Title: Re: Search Focus Dropdown
Post by: FragaCampos on October 01, 2010, 08:54:32 PM
Brettflan, i would like to ask you if you have any spare time to check my custom theme and make this mod work on it?
Title: Re: Search Focus Dropdown
Post by: Brettflan on October 01, 2010, 11:52:45 PM
I should have some time to check it out at some point in the next few days.
Title: Re: Search Focus Dropdown
Post by: FragaCampos on October 03, 2010, 09:01:14 AM
Ok. I attached the index.template of my custom theme.
Thanks in advance for any help you can give me on this.
Title: Re: Search Focus Dropdown
Post by: Brettflan on October 05, 2010, 07:16:36 AM
I checked it out and it looks like it should take the same modification as the default 1.1.11 Core theme's index.template.php.

Just go to the mod page (http://custom.simplemachines.org/mods/index.php?mod=1634), look in the download section for "Manual Install Instructions for SMF" and choose 1.1.11 from the dropdown and click "Parse". On the resulting page, scroll down to the entry for "./Themes/default/index.template.php" and do what it says there to your theme's index.template.php.
Title: Re: Search Focus Dropdown
Post by: FragaCampos on October 05, 2010, 09:20:59 AM
My bad... indeed, everything installed ok and i used the parser to edit the index.template of my custom theme. I had a problem before with the installation, but now everything went fine.

But there's one problem. The "This Topic" search is not working. When i search something in a topic, the results a receive are from the entire forum. What am i doing wrong?

PS: I'm using the mod "Search Enhancement Mod".
Title: Re: Search Focus Dropdown
Post by: Brettflan on October 05, 2010, 09:36:02 AM
Quote from: FragaCampos on October 05, 2010, 09:20:59 AM
But there's one problem. The "This Topic" search is not working. When i search something in a topic, the results a receive are from the entire forum. What am i doing wrong?

PS: I'm using the mod "Search Enhancement Mod".

That mod might well conflict, I've never used it before. Is it supposed to work in 1.1.11? I see it lists 1.1.8 as the last officially supported version for it unless I'm looking at the wrong thing (http://custom.simplemachines.org/mods/index.php?mod=887).
Does "This board" also fail to work like  "This topic"?
Title: Re: Search Focus Dropdown
Post by: FragaCampos on October 05, 2010, 11:54:40 AM
ok, i had a big mess over here...
I installed "Search Enhancement Mod" 2 years ago, and i've just noticed that it does the same as "Search Focus Dropdown". I just didn't make the needed changes in the index.template of my custom theme...  ::)

QuoteIs it supposed to work in 1.1.11?

Yes, it works in 1.1.11.

QuoteDoes "This board" also fail to work like  "This topic"?

Yes, before i unistalled "Search Focus Dropdown" the "This board" function didn't work either. Maybe a conflit with this one?

Title: Re: Search Focus Dropdown
Post by: Spoogs on October 05, 2010, 12:00:26 PM
try uninstalling the other mod and see if search focus works
Title: Re: Search Focus Dropdown
Post by: FragaCampos on October 05, 2010, 03:53:15 PM
Well, the other mod is essential for 1.1.11 since the search function doesn't work well with out it. Anyway, it does what this mod is supposed to do, so i'm good for now.

Thanks for your help, Brettflan.
Title: Re: Search Focus Dropdown
Post by: lovearat on November 05, 2010, 03:15:52 PM
I need to un-install this mod, because it is causing conflict in trying to upgrade from 1.11 to 1.12. But there is no un-installer. Can you please help me? Thank you so much for your time. Have a Blessed day. :)
Title: Re: Search Focus Dropdown
Post by: Robert. on November 05, 2010, 03:34:49 PM
I really like this mod :) It works awesome in the Curve theme :D Thanks for this :)
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 06, 2010, 01:13:16 AM
Quote from: lovearat on November 05, 2010, 03:15:52 PM
I need to un-install this mod, because it is causing conflict in trying to upgrade from 1.11 to 1.12. But there is no un-installer. Can you please help me? Thank you so much for your time. Have a Blessed day. :)

You uninstall it through the package manager like all other mods. If it's not letting you, then... you've already updated to 1.12 with it installed, maybe?

I'll be releasing an update in the next few days for 1.12 and 2.0 RC4.
Title: Re: Search Focus Dropdown
Post by: lovearat on November 06, 2010, 11:23:01 AM
Quote from: Brettflan on November 06, 2010, 01:13:16 AM
Quote from: lovearat on November 05, 2010, 03:15:52 PM
I need to un-install this mod, because it is causing conflict in trying to upgrade from 1.11 to 1.12. But there is no un-installer. Can you please help me? Thank you so much for your time. Have a Blessed day.

You uninstall it through the package manager like all other mods. If it's not letting you, then... you've already updated to 1.12 with it installed, maybe?

I'll be releasing an update in the next few days for 1.12 and 2.0 RC4.

I tried the upgrade and got this error;     Execute Modification    ./Sources/Subs-Package.php    Test failed     So then I tried to un-install the search focas dropdown mod, since  I  think it was the last mod I added prior to trying the upgrade. I thought maybe it was what was causing a conflict.  But then I got an error saying that I couldn't remove it because it didn't have an un-installer.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 06, 2010, 12:25:05 PM
Since you've updated to 1.12, I assume it won't let you install/uninstall the current version of this mod package since it's not listed as supporting that 1.12. THat's just how SMF handles packages.
If you're willing to wait a bit, I'll try to move this package to the front of my work queue and release an updated version later today. You can then upload and uninstall it (though what the conflict you seem to be experiencing would be, I'm at a loss).
Title: Re: Search Focus Dropdown
Post by: lovearat on November 06, 2010, 12:48:00 PM
Quote from: Brettflan on November 06, 2010, 12:25:05 PM
Since you've updated to 1.12, I assume it won't let you install/uninstall the current version of this mod package since it's not listed as supporting that 1.12. THat's just how SMF handles packages.
If you're willing to wait a bit, I'll try to move this package to the front of my work queue and release an updated version later today. You can then upload and uninstall it (though what the conflict you seem to be experiencing would be, I'm at a loss).

I'm sorry if  I didn't make myself clear on this.  What I mean is, that I can't upgrade to 1.12.  So since I think the last mod that I added to my forum prior to trying to upgrade to 1.12 was the search focus dropdown; I tried to un-install it. The search focus dropdown mod is the one giving me the error that it doesn't have an un-installer.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 06, 2010, 01:29:59 PM
Quote from: lovearat on November 06, 2010, 12:48:00 PM
Quote from: Brettflan on November 06, 2010, 12:25:05 PM
Since you've updated to 1.12, I assume it won't let you install/uninstall the current version of this mod package since it's not listed as supporting that 1.12. THat's just how SMF handles packages.
If you're willing to wait a bit, I'll try to move this package to the front of my work queue and release an updated version later today. You can then upload and uninstall it (though what the conflict you seem to be experiencing would be, I'm at a loss).

I'm sorry if  I didn't make myself clear on this.  What I mean is, that I can't upgrade to 1.12.  So since I think the last mod that I added to my forum prior to trying to upgrade to 1.12 was the search focus dropdown; I tried to un-install it. The search focus dropdown mod is the one giving me the error that it doesn't have an un-installer.

What exactly is the problem you're having? "I can't upgrade to 1.12" doesn't provide much in the way of useful information. How are you trying to upgrade? There are a few ways available. Do you get a specific error message, or what?
Title: Re: Search Focus Dropdown
Post by: lovearat on November 06, 2010, 01:35:51 PM
I have tried every way that I know how to explain my problem, but seem to be unsuccessful. Thank you for your time anyway. I will try to resolve this my self.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 06, 2010, 01:46:01 PM
Well, you did mention "./Sources/Subs-Package.php", and that isn't changed by this mod. So, almost certainly unrelated anyway. Good luck with it.
Title: Re: Search Focus Dropdown
Post by: lovearat on November 06, 2010, 01:51:07 PM
Quote from: Brettflan on November 06, 2010, 01:46:01 PM
Well, you did mention "./Sources/Subs-Package.php", and that isn't changed by this mod. So, almost certainly unrelated anyway. Good luck with it.

I do thank  you very much for trying to help me. :)  I do appreciate it.  I hope you have a great day.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 06, 2010, 05:05:18 PM
For reference, I just updated my test 1.x forum from 1.11 to 1.12 using the link on the main admin page and it went through without a hitch, and with the currently released Search Focus Dropdown mod installed. Of course, it won't let me uninstall it afterward since the mod isn't officially updated to support 1.12 quite yet (that's what I'm working on right now), but the 1.12 update itself went through smoothly.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 06, 2010, 06:03:52 PM
Released version 1.51:Thanks to -=[Vyorel]=- for the Romanian translation and to Eclipse16v and Bugo for the updated German and Russian translations respectively.
Title: Re: Search Focus Dropdown
Post by: NanoSector on November 06, 2010, 06:14:52 PM
Works like a charm!

Thank you!
Title: Re: Search Focus Dropdown
Post by: HunterP on November 28, 2010, 08:20:05 PM
Quote from: Brettflan on June 14, 2010, 06:59:55 AMSeriously though, I guess I could potentially add something like that in, though I wouldn't want to change the way the default option works since that's expected behavior. Perhaps a new dropdown option, "This board and child boards"? That reads a bit long though, and would stretch out the width of the dropdown box quite a bit, which wouldn't really be good. So, I'm not so hot on the idea.

You could make it an option ;) I would really appreciate it (and others)
Title: Re: Search Focus Dropdown
Post by: HunterP on November 29, 2010, 06:32:55 PM

One more thing, the "topic" option doesn't seem to work for me. Maybe I've messed something up, I've removed all code regarding Google because I'm not planning on using that. Ofcourse I could just disable it, but I like the modifications as short as possible, that's why I removed it. Forum and board really work like a charm! But topics don't. Is there anything more to edit which doesn't have a direct relation to the Google code?
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 29, 2010, 06:40:12 PM
Quote from: HunterP on November 29, 2010, 06:32:55 PM
One more thing, the "topic" option doesn't seem to work for me. Maybe I've messed something up, I've removed all code regarding Google because I'm not planning on using that. Ofcourse I could just disable it, but I like the modifications as short as possible, that's why I removed it. Forum and board really work like a charm! But topics don't. Is there anything more to edit which doesn't have a direct relation to the Google code?
It works fine for me in 2.0 RC4. What version of SMF are you using?
Title: Re: Search Focus Dropdown
Post by: HunterP on November 29, 2010, 06:43:53 PM
Quote from: Brettflan on November 29, 2010, 06:40:12 PMIt works fine for me in 2.0 RC4. What version of SMF are you using?

Recently updated from 1.1.11 to 1.1.12

What I forgot to mention is that the topic option gives the same results as "forum". So it works, but not correctly...
Title: Re: Search Focus Dropdown
Post by: HunterP on November 29, 2010, 07:38:40 PM

I've just uploaded the original package, without modifications. Still "topic" gives me the same results as "forum", but Google is not being shown, although this option is checked.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 29, 2010, 10:49:19 PM
Hmm. Not sure what to tell you, I've just retested it on my test SMF 1.1.12 forum and everything is working fine there. All search ranges work fine (topic, board, and entire forum), and disabling/re-enabling Google in the Search options works as expected as well.
Did you do a custom install on a different theme than default and possibly not get it done quite right, maybe? For Google not showing up, the cuase might be the same (incorrect installation into a custom theme) or your own modification might have caused that. Have you tried changing that option back and forth and saving a couple of times at least?
Title: Re: Search Focus Dropdown
Post by: HunterP on November 30, 2010, 12:24:46 AM

I've switched to the original mod (including Google), but the topic search didn't work either, and I already mentioned that Google didn't appear in the focus.

Yes, I'm using a custom theme (oxygen11final) :

<file name="$themes_dir/oxygen11final/index.template.php">
<operation>
<search position="after"><![CDATA[<input type="submit" name="submit" value="', $txt[182]]]></search>
<add><![CDATA[';

loadLanguage('SearchFocus');

// Viewing a topic?
if (!empty($context['current_topic']))
{
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
$focus_options = '
<option value="topic" selected="selected">' . $txt['search_focus_topic'] . '</option>
<option value="board">' . $txt['search_focus_board'] . '</option>
<option value="all">' . $txt['search_focus_all'] . '</option>';
}
// Viewing a board?
elseif (!empty($context['current_board']))
$focus_options = '
<option value="board" selected="selected">' . $txt['search_focus_board'] . '</option>
<option value="all">' . $txt['search_focus_all'] . '</option>';
// Viewing something else, such as index
else
$focus_options = '
<option value="all" selected="selected">' . $txt['search_focus_all'] . '</option>';

// Show the search focus dropdown
echo '
<select name="search_focus" id="search_focus">' . $focus_options . '
</select>';

echo '
]]></add>
</operation>
</file>
Title: Re: Search Focus Dropdown
Post by: Spoogs on November 30, 2010, 01:04:12 AM
Switch to the SMF default theme and see if its working properly there
Title: Re: Search Focus Dropdown
Post by: HunterP on November 30, 2010, 01:09:34 AM
Quote from: Spoogs on November 30, 2010, 01:04:12 AMSwitch to the SMF default theme and see if its working properly there

Ok, that seems to work better... What could be the problem with the oxygen11final theme?
Title: Re: Search Focus Dropdown
Post by: Spoogs on November 30, 2010, 01:45:03 AM
As Brettflan said, something probably wasnt edited properly.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 30, 2010, 01:56:18 AM
Quote from: HunterP on November 30, 2010, 12:24:46 AM
Yes, I'm using a custom theme (oxygen11final) :
<snip>
I notice that the Google option was removed in that code snippet, which is why it's not showing up in your theme.
As for why topic searches aren't working correctly, I don't know for sure without really taking the time to investigate that particular theme myself and quite frankly I don't feel like spending the necessary time and effort to do that. My best guess for likely cause would be the that theme not setting the 'topic' value in the search form like usual. Look for code like this (taken from the 1.x default Core theme's index.template.php):
// Search within current topic?
if (!empty($context['current_topic']))
echo '
<input type="hidden" name="topic" value="', $context['current_topic'], '" />';

I suspect that's missing in the theme you're using.
Title: Re: Search Focus Dropdown
Post by: HunterP on November 30, 2010, 09:52:06 AM
Quote from: Brettflan on November 30, 2010, 01:56:18 AMI notice that the Google option was removed in that code snippet, which is why it's not showing up in your theme.

It also doesn't show up when I use the original modification.

Quote from: Brettflan on November 30, 2010, 01:56:18 AMMy best guess for likely cause would be the that theme not setting the 'topic' value in the search form like usual.

If current_topic was missing in my theme, the dropdown box shouldn't get a "topic" entry, or does it?

// Viewing a topic?
[b] if (!empty($context['current_topic']))
[/b] {
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
$focus_options = '
[b] <option value="topic" selected="selected">' . $txt['search_focus_topic'] . '</option>
[/b] <option value="board">' . $txt['search_focus_board'] . '</option>
<option value="all">' . $txt['search_focus_all'] . '</option>';
}


When viewing a topic, I get to see all three options. So far, so good :)

Ah I found it :

               <input type="submit" name="submit" value="', $txt[182], '" style="width: 8ex;" />&nbsp;
                                                <a href="', $scripturl, '?action=search;advanced">', $txt['smf298'], '</a>
                                                <input type="hidden" name="advanced" value="0" />';

I found this in my theme :

  // If we're on a certain board, limit it to this board ;).
  if (!empty($context['current_board']))
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';

  echo '
</form></div>';

<input type="submit" name="submit" value="', $txt[182], '" style="width: 11ex;" />
<input type="hidden" name="advanced" value="0" />';


Replaced it by :

// 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>


Seems to be working correctly now :)
Title: Re: Search Focus Dropdown
Post by: henrik1782 on December 07, 2010, 05:32:17 AM
Hi thanks for this mod...

Here is the danish translation

SearchFocus.danish.php

<?php
// SearchFocus
// encoding: ISO-8859-1

$txt['search_focus_topic'] = 'Dette emne';
$txt['search_focus_board'] = 'Denne kategori';
$txt['search_focus_all'] = 'Hele forum';

$txt['search_focus_google'] = 'Google søgning';

$txt['search_focus_enable_google'] = 'Aktiverer Google søgning som et valg i dropdown menu';

?>




SearchFocus.danish-utf8.php

<?php
// SearchFocus
// encoding: ISO-8859-1

$txt['search_focus_topic'] = 'Dette emne';
$txt['search_focus_board'] = 'Denne kategori';
$txt['search_focus_all'] = 'Hele forum';

$txt['search_focus_google'] = 'Google søgning';

$txt['search_focus_enable_google'] = 'Aktiverer Google søgning som et valg i dropdown menu';

?>



Best regards
Henrik Poulsen
Title: Re: Search Focus Dropdown
Post by: hcfwesker on December 11, 2010, 07:22:50 PM
Was wondering why this wasn't a default option, since it's on the support site.   Thanx for sharing this function with other forums.

A question, though ...  anyway to add custom search tabs, like if i wanted to let members search just the Shop for a certain item?

Title: Re: Search Focus Dropdown
Post by: Brettflan on December 11, 2010, 08:57:31 PM
It's certainly possible, but only if you really know what you're doing.
Title: Re: Search Focus Dropdown
Post by: Petter B on December 22, 2010, 03:11:05 AM
A very nice mod, thanks. But now I have a problem.
I just updated to RC4 and the latest version of this mod.
Inside boards and topics, I now get a double menu...
Title: Re: Search Focus Dropdown
Post by: Brettflan on December 22, 2010, 06:26:51 AM
Quote from: Petter B on December 22, 2010, 03:11:05 AM
A very nice mod, thanks. But now I have a problem.
I just updated to RC4 and the latest version of this mod.
Inside boards and topics, I now get a double menu...

My best guess is that it didn't get uninstalled properly from that theme before you reinstalled the mod package. With these pre-final releases of SMF 2.0 you should make it a habit to uninstall all packages and upload clean copies of any custom themes (preferably updated copies of the themes released for the new SMF version) before running the upgrade.
You might need to either manually edit that out, or uninstall this mod package and revert to a clean original copy of the theme's index.template.php file before reinstalling it (and the same with any other mods which have modified that file).
Title: Re: Search Focus Dropdown
Post by: Petter B on December 23, 2010, 02:33:46 AM
Thanks. Fortunally, it was only a test-version of the forum this time. So I probably get it right in the real forum.
Title: Re: Search Focus Dropdown
Post by: alsaka on January 14, 2011, 03:11:53 PM
i installed successfully this mod but i working with other themes
themes name ( smf pro alpha )

i know i must do this in me theme
/Themes/default/index.template.php
find this
<input type="submit" name="submit" value="', $txt['search'] <<<Does not exist

add befor
';

loadLanguage('SearchFocus');

// Viewing a topic?
if (!empty($context['current_topic']))
{
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
$focus_options = '
<option value="topic" selected="selected">' . $txt['search_focus_topic'] . '</option>
<option value="board">' . $txt['search_focus_board'] . '</option>
<option value="all">' . $txt['search_focus_all'] . '</option>';
}
// Viewing a board?
elseif (!empty($context['current_board']))
$focus_options = '
<option value="board" selected="selected">' . $txt['search_focus_board'] . '</option>
<option value="all">' . $txt['search_focus_all'] . '</option>';
// Viewing something else, such as index
else
$focus_options = '
<option value="all" selected="selected">' . $txt['search_focus_all'] . '</option>';

// Google option enabled?
if (!empty($modSettings['search_focus_enable_google']))
$focus_options .= '
<option value="google">' . $txt['search_focus_google'] . '</option>';

// Show the search focus dropdown
echo '
<select name="search_focus" id="search_focus">' . $focus_options . '
</select>';

echo '


i don't find this code in my theme
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 14, 2011, 03:20:28 PM
This theme (http://custom.simplemachines.org/themes/index.php?lemma=1516)?
I don't see a search box in the screenshots of that theme. That's what this mod alters, so if it's removed in that theme then you're out of luck.
Title: Re: Search Focus Dropdown
Post by: alsaka on January 14, 2011, 03:26:44 PM
yes this is theme
in theme There is no search box

can i add this by this mod or must theme have it frist
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 14, 2011, 03:29:52 PM
As I said, this mod alters the search box. If it's not there in the first place, it can't be altered. It must already exist in the theme.
Title: Re: Search Focus Dropdown
Post by: alsaka on January 14, 2011, 04:02:53 PM
thx Brettflan for replay

please can you down theme and try to add him in this theme

if you can
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 14, 2011, 04:37:13 PM
Sorry, you'd need to take that up with the theme author. He took the trouble of completely removing the quick search form, presumably he had a reason.
Title: Re: Search Focus Dropdown
Post by: hcfwesker on January 23, 2011, 04:47:27 PM
Getting several errors in the Error Log, and I can't figure them out.  Hoping you may have an idea.

When viewing profile pages.  (also shows up on other pages, but is the same Error)
http://www.brawldomain.com/AASMF2/index.php?action=profile;u=14

2: Invalid argument supplied for foreach()

File: /home/brawldom/public_html/AASMF2/Themes/default/languages/SearchFocus.english.php (summary sub template - eval?)
Line: 101



When using the search
http://www.brawldomain.com/AASMF2/index.php?action=search2

8: Undefined index: title

File: /home/brawldom/public_html/AASMF2/Themes/default/languages/SearchFocus.english.php (body_above sub template - eval?)
Line: 480


http://www.brawldomain.com/AASMF2/index.php?action=search2

8: Undefined index: href

File: /home/brawldom/public_html/AASMF2/Themes/default/languages/SearchFocus.english.php (body_above sub template - eval?)
Line: 479



This is, I check the SearchFocus.english.php , and not much on there ... so I'm completely lost.

Title: Re: Search Focus Dropdown
Post by: Brettflan on January 24, 2011, 04:22:06 AM
Yeah, SearchFocus.english.php should consist of just this:

<?php
// SearchFocus
// encoding: ISO-8859-1

$txt['search_focus_topic'] = 'This topic';
$txt['search_focus_board'] = 'This board';
$txt['search_focus_all'] = 'Entire forum';

$txt['search_focus_google'] = 'Google';

$txt['search_focus_enable_google'] = 'Enable Google site-search as a search dropdown option';

?>


There are nowhere near 101 lines in the file as provided, let alone 479 or 480.

The mod package as a whole additionally never references 'title' or 'href' array indexes and does not use a foreach loop. Assuming your SearchFocus.english.php is unmodified, I'd say the error is unrelated to this package.

Since the error reporting seems completely off base, you might want to go into your Admin panel and go to Configuration->Features and Options->General. Make sure the option "Disable evaluation of templates" is unchecked. Only check that option once you've fully tested your themes and know that they work flawlessly.
Title: Re: Search Focus Dropdown
Post by: hcfwesker on January 24, 2011, 07:06:43 PM
QuoteSince the error reporting seems completely off base, you might want to go into your Admin panel and go to Configuration->Features and Options->General. Make sure the option "Disable evaluation of templates" is unchecked. Only check that option once you've fully tested your themes and know that they work flawlessly.

I don't have that option at all in my AdminCP.  I'm on SMF2 RC4
Title: Re: Search Focus Dropdown
Post by: TheListener on January 24, 2011, 07:10:15 PM
Quote from: hcfwesker on January 24, 2011, 07:06:43 PM
QuoteSince the error reporting seems completely off base, you might want to go into your Admin panel and go to Configuration->Features and Options->General. Make sure the option "Disable evaluation of templates" is unchecked. Only check that option once you've fully tested your themes and know that they work flawlessly.

I don't have that option at all in my AdminCP.  I'm on SMF2 RC4

For RC4 look in your server settings
Title: Re: Search Focus Dropdown
Post by: hcfwesker on January 24, 2011, 07:21:24 PM
Yup, it's there.  I thought I checked there before.

But, it is 'unchecked' already by default.

Like you said, it may be caused from something other than this MOD.
Title: Re: Search Focus Dropdown
Post by: NanoSector on January 28, 2011, 02:16:30 AM
This should really be a default part of SMF & it's custom themes :)
Title: Re: Search Focus Dropdown
Post by: steve51184 on March 04, 2011, 08:05:20 AM
hi just wanted to know how do i add a search option to the search dropdown box for a set category?

so if i have a board 'help' with id 12 the dropdown will show 'help' as the first option but with the other options also there

thanks
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 04, 2011, 09:24:50 AM
That would take a fair bit of modification on your part. Sounds like a decent idea for a new feature for me to add, though; more options in the admin panel to add specific boards to the dropdown like that.

I'll probably do that in the next week or two when I have time for it.
Title: Re: Search Focus Dropdown
Post by: smartmouse on May 17, 2011, 07:46:18 PM
Hello, i have installed this great mod, but i have encountered a very little problem. Please have a look at this screenshot:

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg560.imageshack.us%2Fimg560%2F3948%2Fsearchq.jpg&hash=9bfaeb615b77baaab48ae294b6a7983ed4512130)

The two box are not aligned for 1 pixel!

Here is the related code in index.template.php file of my custom theme:

';

loadLanguage('SearchFocus');

// Viewing a topic?
if (!empty($context['current_topic']))
{
echo '
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />';
$focus_options = '
<option value="topic" selected="selected">' . $txt['search_focus_topic'] . '</option>
<option value="board">' . $txt['search_focus_board'] . '</option>
<option value="all">' . $txt['search_focus_all'] . '</option>';
}
// Viewing a board?
elseif (!empty($context['current_board']))
$focus_options = '
<option value="board" selected="selected">' . $txt['search_focus_board'] . '</option>
<option value="all">' . $txt['search_focus_all'] . '</option>';
// Viewing something else, such as index
else
$focus_options = '
<option value="all" selected="selected">' . $txt['search_focus_all'] . '</option>';

// Google option enabled?
if (!empty($modSettings['search_focus_enable_google']))
$focus_options .= '
<option value="google">' . $txt['search_focus_google'] . '</option>';

// Show the search focus dropdown
echo '
<select name="search_focus" id="search_focus">' . $focus_options . '
</select>';

echo '
<input type="submit" name="submit" value="', $txt['search'], '" class="button_submit" />
<input type="hidden" name="advanced" value="0" />';


How to fix it?

Thank you.

Title: Re: Search Focus Dropdown
Post by: Brettflan on May 18, 2011, 04:14:18 AM
Try adding this to your theme's index.css file:
select#search_focus
{
position: relative;
top: -1px;
}
Title: Re: Search Focus Dropdown
Post by: smartmouse on May 18, 2011, 01:36:04 PM
It worked.

Just to understand... why i need this modify to fix it?

Thank you for your support ;)
Title: Re: Search Focus Dropdown
Post by: Brettflan on May 18, 2011, 05:40:31 PM
For whatever reason, that's the way the controls line up by default.
Title: Re: Search Focus Dropdown
Post by: smartmouse on May 18, 2011, 07:27:29 PM
Okay, thank you for your help.
Keep up the good work ;)
Title: Re: Search Focus Dropdown
Post by: dougiefresh on June 15, 2011, 03:18:10 PM
Thank you for the wonderful mod!  I thought I'd let everybody know that when I updated my forum from 2.0 RC5 to 2.0 Gold, I had to reinstall all my mods.  This mod installed without issues and using 2.0 RC5 emulation.  Hope this info helps someone!
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 16, 2011, 01:36:26 AM
I'll be checking over and updating this package in the next few days.
Title: Re: Search Focus Dropdown
Post by: Brettflan on June 21, 2011, 12:01:47 AM
Released version 1.52:
I still haven't gotten around to adding in the capability to add specific boards to the dropdown, but it is still (eventually) planned. I've just been very busy with other concerns lately.
Title: Re: Search Focus Dropdown
Post by: TheListener on June 21, 2011, 12:05:51 AM
Hey Brett

I have only installed this on my test forum so far and like the way it looks.

Regarding the board dropdown would it show all the boards or be permission specific?

Title: Re: Search Focus Dropdown
Post by: Brettflan on June 21, 2011, 12:08:53 AM
The idea would be to add a list of all forum boards in the Admin panel, probably as a list of checkboxes. The admins could set which boards they want to show up in the dropdown on every page.

So, for example you could add your Support board or FAQ board (or whatever) to the dropdown, so people could quickly run a search on that specific board from anywhere in the forum.
Title: Re: Search Focus Dropdown
Post by: TheListener on June 21, 2011, 12:16:39 AM
Sounds good.

Am willing to be a guinea pig for ya.

:-X ( Well it is 5:16am )
Title: Re: Search Focus Dropdown
Post by: cubby61 on August 01, 2011, 05:38:08 PM
Instead of Google can you add a option to search either Google or Bing (Admins's choice in the settings)?
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 01, 2011, 06:15:02 PM
At the moment I don't have time to work on further features for this mod package at all, but I'll consider it when I do have time.
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 16, 2011, 01:42:04 PM
hello, nice mod

but I have a problem when install this on my forum, all look messy

see the screenshoot

I use Ant's prince of darkness themes
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 17, 2011, 02:12:45 AM
I actually haven't tested his new versions, so it looks like I need to do so.
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 17, 2011, 10:22:30 AM
thanx, waiting the conclusion
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 19, 2011, 07:21:21 AM
Here we are, then:
Quote from: Brettflan
version 1.53:

  • better support for Antechinus' newest Prince of Darkness and Chocolate Curvaceous theme releases ("201" versions)
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 21, 2011, 09:46:35 AM
after reinstall it, its same as my previous result, still look messy, hem i dunno whats wrong here
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 21, 2011, 09:52:26 AM
1. What folder path is the theme installed to?
2. Are you running a portal or any other modification which might be interfering?
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 21, 2011, 09:59:33 AM
actually the folder path is default like other SMF installer , locate in :

mydomain/Themes/Ants_Curve_Variants_20

and yes, I have portaMX 1.41 installed as my portal

regards,
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 21, 2011, 10:11:13 AM
You got it from here, right?
http://custom.simplemachines.org/themes/index.php?lemma=2428
Or if not, where did you get it?

The folder name should be "Prince_of_Darkness_201" unless I'm missing something, and that's what I updated it to point to.
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 21, 2011, 10:25:06 PM
Ah I see, yes I got it from there, but back when I got those themes, there is no Chocolate_Curvaceous themes, but Ants Curve Variants 20, aha thats whay your fix wont work   ::)

I quote Antechinus word on his themes page :

QuoteBlue Steel will follow shortly, and I'll update this page then. When all three are available I'll pack them into one multi theme, which is going to be called (wait for it) Ant's Curve Variants

see, there was Ant's Curve Variants  :-\ , but I dunno why was removed  :o

so should I upload mine to you or I need to contact Antechinus ?

thanx for your help  :)
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 21, 2011, 10:54:16 PM
The portions which need to be modified are probably the same. If you're willing, I'll try a simple update tomorrow (heading to bed right now) and send you a PM so you can test it out.
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 22, 2011, 11:43:58 PM
aha, glad to hear that, hem I thought so, since my themes exactly same with Prince of Darkness, even the link at the bottom of my forum said "Prince Of Darkness" but my packages is Ant's Curve Variants 2

hem, okay, I found my virgin packages, back when I download in Antechinus's themes page, check the attachment
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 22, 2011, 11:46:19 PM
OK, but I sent you a PM earlier today with an update for you to test. Could you get back to me on that first?
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 23, 2011, 01:56:49 AM
it works, except minor glitch, I explain to you on the PM

search column and dropdown column not align nicely, there is glitch in few pixel, menu dropdown little bit lower, but thanx for your solution, thanx you  ;D
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 27, 2011, 12:54:14 PM
A major update is now available, 1.6.0.

I finally got around to adding in the ability to add specific boards to the dropdown, and decided the whole codebase needed an overhaul while I was at it. Bing site-search is available now as well (but defaults to disabled).
Adding boards to the dropdown is only supported in SMF 2.0; sorry, but it turned out to be quite a pain to implement properly even in 2.0. I don't even have a 1.1.x board available at the moment, and don't feel like messing with it anyway. So, 2.0 only for that feature.

EDIT: by the way, a screenshot of the new additional boards feature in action:
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg7.imageshack.us%2Fimg7%2F4459%2Fsearchfocusdropdown160.png&hash=7ddbfa7151191ed31634e75aae4da9f3e13c1bb4)

Quote from: Brettflan on February 14, 2009, 02:34:48 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1634)

<snip>

The "Google" site-search option can be disabled in the Admin panel by going to Forum->Search->Settings and unchecking the new option there. Similarly, there is another option to enable "Bing" site-search in the same place.
You will also see a list of all your forum's boards there for possible inclusion in the dropdown as choices. These board choices will shown everywhere, just above the "entire forum" option. You can use this to add your "FAQ" or "Support" board (or whatever you like) to the dropdown for easy searching from anywhere in the forum.

Other than English, language strings are also provided for these languages: Brazilian Portuguese, French, German, Italian, Romanian, Russian, Spanish, Turkish.


version 1.6.0:

  • Complete overhaul of codebase. The old code was a bit kludgy in places. The changes needed for each theme's index.template.php file are very compact now as most of the display code has been consolidated into a couple of separate new files.
  • New "Bing" site-search option. Works the same as the Google option, but (naturally) uses Bing. Defaults to disabled.
  • You can now add whatever boards you want to the dropdown as separate options, to be shown on every page just above the "Entire site" option. Could be useful for your "FAQ" or "Support" board if you have one. NOTE that this is only available in SMF 2.0. If you are using SMF 1.1.x, sorry. Consider upgrading.
  • If you have Visual Verification required for searches (for Guests, or whatever), the search focus will be properly passed through that instead of being lost.
  • Attempted to improve vertical alignment of search form elements.
  • Removed support for old 2.0 RC1 installations; if you're still using it, you should have updated a long long time ago.
version 1.54:

  • support for Antechinus' Prince of Darkness theme outdated release named "Ants_Curve_Variants_20"
Title: Re: Search Focus Dropdown
Post by: farao25 on August 27, 2011, 01:59:26 PM
nice!!!!
where is the download link ?
Download this mod
search_focus_dropdown_1.54.zip    
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 27, 2011, 02:46:48 PM
The one without the 1.54, right above the one with the 1.54. I see that's confusing people, so I'll adjust the name of the old 1.54 release.

EDIT: for clarification, I'm keeping 1.54 up as well since 1.6.0 broke compatibility with 2.0 RC1.
Title: Re: Search Focus Dropdown
Post by: Inti31 on August 27, 2011, 04:24:46 PM
thx - works like it should... - good work

by the way - here is the updated German translation (SearchFocus.german(-utf8).php)

$txt['search_focus_topic'] = 'Dieses Thema';
$txt['search_focus_board'] = 'Dieses Forum';
$txt['search_focus_all'] = 'Gesamtes Forum';
$txt['search_focus_google'] = 'Google';
$txt['search_focus_enable_google'] = 'Erlaube die Google Suche als zus&#228;tzliche Option im Dropdown Men&#252;';
$txt['search_focus_bing'] = 'Bing';
$txt['search_focus_enable_bing'] = 'Erlaube die Bing Suche als zus&#228;tzliche Option im Dropdown Men&#252;';
$txt['search_focus_boards'] = 'F&#252;ge markierte Boards dem Dropdown Men&#252; hinzu';


cheers inti31
Title: Re: Search Focus Dropdown
Post by: Brettflan on August 27, 2011, 04:42:50 PM
Should I have the characters encoded like that, or is it safe to leave them as regular characters? I never really understood the reasoning for encoding them if they're supported by the character set you're using.
Title: Re: Search Focus Dropdown
Post by: gisfreak on August 28, 2011, 07:44:12 AM
great update, thanx
Title: Re: Search Focus Dropdown
Post by: Inti31 on August 28, 2011, 07:57:16 AM
Quote from: Brettflan on August 27, 2011, 04:42:50 PM
Should I have the characters encoded like that, or is it safe to leave them as regular characters? I never really understood the reasoning for encoding them if they're supported by the character set you're using.
it is safe - it's just the view which looks like 'corrupt' (see att'ed shot) so it is recommended to use it like I posted...

You also could use
&uuml; for ü, also ü
&auml; for ä also ä
&ouml; for ö also ö

simple, eh :) - German is a fantastic language, isn't it...?


I find all my codes it these lists:
http://www.gemeinde-michendorf.de/homepage/8sonstiges/entity.php or
http://bueltge.de/wk-utf-8-konvertierung/130/

Title: Re: Search Focus Dropdown
Post by: hcfwesker on August 28, 2011, 09:49:57 PM
Great Update, Brettflan!!!
Title: Re: Search Focus Dropdown
Post by: gisfreak on September 02, 2011, 02:35:49 AM
it cant skip properly on some file, here my error :

Execute Modification   ./Themes/TWcurve/index.template.php   File not found
Title: Re: Search Focus Dropdown
Post by: hcfwesker on September 02, 2011, 02:46:10 AM
Quote from: gisfreak on September 02, 2011, 02:35:49 AM
it cant skip properly on some file, here my error :

Execute Modification   ./Themes/TWcurve/index.template.php   File not found

thats just a file for a custom theme.  you dont have that theme, so its not needed.  it's safe to continue and install.  :)
Title: Javascript error
Post by: EL34 on September 10, 2011, 07:25:38 AM
Hi, The mod installs correctly in my 1,1,14 forum but every page shows a javascript error icon in the browser
Here's the full error message



Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; FDM)
Timestamp: Sat, 10 Sep 2011 11:22:44 UTC


Message: 'searchForm' is null or not an object
Line: 6
Char: 1
Code: 0

URI: http://www.myforum/Forum/Themes/default/scripts/SearchFocus.js

Title: Re: Javascript error
Post by: Brettflan on September 10, 2011, 08:14:10 AM
Quote from: EL34 on September 10, 2011, 07:25:38 AM
Hi, The mod installs correctly in my 1,1,14 forum but every page shows a javascript error icon in the browser
Here's the full error message



Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; FDM)
Timestamp: Sat, 10 Sep 2011 11:22:44 UTC


Message: 'searchForm' is null or not an object
Line: 6
Char: 1
Code: 0

URI: http://www.myforum/Forum/Themes/default/scripts/SearchFocus.js
Hmm, that's what I get for not testing the 1.1.x version. I'm sending you a test fix by PM; let me know if it fixes the problem, and I'll go ahead and release it if it does.
Title: Re: Search Focus Dropdown
Post by: EL34 on September 10, 2011, 08:38:40 AM
I just tested your new file and your fix seems to be working just fine.

Thanks, appreciate the quick response

Title: Re: Search Focus Dropdown
Post by: Brettflan on September 10, 2011, 08:54:08 PM
OK then, went ahead and released it:
Quote from: Brettflan on February 14, 2009, 02:34:48 PM
version 1.6.1:

  • fix for bug on SMF 1.1.x versions which kept the mod from working at all
Title: Re: Search Focus Dropdown
Post by: EL34 on September 11, 2011, 07:17:05 AM
The mod seemed to be working for me, I was able to search the forum, topics and google.
Searching Bing did not work when I tested that.

I Just noticed the javascript error in the browser.

Thanks again
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 11, 2011, 07:50:47 AM
Quote from: EL34 on September 11, 2011, 07:17:05 AM
The mod seemed to be working for me, I was able to search the forum, topics and google.
Searching Bing did not work when I tested that.

I Just noticed the javascript error in the browser.

Thanks again
What version of SMF are you using?
What browser (and what version of it) are you using?
What javascript error did you receive?
Title: Re: Search Focus Dropdown
Post by: ApplianceJunk on September 11, 2011, 08:55:47 AM
Awesome mod, thanks!

How could I incorporate our google adsense code so it is used when google is selected on the drop down menu?

Here is the code we get from google to create are own google search text box.


<form action="http://www.google.com/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-9391510879744461:xgcasme4qx7" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="31" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>


Thanks,

Edited to add: After reading google adsense terms even if our adsense code can be used in your mod it may not be allowed by google, not sure...

QuoteAdSense for search:
A maximum of two Google AdSense for search boxes may be placed per page. Also, a single link unit or a search box, but no other Google ads, may be placed on pages with AdSense for search results. Queries must originate from users inputting data directly into the search box and cannot be modified. This includes pre-populating the search box with terms or hard-coding direct links to search results pages. AdSense for search code may not be integrated into any software application such as a toolbar.

Would this mod be considered a software application?

Thanks again,
Title: Re: Search Focus Dropdown
Post by: EL34 on September 11, 2011, 11:20:11 AM
See reply #241

It's working ok now as I reported in #243
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 12, 2011, 04:51:15 PM
Quote from: ApplianceJunk on September 11, 2011, 08:55:47 AM
Awesome mod, thanks!

How could I incorporate our google adsense code so it is used when google is selected on the drop down menu?

Here is the code we get from google to create are own google search text box.


<form action="http://www.google.com/cse" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-9391510879744461:xgcasme4qx7" />
    <input type="hidden" name="ie" value="ISO-8859-1" />
    <input type="text" name="q" size="31" />
    <input type="submit" name="sa" value="Search" />
  </div>
</form>
<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

Based on that code, this might do the trick. Change:
if ($s_focus == 'google')
header( 'Location: http://www.google.com/search?q=' . urlencode($_REQUEST['search']) . '&sitesearch=' . $site_domain );

To:
if ($s_focus == 'google')
header( 'Location: http://www.google.com/search?q=' . urlencode($_REQUEST['search']) . '&sitesearch=' . $site_domain . '&cx=partner-pub-9391510879744461:xgcasme4qx7&ie=ISO-8859-1&sa=Search' );


Worth a shot, anyway.

Quote from: ApplianceJunk on September 11, 2011, 08:55:47 AM
Edited to add: After reading google adsense terms even if our adsense code can be used in your mod it may not be allowed by google, not sure...

QuoteAdSense for search:
A maximum of two Google AdSense for search boxes may be placed per page. Also, a single link unit or a search box, but no other Google ads, may be placed on pages with AdSense for search results. Queries must originate from users inputting data directly into the search box and cannot be modified. This includes pre-populating the search box with terms or hard-coding direct links to search results pages. AdSense for search code may not be integrated into any software application such as a toolbar.

Would this mod be considered a software application?

Thanks again,
None of that should be a problem. They're referring to a browser toolbar, or other software on the user's system, not (apparently) software on the server.
Title: Re: Search Focus Dropdown
Post by: ApplianceJunk on September 12, 2011, 04:57:24 PM
What file would I look for that code in?

Thanks for the reply,

Edited to add: Think I found it

Sources>Search.php

Will try it and report back...

Thanks again.
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 12, 2011, 05:05:46 PM
Inside the Search Focus Dropdown zip file, either in 1.x.xml (if you're running SMF 1.1.x) or 2.x.xml (if you're running SMF 2.0).
If you directly edit Search.php, you'll be unable to uninstall the mod package correctly.
Title: Re: Search Focus Dropdown
Post by: ApplianceJunk on September 12, 2011, 05:38:38 PM
Ok, I directly edited the Search.php and it works!

I have never tried to edit a mod zip file. I will check out doing that way too.

Thanks,
Title: Re: Search Focus Dropdown
Post by: ApplianceJunk on September 12, 2011, 05:54:41 PM
Ok, I unzipped the file, edited 2.x.xml and zipped it.

I removed the original mod from my site without any problems and then tried to upload the new .zip that I edited.

I get a message,

QuotePackage upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."

I notice the original .zip file is 16kb and after I edit and zip it again it's 31kb.

Title: Re: Search Focus Dropdown
Post by: Brettflan on September 12, 2011, 06:43:29 PM
Quote from: ApplianceJunk on September 12, 2011, 05:54:41 PM
Ok, I unzipped the file, edited 2.x.xml and zipped it.

I removed the original mod from my site without any problems and then tried to upload the new .zip that I edited.

I get a message,

QuotePackage upload failed due to the following error:
"Although the package was downloaded to the server it appears to be empty. Please check the Packages directory, and the "temp" sub-directory are both writable. If you continue to experience this problem you should try extracting the package on your PC and uploading the extracted files into a subdirectory in your Packages directory and try again. For example, if the package was called shout.tar.gz you should:
1) Download the package to your local PC and extract it into files.
2) Using an FTP client create a new directory in your "Packages" folder, in this example you may call it "shout".
3) Upload all the files from the extracted package to this directory.
4) Go back to the package manager browse page and the package will be automatically found by SMF."

I notice the original .zip file is 16kb and after I edit and zip it again it's 31kb.
What software are you using to zip the file up?
Title: Re: Search Focus Dropdown
Post by: ApplianceJunk on September 12, 2011, 06:46:50 PM
QuoteWhat software are you using to zip the file up?

Good question, I'm on a Mac.
I right click on the search_focus_dropdown folder and select Compress search_focus_dropdown and it makes a search_focus_dropdown.zip
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 12, 2011, 07:19:29 PM
Quote from: ApplianceJunk on September 12, 2011, 06:46:50 PM
QuoteWhat software are you using to zip the file up?

Good question, I'm on a Mac.
I right click on the search_focus_dropdown folder and select Compress search_focus_dropdown and it makes a search_focus_dropdown.zip
I'm not sure about the best free archive software for Mac. A quick search based on 7-Zip turned up a couple of possibilities, though I can't vouch for either:
http://www.kekaosx.com/en/
http://www.macupdate.com/app/mac/19139/ez7z
Title: Re: Search Focus Dropdown
Post by: ApplianceJunk on September 12, 2011, 08:01:44 PM
Ok, I will mess around with how to correctly zip a mod file on a Mac some other time.

For now the manual edit of the Search.php file is working great and I have easily been able to restore the original Search.php file and remove the mod that way just fine so I will just stick with doing it that way for now.

Thanks for all your help.
Title: Error message
Post by: EL34 on September 30, 2011, 10:37:32 AM
SMF 1.1.15 and  SF 1.6.1

Hi,
I am seeing this error message in the Forum error log

Quote8: Undefined variable: view
File: D:\hshome\el34xyz\el34world.com\Forum\Themes\default\languages\SearchFocus.english.php (eval?)
Line: 238
Not sure if this just started with the SMF 1.1.15 update or not?

Don't remember seeing this with 1.1.14
Title: Re: Error message
Post by: Brettflan on September 30, 2011, 12:44:08 PM
Quote from: EL34 on September 30, 2011, 10:37:32 AM
SMF 1.1.15 and  SF 1.6.1

Hi,
I am seeing this error message in the Forum error log

Quote8: Undefined variable: view
File: D:\hshome\el34xyz\el34world.com\Forum\Themes\default\languages\SearchFocus.english.php (eval?)
Line: 238
Not sure if this just started with the SMF 1.1.15 update or not?

Don't remember seeing this with 1.1.14
SearchFocus.english.php should be only 17 lines long (not 238+), and not even have the text "view" anywhere in it. What does your copy of the file look like?
Title: Re: Search Focus Dropdown
Post by: EL34 on September 30, 2011, 12:49:38 PM
It looks just like what you described

I went and opened it when I saw the error messages.
I was confused also by the error message.

There were no less than 20+ of the same message in the error log this morning.

<?php
// SearchFocus
// encoding: ISO-8859-1

$txt['search_focus_topic'] = 'This topic';
$txt['search_focus_board'] = 'This board';
$txt['search_focus_all'] = 'Entire forum';

$txt['search_focus_google'] = 'Google';
$txt['search_focus_enable_google'] = 'Enable Google site-search as a search dropdown option';

$txt['search_focus_bing'] = 'Bing';
$txt['search_focus_enable_bing'] = 'Enable Bing site-search as a search dropdown option';

$txt['search_focus_boards'] = 'Add specific boards as search dropdown options (board search)';

?>
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 30, 2011, 01:31:59 PM
No idea what the deal is there, then.
Title: Re: Search Focus Dropdown
Post by: EL34 on September 30, 2011, 01:58:38 PM
If you look back at Reply #241 on: 10 September 2011, 02:25:38
I am the one who discovered the mod had problems in 1.1.14

You gave me some code to change and I reported that it worked fine
Then you changed your code.

I probably still have your patched code in place.
Do you think that could have anything to do with this?

Wondering if I should uninstall and download a fresh copy of the mod.
Title: Re: Search Focus Dropdown
Post by: Brettflan on September 30, 2011, 02:08:54 PM
It shouldn't have anything to do with that inexplicable error, but uninstalling and reinstalling a fresh copy of the mod package can't hurt.
Title: Re: Search Focus Dropdown
Post by: EL34 on September 30, 2011, 02:12:07 PM
ok, I'll give it a go
Thanks
Title: Re: Search Focus Dropdown
Post by: beanflying on November 02, 2011, 09:31:48 AM
Getting exactly the same error on 2.0.1 with this mod? Nothing wrong with the search focus English file but may be a problem with one of the other changed files??

(main sub template - eval?)
Line: 293


is the error I am getting for what I assume is every page load on the forum - LOTS of Errors.
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 02, 2011, 11:18:06 AM
If PHP is not reporting the correct filename in the error report, I don't see how to help you.
Further, if it's reporting the same index of 'view' as the other user reported, this mod package never even references a variable index of that name. So... I'm not sure what else to tell you.
Title: Re: Search Focus Dropdown
Post by: beanflying on November 03, 2011, 06:39:46 AM
Currently have the mod un installed and have gone to a backed up css and the error has gone  ???

I also realised after I posted last night it was using a backup css sheet rather than the current one from my theme? So is there a possible issue with my current css and your mod causing it to go to another?

Anyway if you have any thoughts on where to look or ideas to try I am happy to put it back on the site and try and sort it as I really like the extra functionality it provides the members.
Title: Re: Search Focus Dropdown
Post by: Norv on November 03, 2011, 03:57:35 PM
beanflying,

Please when you see those "(main sub template - eval?)" messages, on SMF 2.0 you can go in Admin center > Server settings, and tick the "Disable evaluation of templates" option. That will instruct SMF to disable eval on the fly and will make it log the actual file at the origin of the respective error(s).

It will help us figure out where the problem is exactly.
Title: Re: Search Focus Dropdown
Post by: TheListener on November 03, 2011, 07:31:33 PM
Out of curiosity can the search box (which this mod compliments nicely) be used without the search tab on the menubar?

I would like to lose the search menu tab if so.
Title: Re: Search Focus Dropdown
Post by: beanflying on November 03, 2011, 10:55:54 PM
Many thanks for the tips Norv  :)

Brack1 you can remove the search from the main menu or change those settings in the Source files. Open up the subs.php file and search for "$buttons = array(" will get you to the section where the buttons are done in 2.0.1 anyway  :) I removed mine when I was playing with the mod too.
Title: Re: Search Focus Dropdown
Post by: TheListener on November 03, 2011, 11:04:15 PM
Have not long had an error :(
Title: Re: Search Focus Dropdown
Post by: beanflying on November 04, 2011, 08:41:16 PM
Ok used Norv's tips from above to find and debug the files (finished up being a problem in the display.php) and had nothing to do with this mod.

Since reinstalled this mod happily and running error free on 2.0.1. Great functionality mod  :D
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 04, 2011, 09:04:53 PM
Good catch, Norv. I somehow didn't even pick up on it being a template eval issue even though it was right there in his message.  :P

Quote from: beanflying on November 04, 2011, 08:41:16 PM
Ok used Norv's tips from above to find and debug the files (finished up being a problem in the display.php) and had nothing to do with this mod.

Since reinstalled this mod happily and running error free on 2.0.1. Great functionality mod  :D
Cool, thanks.
Title: Re: Search Focus Dropdown
Post by: beanflying on November 09, 2011, 05:28:54 AM
Just looking at tidying up the header section of my forum (reducing vertical height) and wondering if it is possible by modding the index.template to move the search bar to the right of the linktree as per the pic below?

All my playing (limited php skills) has been returning template parsing errors but I gather moving the lines below is part of it?

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '


Advice or guidance very welcome  :)
Title: Re: Search Focus Dropdown
Post by: Brettflan on November 09, 2011, 09:22:19 AM
Yes, it can be moved. You'll of course need to move the entire search form though ("<form" to "</form>"), not just the search focus dropdown addition.
I expect it will also take some HTML/CSS modification in order to make it fit in appropriately there.
Title: Re: Search Focus Dropdown
Post by: Kirck on December 14, 2011, 02:02:57 AM
Hello, here you have an update translatation for spanish and a new translation for catalan language :)

Spanish
$txt['search_focus_topic'] = 'Este tema';
$txt['search_focus_board'] = 'Este sub-foro';
$txt['search_focus_all'] = 'Todo el foro';

$txt['search_focus_google'] = 'Google';
$txt['search_focus_enable_google'] = 'Habilitar la búsqueda de Google como opción en la lista';

$txt['search_focus_bing'] = 'Bing';
$txt['search_focus_enable_bing'] = 'Habilitar la búsqueda de Bing como opción en la lista';

$txt['search_focus_boards'] = 'Añadir sub-foros como opciones de búsqueda en la lista';


Catalan
$txt['search_focus_topic'] = 'Aquest tema';
$txt['search_focus_board'] = 'Aquest sub-fòrum';
$txt['search_focus_all'] = 'Tot el fòrum';

$txt['search_focus_google'] = 'Google';
$txt['search_focus_enable_google'] = 'Habilitar l\'opció de recerca de Google com a opció a la llista';

$txt['search_focus_bing'] = 'Bing';
$txt['search_focus_enable_bing'] = 'Habilitar l\'opció de recerca de Bing com a opció a la llista';

$txt['search_focus_boards'] = 'Afegir sub-fòrums com a opcions de recerca a la llista';
Title: Re: Search Focus Dropdown
Post by: Brettflan on December 14, 2011, 03:40:08 AM
Thanks, I'll add those in the eventual next release. Quick question though, what character set (besides UTF-8 of course) does Catalan use? ISO-8859-1?
Title: Re: Search Focus Dropdown
Post by: Kirck on December 14, 2011, 05:23:04 PM
Yes, ISO-8859-1
Title: Re: Search Focus Dropdown
Post by: Draffi on February 02, 2012, 03:42:15 PM
One question:

I use this mod on my SMF 2 RC5 Board, default theme (Curve).

It is possible to show the google search result on a page that looks exactly like my forum?

e.g. exactly like this:
http://www.tystips.com/archives/66/how2-create-a-google-search-results-page-template-for-wordpress-27/
http://www.vbseo.com/f34/how-create-custom-google-search-custom-result-page-your-site-using-vbulletin-template-46319/

Thank you!
Title: Re: Search Focus Dropdown
Post by: Brettflan on February 02, 2012, 05:36:41 PM
Quote from: Draffi on February 02, 2012, 03:42:15 PM
One question:

I use this mod on my SMF 2 RC5 Board, default theme (Curve).

It is possible to show the google search result on a page that looks exactly like my forum?

e.g. exactly like this:
http://www.tystips.com/archives/66/how2-create-a-google-search-results-page-template-for-wordpress-27/
http://www.vbseo.com/f34/how-create-custom-google-search-custom-result-page-your-site-using-vbulletin-template-46319/

Thank you!
The method this mod uses is the standard Google-hosted site-search method. The method you've linked to uses special Google Search API integration which also requires an AdSense account. It would take a fair bit of work on my part to implement that option, and would require further configuration on your part.
I don't really have time to work on something like that at the moment, and for that matter I don't relish the idea of offering support for people having trouble getting an AdSense account set up and configured.
Sorry.
Title: Re: Search Focus Dropdown
Post by: madman71 on March 27, 2012, 10:00:55 PM
Brett,


Am i SOL with my theme?
http://custom.simplemachines.org/themes/index.php?lemma=2509

I search this whole thread and searching keyword "search" only appears like 4 times and none of the code that you say to remove/add exists.  I think i just might have one of those themes that doesnt have this search function.
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 28, 2012, 12:25:41 AM
Does it have the standard quick search form on every page, normally in the upper right corner like the forum here has? That's what this mod package works on.
Title: Re: Search Focus Dropdown
Post by: Rehash D Internet on July 05, 2012, 12:00:53 AM
When attempting to install this on 2.0.2 using emulator for 2.0 I'm getting 'Test Failed' on search.template.php. Any ideas why?

Many thanks
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 05, 2012, 01:05:56 AM
You shouldn't need to use an emulator; 1.6.1 installs directly in SMF 2.0.2.

Is the "Test Failed" notice under the "Install in Other Themes" section, or is it above that in the main installation? If it's in the upper section, which is very very unlikely, it's on the default theme and presumably another mod has changed that particular tiny target piece of code.
If it's in the lower section as I suspect, it's for a custom theme you have installed which uses a custom Search.template.php file that doesn't have the target code. In that case, you can still install this package, but it won't work in that particular theme without additional modification.
Title: Re: Search Focus Dropdown
Post by: gisfreak on July 15, 2012, 12:00:07 PM
hello my friend

I use extreme6 themes by fussilet :

http://custom.simplemachines.org/themes/index.php?lemma=1078

and failed on

Add Before    ./Themes/extreme6_2_0_texture/index.template.php

how should I insert additional line , since I cant find the :

Quote<input type="submit" name="submit" value="', $txt['search']

index.template attached
Title: Re: Search Focus Dropdown
Post by: Brettflan on July 15, 2012, 11:18:57 PM
With that theme's customized search box, it would fit in after this (somewhere between lines 281 to 291):
<input class="inputbox" type="text" name="search" value="', $txt['search'], '..." onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\'', $txt['search'], '...\';" />';

You'll also want to add some extra CSS styling to make it fit in better with the theme, I expect.
Title: Re: Search Focus Dropdown
Post by: DBAllTerrain on October 12, 2012, 08:19:10 PM
I have this installed on my custom theme and the dropdown appears and contains the correct options depending on the page. However, when searching, it ignores the dropdown and always searches based on where I am, ie-search only current topic if I'm in a topic. Where do I begin to troubleshoot this?

Sorry, I should mention I'm using TinyPortal, downloads system, custom board sort and custom forms mod.
Title: Re: Search Focus Dropdown
Post by: Brettflan on October 12, 2012, 10:43:01 PM
Quote from: DBAllTerrain on October 12, 2012, 08:19:10 PM
I have this installed on my custom theme and the dropdown appears and contains the correct options depending on the page. However, when searching, it ignores the dropdown and always searches based on where I am, ie-search only current topic if I'm in a topic. Where do I begin to troubleshoot this?

Sorry, I should mention I'm using TinyPortal, downloads system, custom board sort and custom forms mod.
Something else has presumably changed how the search focus is determined. Check your other packages for one which modifies "/Sources/Search.php" and has also modified the search form in the index.template.php theme file. At a guess it's probably TinyPortal.
Title: Re: Search Focus Dropdown
Post by: DBAllTerrain on October 13, 2012, 12:13:53 AM
My apologies. It was my own fault. I was using a custom theme and the search form at the top of the page had no ID. Set it up as search_form and it's now working. Thanks for the reply and for making a very useful mod that makes the search feature much more clear for my users.
Title: Re: Search Focus Dropdown
Post by: Skaty on December 29, 2012, 09:06:26 AM
Quote from: DBAllTerrain on October 13, 2012, 12:13:53 AM
My apologies. It was my own fault. I was using a custom theme and the search form at the top of the page had no ID. Set it up as search_form and it's now working. Thanks for the reply and for making a very useful mod that makes the search feature much more clear for my users.

i have the same problem but i don't understand how you fix this.

i add some codes to SearchFocus.turkish-utf8.php  like

$txt['search_focus_all'] = 'Bütün forumda';
$txt['search_focus_ps-vita-teknik-destek'] = 'PS Vita Sorunlarınız ve Teknik Destek'; 

but it is not work properly.
Title: Re: Search Focus Dropdown
Post by: Skaty on December 29, 2012, 07:53:06 PM
i'm using the Zentoa theme by DzinerStudio and here is my index.template.  where do i have to add the code exactly ?

Title: Re: Search Focus Dropdown
Post by: Badboy on December 29, 2012, 08:16:07 PM
Quote from: Skaty on December 29, 2012, 07:53:06 PM
i'm using the Zentoa theme by DzinerStudio and here is my index.template.  where do i have to add the code exactly ?



The code is already added to your file. However, you need to make the following fix to work properly.

Code (FIND) Select
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">

Code (REPLACE) Select
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
Title: Re: Search Focus Dropdown
Post by: Skaty on December 30, 2012, 05:06:39 AM
Quote from: Badboy on December 29, 2012, 08:16:07 PM
Quote from: Skaty on December 29, 2012, 07:53:06 PM
i'm using the Zentoa theme by DzinerStudio and here is my index.template.  where do i have to add the code exactly ?
The code is already added to your file. However, you need to make the following fix to work properly.
Code (FIND) Select
<form action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
Code (REPLACE) Select
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">

Aha! thank you, now is ok :)

Still no fix for child board search ?
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 03, 2013, 12:17:13 AM
Quote from: Skaty on December 30, 2012, 05:06:39 AM
Still no fix for child board search ?
For starters, what problem are you actually having with it?
Title: Re: Search Focus Dropdown
Post by: Skaty on January 03, 2013, 07:02:24 AM
Quote from: Brettflan on January 03, 2013, 12:17:13 AM
Quote from: Skaty on December 30, 2012, 05:06:39 AM
Still no fix for child board search ?
For starters, what problem are you actually having with it?

For example, i wanna search in games board but there is a child boards like A-C, D-F etc...  so when i search in games there is no results that i want.
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 03, 2013, 08:22:09 AM
Quote from: Skaty on January 03, 2013, 07:02:24 AM
Quote from: Brettflan on January 03, 2013, 12:17:13 AM
Quote from: Skaty on December 30, 2012, 05:06:39 AM
Still no fix for child board search ?
For starters, what problem are you actually having with it?
For example, i wanna search in games board but there is a child boards like A-C, D-F etc...  so when i search in games there is no results that i want.
Ah, I think I see what you mean. "This board" indeed only works on the current board, it doesn't include any child boards. That could potentially be changed with a bit of work, but what of people who would expect the current behavior? It could be argued either way, with certain people confused or dissatisfied with either way of handling it (including child boards or not). I think including child boards might actually be a bit more confusing and would make it impossible to limit a search to a single board if it has children, without resorting to the full advanced search form.
Another option in the dropdown could be added for the current board and child boards, but I'm not convinced it would be all that useful for most people.
Title: Re: Search Focus Dropdown
Post by: Skaty on January 03, 2013, 02:34:45 PM
maybe there can be such options:

[  ]  search just main board
[  ]  include child boards
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 05, 2013, 10:39:39 AM
Hi.
I fear this may be too complicated for me to explain  :-\

On my own forum (2.0.3) i have installed this mod and FacebookSMF theme and it works without fault  :)

On a forum I am a Global Mod on (2.0.2) it doesnt work.............. (does work faultlessly with core theme on this forum)
The forum has a modified (css I think) Facebook SMF and your mod doesnt work with this. See screen shot of board view.

Is there any way that is enough information for you to point me to the error?
The forum is member only controlled access so I cant show you it that way........

from error log...............

Apply Filter: Only show the error messages of this URL
http://xxxx.com/index.php?topic=3700.0;topicseen
Apply Filter: Only show the errors with the same message
8: Undefined index: search_scope_board
Apply Filter: Only show the errors from this file
File: /home/turbopb1/public_html/xxxx.com/Themes/default/languages/Faq.english.php (body_above sub template - eval?)
Line: 253


does that point to a clash with the FAQ mod ?
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 06, 2013, 12:38:12 AM
What that points to is the language files for this mod not being loaded properly (the "Undefined index: search_scope_board" bit). Those files should be in the default theme's "languages" folder as "SearchFocus.[LANGUAGE].php" if you installed the mod correctly. Since the language file is loaded by the SearchFocus.template.php file which you clearly have in place, unless you've modified that file, pretty much the only explanation should be those language files missing.
Title: Re: Search Focus Dropdown
Post by: NanoSector on January 06, 2013, 08:38:55 AM
Brettflan: template files are not supposed to load language files, are you sure the mod is doing this? (if yes we'll need to take a second glance over this)
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 06, 2013, 09:11:49 AM
Quote from: Yoshi2889 on January 06, 2013, 08:38:55 AM
Brettflan: template files are not supposed to load language files, are you sure the mod is doing this? (if yes we'll need to take a second glance over this)
This mod does not use a separate source file, but it does have a separate template file to simplify inclusion in multiple themes. I suppose this "template file" is not really structured or used as one since it's simply include()ed from another template file to use its inline code (no functions added), but the code is for frontend template use. It also simplifies making a customized version of the dropdown box for different themes if desired.

I could add the loadLanguage call to the appropriate existing source file(s) instead, but I'm trying to keep this package as clean and compartmentalized as possible so that it's less likely to conflict with other mod packages (mainly IRT installation and uninstallation order conflicts from changing the same section of code and such). I also have seen no reason not to add the loadLanguage call right where it's needed there; if there is some fundamental reason it shouldn't be where it is, please do let me know.
Title: Re: Search Focus Dropdown
Post by: demlak on January 06, 2013, 09:34:49 AM
im sorry for not reading 16 pages...
but is it possible to not show the dropdown menu at all, if there is only one option available? for example when there is only "entiry forum" available?

EDIT:
nevermind.. im using a different mod to enhance search =)
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 09, 2013, 04:56:21 AM
main page is fine and the search works brilliantly everywhere now thanks.
only visual faults are in board view and topic view (see att)

is that just a bit od code we have there by mistake? can you guess what it might be ?

thanks
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 09, 2013, 05:03:01 AM
Quote from: iain sherriff on January 09, 2013, 04:56:21 AM
main page is fine and the search works brilliantly everywhere now thanks.
only visual faults are in board view and topic view (see att)

is that just a bit od code we have there by mistake? can you guess what it might be ?

thanks
You do appear to have something extra added there by mistake. Did you figure it out yourself? I followed the link in your sig to see if I could check the page source for an inkling of what that extra dropdown is for, but the forum in your sig looks fine at a glance (default theme though, of course).
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 09, 2013, 05:53:26 AM
my link is to my forum . the errror is on the one I moderate whichI didnt install............
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 09, 2013, 05:58:43 AM
Quote from: iain sherriff on January 09, 2013, 05:53:26 AM
my link is to my forum . the errror is on the one I moderate whichI didnt install............
Well, good luck with it.
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 09, 2013, 08:33:42 AM
...does that mean you cant guess what the code may be ?
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 09, 2013, 08:43:15 AM
Quote from: iain sherriff on January 09, 2013, 08:33:42 AM
...does that mean you cant guess what the code may be ?
A screenshot isn't much to go on for determining what was done that messed it up, especially since that extra empty dropdown after the search button wouldn't exist in a normal installation of this mod package.
Presumably some extra code ended up in there, but I have no way of knowing what without a link to the site or the contents of the theme's index.template.php file. Actually, you could probably spot the extra code just looking at that file yourself.
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 09, 2013, 11:59:33 AM
thanks  :)
I'll compare it to mine and see what I can find. The one I moderate is a massive forum and we have real problems trying to get people to use search rather than just starting another topic...your mod is going to go a long way to helping that situation.
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 09, 2013, 06:02:30 PM
From the index.template.php

Is it the bit between ***   ***?

<option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
               <option value="board">', $txt['search_scope_board'], '</option>
               <option value="all">', $txt['search_scope_all'], '</option>
            </select>';
   // 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'], '" />
            ***  <select name="search_scope">
               <option value="board" selected="selected">', $txt['search_scope_board'], '</option>
               <option value="all">', $txt['search_scope_all'], '</option>
            </select>';   ***

      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>';
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 09, 2013, 09:38:37 PM
Quote from: iain sherriff on January 09, 2013, 06:02:30 PM
From the index.template.php

Is it the bit between ***   ***?
It's from well before where you have the start location marked, to the end of where you have it marked. Some of the code in there IIRC shouldn't be removed though, it's code which exists even without this package interspersed in there. What you have in there is the old pre-1.6.0 code for this mod, by the way; looks like an older version of this package wasn't uninstalled properly before installing the latest version. That could cause all sorts of problems, leaving bits of old packages installed without uninstalling them properly.
You'd probably do better to uninstall all packages, upload a fresh copy of all SMF and theme files, and then re-install all packages to be sure you don't have more leftover code in there. Then be more careful in future about package handling, not just deleting or overwriting packages without uninstalling them through the admin panel first.
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 10, 2013, 11:45:14 AM
thanks.............as I said not one that I installed   ???
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 10, 2013, 11:54:50 AM
Quote from: iain sherriff on January 10, 2013, 11:45:14 AM
thanks.............as I said not one that I installed   ???
Well, again, good luck with it.  :)
Title: Re: Search Focus Dropdown
Post by: iain sherriff on February 12, 2013, 02:19:26 PM
hi.
Rebuilding the above site with Anecdota theme.
All installed well and works with defaul theme. I did a manual install on Anecdota as your search didnt work with that.
I now have the drop down menu but am missing the search button....................what have I forgotten to do please ?

isthatagnu.com/smf
Title: Re: Search Focus Dropdown
Post by: Brettflan on February 13, 2013, 12:06:29 PM
Quote from: iain sherriff on February 12, 2013, 02:19:26 PM
hi.
Rebuilding the above site with Anecdota theme.
All installed well and works with defaul theme. I did a manual install on Anecdota as your search didnt work with that.
I now have the drop down menu but am missing the search button....................what have I forgotten to do please ?

isthatagnu.com/smf
You didn't provide a link to the theme in question, but after a quick search I see that the theme doesn't have a search button to begin with. It should work fine all the same, you just press Enter on your keyboard to submit the form.
Title: Re: Search Focus Dropdown
Post by: haito on March 19, 2013, 06:14:19 AM
great mod :)

i have a question.

i have 3 board
index.php?board=56.0
index.php?board=57.0
index.php?board=58.0

how to add them into dropdown box as default dropdown?

thanks in advance:)
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 19, 2013, 12:22:41 PM
Quote from: haito on March 19, 2013, 06:14:19 AM
great mod :)

i have a question.

i have 3 board
index.php?board=56.0
index.php?board=57.0
index.php?board=58.0

how to add them into dropdown box as default dropdown?

thanks in advance:)

You can add your own boards to the drop down by going into search configuration in the admin panel.
Title: Re: Search Focus Dropdown
Post by: Skaty on March 27, 2013, 11:07:10 AM
How can i add this code without broke my theme ?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FHqp31ye.png&hash=75686427d7636b4bebeb2e6d241761203abaf0eb)

';

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '



</div>
<div id="search">
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input class="search-input" type="text" name="search" value="', $txt['forum_search'], '" onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\'', $txt['forum_search'], '\';" />
<input class="search-button" type="submit" name="submit" value="" />';
Title: Re: Search Focus Dropdown
Post by: Brettflan on March 27, 2013, 02:05:45 PM
Quote from: Skaty on March 27, 2013, 11:07:10 AM
How can i add this code without broke my theme ?

(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fi.imgur.com%2FHqp31ye.png&hash=75686427d7636b4bebeb2e6d241761203abaf0eb)

';

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '



</div>
<div id="search">
<form id="search_form" action="', $scripturl, '?action=search2" method="post" accept-charset="', $context['character_set'], '">
<input class="search-input" type="text" name="search" value="', $txt['forum_search'], '" onfocus="this.value = \'\';" onblur="if(this.value==\'\') this.value=\'', $txt['forum_search'], '\';" />
<input class="search-button" type="submit" name="submit" value="" />';

For one thing you might add it after the submit button code on that theme; it looks like you have it added in before it, and that theme is clearly designed to have the look of the submit buttom blend into the right side of the search box. You can also of course use CSS to make the look of it match your theme better.
Title: Re: Search Focus Dropdown
Post by: TLMB on December 23, 2013, 09:11:29 AM
Hi,
First of all, thank you for this mod. I've been using it for a while now (1.52). I just upgraded to 1.61 to try to fix something I'd discovered, but with no luck....

It seems like an apostrophe ' in the middle of the search term will break the search.

e.g. There is a post on my forum which contains the phrase
monkey's chair

Searching for
monkey chair
or
monkey
or
'monkey'
will find it, but if I search for
monkey's chair
or
monkey's
then no results are shown.

I don't know if this is a problem with the search itself, or with this mod. Sorry if this has been answered elsewhere, but I tried searching this thread for "apostrophe", and also googling, but didn't find a solution.
I'm on SMF 2.0.6.

Thanks for any replies.
Title: Re: Search Focus Dropdown
Post by: Brettflan on December 23, 2013, 01:49:29 PM
That problem would be unrelated to this mod package; the search terms and index method aren't affected by it. It sounds like a problem with the search index method you're using not properly sanitizing the search string. I seem to recall there were some bugs with the Sphinx search method a few years back along those lines, but that has long since been fixed.
I use this mod on a few forums and a Sphinx index as well on a particularly large one (~6M posts), and I don't have your problem on any of them.
Title: Re: Search Focus Dropdown
Post by: TLMB on December 30, 2013, 10:58:42 AM
Okay, thanks for letting me know.
Title: Re: Search Focus Dropdown
Post by: iain sherriff on December 31, 2013, 02:09:16 AM
I see you have commented on this before
I am getting a lot of errors in the log

Apply Filter: Only show the error messages of this URL
http://***/index.php?topic=6293.125;topicseen
Apply Filter: Only show the errors with the same message
8: Undefined index: search_scope_board
Apply Filter: Only show the errors from this file
File: /home2/turbopb1/public_html/***/Themes/default/languages/SearchFocus.english.php (body_above sub template - eval?)
Line: 278


and the same but line 277 and line 279

The search is working fine and the error has no effect that I can see on forum operation. the file look as it does if I parse the mod files on here.

A way to stop the log filling up would be good, just wondering if anything I have posted here is a clue for you  :)

Thanks
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 01, 2014, 03:49:36 PM
Quote from: iain sherriff on December 31, 2013, 02:09:16 AM

Apply Filter: Only show the error messages of this URL
http://***/index.php?topic=6293.125;topicseen
Apply Filter: Only show the errors with the same message
8: Undefined index: search_scope_board
Apply Filter: Only show the errors from this file
File: /home2/turbopb1/public_html/***/Themes/default/languages/SearchFocus.english.php (body_above sub template - eval?)
Line: 278

Where do you have 'search_scope_board'? That's not correct for this mod, it would correctly be 'search_focus_board'. Also, the reported error isn't useful with template eval disabled; you can find that option under Admin->Configuration->Server Settings->General, as "Disable evaluation of templates". You do normally want to have that option enabled for better performance, but you should temporarily disable it to let you track down errors occurring inside templates/themes.
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 01, 2014, 05:28:23 PM
Thanks for the answer.
" Disable evaluation of templates " was not ticked.
I have ticked it now and get

Apply Filter: Only show the error messages of this URL
http://***.com/index.php?topic=6271.100;topicseen
Apply Filter: Only show the errors with the same message
8: Undefined index: search_scope_board
Apply Filter: Only show the errors from this file
File: /home2/turbopb1/public_html/***.com/Themes/default/index.template.php
Line: 278


is there another mod that could have been installed/deleted that couldhave left behind "scope" ? Any clue were to look please ?

Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 01, 2014, 05:33:17 PM
from index.template.php around line 270

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '
';

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '
<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'], '" />
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />
<select name="search_scope">
<option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
<option value="board">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';
// 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'], '" />
<select name="search_scope">
<option value="board" selected="selected">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';

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>

Title: Re: Search Focus Dropdown
Post by: Brettflan on January 01, 2014, 06:09:34 PM
Quote from: iain sherriff on January 01, 2014, 05:33:17 PM
from index.template.php around line 270

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '
';

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '
<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'], '" />
<input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />
<select name="search_scope">
<option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
<option value="board">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';
// 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'], '" />
<select name="search_scope">
<option value="board" selected="selected">', $txt['search_scope_board'], '</option>
<option value="all">', $txt['search_scope_all'], '</option>
</select>';

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>

The primary code for integration in index.template.php is this:
// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

You appear to have that twice, which shouldn't be a problem really since it's an include_once, but only one is needed so you could remove the second copy.

Then below that you do appear to have some old code from pre-1.5 versions of this mod, which is the source of your problem. That explains the 'search_scope_board' index reference; I'd thought it sounded familiar, but I don't even have that old of a version still available in my local backups and didn't find any reference to it in the 1.5+ code backups I do have when I did a quick check earlier.

The main thing to remove there to fix your error would be the two "<select name="search_scope">...</select>" sections. That will take care of it. There's a tiny bit more extraneous code in there added by that old version of the mod which could be removed, but it won't cause any problems and I'm not completely certain which bit(s) it would be at this point. If you have an original unmodified copy of the index.template.php for your theme you could do a comparison to be sure what has been changed.
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 02, 2014, 06:34:29 AM
That's great, thanks. Bit of a mystery but I haven't admined this board from the start.

Big help form here as always  :)
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 02, 2014, 12:49:05 PM
So remove the bits in red ?

Quote// Search Focus Dropdown
      include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

      echo '
               ';

      // Search Focus Dropdown
      include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

      echo '
               <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'], '" />
            <input type="hidden" name="brd[', $context['current_board'], ']" value="', $context['current_board'], '" />
            <select name="search_scope">
               <option value="topic" selected="selected">', $txt['search_scope_topic'], '</option>
               <option value="board">', $txt['search_scope_board'], '</option>
               <option value="all">', $txt['search_scope_all'], '</option>
            </select>';
   // 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'], '" />
            <select name="search_scope">
               <option value="board" selected="selected">', $txt['search_scope_board'], '</option>
               <option value="all">', $txt['search_scope_all'], '</option>
            </select>';

   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>
Title: Re: Search Focus Dropdown
Post by: iain sherriff on January 03, 2014, 07:37:41 PM
I referred to #13 and removed the relevant bits. Seems to be OK now  :)
Title: Re: Search Focus Dropdown
Post by: Brettflan on January 07, 2014, 03:25:58 AM
Quote from: iain sherriff on January 03, 2014, 07:37:41 PM
I referred to #13 and removed the relevant bits. Seems to be OK now  :)
Sorry, yes, that's correct. Good to hear you sorted it out.

My internet went down and needed me to fix it, and as it happened I got really sick at the same time. Finally felt good enough to work on it and fix it today, so now I'm finally catching up.
Title: Re: Search Focus Dropdown
Post by: Chas Large on August 26, 2014, 06:08:00 AM
Hi Brett,

Been using you mod for ages now on 2.0.xx and working very well, thank you.  :)

Two quick questions / requests.

1. Is it possible to move the "Entire Forum" item in the drop down list from the bottom to the top? Many phone users say it causes too much scrolling.

2. Is it possible NOT to show ADMIN ONLY boards in the list? I have several that only Admins and Global Mods can see but if I include these in the list, other members can see them in the drop down and try to access them, failing of course then asking what they are etc. It would be better if they were only visible to Admins and GMs.

Thanks again.

Chas.
Title: Re: Search Focus Dropdown
Post by: Chas Large on August 27, 2014, 05:49:35 PM
I've adjusted the code to place the "Entire Forum" option above all the selected board and post options.

In Themes/default/SearchFocus.template.php Change this:

// If specific extra boards are to be listed, go ahead and add them
$focus_boards = array();
if (!empty($modSettings['search_focus_boards']))
{
$focus_boards = unserialize($modSettings['search_focus_boards']);
foreach ($focus_boards as $brd_id => $brd_name)
{
$focus_options .= '
<option value="' . $brd_id . '">' . $brd_name . '</option>';
}
}

// Always have "entire forum" option available
$focus_options .= '
<option value="all"' . $sel . ' style="font-weight: bold;" id="search_focus_all">' . $txt['search_focus_all'] . '</option>';



to this:

// If specific extra boards are to be listed, go ahead and add them
$focus_boards = array();
if (!empty($modSettings['search_focus_boards']))
{

// Always have "entire forum" option available
$focus_options .= '
<option value="all"' . $sel . ' style="font-weight: bold;" id="search_focus_all">' . $txt['search_focus_all'] . '</option>';

$focus_boards = unserialize($modSettings['search_focus_boards']);
foreach ($focus_boards as $brd_id => $brd_name)
{
$focus_options .= '
<option value="' . $brd_id . '">' . $brd_name . '</option>';
}
}



Hope this helps anyone else who needs the same tweak.

Not yet worked out the permissions issue I raised.
Title: Re: Search Focus Dropdown
Post by: DSystem on October 22, 2014, 07:24:05 PM
Brazil Portuguese translation update. Was with strange characters when used UTF8

Title: Re: Search Focus Dropdown
Post by: MESWEB on November 16, 2014, 08:08:43 PM
Quote from: Brettflan on August 13, 2010, 04:11:23 AM
Quote from: Joker™ on August 13, 2010, 03:28:36 AM
In my test site, i went in Board "A" , and searched for -> Test

Same name post is in Board "B" also

the search output url is

http://localhost/rc3/index.php?action=search2;search=test;search_focus=board;submit=Search;advanced=0;brd=

Also in result both test posts of Board "A" and "B" were shown , and i just made search for Board "A" post.

OK, I think the "brd" value is being parsed out as an array and getting lost. Try this then:

<?php
//Path to SSI.php
require(dirname(__FILE__) . '/SSI.php');

$redir 'action=search2';

foreach (
$_POST as $var => $val)
{
if( is_array($val) )
foreach ($val as $vala => $valb)
$redir .= ';' urlencode(stripslashes($var)) . '[' urlencode(stripslashes($vala)) . ']=' urlencode(stripslashes($valb));
else
$redir .= ';' urlencode(stripslashes($var)) . '=' urlencode(stripslashes($val));
}

redirectexit($redir);

?>


I paste this code to top of Search.template.php but not working. How I can see query string like search=anyword
Title: Re: Search Focus Dropdown
Post by: roshaoar on May 06, 2015, 05:46:36 AM
Hello,

This is really nice thank you, works fine on 2.0.10. May I request, how would I add an additional custom option in the dropdown, make it default, with a URL and parameter for it to go to? I already have zoomindex on my site and the forum is just a small part of the site, so I'd like to add an option "Search entire site".

Thank you for your time,

-Johan
Title: Re: Search Focus Dropdown
Post by: hong_thanawat on October 04, 2015, 11:23:19 AM
Hello,

I am not sure whether this mod is still active. I have a very high expectation for this mod. However, it seems the mod has not been updated for a while.

After installed 'Search Focus Dropdown', the default search box on my forum is disappeared. I have not idea how to get it back. I have uninstalled the mod  but I still can not recover the search box.

Can anyone advice me how to get the search box back with 'Search Focus Dropdown' mod? I am using SMF 2.0.11 atm.

Thank you,
Thanawat
Title: Re: Search Focus Dropdown
Post by: br360 on October 04, 2015, 02:12:57 PM
Did you do a backup before you installed the mod? When you tried to install or uninstall, were there any errors that showed?
Title: Re: Search Focus Dropdown
Post by: Dwev on December 25, 2017, 02:43:07 AM
Is there still support for this mod? It seems that "Brettflan" hasn't been here since for almost four years.

I'm trying to get this mod to work, but it fails on the search in index.template.php in the Theme, because it can't find the following:


<input type="submit" name="submit" value="', $txt['search']


I'm using SimplePortal and a custom theme, so I'm guessing things aren't exactly standard.

I could attach my index.template.php, but if nobody is watching I'd rather not.
Title: Re: Search Focus Dropdown
Post by: @rjen on December 25, 2017, 03:24:46 AM
That's a fairly simple thing to do, I am sure some one will help you if you attach the file. I would...
Title: Re: Search Focus Dropdown
Post by: Dwev on December 25, 2017, 08:05:00 AM
Thanks for the generous offer, I attached our index.template.php
Title: Re: Search Focus Dropdown
Post by: @rjen on December 25, 2017, 12:48:17 PM
Quote from: Dwev on December 25, 2017, 08:05:00 AM
Thanks for the generous offer, I attached our index.template.php

Mmm, I had a quick look, expecting to find some sort of reference to the search box in this remplate, but it does not seem to be there..

Two questions:
1. does your theme actually have the search box in the header?
2. can you provide a link to the forum to check?
Title: Re: Search Focus Dropdown
Post by: skb on December 25, 2017, 09:05:20 PM
To open Google Search results in a new tab, where can I add - target="_blank"
if ($s_focus == 'google')
header( 'Location: http://www.google.com/search?q=' . urlencode($_REQUEST['search']) . '&sitesearch=' . $site_domain );
Title: Re: Search Focus Dropdown
Post by: Sir Osis of Liver on December 25, 2017, 09:17:05 PM
https://stackoverflow.com/questions/12539011/header-location-in-new-tab
Title: Re: Search Focus Dropdown
Post by: Dwev on December 27, 2017, 10:22:54 AM
Quote from: @rjen on December 25, 2017, 12:48:17 PM
Two questions:
1. does your theme actually have the search box in the header?
2. can you provide a link to the forum to check?

1. No, our theme does't have this, But I had one activated through SimplePortal, I just added a second one (one on the header block, one in the right block).
2. Test-site can be found here: https://www.applezone.nl
Title: Re: Search Focus Dropdown
Post by: @rjen on December 27, 2017, 10:35:55 AM
Quote from: Dwev on December 27, 2017, 10:22:54 AM
Quote from: @rjen on December 25, 2017, 12:48:17 PM
Two questions:
1. does your theme actually have the search box in the header?
2. can you provide a link to the forum to check?

1. No, our theme does't have this, But I had one activated through SimplePortal, I just added a second one (one on the header block, one in the right block).
2. Test-site can be found here: https://www.applezone.nl

That explains the problem: the mod will try to enhance the existing function. If the function is not there it cannot be enhanced: you will have to create it first in the theme.

As far as I can see in the index.template.php a designer has stripped that part out of the original template file (which is a copy from curve as far as I can see)  when he stripped out all other items , such as the login form, newsfader, the header toggle etcetera

It will need to be put back in for this mod to work...

This guy...
Quote/*   MacFreak is a work of Joost Kolkman - mediabouwers.nl. For more information please visit
   http://mediabouwers.nl/
   MacFreak was developed by Joost Kolkman.
*/

The code that needs to be put back in (somewhere around line: 284) is this:


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" />&nbsp;
';

// Search Focus Dropdown
include_once($settings['default_theme_dir'] . '/SearchFocus.template.php');

echo '
<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'], '" />';





Title: Re: Search Focus Dropdown
Post by: Dwev on December 27, 2017, 11:45:30 AM
The theme that he built was based on Bootstrap, I guess this got lost in the process.

I just added the code in the index.template.php of the theme, and turned off the search options from SimplePortal.

And it worked!
I now have a Search field, and Search Focus Dropdown did indeed install without a problem!

One more question, the Search field is all the way down at the bottom (in the footer I guess).
I suppose that this has to do where it was placed in the code?

If you want to have a look, the URL hasn't changed.
Title: Re: Search Focus Dropdown
Post by: @rjen on December 27, 2017, 12:02:13 PM
Yes,

if you want it in the header, try moving the code into a div in the header section
You may want to try in the  '<div class="userarea navbar-right">'
Line 212 in the template.

Getting it right takes some experimentation using the correct div and styles, depending on where you exactly want it to show up...
Title: Re: Search Focus Dropdown
Post by: a10 on February 07, 2020, 03:45:40 PM
This very useful mod doing fine in 2.0.17 \ php 7.2 & 7.3

Looking into the future :O) testing php 7.4, search works but with following:

hps://ww.asdfgh/forum/index.php?action=admin;area=logs;sa=errorlog;desc
8: Trying to access array offset on value of type null
File: /customers/asdfgh/httpd.www/forum/Sources/ManageErrors.php
Line: 129

hps://ww.asdfgh/forum/index.php?action=search2
8: Trying to access array offset on value of type null
File: /customers/asdfgh/httpd.www/forum/Themes/default/languages/SearchFocus.english.php (results sub template - eval?)
Line: 316
Title: Re: Search Focus Dropdown
Post by: a10 on February 10, 2021, 05:08:49 PM
^^^ ref post above. Using smf 2.0.18 all looks well, no errors showing up with php 7.4.15
Title: Re: Search Focus Dropdown
Post by: shawnb61 on October 22, 2021, 01:03:42 PM
I find this mod quite helpful.  And yes, it runs perfectly on the latest smf/php versions.

It'd be nice to see a 2.1 version!   :)