com web/php: Panic, and hacked in a custom google search until this bing-is-no-longer-free issue is resolved.: include/google-cse.inc quickref.php
results.php
| From: | Philip Olson | Date: | Thu, 02 Aug 2012 17:20:01 +0000 |
| Subject: | com web/php: Panic, and hacked in a custom google search until this bing-is-no-longer-free issue is resolved.: include/google-cse.inc quickref.php results.php |
||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-14043@lists.php.net to get a copy of this message | ||
Commit: 51b7a544f9210c9c248d68d6174ee8a9a8340a4c
Author: Philip Olson <philip@php.net> Thu, 2 Aug 2012 10:20:01 -0700
Parents: d15df71865dd3563852ab7849530c359b5cf6be8
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=51b7a544f9210c9c248d68d6174ee8a9a8340a4c
Log:
Panic, and hacked in a custom google search until this bing-is-no-longer-free issue is resolved.
Changed paths:
A include/google-cse.inc
M quickref.php
M results.php
Diff:
diff --git a/include/google-cse.inc b/include/google-cse.inc
new file mode 100644
index 0000000..ef4e9e2
--- /dev/null
+++ b/include/google-cse.inc
@@ -0,0 +1,13 @@
+<div id="cse" style="width: 100%;">Loading</div>
+<script src="http://www.google.com/jsapi"
type="text/javascript"></script>
+<script type="text/javascript">
+ google.load('search', '1', {language : 'en', style :
google.loader.themes.MINIMALIST});
+ google.setOnLoadCallback(function() {
+ var customSearchOptions = {}; var customSearchControl = new google.search.CustomSearchControl(
+ '011570197911755000456:fip9wopfz_u', customSearchOptions);
+ customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
+ var options = new google.search.DrawOptions();
+ options.setAutoComplete(true);
+ customSearchControl.draw('cse', options);
+ }, true);
+</script>
diff --git a/quickref.php b/quickref.php
index abe15dc..059af83 100644
--- a/quickref.php
+++ b/quickref.php
@@ -132,6 +132,9 @@ if ($snippet = is_known_snippet($notfound)) {
}
?>
+<h1>Perform an alternative search here</h1>
+<?php include './include/google-cse.inc'; ?>
+
<h1>PHP Function List</h1>
<?php if (!empty($notfound) && count($maybe) > 0) { ?>
diff --git a/results.php b/results.php
index 46eb2c1..46167db 100644
--- a/results.php
+++ b/results.php
@@ -63,6 +63,8 @@ if (!is_array($res)) {
// No results for query
if ($res['ResultSet']['totalResultsAvailable'] == 0) {
+ echo '<h1>Perform an alternative search instead</h1>';
+ include '../include/google-cse.inc';
exit_with_pretty_error(null, 'No matches', 'No pages matched your query');
exit;
}