Advertisement:

Author Topic: Search Focus Dropdown  (Read 108718 times)

Online @rjen

  • Full Member
  • ***
  • Posts: 574
  • Gender: Male
    • FJR-club Nederland
Re: Search Focus Dropdown
« Reply #340 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...
Running SMF 2.0 with Tinyportal 1.6.6 at www.fjr-club.nl

Offline Dwev

  • Jr. Member
  • **
  • Posts: 247
Re: Search Focus Dropdown
« Reply #341 on: December 25, 2017, 08:05:00 AM »
Thanks for the generous offer, I attached our index.template.php

Online @rjen

  • Full Member
  • ***
  • Posts: 574
  • Gender: Male
    • FJR-club Nederland
Re: Search Focus Dropdown
« Reply #342 on: December 25, 2017, 12:48:17 PM »
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?
Running SMF 2.0 with Tinyportal 1.6.6 at www.fjr-club.nl

Offline skb

  • Full Member
  • ***
  • Posts: 403
    • Metabolically Challenged
Re: Search Focus Dropdown
« Reply #343 on: December 25, 2017, 09:05:20 PM »
To open Google Search results in a new tab, where can I add - target="_blank"
Code: [Select]
if ($s_focus == 'google')
header( 'Location: http://www.google.com/search?q=' . urlencode($_REQUEST['search']) . '&sitesearch=' . $site_domain );
Learning, every day.
Forum - Diabetes Forum
Because every diabetic needs help
SMF 2.1 RC2 (default theme) / TP 1.6.2

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 10,145
  • Hoarding Budweiser in NY

Offline Dwev

  • Jr. Member
  • **
  • Posts: 247
Re: Search Focus Dropdown
« Reply #345 on: December 27, 2017, 10:22:54 AM »
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

Online @rjen

  • Full Member
  • ***
  • Posts: 574
  • Gender: Male
    • FJR-club Nederland
Re: Search Focus Dropdown
« Reply #346 on: December 27, 2017, 10:35:55 AM »
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:

Code: [Select]
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'], '" />';




Running SMF 2.0 with Tinyportal 1.6.6 at www.fjr-club.nl

Offline Dwev

  • Jr. Member
  • **
  • Posts: 247
Re: Search Focus Dropdown
« Reply #347 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.

Online @rjen

  • Full Member
  • ***
  • Posts: 574
  • Gender: Male
    • FJR-club Nederland
Re: Search Focus Dropdown
« Reply #348 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...
Running SMF 2.0 with Tinyportal 1.6.6 at www.fjr-club.nl

Offline a10

  • Charter Member
  • Sr. Member
  • *
  • Posts: 985
Re: Search Focus Dropdown
« Reply #349 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
2.0.17, ssl, php 7.3.16, 10.3.21-MariaDB
Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.