Webmastersite.net
Register Log In

Small Upgrade to the Searchalldefaulttab Tweak

Title Small Upgrade to the Searchalldefaulttab Tweak
Message Text

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.
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership eeyipes
Views 396 views. Averaging 0 views per day.
Similar Topics
Submission Date Apr 27, 2013 - 7:06 AM