TinyPortal

Development => Support => Topic started by: fak3 on May 11, 2009, 01:02:08 AM

Title: Remove extended search panel
Post by: fak3 on May 11, 2009, 01:02:08 AM
Hi. :)
Since I don't use articles and downloads modules I want to remove the extended search panel under index.php?action=search. What file to modify?
I'm using SMF 1.1.8 with the last beta of TP.

Thanks in advance.


You can see the panel I want to remove in the attached screenshot.

EDIT: marked solved!
Title: Re: Remove extended search panel
Post by: IchBin on May 11, 2009, 05:41:33 AM
Those layers are loaded from the TP functions in TPortalBlocks.template.php.
function template_TPsearch_above() and function template_TPsearch_below() are the functions that are loaded on the search page.
Title: Re: Remove extended search panel
Post by: fak3 on May 11, 2009, 11:19:32 AM
If I delete these 2 functions in TPBlocks.template.php, the search page results in
QuoteUnable to load the 'TPsearch_above' template.

:'(
Title: Re: Remove extended search panel
Post by: IchBin on May 11, 2009, 04:32:16 PM
Then make them both return;

:)
Title: Re: Remove extended search panel
Post by: fak3 on May 11, 2009, 04:59:00 PM
Like this?
function template_TPsearch_above()
{
return;

}
function template_TPsearch_below()
{
return;
}
Title: Re: Remove extended search panel
Post by: Ianedres on May 11, 2009, 05:05:55 PM
That code will make the functions execute, but immediately return to the script with nothing performed.
Title: Re: Remove extended search panel
Post by: fak3 on May 11, 2009, 05:11:27 PM
In other words? ::) Is it safe or...?
Sorry for such a question but I don't know nothing about php and coding.
Title: Re: Remove extended search panel
Post by: Ianedres on May 11, 2009, 06:29:59 PM
Safe, as in the functions won't perform anything and return back to the point they were called from.

It should be noted that you should retain a backup copy of anything you are changing.

That said, you could also put '//' (two slashes) at the beginning of the lines between the bracket sets to comment out the code you wish to exclude. This would allow you to remove the slashes at some later point to revert back to using the search, without having to copy the file back over and having to edit any other changes you make to the script.
Title: Re: Remove extended search panel
Post by: fak3 on May 11, 2009, 07:33:01 PM
Thank you Ianedres. I did like you suggested. :)

Code (TPBlocks.template.php) Select
function template_TPsearch_above()
{
// global $context, $boardurl, $txt, $scripturl;


// echo '
// <div class="tborder" style="margin: 0 auto .2em auto;">
// <div class="titlebg" style="padding: 6px;">' , $txt['tp-searcharticles'] , '</div>
// <div class="windowbg" style="padding: 10px;">
// <a href="' . $scripturl. '?action=tpmod;sa=searcharticle">' . $txt['tp-searcharticles2'] . '</a> |
// <a href="' . $scripturl. '?action=tpmod;dl=search">' . $txt['tp-searchdownloads'] . '</a>
// </div>
// </div>';
return;
}
function template_TPsearch_below()
{
return;
}