OFF-SOFT.net

This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?

Let's try put Google custom search on Joomla!.

Published on| July 3rd, 2009 | No Comment.
Description:
Google Custom Search, Google Adsense ads can be created as one. Own the site, most of the article, Google's index if, Joomla! From the search, Google search and replace and a good custom.
Finally, some sites, Google has indexed it, Google tried to paste a custom search.

This time, Google will include instructions and paste the custom search.
A little php, Joomla! Requires knowledge of the template. (Article for beginners. )
Keep paste Custom Search

Custom Search, paste the following steps.

Sign up for Google Adsense
- Have already signed up, you ready to create an ad for yourself, go to the next.

Joomla! Search box in the + button to determine the position of the search
Also, if you want to paste the results to your page, decide where you want to paste.
- As a result, you need a certain amount of size. (Note: + Width and on an ad you'd like to get right, 800px will need more. )
The resulting arrangement, Think.
I do not know whether The search box can put on Joomla! with custom module. I recommend typing directly to the template. Because when the retrieval result is put, the description is needed with php in my way. (Later, when I try to customize one's own, PHP part, I write. )

You have to check whether any of the files installed in the position.
/joomla!installed/templates/yourtemplatename/index.php

※ If you undoerstand somewhere, you should search with location (left, right, header, footer, etc.). I think you will be able to understand position for put Google Custum Search Code.
The resulting output, perhaps, because I think the results show where to display the main content, "showComponent" and "component" and I want to search.

1
<jdoc:include type="component" />
Is to show where the main content areas are described above.

Google Adsense to create your own custom search ads
Google Adsense after the login, you can create from the screen below.

Follow the screen instructions as given, not difficult.
Elementary operations for the site, so it may difficult, you can paste the following set of examples to find your site.
This screen settings are set to search within this site.


Here, we define the width and color. Color, background color is not transparent, I want to get together to set up to own a set of colors.

- Once created, you can copy the code.
Later, Google is the sample code provided in the custom search.
This code will be displayed at the end, then copy it and leave the store.

[Example code search box]
1
2
3
4
5
6
7
8
9
10
11
<form action="http://www.off-soft.net" id="cse-search-box">
  <div>
    <input type="hidden" name="cx" value="partner-pub-xxxxxxxxxxxxx" />
    <input type="hidden" name="cof" value="FORID:11" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" name="q" size="31" />
    <input type="submit" name="sa" value="&#x691c;&#x7d22;" />
  </div>
</form>
 
<script type="text/javascript" src="http://www.google.co.jp/coop/cse/brand?form=cse-search-box&lang=ja"></script>

※ partner-pub-xxxxxxxxxxxxx is the equivalent of your ID.


[Example Code Searches
1
2
3
4
5
6
7
8
9
<div id="cse-search-results"></div>
<script type="text/javascript">
  var googleSearchIframeName = "cse-search-results";
  var googleSearchFormName = "cse-search-box";
  var googleSearchFrameWidth = 775;
  var googleSearchDomain = "www.google.co.jp";
  var googleSearchPath = "/cse";
</script>
<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>

Joomla! Templates, search box + embed code search button
Also, if you want to paste the results into their own pages, embed the code in the results.

Search box, and paste anywhere at any time, it is shown that, fine.

Search results are not good anywhere. Requires a degree of magnitude as described in the first, if you are viewing the results, the other main content, you need not to control.

So, write the following sample code to replace the main content and search results.

Example paste Searches

1
2
3
4
5
6
7
8
9
10
11
12
13
<?php if(isset($_GET['cx']) &&  $_GET['cx']=='partner-pub-xxxxxxxxxxxxx' ) : ?>
	<div id="cse-search-results"></div>
	<script type="text/javascript">
	  var googleSearchIframeName = "cse-search-results";
	  var googleSearchFormName = "cse-search-box";
	  var googleSearchFrameWidth = 775;
	  var googleSearchDomain = "www.google.co.jp";
	  var googleSearchPath = "/cse";
	</script>
	<script type="text/javascript" src="http://www.google.com/afsonline/show_afs_search.js"></script>
<?php else: ?>
	<jdoc:include type="component" />
<?php endif; ?>

Easily explained. The first line, 'cx' parameter in the URL, and the information that you check the Google Custom Search ID.
Lines 2-10, where Google Adsense code and paste it in the results obtained.
11 from the line is the existing process. The main content is displayed.


This complete!

To conduct an actual search, let's see if the results are displayed.
Here's the site, "Joomla" is the resulting image when the word search.



php and I've written the code, which you may also have closed down a little.
Extension, there will also be doing the above. In fact, I tried a little, the quality problems are, after all, I have to do it yourself.
I could easily do so, I had the article. Now, I'm glad if that'll help you paste a custom search.

At this site, WEB and the two off-soft.net has the ability to search by type, that is, Google Custom Search is the only ID I have to prepare.
Things to do, together with the ID is the only two I'll run a search with.

Finally, at first glance, the results of this search will put Google ads. But the site of the popular (at least 1 page views per day GURAINAI and more than 1000) unless, I think your income is not I think he is better.
Google Adsense ads are not even normal. Paste this search, I was probably better to manage their own site.
At least, I'm not in this search are used to verify the order and the site search.



Add to your favorites(bookmarks): はてなブックマークへ追加するdel.icio.usLivedoor ClipYahoo!FC2Nifty ClipPOOKMARK. AirlinesBuzzurl(バザール)Choixnewsing

Trackback URL

After Admin approves this comment, it will be shown.


Comments

Leave a Reply





*





Tag Cloud

Links

Site Description

This site is support & information site of WEB,and Software. This site might help you that create software or Web Site…perhaps?

Add to your favorites(bookmarks)

はてなブックマークへ追加するdel.icio.usLivedoor ClipYahoo!FC2Nifty ClipPOOKMARK. AirlinesBuzzurl(バザール)Choixnewsing