Archive for the Tutorials Category
We’ve had several questions lately about how you can use PHP includes in your datafeed web service client to do things like add standard site-wide content to your datafeed template.
Note: Due to some recent changes in the way the datafeed client creates SEO friendly URLs, we’ve changed the main datafeed client script name from “shop” to “shop.php”. To cover both versions we’ll refer to this script as “shop” or “shop.php” below.
Here’s how you can accomplish this:
- Look for your “shop” or “shop.php” script which is in the same folder as the “template.html” file.
- Make a backup of both the “shop” or “shop.php” script and the “template.html” file just in case you want to revert back to the original.
- Open the “shop” or “shop.php” file up in a text editor and add the following right below the opening <?php code:
ob_start(); include(’/path_to_include/include.php’); // Replace with actual path and file name. $my_include_content = ob_get_contents(); ob_end_clean();
- Look for the block of code that looks like this:
$strHTML = eregi_replace(’\[PAGE_TITLE\]‘, $page_title, $strHTML); $strHTML = eregi_replace(’\[PAGE_KEYWORDS\]‘, $page_keywords, $strHTML); $strHTML = eregi_replace(’\[PAGE_DESCRIPTION\]‘, $page_description, $strHTML); $strHTML = eregi_replace(’\[PAGE_NAVIGATION\]‘, $page_navigation, $strHTML); $strHTML = eregi_replace(’\[PAGE_CONTENT\]‘, $page_content, $strHTML); $strHTML = eregi_replace(’\[HIT_TRACKING\]‘, $hit_tracking, $strHTML);
- Add the following line right below that block of code:
$strHTML = eregi_replace(’\[MY_INCLUDE_CONTENT\]‘, $my_include_content, $strHTML);
- Save your “shop” or “shop.php” script.
- Open up your “template.html” file and add [MY_INCLUDE_CONTENT] to the html where you want that content to show.
- Save your template.html file.
- Upload your files to your server.
- If this isn’t the first time you’ve uploaded changes and/or viewed your datafeed pages make sure you clear your cache by logging into your account and going to ‘Tools -> Edit Current Datafeeds’ and then click on the ‘Clear Page Cache’ link next to your datafeed subscription in the list.
** These instructions assume that your PHP include just echo’s out a block of html content. If your include script places your html content within PHP variables then all you would need to do is simply include your script from within the “shop” or “shop.php” file, add eregi_replace() function calls (See example above) for each of the variables you want to use from within your include script, and then add those place holders (eg. [MY_PLACE_HOLDER]) to your template.html file.
Scott & AvantLink
The Affiliate Link Encoder (ALE) is a tool that uses javascript to automatically change direct merchant links that appear in your website html into AvantLink.com Affiliate tracking links. The ALE javascript will detect and change direct links only for merchants that are in the AvantLink network.
This is a powerful tool for Bloggers, Forum Admins, and other community sites. It allows you or your community contributors to post direct links to any of the merchants you are associated with in the AvantLink Affiliate network and still earn a commission when a site visitor clicks on one of those links and buys from the merchant.
In this quick tutorial we are going to show you how to install the ALE javascript on a WordPress blog.
Get the Affiliate Link Encoder (ALE) code:
- First, log into your Affiliate account, click on ‘Tools’ and then under ‘Ad/Link Tools’ click on ‘Affiliate Link Encoder’.
- Choose the website you will be using the ALE code on, add a custom tracking code if you want, and click the ‘Get Html’ button.
- Cut and paste the source code into a text editor or just leave it there and open another tab in your browser.
Install the code in your WordPress template:
- Log into your WordPress admin interface.
- Click on ‘Presentation’ and then ‘Theme Editor’.
- On the right side of the page you’ll see a list of theme files. Click on the ‘Footer’ link.
- In the source code form field, look for the closing </body> html tag.
- Cut and paste your ALE javascript code in right before the closing </body> tag.
- Save the changes and you’re done.
Now you can try creating a blog post and adding a direct link to one of your AvantLink merchants. You’ll notice that when you view the published article and rollover those links that they are Affiliate tracking encoded.
Scott & AvantLink


