Diet Direct Affiliate Program
Dynamic Site Template README

Version 1.0

1. Introduction

The Diet Direct Dynamic Template site is a powerful tool that will allow you to essentially have a live, working web site or web site category, promoting the products of the Diet Direct Affiliate program. This template site was designed to be flexible, customizable, and user-friendly, with the ultimate goal of giving you a tool that is dynamically updated when our product data feed is updated.

In order to use the Diet Direct Dynamic Template site, you must:

  • Let us know the domain(s) that you will be using for this dynamic template site (this will allow us to keep track of usage of the dynamic site and monitor for potential abuses).
  • Have a web hosting provider that is running PHP and MYSQL (preferably the latest versions)
  • Your web hosting provider must allow remote database connections (the template site connects to a product database located on our server). Remote database connections are usually allowed. But, if you load this site and are having connection issues, your web host may not allow such remote connection, or you may have to request access. See known list of hosts that don't allow remote connections here.
  • Adjust the config.php file accordingly to add your Affiliate ID so the site tracks and credits all traffic and sales to your Affiliate account.
  • Be willing to customize the dynamic template site. We have made customization of the site very easy, and, with basic html knowledge, you can essentially make the site look and feel as you want it to, as well as add content to various areas/pages of the site.
  • Agree not to alter the php code which populates/displays various data from our product database. Altering such code will result in problems with the site's ability to display products and product categories.

2. Installation

To install the Dynamic Template site, simply unzip the distribution .zip file and upload the files to your hosting provider, in the directory that you want the site/category to appear in. (For example, if you have a site www.mall.com, and you want to add a Widgets category to your site, you could upload these files to mall.com/widgets/)

Once the files are stored in the directory you wish, it is now time to prepare/customize the site.

3. Getting Started

To prepare/customize your site, we first recommend editing the config.php file. The first and most important item in the config.php file that you must edit is the $affiliate_id. Make sure you change 99999 to your Diet Direct Affiliate ID. Making this change in the config.php file will update the entire template site to ensure that all links are properly coded with your Diet Direct affiliate tracking links.

You can also make other changes in this config.php file. The config.php setup area looks like below and the changes that can be made are explained below:

// setup
$affiliate_id = '99999'; - change this to your Diet Direct affiliate ID
$header_color = '#E0EEDF'; - change this font color to change color of the header
$left_menu_color = '#E0EEDF'; - change this font color to change color of the left navigation bar
$product_nav_color = '#EEEEEE'; - change this font color to change color of the product nav bar on category pages
$main_border_color = '#E0EEDF'; - change this font color to change color of the site border
$product_row_limit = '10'; - change this to the # of rows of products you want displayed on category pages.
$nopic_row_limit = '50'; - change this to the # of products you want displayed on the page without pictures

4. Dynamic Web site Template Contents

This section describes the site and its components at a basic level. These following pages retrieve data from the Diet Direct database: index.php, catlist.php, subcatlist.php, nopiclist.php and product.php. These pages all rely on the config.php file that enables them to connect to the database and provides other information to dynamically populate the site. The pages of the template are described below in more detail.

  • index.php - this page lists all categories and their total product counts.
  • subcatlist.php - this page lists all subcategories of a particular category and their product counts.
  • catlist.php - this page displays all of the products for a particular subcategory that link to the individual product description.
  • nopiclist.php - this page displays all of the products for a particular subcategory without pictures. Each product links to the individual product page.
  • product.php - this page contains all the product details and the BUY NOW button, that links to the shopping cart on the Diet Direct site and is encoded with your affiliate tracking link.
  • config.php - this file contains the configuration for the database and other variables that are used to customize your site. This page includes the db_funcs.php which contains the sites database functions.
  • db_funcs.php - this files contains all the functions used to access the database. These can be modified to your liking or other can be added to this file. Please be cautious when editing the sql as this can have an impact on the performance of your site.
  • header.php - contains the data for the header
  • footer.php - contains the data for the footer
  • left_menu.php - contains the data for the left menu

5. Customization using HTML and/or PHP

The dynamic template site is fully customizable. If your knowledge of PHP and HTML is limited, you will still be able to make significant changes to the site. As mentioned above, the config.php contains some basic items that can change the look and feel of your site.

More advanced customization can be done on your own utilizing your knowledge of PHP and/or HTML.

PHP is a server side language that executes upon sending a request to the server. The server responds with various responses based on the PHP command that was sent to it. PHP code can be found embedded within HTML. It is easily identified by the <? ?> tags. Any code that is inside these tags is PHP code. Editing PHP is easy. For example, <? echo $affiliate_id ?> prints the affiliate id to that position. This code is usually used in conjunction with links, titles, descriptions and any other areas that a piece of data needs to be printed out. In this case, the $affiliate_id is a variable in the config.php file that can be used throughout the HTML pages. Instead of typing the id over and over again, this variable is used as a pointer back to the real value in the config.php file.

This is a very simple example of PHP. Be careful not to edit some of the more complex PHP functions that control layout and navigation. This template is fully customizable based on your knowledge of PHP and HTML. So, if you feel comfortable moving the displaying of categories, feel free. However, small changes to the code can cause problems in many areas if you're not familiar with the language.

Essentially you can customize any page of the site, just be sure not to alter the embedded PHP code (unless you are comfortable coding with PHP and will not cause issues with the dynamic areas of the pages). However, we strongly suggest customizing as much of the site as possible.

Why you should customize your template site:

  • Search engines are filtering out duplicate content. If you simply load this site and make no modifications, your chances of achieving quality rankings in the search engines are FAR LESS than if you take the time to add your own customization ideas to the site.
  • Customizing your site will make your site different than all other sites. Unique original content is what will allow you to achieve higher rankings than others.
  • This site is simply a tool for you. This tool won't deliver results on its own. However, with some creative customization to the 8-9 files of this site, you can have a unique site offering thousands of products.

Some ideas for customization are:

  • Edit the header.php file to add your logo, site name, etc. Possibly even some other navigation links
  • Edit the left_menu.php file to add links, text, any other data you may want in the left_menu.php file
  • Edit the footer.php to add your site name, email, links, logo, etc.
  • Editing the various options in the config.php file to change the color, # of products, etc. that are displayed
  • Edit the index.php page to add content/text to the page about the list of product categories, below the categories, etc.
  • Edit the catlist.php, subcatlist.php, nopiclist.php and product.php pages to add content/text that will display on each category or product page.
  • Add text/content before or after .php coding page titles to help with page titles for the search engines.
  • On the product or category pages of the site, add your own content, such as paragraphs, etc. You can even use php tags to insert product names, category names, etc. to customize these pages. Adding your own text on the product page will make each product page unique.

These are some basic customization suggestions to make the site your own, while still allowing the site to work as created. Remember altering the actual PHP code without knowledge of PHP could result in issues/problems with the sites functionality.

6. Known Hosts That Don't Allow Remote Database Connections

  • Go Daddy
  • Fatcow
  • iPower Web