News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Search Focus Dropdown

Started by Brettflan, February 14, 2009, 02:34:48 PM

Previous topic - Next topic

Brettflan

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.

imno007

#41
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.

Brettflan

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 for.

apTyaH

How-To make wieved SEARCH FOCUS DROPDOWN on first forum page with search in google or entire forum or somewhere else?

Brettflan

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.

imno007

#45
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 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.

4Kstore


¡¡NEW MOD: Sparkles User Names!!!

apTyaH

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)

Brettflan

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?

apTyaH

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.

Brettflan

Hmm... could you provide a link to the forum, or a screenshot of what exactly you're talking about?

apTyaH


apTyaH

here default theme index.template.php

Brettflan

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.

apTyaH

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?

Brettflan

#55
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.

apTyaH

As example can you post some useful code for search box? Some for users or something else? 8)

Brettflan

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 before trying to mess around with it.

apTyaH

Brettflan , its practically that needs to know. Biggest thanks !

Brettflan

Minor update: installation support for SMF 1.1.10 and 2.0RC1.2.
See the mod link in the first post.

Advertisement: