phpYellow Pages Developer's Guide

Docs Home | Read Me | FAQ | License | Security | Install | ChangeLog | Customize | Paid Listings
CUSTOMIZE

CUSTOMIZE

You may want to change the look and feel of phpYellow Pages. Make a backup copy before working on any file. Here are major Customization topics:

Files Likely to Need Cosmetic Change

These are some of the files you may change to effect the look and feel you want:

  1. header.php - modify to suit
  2. footer.php - modify to suit - *** a link to Dreamriver.com is required *** unless you have purchased a copy.
  3. yellow.css - modify to suit using a .css editor like Topstyle from http://www.bradsoft.com
  4. oneRecord.php - modify to suit. This file is the central template for how one record looks like to the users, for the Standard Edition.
  5. categories.php - modify to suit. Add your very own categories!

Change the Look and Feel of each Record

Premium Edition

phpYellow Pages is capable of showing any combination of data you wish. If the data is contained within the database, then the data may be displayed in a record. phpYellow Pages can show different data based on the rank of any listing. Ranks may be Basic, Preferred, or First Page. showOneRecord.php is the central switching file which determines which file is rendered based on the rank of a listing. It is used for EVERY user initiated search. The file showOneRecord.php conditionally shows:

Each of these four files may display different data, and that data can be modified to appear different. To change how a First Page listing appears open up premiumListingFirstPage.php and modify it to suit. Do the same for the other files.

showOneRecord.php is just a small file. Open it up, take a look, and you will see the logic of how records are displayed in every user initiated search.

Standard Edition

The Standard Edition does not recognize and does not use ranks for listings in searches. Accordingly, one file is used to show results for user initiated searches - oneRecord.php. This file can be modified to suit your taste. Using plain HTML or php you can show data or rearrange the look, or change color or font-size or font-family ... basically any change you want to make to customize how your records look you can make.

Preferred Customization Methods

It is preferable to make as many changes as possible using an external style sheet. By making changes to the external style sheet you keep your content separate from the formatting (font, color, position and so on...). This in turn allows you to:

  1. easily make sitewide changes with just one file
  2. easily upgrade to a premium version of phpYellow Pages
  3. easily upgrade to a newer version of phpYellow Pages

The more changes you make to the original php files the more work you are creating for yourself in the long term. Do yourself a favor and keep the content separate from the formatting - by learning how to use cascading style sheets. The Web Developer's Virtual Library has excellent resources for you to learn CSS styles.

W3C Cascading Style Sheets

phpYellow Pages is compliant with the W3C's HTML 4.0, which since 1997 has been recommending that you keep structure apart from formatting. For example, in a Heading 1 tag colored red, the heading tags will be in the html document, and the color for the heading will be in an external .css file. This makes it easy to make sitewide changes in formatting to every page, but at the cost of a learning curve for .css - well worth it! You may find .css tutorials online and contained within better html editors.

Netscape Display Optimization

Netscape users will be familiar with display dysfunctionality in Netscape, especially in regard to W3C cascading style sheets. I am happy to report that Netscape 6 (and higher versions) do a tolerable job in supporting Level 1 CSS. Most (if not all) of phpYellow Pages only uses CSS Level 1, and most phpYellow Pages should display tolerably well in Netscape 6 or higher.

How to Optimize for Other Netscape Browsers

The formatting for phpYellow Pages is driven with external cascading style sheets. There is also browser detection. When a user loads any page a javascript detects their browser and loads a .css file for that specific browser make. To change the look and feel for Netscape simply open netscape.css in any css editor and format this file to suit your tastes. You can have a totally different look and feel for Netscape visitors - and another for Internet Explorer visitors.

You can add more browser types by adding another case statement block and a related css file in the yellow.js script. Based on an analysis of website traffic most surfers use recent browser versions. You can add specific versioning if you want but the traffic that will use it will tend to be negligible ...

CMS Bridge

Parts of Version 2.24 and higher versions incorporate CMS Bridge middleware. This is useful if you are using a Nuke software product and want to integrate your Nuke copy with the phpYellow Pages application. See http://portal.dbserve.net/codeshare/cms_bridge.htm for instructions and information.

Use Your Own Categories

One of the ways to customize phpYellow is to make changes to the category values. For example, instead of offering a generic Yellow Page service, you may change all the category values to the type of service you wish to have an online directory for. You may want to build a directory just for Real Estate services in your city, or create a Tourism only directory, or a High Tech services directory for your state, or an Automobile Dealer directory in your country, or ... the potential is limited only by your imagination. To make such a change will dramatically specialize your phpYellow implementation and very possibly enable you to provide a UNIQUE service not offered elsewhere.

Specialized directories can be created by using the categories*.php files as found in the distribution package. To do so, change the filename containing the categories you want to "categories.php".

How to Change an Individual Category

It's easy to customize the categories of products and services in phpYellow. Open up the file named categories.php in your html editor. Add, edit or remove one or more categories like this:

Example

Replace each select list item with the value and value displayed to the user that you want. For example, within categories.php:

<option value="Air-Conditioning">Air Conditioning</option>

Above you may change the actual value of "Air-Conditioning" to, for example, "Education". Also remember to change the words between the begin and end of the <option> tags to "Education".

Upload the new categories.php file to your web server and that's all you need to do - if these changes are made before you go online with your phpYellow implementation.

In NO CIRCUMSTANCE should you change any php or selected code or variables when making these category option changes. Change the option values only. By making these changes you are merely altering the V A L U E S that get selected by the user and sent or searched from the database. Instead of storing generic Yellow page like values, you are storing specialized values for your particular implementation - for example all services and products relating to "Education", or "Internet Products and Services" - whatever your implementation is. Changing the values makes all the difference - everything else still works exactly the same way - it is the values that make the results different. Any developer can make these value changes by following the steps detailed above.

Changing the categories within Administration

In PREMIUM version 2.22 and higher you may change the category of a listing using a point and click tool. This tool is called 'Set CKEY Parameters'. The listing expiry date, category, position, payment required and status may be changed. A pop up window reports the result of your selection and automatically closes in POPUPTIMEOUT milliseconds. You may set your own value for POPUPTIMEOUT in the util.php file.

Change the category of a listing using a point and click tool

For example, you can change a category submitted by the user for their listing from "Computer Software" to "Internet Products". To do so you need to note the ckey number stamped on the listing (obtained via any search), then use the number in the 'Set CKEY Parameters' admin tool as pictured above.

How to Customize Your Provinces

see below

How to Customize Your Countries

Changing provinces or countries is exactly the same as changing categories. Open up the provinces or countries file, make desired changes, save and upload to your web server.

Modify the data fields you want to make required

The bare minimum requirements for any listing is email and password. If you wnat to make MORE data fields required then follow these steps:

HOW TO MAKE DATA REQUIRED

To require certain data to be entered by the user:

  1. save yellow.js as yellowORIGINAL.js
  2. open yellow.js in your html editor
  3. find the data to require: example: locate the // Phone section
  4. copy the phone section from the // start of ... to the // end of ...
  5. paste the phone section in yellow.js where it says "paste below this line"
  6. save yellow.js and upload to your web server
  7. test by adding a new record
  8. [OPTIONAL] color code [red] the new fields you require in the file addForm.php

Highlight - Link a URL to a specific Database Record

You can build a link to point toward a specific record. The highlight feature is used to do so. Highlight selects a specific record number using the form:

http://www.yourDomain.com/phpYellow/yellowresult.php?goal=highlight&ckey=1

Change ckey to the value of your record. ckey may be located by completing any search and looking for " On correspondence quote ckey# ". By default this is found in each displayed listing. You may also find it by asking the webmaster. ckey is the unique database key for the category record. For example, when you submit a listing you have a single contact table record number, called yps. When you submit one or more category records each record has a unique number called ckey. The two tables are joined together as needed using a common id. A special script is programmed to find the ckey and display the related contact and category record on a page all by itself.

Partner with AnswerPlus Communications

Partner with AnswerPlus Communications Partner with AnswerPlus Communications and stay ahead of the competition. Personalize your website, and dramatically increase your web service. Get immediate live on-line assistance from our customer service representatives, using our award winning call centre software! Our goal is to keep your potential customers interested and locked on to your website and to personally guide them to complete their purchase while avoiding abandoning your site.

Further details are on the AnswerPlus Communications website at www.answerplus.com. If you are interested call and talk to one of our consultants at 1-800-661-2522 Monday - Friday, 8 am - 4 pm Pacific Time, or email us at info@answerplus.com.

Setup AnswerPlus with phpYellow Pages

After you create an account with Answerplus it is easy to use Answerplus in phpYellow Pages. To do so you open one file and change the CONSTANTS contained within it. Here's how - open phpYellow/util.php and :

Step 1: set the constant USEANSWERPLUS to a value of "yes"
Step 2: set the Answerplus Accounts

Step 3: save util.php and upload it to your web server

END OF DOCUMENT

Docs Home | Read Me | FAQ | License | Security | Install | ChangeLog | Customize | Paid Listings

All Pages Copyright©2000,2001,2002 Dreamriver.com. All rights reserved.