PHP Web Host - Quality Web Hosting For All PHP Applications Sign up for PayPal and start accepting credit card payments instantly
  Login or Register
 • Home • Downloads • Your Account • Forums • 

View next topic
View previous topic


Google
 
Web RavenPHPScripts (This Site)
Post new topic   Reply to topic
Author Message
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Tue Mar 10, 2009 12:54 pm Reply with quote Back to top

I'm not literate enough.

Code:

<!--
  copyright (c) 2009 google inc.

  You are free to copy and use this sample.
  License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google AJAX Search API Sample</title>
    <script src="http://www.google.com/jsapi?key=<<INSERT KEY>>"></script>
    <script type="text/javascript">
    /*
    *  How to do a search that returns the max number of results per page.
    */
   
    google.load('search', '1');
   
    function OnLoad() {
   
      // create a search control
      var searchControl = new google.search.SearchControl();
   
      // Set the Search Control to get the most number of results
      searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
   
      // Create 2 searchers and add them to the control
      searchControl.addSearcher(new google.search.WebSearch());
      searchControl.addSearcher(new google.search.BlogSearch());
   
      // Set the options to draw the control in tabbed mode
      var drawOptions = new google.search.DrawOptions();
      drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
   
      // Draw the control onto the page
      searchControl.draw(document.getElementById("content"), drawOptions);
   
      // Search!
      searchControl.execute("Subaru STI");
    }
    google.setOnLoadCallback(OnLoad);
    </script>
  </head>
  <body style="font-family: Arial;border: 0 none;">
    <div id="content">Loading...</div>
  </body>
</html>


I tried putting the javascript in the javascript.php and converted the html to a block but when I loaded the block the site would not load. Blank screen.

Now I assumed it should be that simple but as Im not that literate ... obviously its not .... LOL Smile
View user's profile Send private message
horrorcode
Involved
Involved


Joined: Jan 17, 2009
Posts: 268
Location: Missouri

PostPosted: Wed Mar 11, 2009 4:40 am Reply with quote Back to top

Simple way to do this would be using iframes. Im also not that literate, but with iframes anything is possible.

Create a new folder, lets say Google, and save the code you posted as index1.html, next create a blank file called index.html, now create an index.php and add the following:

Code:
<?php
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
include("header.php");
$index = 0;
OpenTable();
echo"<IFRAME src=\"/modules/Google/index1.html\" width=\"800\" height=\"1200\">"
  . "<p>Your browser doesn't support frames. Click <a href=\"http://ThePageYourIncluding.com\" target=\"_blank\">here</a> to view the page.</p>"
  . "</IFRAME>";
CloseTable();
include("footer.php");

?>


So in the Google folder youll have 3 files, index.html index1.html and index.php. Now just change the settings in the above etc, dont forget your google api key in the index1...save and upload. The blank index is to prevent access to the modules dir.
View user's profile Send private message Visit poster's website MSN Messenger
draxx
Worker
Worker


Joined: Nov 19, 2003
Posts: 186

PostPosted: Fri Mar 13, 2009 3:25 pm Reply with quote Back to top

Thanks horrorcode - I will go and try to make this work this evening Smile
View user's profile Send private message
Display posts from previous:       
Post new topic   Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Forums ©
 

All logos and trademarks in this site are property of their respective owner.
The comments are property of their posters, all the rest © 2002-2011 by Raven

You can syndicate our news using the file xml

CSE HTML Validator Helped Clean up This Page! [Valid RSS] valid RSS 2.0 Valid robots.txt Stop Spam Harvesters, Join Project Honey Pot

Website engines core code is © copyright by PHP-Nuke but has been heavily patched and modified by myself and others.
PHP-Nuke is a free software released under the GNU/GPL.


:: fisubice phpbb2 style by Daz :: PHP-Nuke theme by www.nukemods.com ::
:: fisubice Theme Modified by the RavenNuke™ Team ::

:: W3C CSS Compliance Validation :: W3C HTML 4.01 Transitional Compliance Validation ::

zerosum