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

You've seen how to implement the RatePubs system on your own web page by simply cutting and pasting some code. While this produces a quick and effective way to implement the service there are modifications that can be made to allow you to customise it further;

Changing the pagenames

The previous page showed how the service can be implemented using default page names. This is fine for most purposes but if you are running an active page such as ASP or PHP you would wish to modify the page names. This is easily accomplished.
At the start of each line of code are one or two variable definitions. You can change these to the page names you require.

showpubs.htm has two variables; thispage and nextpage. thispage is the name of the current page and is by default set to 'showpubs.htm'. If you change the name of the page then you need to change this variable to match.
When a search is carried out, each pub listed has a link to a detailed description and reviews. The name of this page is contained in the variable nextpage. This is set to pubdetails.htm by default and can be changed.

pubdetails.htm - This has just one variable; 'thispage'. This by default is set to 'pubdetails.htm' but can be changed if you change the page name. Remember, if you do change this then you must also change nextpage on showpubs.htm.

newpub.htm This page also has two variables; 'thispage' and 'nextpage'. As with the other pages, 'thispage' is the name of the current page and, if you change the name of the page, then you need to change this variable to match.
'nextpage' contains the name of the page to be shown after a new pub or bar has been successfully entered. By default this shows the pub details and allows the person entering to also enter a review. You can change this if you change the pubdetails.htm name or to show a different page if you so wish.

Hiding the search parameters

The previous page showed how the search parameters can be controlled by modifying the calling URL. This is simple and effective but the downside is that the URL is easily scanned and manipulated. While this is not a big deal for most uses it might be something you wish to control in order to make the results fit your site. For instance if you have a site dealing with a particular town you may wish to show only the bars in that town. You could do this using the URL as outlined but it is then possible for someone to play with that and realise that they can see other towns or countries.
With just a minor manipulation of the Javascript you can prevent this...

Quite simply all you need to do is hardcode the various parameters to the end of the javascript. For instance you may wish to show only Irish Pubs in Edinburgh, Scotland and only allow searches within that city. To do this you would modify the javascript as follows;

<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) + '&country=scotland&town=edinburgh&keyword1=Irish&searchbox=2"></sc' + 'ript>');</script>

Now you can link directly to showpubs.htm without any URL string, and without giving any obvious hints that the search can be broadened.

It is important that the parameters be in the area shown above if they are to be correctly interpreted.
The parameters that can be used are the same as those outlined in the basic implementation page.

Controlling the parameters of a new pub

You may wish to limit the areas in which a pub can be entered to the same town or country as your search results. Again, all you need to do is hardcode the various parameters to the end of the javascript.

<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) + '&country=ireland&town=cork&searchbox=2"></sc' + 'ript>');</script>

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.

Sites that use the keyword facility to select the type of bar they show 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.
















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