Use Google as a search tool inside the Forum
3 posters
Page 1 of 1
Use Google as a search tool inside the Forum
I recently got the search function working. But the google search tool inside the forum gives no results when searching for words found on the forum. I would like google search to work on the forum. Please Note: This is not about the forum appearing on google. Only filter results posted on the forum. In the search field, it should say site: xxxx.forumotion.eu together with keywords.
Re: Use Google as a search tool inside the Forum
You can create a custom search engine for your forum from here:
https://programmablesearchngine.google.com/about/
Once the engine is created by filling in the data that asks you, you must press on obtaining code
It will give you a code <script> copy and sticker in a notepad
then you must create a new javascript for your forum in this way:
Important You must have a Gmail account to be able to do this.
You can customize it with CSS
Or the search box where writing:
Or the search button:
But the simplest and most practical thing is to do it from the Google page, you can customize by clicking on your new search engine created, and adding the keywords design and more things from the menu you have to the left of the page.This new engine what you do is look for any word you have in your forum, and that this is indexed on Google, for this, of course you must have your forum indexed correctly.
https://programmablesearchngine.google.com/about/
Once the engine is created by filling in the data that asks you, you must press on obtaining code
It will give you a code <script> copy and sticker in a notepad
then you must create a new javascript for your forum in this way:
Important You must have a Gmail account to be able to do this.
- Code:
$(function () {
//Here goes the saved code line of the previous step since var cx what goes From = up to "
var cx = your code";
if($("div#search-box").length){
//phpbb3 with search engine
$("div#search-box").html("<div id='my_gs'><gcse:search></gcse:search></div>");
}else{
if($("div#page-body").length){
//phpbb2, phpBB3 No search engine and Punbb
$("<div id='my_gs'><gcse:search></gcse:search></div>").insertBefore("div#page-body");
}else{
//Invision
$("<div id='my_gs'><gcse:search></gcse:search></div>").insertAfter("div#submenu");
}
}
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') +
'//www.google.com/cse/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
});
You can customize it with CSS
- Code:
.my_gs{
/* CSS properties here (here is not necessary the !important) */
}
div#my_gs {
width: 300px; /* If the bar comes out very long in Chrome */
}
Or the search box where writing:
- Code:
input.gsc-input{
/* CSS properties here (with !important) */
}
Or the search button:
- Code:
input.gsc-search-button{
/* CSS properties here (with !important) */
}
But the simplest and most practical thing is to do it from the Google page, you can customize by clicking on your new search engine created, and adding the keywords design and more things from the menu you have to the left of the page.This new engine what you do is look for any word you have in your forum, and that this is indexed on Google, for this, of course you must have your forum indexed correctly.
skouliki and Niko like this post
Re: Use Google as a search tool inside the Forum
The default search engine on our forums is not a Google search. So did you add the Google search?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Use Google as a search tool inside the Forum
Exactly.SLGray wrote:The default search engine on our forums is not a Google search. So did you add the Google search?
But jucarese explanation was hard to understand for me who does not have programming skills. I managed to get the code on google via the gmail address. I can not get any further than that.
Re: Use Google as a search tool inside the Forum
JavaScript:
AP > Modules > JavaScript/HTML > JavaScript Management
AP > Modules > JavaScript/HTML > JavaScript Management
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Similar topics
» Forum does not show up in a Google search
» why my forum is not search by google ?
» Forum appearing in google search with old domain
» Google Forum Search Breaks
» how do we direct that the forum could appear in google search?
» why my forum is not search by google ?
» Forum appearing in google search with old domain
» Google Forum Search Breaks
» how do we direct that the forum could appear in google search?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum