Definitely. I'll add phrases when I release it as a downloadable addon.
Regarding the CSS, I've made a new version with a cleaner look based on the styling of
http://xenforo.com/community/members/ . Basically, the old version had a light blue border in it that I think makes things look too busy when mixed with the tabs at the top. Here's the new version:
Code:
<xen:if is="{$search.search_query} AND {$page} < 2">
<ul class="tabs Tabs" data-panes="#xfgcs_Panes > li">
<li><a href="{xen:link search, $search}#gcs">Results from search.tmswiki.org</a></li>
<li><a href="{xen:link search, $search}#xf">Results from our forum only</a></li>
</ul>
<br/>
<ul id="xfgcs_Panes" style="padding-left: 10px; padding-right: 10px;">
<li id="gcs">
<div id="cse" class="section searchResults" style="margin-top:0px;">Loading results from search.tmswiki.org ...</div>
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load('search', '1', {language : ''});
google.setOnLoadCallback(function() {
var customSearchOptions = {};
var customSearchControl = new google.search.CustomSearchControl(
'012738456707262399698:srlyqkszdjg',
customSearchOptions
);
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
var options = new google.search.DrawOptions();
options.enableSearchResultsOnly();
customSearchControl.draw('cse', options);
customSearchControl.execute('{$search.search_query}');
}, true);
</script>
</li>
<li id="xf">
</xen:if>
Sure. That line ensures that the Google CSE results don't show up in two cases when they wouldn't be helpful. In the first case, when {$search.search_query} evaluates to null, there is no search query. This happens when, for example, you search by all posts by a certain user or on a specific day without specifying a search string or when you click on
a link to see all posts by a specific user. Google based search results won't be helpful in such a case, so the addon just essentially disappears in that case.
In the second case, when a user is looking through the XenForo search results, perhaps after doing an advanced search, the search_results template is called again, with {$page} >= 2. In this case, we know that the user doesn't want the Google CSE results, so why make them click on the tab for the XF results? At some point I'd love to find a way to make the tabs be displayed but have the XF results selected while still keeping the code simple. However, I have yet to find any documentation of the "Tabs tabs" javascript library that XF uses. If anyone knows how to do this, please let me know.
Unfortunately, this can't be done with a template edit because no template is called when the search results are empty. Therefore, to fix this case, I'll have to override getNoSearchResultsResponse or a related method from Search.php. I'm working on this now.