The McJiffy EASy (eBay Affiliate Store) program is a quick and easy way to create a storefront based on of eBay's affiliate program. To use McJiffy EASy, you will need two eBay accounts. One for the eBay Developer program and another for the eBay Affiliate program.
How McJiffy EASy Works
When the EASy page is loaded, it makes two calls: one to the eBay API for related keywords and a second one to the eBay RSS to pull in item data.
For related keywords, EASy first looks in the "cache/keyword" directory to see if the related keywords are already cached. If the cache does have a current record for the related keywords, this cache file is used and the call to the eBay API is skipped. If no current cache file is found, a call to the eBay API finds the related keywords. This result of the API call is saved in the "cache/keywords" directory for 7 days. If you are doing multi-site hosting, all of your sites have access to the related keyword cache.
The second call is for the eBay RSS feed. The current keyword is sent to the eBay RSS service and then prep'd for output. This RSS feed is cached in the "cache/[campaign id]" directory for 5 minutes. This allows for a user to page through all the results with EASy not needing to re-download the RSS feed. The cache of this RSS feed is only accessible to sites with the same eBay campaign id.
All product links are cloaked. The link in the eBay RSS is modified to redirect back through the EASy script. This allows for a nicer url that does not look like an affiliate link.
Place the EASy files into your website directory. In the same directory as the EASy files, create a directory called cache and make it writable to the webserver.
chmod 777 cache// Ebay Developer Production Key
$AppId = 'enter app production key here';
// Ebay Affiliate program Campaign Id
$site['account'] = 'enter ebay affiliate campaign id here';Setting up McJiffy EASy is all done through a simple configuration file. The default configuration file is found under the "sites" directory. The sites directory can contain multiple configuration files to be used with Multi-site hosting.
Below is a run down of the different variables in the configuration file.
$AppId - your production key associated with your eBay Developer account
$site['account'] - your campaign idea from your eBay Affiliate account
$site['title'] - title of your site
$site['theme'] - the name of the template used for this site. This corresponds to a folder name under the "themes" directory.
$site['slogan'] - slogan text to appear for your site
$site['pagesize'] - number of product items to display per page
$site['mainkeywords'] - comma seperated list of keywords. This list will be used to seed the dynamic keyword creation functions.
Optional Configuration - these can still be set on a per site basi
$site['ebaycat'] - limit the product listings to a particular category by entering the ebay category id
$site['auctiontype'] - limit product listings to specific types of product listings: 0 = auction and buy it now listings, 1 = auction listings only, 2 = buy it now listings only
$site['minprice'] - limit product listings to only listings with a price above this minimum price.
$site['maxprice'] - limit product listings to only listings with a price below this maximum price.
$site['sortby'] - order the product listings by using one of the following codes
1&fsoo=1 = Time: ending soonest
2&fsoo=2 = Time: newly listed
34&fsoo=1 = Price + Shipping: lowest first
34&fsoo=2 = Price + Shipping: highest first
32&fsoo=2 = Best Match
cache lifetime of keyword lookup
$site["CACHE_KEYWORD_TIME"] = 604800; // 7 days in seconds
cache lifetime of ebay items
$site["CACHE_ITEMS_TIME"] = 300; // 5 minutes in seconds
force using a specific country
comment out this setting if you want the country to automatically be detected
available countries, en-us, en-au, en-ca, en-gb, en-it, fr-fr, be-fr, nl-nl, zh-sg, zh-hk, it-it, es-es
$site["country"] = "en-us";
McJiffy EASy make mutli-site easy. First, you need to point all your domains to your installation of McJiffy EASy. Then, you will need to create a new configuration file for each site.McJiffy EASy uses a recursive method to configure sites. For an example of a site at www.mydomain.com, the following configuration files will be loaded:
Each time a new configuration file is loaded it, replaces any of the settings previously loaded during the configuration process. So the title that is set in default.php can be over written in the com.php file and then over written again in the mydomain.com.php file. The site specific configuration files do not have to include all the configuration variables. A site specific configuration file needs to only include variables that affect that specific site, like your eBay campaign id or the theme name.
The template files used in McJiffy EASy uses basic php files for it's templates. You will just need to use <?php echo $VARIABLENAME; ?> to output any of the variables set in the EASy script.
To create a template, create a new directory under the "themes" directory and name your template file "index.php". As mentioned before, this template file is a basic php file, so you can use any type of php programming in your template file.
The pre-set variables available for templates to use are:
$AppId - your eBay Developer production key
$site - the array set from the configuration files
ROOT_DIR - the file system path to your installation of McJiffy EASy
THEME_DIR - the file system path to the currently selected theme
$keyword - the currently selected keyword
$url - the full url of the current page
$themeUrl - the full url to the themes directory
$page - the current page number
$pageSize - the number of items to show on each page
$pageNumbers - the total number of pages for the current keyword
$mainkeywords - array of main keywords set through the confiugration files
$related - array of keywords dynamically pulled from eBay that are related to the current keyword. These are usually more refined versions of the current keyword.
$topics - array of kewords dynamically pulled from eBay that are considered related topics to the current keyword.
$ebayItems - array of product search results from eBay. Each item is also an array with entries for: title - product name, link - link to product, image - link to image hosted on ebay, currentbid - current bid price, bidcount - current number of bids for this product, endtime - time when auction ends, type - either auction or buy it now, bin - buy it now price if available
$impressionPixel - a tracking image used by eBay to log impressions of a given page and keyword. These stats will appear in your eBay affiliate dashboard.
$country['bin'] - localized text for "Buy It Now"
$country['currentbid'] - localized text for "Current Bid"
$country['bids'] - localized text for "Bids"
$country['ends'] - localized text for "Ends"
Starting with McJiffy EASy 1.2, the script now supports internationalization. This allows for the eBay listing to be targeted to a specific eBay affiliate program. EASy can either be setup to us only one specific country or automatically determine the best country fit for a particular visitor.
To choose a specific country, you will need to set the $site['country'] option in your settings file under the sites directory. The available country options are:
en-us = United States
en-gb = United Kingdom
en-au = Australia
en-ca = Canada
en-in = India
es-es = Spain
fr-fr = France
be-fr = Belgium
nl-nl = Netherlands
zh-sg = Singapore
zh-hk = Hong Kong
If you comment out the $site['country'] option in the settings file, EASy will try to determine the best country based on the user's browser language. If no match is found, the script defaults to "en-us".
Country specific settings can be found in the country.php file. This file includes eBay specific settings along with localized text. These localized text messages are used in the default template.
Starting with version 1.3, the script tries to find links to eBay buyer guides. The script searches the http://reviews.ebay.com/ for guides, strips out the link url, link title and link description and then exposes this data to the theme through the $guides variable. The script also redirects the links to the buyer guides back through the script in order to get credit for any click thrus. The links are rewritten to use the ebay rover links and should look like any other link generated by the Custom Url Link Generator tool.
Certain keywords may not contain any buyer guides. In this case, no links are displayed.
To include the guides in your theme, place the following code in the theme where you want the buyer guide links to appear.
<?php if (count($guides)>0) { ?>
<h2><?php echo $keyword;?> Buyer Guides</h2>
<ul>
<?php foreach ($guides as $guide) { ?>
<li><a href="<?php echo $guide['url'];?>"><?php echo $guide['title'];?></a> - <?php echo $guide['desc'];?>
<? } ?>
</ul>
<?php } ?>Starting with version EASy 1.3, you can now pre-write text to go along with each keyword. When a page is loaded, EASy checks to see if a corresponding text snippet exists. If it does, it reads the snippet into the $keywordtext variable that can then be used in your theme.
By default, all the keyword text snippets are stored in the "text" directory under in the site root. This directory can be adjusted using the $site["textdirectory"] variable in the settings file. If you are doing multi-site hosting and want to have unique text for each site, then all you will need to do is create a different directory for each site. One way to do this is to make subdirectories within the "text" directory.
/
/cache
/sites
/text
-/site1
-/site2
/themesThen in your configuration files for each site, just set the $site["textdirectory"] to the appropriate directory. ex: $site["textdirectory"] = "text/site1"
The keyword snippet files are plain text files. The filename should be the urlencoded version of the keyword and have a file extension of ".txt".
wii --> wii.txt
wii console --> wii+console.txtThe contents of the file are directly piped to the $keywordtext variable. So you can include HTML in your text file and it will show up on your theme page.
The new 1.3 version should work with existing themes from version 1.2 and earlier. You can easily modify your themes to display the new 1.3 features.
Buyer Guide Links
To use the new buyer guide links, you should add the following code to your theme where you want the links to appear.
<?php if (count($guides)>0) { ?>
<h2><?php echo $keyword;?> Buyer Guides</h2>
<ul>
<?php foreach ($guides as $guide) { ?>
<li><a href="<?php echo $guide['url'];?>"><?php echo $guide['title'];?></a> - <?php echo $guide['desc'];?>
<? } ?>
</ul>
<?php } ?>You will also need to add a setting to your site configuration file to tell how long to cache the buyer guide links.
$site["CACHE_GUIDES_TIME"] = 604800; Keyword Text
To use the new keyword text feature, add the following code to your theme where you want the keyword text snippet to appear.
<?php if (!empty($keywordtext)) {
echo '<div class="keywordtext">' . $keywordtext. '</div>';
} ?>You will also need to add a setting to your site configuration file. This will tell EASy which directory, relative to the site root, holds the text snippets. Currently it defaults to "text".
$site["textdirectory"] = "text";Htaccess Changes
You will need to make two changes to your .htaccess file. One is for the buyer's guide and the other is for the sitemap. Add the following to your .htaccess file.
RewriteRule guide/(.*)/(.*)$ index.php?action=guide&q=$1&link=$2
RewriteRule ^sitemap\.xml$ sitemap.php [L]Version Number Variable
You can add a McJiffy EASy version number to your theme by using the following code. In the updated theme distributed with version 1.3, the version variable is used in the Powered By McJiffy link.
<?php echo $version;?>----------------------------------------------------------
CHANGE LOG
----------------------------------------------------------
Version 1.0
- initial release
Version 1.1
- fixed incorrect displaying of price information from ebay
RSS, prices and bid counts not showing correctly
- fixed base template to use / as site homepage instead
of index.php
- added logic to display custom text if no related keywords
or topics found
- added new options to ebay RSS search: minimum price, maximum
price, ebay category, listing type (auction or buy it now)
and sort by
Version 1.2
- fixed page size issue, was showing 1 more listing than total page size
- added robots.txt so crawlers will not traverse the go links
- added function to automatically clear cache directory of files older
than the cache lifetime
- added configuration settings for CACHE_KEYWORD_TIME and CACHE_ITEMS_TIME
- added country selection through setting "country" or automatic detection by
EASy
- added pixel tracking variable to template, $impressionPixel
Version 1.3
- added $version variable that can be used in templates
- added ebay category id to cache filenames
- allow limiting related keywords to a specific ebay category
- pull in ebay buyer guide links, variable is set as $guides for templates
- added text snippets for keywords, snippets can in included in templates
using the $keywordtext variable
- added sitemap code by ChuckMcB