RatePubs.com - Your Personal Bar Guide.
Now you too can have Pub and Bar Reviews on your own site!

With our Javascript function you can add the functionality and content of RatePubs.com without any programming!. Just copy and paste a few lines of code which we provide you can increase the attractiveness of your site to your visitors...and give them a reason to hang around.
And even better you can customise the result so that the pubs are just the ones in your area or town, or the whole country...or even the whole world. The choice is yours...

We have divided the functionality into two groups (with more to come in the future so be sure to register for updates). The basic set of showing pubs and reviews, and allowing your guests to add their own reviews takes just two pages with one line of code in each. The second set allows your guests to add a new pub and this requires just one page so we strongly recommend you include it.

The page names here are the default pagenames. If you cut-and-paste the code then the page must be called the name specified. It is possible to change the name with a slight modification of the code. This is particularly useful for those running php or asp. If you don't change any names then the three pages must reside in the same directory on the server.
To learn how to change the names, see the Advanced Implementation page



Group 1 : Reading and Adding Reviews

To display the pubs and reviews...and allow your visitors to enter their own reviews requires just two pages, each one containing just one line of code.

showpubs.htm - This page lists all the pubs according to a specific search criteria. The criteria can be set in advance according to the criteria you specify in the URL (country,town, address, and pubname). This page also contains a search form for your visitors to specify their own criteria. The line of code to include in this page is;

<script>var thispage='showpubs.htm'; var nextpage='pubdetails.htm';document.write('<sc' + 'ript src="http://www.ratepubs.com/freecontent/js/pubsearchjs.php?thispage=' + thispage +'&nextpage=' + nextpage + '&' + document.location.search.substring(1) + '"></sc' + 'ript>');</script>

You can limit the search by modifying the url of the page you have this code in to include variables. The valid variables are; country, town, address, pubname, keyword1, keyword2, keyword3, keyword4, keyword5, searchbox
. Please be aware these variables are case sensitive and must be used in lower case.

These can be included in the link you use to open the page showing the pubs such as;
<a href="http://www.dummysite.com/pubsearch.htm?country=Ireland&town=&address=&pubname=&keyword1=Sports">Showpubs</a>


The first four variables are self-explanatory but the keyword and searchbox require some explanation;
keywords When a pub or bar becomes a basic member they can, in addition to entering their description, include keywords which define their premises. These can be words such as Irish for Irish Pubs, Sports for Sports Bars, Beergarden for those with beergardens etc. The keyword facility in the calling URL allows you to specify up to 5 keywords that must be present for the pub to be returned in the search results.
searchbox If you have chosen to show only pubs in Scotland (using the URL variable country=Scotland) you may want your visitor to search only for pubs in Scotland. This can be achieved with the searchbox variable. If searchbox=1 the country option is hidden in the search, while a value of 2 hides both the country and the town.

The best thing to do is experiment with the URL in order to fully understand it. But here's an example

http://www.ratepubs.com/freecontent/js/example/showpubs.htm?country=Scotland&keyword1=Irish&searchbox=1

This shows only Irish Pubs in Scotland and only allows the visitor to search within Scotland.
Note that this does not require changing the code in any way, just the URL you provide to the calling page. This is fine for most uses. However, analysis of the URL by a visitor will give them hints on how to manipulate it (as you can see in the address bar). You can prevent this happening if you wish by simple modification of the code as outlined here


pubdetails.htm - This page gives further details on the pub as well as a list of individual reviews. It also contains a form for your visitors to add their own review. The line of code to include in this page is;

<script>var thispage='pubdetails.htm';document.write;document.write('<sc' + 'ript src="http://www.ratepubs.com/freecontent/js/pubdetailsjs.php?thispage=' + thispage +'&' + document.location.search.substring(1) + '"></sc' + 'ript>');</script>

These two simple pages contain all you need to add fully functional content to your site. You also have the (recommended) option of allowing your visitors to add new pubs they might know of. The can then add a review for that pub of course. We recommend you include this as it takes just one more page and increases the value of content for everyone...

Group 2: Adding New Pubs and Bars

This page must be called newpub.htm and contains this line of code;

<script>var thispage='newpub.htm';var nextpage='pubdetails.htm';document.write('<sc' + 'ript src="http://www.ratepubs.com/freecontent/js/newpubjs.php?thispage=' + thispage + '&nextpage=' + nextpage + '&' + document.location.search.substring(1) + '"></sc' + 'ript>');</script>


Again you can limit the input to a particular town or country as you did with the search parameters above. The same three URL variables control this;
country contains the name of a country or US state
town is the name of a town within that country or state
searchbox is either empty in which case both town and country fields are visible, 1 in which case the country field is invisible, or 2 which hides both town and country fields.
It's important that you don't set searchbox to a value that hides a box you don't provide a value for. For example, don't set searchbox=2 and only provide the country variable in the URL. In this case the town variable must also be provided.

NOTE: Sites using the keyword facility to show only certain types of bars can also ensure that any premises entered via their web site automatically have the relevant keyword entered as well. This is an option available to affiliates and operates by registering the keyword. Becoming an affiliate is simple, free and gives you the chance to earn money by including the content in your site. For further details on becoming an affiliate see here.

Not Displaying Characters Properly

Non-Latin Characters are handled by the system. However it is possible that they are not showing properly when you integrate the code into your page.
This may be because the encoding is not of the correct type. This is something we are unable to control from our servers but can be fixed by you by adding the following line into the head section of the page.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Terms of Use

Basically anyone is free to use the content and APIs, though the copyright remains ours and we do reserve the right to remove, restrict or edit the feed at any time.

You can use this only on a web site and all we require in return is that you credit us (including a link back to us) on a page within one click of your front page

Register for updates

While you don't need to give us your email address we advise that you do so we can keep you informed of any relevant changes. We won't use this for any other purpose nor will we keep sending you irrelevant mails.

Your Web Site
Your email
The content you're taking

















Affiliates     Member Bar Login     Free Content & APIs     RSS     Network Sites     Press      Sitemap 


Copyright (c) 2004 RatePubs. All Rights Reserved    info@ratepubs.com



RatePubs.com Title