Page Index Toggle Pages: 1
Topic Tools
Normal Topic Set Search Default to Longer than One Week? (Read 1,347 times)
ZachMatthews
Full Member
***
Offline



Posts: 107
Set Search Default to Longer than One Week?
Mar 8th, 2012 at 9:24pm
Post Tools
Hey guys -

I get complaints about my site's search function all the time, and it is always the same problem: they are searching from the built-in form on the main menu rather than from the Advanced Search menu, and thus they are limiting their searches to the default of one week.

Really this is very silly; people only search for stuff they aren't seeing in the first couple pages and few boards get enough traffic to roll back that fast.  This default should really be set to a year at least.

Can anyone tell me how to change this?  I am sure it has to be in the Settings.pl file or something somewhere.

Thanks,
Zach
  
Back to top
 
IP Logged
 
Bill Myers
God Member
Beta Testers
*****
Offline



Posts: 1,737
Location: Los Angeles

YaBB 2.4
Re: Set Search Default to Longer than One Week?
Reply #1 - Mar 8th, 2012 at 11:02pm
Post Tools

Zach, this isn't the real solution, but mainly because the search engine box wasn't working in our forum, and nobody here to date has figured out how to fix this, I simply removed that search box so that the only search option left is the better and more comprehensive one that's located on the menu.

For those who may have missed the discussions about it, evidently there are many forums that have inoperable search engine boxes anyway, so why have it available? All it does is a simple search anyway.

  

Morning, noon, or night, have a great one!

Note: This forum doesn't allow for us to freely edit our posts or topics to make corrections as needed, so please remember to look for subsequent posts if you see any mistakes or outdated information. Sorry for the inconvenience.
Back to top
IP Logged
 
WebMe
Junior Member
**
Offline



Posts: 66

None
Re: Set Search Default to Longer than One Week?
Reply #2 - Mar 13th, 2012 at 9:50pm
Post Tools
In Sources\Subs.pl look for the section setting up the search box.
There should be a line like: <input type="hidden" name="age" value="31" />
(Line 380 in YaBB2.5)
Change the value to the number of days you would like.
  

We offer YaBB compatible hosting. Ask for a free trial.
Back to top
IP Logged
 
Bill Myers
God Member
Beta Testers
*****
Offline



Posts: 1,737
Location: Los Angeles

YaBB 2.4
Re: Set Search Default to Longer than One Week?
Reply #3 - Mar 14th, 2012 at 7:22am
Post Tools
Just in case this helps admins to offer a more extensive search option than the searchbox in the upper right hand corner of your forum ...

WebMe wrote on Mar 13th, 2012 at 9:50pm:
In SourcesSubs.pl look for the section setting up the search box.
There should be a line like: <input type="hidden" name="age" value="31" />
(Line 380 in YaBB2.5)
Change the value to the number of days you would like.

Thank you. This is very helpful.

Your help inspired me to put back the YaBB searchbox in our forum, which I can happily say is working fine now.

Regarding YaBB's searchbox restrictions, I added text below the searchbox feature to remind members that YaBB has a more extensive search option available to them.

In the template I used the following code:
Code
Select All
<td class="rightbox" width="160" valign="top"><div style="float: left; width: 160px; height: 21px; text-align: center; padding-top: 3px; display: inline;">
{yabb searchbox}
The search box above only searches back for 31 days.<br><br>
Want more?<br><br>
<a href="http://www.yabbforum.com/community/YaBB.pl?action=search" onMouseover="window.status='forum search options'; return true;"><SPAN style="BACKGROUND-COLOR: #ffff00">Click this highlighted text for our forum's more extensive search options, and scroll down.</SPAN></a>
</div>
 


So directly underneath the searchbox as you see it in the upper right hand corner of this forum, the following text was included in our forum:

The search box above only
searches back for 31 days.

Want more?

Click this highlighted text
for our forum's more
extensive search options,
and scroll down
.


Edited:
Note: Because of how different browsers format your forum, including when windows are repositioned to be smaller, you may want to limit any text you place underneath your searchbox if you add text at all.

As it turned out, after testing different browsers, and different sized windows, I ended up with simpler text as follows:

« Last Edit: Mar 14th, 2012 at 7:38am by Bill Myers »  

Morning, noon, or night, have a great one!

Note: This forum doesn't allow for us to freely edit our posts or topics to make corrections as needed, so please remember to look for subsequent posts if you see any mistakes or outdated information. Sorry for the inconvenience.
Back to top
IP Logged
 
Bill Myers
God Member
Beta Testers
*****
Offline



Posts: 1,737
Location: Los Angeles

YaBB 2.4
Re: Set Search Default to Longer than One Week?
Reply #4 - Mar 14th, 2012 at 3:30pm
Post Tools
Bill Myers wrote on Mar 8th, 2012 at 11:02pm:
Zach, this isn't the real solution, but mainly because the search engine box wasn't working in our forum, and nobody here to date has figured out how to fix this, I simply removed that search box so that the only search option left is the better and more comprehensive one that's located on the menu.

For those who may have missed the discussions about it, evidently there are many forums that have inoperable search engine boxes anyway, so why have it available? All it does is a simple search anyway.


Sorry to quote myself here, but this forum doesn't allow for posts to be edited for corrections after two days have passed if I remember correctly.

Evidently, I erroneously reported that our forum's "searchbox" was inoperable, and I know that other admins were reporting the same. What I didn't know was that YaBB's searchbox limits searches to 31 days. As such, reports of a searchbox being inoperable may be erroneous. At least in our forum that mistake was made.

The reason I suggested making edits to the template was because changing the Sources\Subs.pl file for many admins is beyond their expertise, and there's no way to use the Admin Center to change the default setting for the number of days the searchbox does its search.

  

Morning, noon, or night, have a great one!

Note: This forum doesn't allow for us to freely edit our posts or topics to make corrections as needed, so please remember to look for subsequent posts if you see any mistakes or outdated information. Sorry for the inconvenience.
Back to top
IP Logged
 
ZachMatthews
Full Member
***
Offline



Posts: 107
Re: Set Search Default to Longer than One Week?
Reply #5 - Mar 23rd, 2012 at 8:09pm
Post Tools
Based on my reading of the Search.pl file, these are the available options for that setting:

Code
Select All
<option value="7" selected="selected">$search_txt{'2'}</option>
				<option value="31">$search_txt{'3'}</option>
				<option value="92">$search_txt{'4'}</option>
				<option value="365">$search_txt{'5'}</option>
				<option value="0">$search_txt{'6'}</option>
 



Obviously that would translate to a week, a month, three months, a year, and all time. 

I set mine to all time initially but as my board is now 7 years old this proved to be way too slow, so I set it back to a year, which ought to be enough for quick search purposes.

Zach
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools