Subject: phpblock_searchform

Posted on: 29/11/11 10:16am
By: ::Ben

Need to display a searchform in a phpblock. Try this function:

PHP Formatted Code
function phpblock_searchform ()
{
    global $_CONF, $LANG09;
       
    $searchbox = "<div>";
    $searchbox .= "    <form method=\"get\" action=\"{$_CONF['site_url']}/search.php\">";
    $searchbox .= "         <div>";
    $searchbox .= "         <input id=\"header-textbox\" type=\"text\" name=\"query\" maxlength=\"255\" value=\"{$LANG09[10]}\" title=\"Search\" onfocus=\"if (this.value=='{$LANG09[10]}')this.value='';\" onblur=\"if(this.value=='')this.value='{$LANG09[10]}';\"" . XHTML . "><input type=\"hidden\" name=\"type\" value=\"all\"><input type=\"hidden\" name=\"mode\" value=\"search\"" . XHTML . ">";
    $searchbox .= "         </div>";
    $searchbox .= "     </form>";
    $searchbox .= "     </div>";
                       
    return $searchbox;
}


Ben

Geeklog - Forum
https://www.geeklog.net/forum/viewtopic.php?showtopic=93687