Version: 1.00, by noypiscripter
Developer Last Online: Sep 2023
Category: Miscellaneous Hacks -
Version: 5.5.5
Rating:
Released: 02-28-2022
Last Update: Never
Installs: 1
Supported Template Edits
In some cases, the vB5 search results may not provide you what you're searching for in a forum. You could replace the default vB5 Search box with the Google Search box or add a Google search result link (and other search engines) together with the vB5 search results. These search engine links will redirect the user to their search results for your site.
If you are more interested in the latter, then continue reading.
Before giving you the code to accomplish what is shown in the above screenshot, let me give you first the limitations/disadvantages of doing this modification:
Your site must be public as search engines cannot index private pages.
Your site will lose branding to search engines as users are taken out of your site and redirected to search engine search results page.
Recent content from your forum may not be instantly available until search engines index your site.
This mod requires editing the Search Results template which means the changes may cause template conflicts during upgrades.
Since this requires template editing, this is not for vBCloud although there is another solution to implement it that will work on vBCloud.
If you are okay with the above, then proceed with these steps:
Logon to AdminCP.
Go to Styles → Search in Templates
Choose the target style/theme in the "Search in Style" dropdown.
In the "Search for Text" field, type widget_search_results.
Select "Yes" in the "Search Titles Only" radio button.
Click Find button.
In the search results, double-click the template to edit it or select it then click Customize button.
Find the following code (Click the Template input box and press Ctrl+F or Command+F)
<vb:if condition="!empty($searchJSONStructure['keywords'])">
<p class="alternative-search-engine-search h-margin-top-l">
Can't find what you're looking for? See <a href="https://www.google.com/search?q={vb:urlencode {vb:raw searchJSONStructure.keywords}}+site%3A{vb:urlencode {vb:raw baseurl}}" target="_blank"><strong>Google</strong></a> search results for '{vb:raw searchJSONStructure.keywords}'.
</p>
</vb:if>
That adds a Google search results link using the "site:" filter on search engines that search within the specified site URL which is your forum URL in this case. To add other search engine links, include the following hyperlink HTML: