called vendors/SmartyPlugins/function.googlesearchbox.php
change the line below to reflect your forum
$Form->Open(array('action' => Url('http://www.google.com/search?q=site:vanillaforums.org'), 'method' => 'get')).
<?php if (!defined('APPLICATION')) exit();
/*
/**
* Writes the search box to the page.
*
* @param array The parameters passed into the function. This currently takes no parameters.
* @param Smarty The smarty object rendering the template.
* @return The url.
*/
function smarty_function_googlesearchbox($Params, &$Smarty) {
$Form = Gdn::Factory('Form');
$Form->InputPrefix = '';
$Result =
$Form->Open(array('action' => Url('http://www.google.com/search?q=site:vanillaforums.org'), 'method' => 'get')).
$Form->TextBox('+', array('placeholder' => T('GoogleSearch'))).
$Form->Button('Go', array('Name' => '')).
$Form->Close();
return $Result;
}
then from your tpl theme call it via {googlesearch}
I assume you've started with your forum, tried to search and didn't get proper or even no results, right?
That's how MySQL works: http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html
You have to have some more discussions/comments (the more words the better!) in order to get meaningful results.
Comments
do you see a search bar?
if you see a search bar and the search doesn't work well.
see reasons why:
http://vanillaforums.org/discussion/25981/search-bug
http://vanillaforums.org/addon/sphinxsearch-plugin
you could change to google search in your theme (see other discussions)
option
http://vanillaforums.org/discussion/24136/tutorial-how-to-make-separate-search-page-with-google-custom-search
option
http://vanillaforums.org/discussion/21676/penetrating-google-into-built-in-search-box
option
or you could create a new smarty function
called vendors/SmartyPlugins/function.googlesearchbox.php
change the line below to reflect your forum
$Form->Open(array('action' => Url('http://www.google.com/search?q=site:vanillaforums.org'), 'method' => 'get')).
<?php if (!defined('APPLICATION')) exit(); /* /** * Writes the search box to the page. * * @param array The parameters passed into the function. This currently takes no parameters. * @param Smarty The smarty object rendering the template. * @return The url. */ function smarty_function_googlesearchbox($Params, &$Smarty) { $Form = Gdn::Factory('Form'); $Form->InputPrefix = ''; $Result = $Form->Open(array('action' => Url('http://www.google.com/search?q=site:vanillaforums.org'), 'method' => 'get')). $Form->TextBox('+', array('placeholder' => T('GoogleSearch'))). $Form->Button('Go', array('Name' => '')). $Form->Close(); return $Result; }then from your tpl theme call it via {googlesearch}
<div id="Body"> <div class="Wrapper"> <div id="Panel"> <div class="SearchBox">{googlesearchbox}</div> {asset name="Panel"} </div> <div id="Content"> {asset name="Content"} </div> </div> </div>I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I assume you've started with your forum, tried to search and didn't get proper or even no results, right?
That's how MySQL works: http://dev.mysql.com/doc/refman/5.6/en/fulltext-search.html
You have to have some more discussions/comments (the more words the better!) in order to get meaningful results.
No results at all!
http://vanillaforums.org/discussion/comment/196079#Comment_196079
the hidden link - if there was ever a discussion should have been split...
also @Bezlepkin
see my post above for various alternate solutions.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
This discussion would have been here, even if the discussion back has been split