PDA

View Full Version : [Solved] Google Custom Search Engine (HTTPS)


Stratis
04-12-2017, 04:13 PM
Hi! I was wondering if someone has Google Custom Search Engine as replaced of vb?
I used one here for years but after I changed to https it does not work well.
Firefox does not show anything of results, some other browsers I must click there it says "Show only secure content" every time.


* This I used
https://vborg.vbsupport.ru/showthread.php?t=263440


Checked and test others to, but only the above opens in same page with the CCS of forum skin.


Any suggestions will be appreciated


Thanks...

z3r0
04-12-2017, 05:16 PM
In the google template change:-

<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

to

<script type="text/javascript" src="https://www.google.com/afsonline/show_afs_search.js"></script>



and in the navbar Template change:-


<form action="http://www.yourforum.com/google.php" id="cse-search-box">

to

<form action="https://www.yourforum.com/google.php" id="cse-search-box">

and

<script type="text/javascript" src="http://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

to

<script type="text/javascript" src="https://www.google.com/cse/brand?form=cse-search-box&amp;lang=en"></script>

Stratis
04-12-2017, 05:30 PM
Thank you very muck for your answer.
All http was changed to https (This was the first I did)
First very odd that does not work in FireFox and IE11, in Chrome and Edge I must click the button I mentioned. I do not know why this?

Do you use it as https to?

z3r0
04-12-2017, 05:38 PM
The best thing to do is use your browser F12 tools and check the console to see what it triggering the mixed content.

Stratis
05-04-2017, 04:54 AM
To close this thread, i did not manage to make Google Custom Search Engine as i had it before, but at least is ok as i managed it know.

What i did for some one else needs:
Find "ad_navbar_below" template

Than copy-paste code that google gives you in the template.
Where 'xxxxxxxxxxxxxxxxxxxxxx' change with your code.
Example:
<script>
(function() {
var cx = 'xxxxxxxxxxxxxxxxxxxxxx';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:search></gcse:search>With this way you will have both searches. vb & custom.
156362

Thanks.