(version 1.001; updated 11-06-07) (works with Drupal versions 5.x) Installing phpBay Pro from Wired Solutions (www.wiredsolutions.com) in Drupal. --------------------------- About phpBay Pro from Wired Solutions: phpBay Pro provides an easy way of integrating eBay auctions into your website's content to earn money through eBay's affiliate program. phpBay Pro is not a free script, and must be purchased from Wired Solutions (www.wiredsolutions.com). To use the script, you must sign up for an eBay affiliate account with either Commission Junction or Mediaplex. --------------------------- Configuring phpBay Pro in Drupal: This module will walk you through the steps of integrating phpBay Pro into your Drupal website. We'll first walk through the initial setup of the script to ensure that it is working properly, and then I'll show you how to display live eBay auctions in your website. Before you start: 1. Purchased phpBay Pro from Wired Solutions (www.wiredsolutions.com) 2. Setup an affiliate account with eBay from either Commission Junction or Mediaplex Note: integration of phpBay Pro includes the following files from phpBay Pro: ebay.php, auction.php, template.ebay.results.html. There are other files that come included with phpBay Pro, but these are the files we will use for our integration into Drupal. Step 1: Create a folder for phpBay Pro in your website. Using an ftp program, or another program you might use to manage your webspace and website folders, create a folder called "ebay" in your website's root directory. The location of this folder should be similar to www.mysite.com\ebay. You can call this folder something else, but you'll need to update code changes later in this document as such. Step 2: Update the settings in the ebay.php file provided in phpBay Pro. In the section above the "No further editing required" section, make the appropriate adjustments to the settings. These adjustments include inserting your website url, as well as adding information regarding your eBay affiliate account. Step 3: Modify additional settings in the ebay.php file. This is where the majority of the changes to phpBay Pro take place to allow for Drupal integration. All of the following code changes take place in the "No further editing required" section. I have listed the changes in the order you will arrive at them while scrolling down the page from top to bottom: [Step 3a] change: var $redirect_url = "auction.php?eb=" to: var $redirect_url = "ebay/auction.php?eb=" [Step 3b] change: var $eb_template = "template.ebay.results.html"; to: var $eb_template = "ebay/template.ebay.results.html"; [Step 3c] Replace this code: # assign variables $this->eb_saaff = $aff_type; if ($this->eb_saaff == "afcj") { $this->eb_afcj = trim($ebay_pid); } else { $this->eb_afmp = trim($ebay_pid); } With this code: #assign variables $this->ebay_pid = "12345678"; Note: insert your appropriate Commission Junction or Mediaplex PID here. [Step 3d] Remove the following code: # some error trapping before we query ebay if ($this->eb_saaff == "") {echo "Set the affiliate type variable in ebay.php"; exit;} if (($this->eb_afcj == "") && ($this->eb_afmp == "")) {echo "Set the affiliate id variable in ebay.php"; exit;} error_reporting(0); [Step 3e] Replace this code: if ($this->eb_saaff == "afcj") { $url .= "afcj=" . $this->eb_afcj . "&"; } else { $url .= "afmp=" . $this->eb_afmp . "&"; } With this code: $url .= "afcj=" . $this->ebay_pid . "&"; NOTE, if using Multiplex affiliate account, "afcj" above should be changed to "afmp" Step 4: Make the following change to the template.ebay.results.hml page: Find %%image_url%% and replace with %%link_url%%% Step 5: Upload the following files to your \ebay folder: ebay.php; auction.php; template.ebay.results.html. You are now ready to begin using phpBay pro in Drupal! --------------------------- Displaying auctions with phpBay Pro in Drupal: phpBay Pro comes with several examples and templates for showing auctions in your website. To display auctions in Drupal, we will be using the code samples provided by phpbay in content sections with the filter set to PHP. phpBay comes with 7 examples ready for use, and also contains instructions on displaying as much or as little information for auctions as you desire. Please refer to phpBay Pro's documentation for specific code references and snippets. For displaying our first set of ebay listings on your website, we'll use the sample code provided by phpBay in "example4.php," and place this code in a new "page" for display in our Drupal site. Step 1: Open up "example4.php" (not in browser, in text or code editor) and copy the php code following