Webmastersite.net
Register Log In

Small Upgrade to the Searchalldefaulttab Tweak

Comments on Small Upgrade to the Searchalldefaulttab Tweak

eeyipes
Member

Usergroup: Customer
Joined: Nov 12, 2004

Total Topics: 9
Total Comments: 20
eeyipes
Small Upgrade to the Searchalldefaulttab Tweak
Posted Apr 27, 2013 - 9:06 AM:

ex: I have the searchalldefaulttab tweak set to categories, so categories always show first on a search. But sometimes there may be no category match, but several link matches. In this case, the tab for link matches shows up, but the actual link listings remain hidden. It'd be nice if your default tab has no results, than listings of other types would become the new default.

I fixed that in searchallfilled.php by changing the code bit to:

// add template javascript for the new tabbing options
if (tweakisset('searchalldefaulttab')) $default = tweakvalue('searchalldefaulttab'); else $default = 'categories';
if ($numcatresults == 0) {
$extradocreadystuff .= "
$('#links').show0);
$('#categories').hide(0);
$('#comments').hide(0);
$('#members').hide(0);
$('#".$default."').hide(0);
";
} else {
$extradocreadystuff .= "
$('#links').hide(0);
$('#categories').hide(0);
$('#comments').hide(0);
$('#members').hide(0);
$('#".$default."').show(0);
";
}
But I'm sure there's a better way that would be universal for everyone, no matter what their default tab is.
Paul
developer

Usergroup: Administrator
Joined: Dec 20, 2001
Location: Diamond Springs, California

Total Topics: 61
Total Comments: 7867
Paul
Posted Apr 28, 2013 - 1:42 AM:

Fixed search all to always default to a tab that has results in it.
eeyipes
Member

Usergroup: Customer
Joined: Nov 12, 2004

Total Topics: 9
Total Comments: 20
eeyipes
Posted Apr 28, 2013 - 10:09 AM:

nice, thanks!
Search thread for
Download thread as
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5



Sorry, you don't have permission to post posts. Log in, or register if you haven't yet.