<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>phpPig</title>
	<atom:link href="http://phppig.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://phppig.org</link>
	<description>PHP scripts and code to help newbies</description>
	<lastBuildDate>Fri, 05 Feb 2010 08:12:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>CJ Wordpress Plugin now available</title>
		<link>http://phppig.org/40/cj-wordpress-plugin-now-available/</link>
		<comments>http://phppig.org/40/cj-wordpress-plugin-now-available/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 08:04:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Wordpress Plugins]]></category>
		<category><![CDATA[CJ API Code]]></category>
		<category><![CDATA[CJ Wordpress Plugin]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=40</guid>
		<description><![CDATA[For all of you bloggers who have been following the posts about the CJ Wordpress code on my site for the CJ webservices, I have written two different plugins that make it simple to add listings to your post. Simply use a little short code and literally have as many listings on your post as [...]]]></description>
			<content:encoded><![CDATA[<p>For all of you bloggers who have been following the posts about the CJ Wordpress code on my site for the CJ webservices, I have written two different plugins that make it simple to add listings to your post. Simply use a little short code and literally have as many listings on your post as you desire within seconds.</p>
<p>You will need an affiliate PID that can be retrieved from the CJ settings and a CJ webservices developer id. Enter that into the plugin settings and activate the plugin. Then go to advertiser that you wish to add products from and enter the advertiser id (found in the url at the top of the advertiser page listed as &amp;advertiserid=12345).  Use the shortcode [cjaff keywords="What you want to search for" amount="# of listings" advertiser="12345 or whatever the advertiser is"]. You can do this with as many advertisers and as many keywords as you wish per listing.</p>
<p>Why would you want to use such a plugin as this? Unlike the other plugins available, our plugin makes the advertisements look as if they were added by you into the post. Here is an example of my fiance&#8217;s post about <a href="http://www.polkaspotfarm.com/2010/01/24/i-think-i-found-a-dress/" target="_blank">wedding gowns.</a> Here is also an affiliate site of mine <a href="http://pickup-truck-accessories.com" target="_blank">Pickup truck accessories</a> and a post about <a href="http://pickup-truck-accessories.com/7/pickup-truck-bed-covers/" target="_blank">pickup truck bed covers</a>. These affiliate links appear naturally as if they were added into the post by the blogger. Both of these sites are using the php5 REST version.</p>
<p>The php4 soap version can be viewed on a page on my site about <a href="http://scottpdaugherty.com/2010/01/24/fender-stratocaster/" target="_blank">Fender Stratocasters</a>.</p>
<p>Either version gives you the options of finding only your specified keywords without having to get links from cj and return the amount of listings that you choose. You can choose the amount of advertisers, the amount of listings, and relevant keywords to your post and add as many as you like.</p>
<p>With this CJ API plugin for wordpress, I have seen clicks and earnings go up over the past month since I wrote the plugin and have also seen my page impressions go up because more traffic is finding my pages organically than before due to the extra keyword listings from each ad on the site.</p>
<p>I will give you unlimited upgrades and unlimited support. We have a members section that is available to you and I will personally help each and every one of my customers succeed using this plugin. I will even make small modifiications to the code to suit your specific needs.</p>
<p>How much would this cost, is the next question? Well, it took hours of developing and debugging to get it to work. After over a week, the plugin was perfected to where it works effortlessly. The plugin that will earn you hundreds, thousands, or even more; a $497 value is yours not for $497. I wouldn&#8217;t even charge you $297. It can be yours for<span style="text-decoration: line-through;">$147</span>. For a limited time in the month of February 2010, I am giving this away for only <span style="color: #ff0000;"><strong>$97.</strong></span></p>
<p>This is a limited time offer so don&#8217;t miss your chance to earn large money without ANY HASSLES at all. Simply choose your php version below because the SOAP version will run with php4 and the REST version will run with php5. I can assure you that it is so easy to use, my son who is in the 3rd grade can add advertisements to a site. (Post will be available on February 6th with video footage of him using the software.)</p>
<p>Download your copy instantly now. (If you are not redirected, check your email to get the download link.)</p>
<p>php4 users using SOAP for only $97!</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="BNNWSYD9QLVBJ">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
<p>php5 users using REST calls for only $97!</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="HZQ74LHDYNYNQ">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/40/cj-wordpress-plugin-now-available/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building a sufficient php site</title>
		<link>http://phppig.org/35/building-a-sufficient-php-site/</link>
		<comments>http://phppig.org/35/building-a-sufficient-php-site/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 06:32:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=35</guid>
		<description><![CDATA[To get more popular search engine rank, a new webmaster must make sure that they do their keywords homework. There are several ways to do this, with Wordtracker being the most popular. Once you have done your homework and have great keyword phrases, then register your domain and start building your site.
If you are running [...]]]></description>
			<content:encoded><![CDATA[<p>To get more popular search engine rank, a new webmaster must make sure that they do their keywords homework. There are several ways to do this, with <a href="http://wordtracker.com">Wordtracker</a> being the most popular. Once you have done your homework and have great keyword phrases, then register your domain and start building your site.</p>
<p>If you are running a php/mysql website, then you will have urls that look like this: http://yoursite.com/index.php?task=view&#038;id=1 or something of that nature. You can change the urls, if your server allows for ModRewrite by utilizing a small file that is planted on the server. The file name is .htaccess. Now, to rewrite the files, you will need to write the file in a text editor and simply save as .htaccess or .htaccess.txt and rename on server by removing the .txt extension. In this file, using a url like the one listed above, you will want to write the .htaccess like this:</p>
<p><code><br />
Options -Indexes<br />
RewriteEngine on<br />
RewriteRule ^([0-9]+)-([a-zA-Z0-9?-]+) index.php?task=view&#038;id=$1&#038;name=$2 [L]<br />
RewriteBase /<br />
</code></p>
<p>Now is time for the php code to rename the urls. This can be done in a separate php file if so desired or on the pages that query for the urls on the site. If you use the latter, your code can look something like this.<br />
<code><br />
&lt;?php<br />
$sql = mysql_query("SELECT * FROM table_in_datbase_where_info_is");<br />
$row = mysql_fetch_assoc($sql);<br />
$url_1 = $row['id'].'-'.$row['name'];<br />
</code><br />
That will query the database and get you a link that would look like this:<br />
1-Your url name<br />
Now that we have done this, we will use php str_replace to make the link look friendlier.<br />
<code><br />
$url_1 = str_replace(" ","_",$url_1);<br />
</code><br />
That will remove the spaces and replace them with an underscore. Now to tie it all in together:<br />
<code><br />
$url = "http://yoursite.com/".$url_1.".html";<br />
echo "&lt;a href='".$url."'&gt;$row['name']&lt;/a&gt;";<br />
?&gt;<br />
</code><br />
This will now make your urls look like this: http://yoursite.com/1-Your_page_or_post_name.html. With the .htaccess file that we placed earlier, it will look for that url and place it with the same url as before based on the id of your page being 1 or the first entry found in your database. It will automatically rename every entry in the database in that table and will increase your sites search engine popularity.</p>
<p>When your url matches the keywords of the popular searched phrase with little competition, you will soon start to see a steady flow of traffic from the search engines. </p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/35/building-a-sufficient-php-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mod_rewrite with .htacess to change links in rss feed</title>
		<link>http://phppig.org/30/mod_rewrite-with-htacess-to-change-links-in-rss-feed/</link>
		<comments>http://phppig.org/30/mod_rewrite-with-htacess-to-change-links-in-rss-feed/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 09:07:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=30</guid>
		<description><![CDATA[The last post, we showed you how to add datafeeds to a site utilizing php and the MagpieRSS script. In this post, I am going to show you how to go one step further for search engine optimization using your .htaccess file and the str_replace command in php.
In the last post, I showed you how [...]]]></description>
			<content:encoded><![CDATA[<p>The last post, we showed you how to add datafeeds to a site utilizing php and the MagpieRSS script. In this post, I am going to show you how to go one step further for search engine optimization using your .htaccess file and the str_replace command in php.</p>
<p>In the last post, I showed you how to use an rss feed from craigslist and incorporate it into your site. This time, I am going to show you how to take the same feed and rename all urls in the feed to urls that are more appropriate to your site. </p>
<p>I cannot be sure how this will react with wordpress because I have not tried it yet, however, I am going to give it a shot tomorrow and see what needs to be changed and will write a post about that.</p>
<p>In the last post, we pointed you to <a href="http://scottpdaugherty.com/mobile-al-boat-classifieds/" target="_blank">Boat Classifieds</a>. Since the last post, I have taken all of the links from that by removing the $href statement.</p>
<p>Now if you have a custom php script or would like to run this with no style, feel free to copy this into wordpad and save as index.php or whatever you choose to rename it. </p>
<p>Okay, enough of the talk, here is the code:<br />
<code>Options -Indexes<br />
RewriteEngine on<br />
RewriteRule ^boat_classifieds/([0-9]+)-([a-zA-Z0-9?-]+) http://mobile.craigslist.org/boa/$1.html</code><br />
Now to discuss what we are doing. This is telling your server to redirect all links that appear like this: www.yoursite.com/boat_classifieds/1-This_is_your_boat_ad.html to craigslist. The $1 tells the file that the first string of the url defined ([0-9]+) is the string that it will redirect to.</p>
<p>Now for the php code to actually rewrite the urls so that the urls listed actually appear to belong to your site.<code>&lt;?php<br />
require_once('magpierss/rss_fetch.inc');<br />
$url = "http://mobile.craigslist.org/boa/index.rss";<br />
$rss = fetch_rss ( $url );<br />
echo "&lt;ul&gt;";<br />
foreach ($rss->items as $item) {<br />
$href = $item['link'];<br />
$title = $item['title'];<br />
$title1 = seo_str($title);<br />
$href1 = str_replace("http://mobile.craigslist.org/boa/","",$href);<br />
$href1 = str_replace(".html","",$href1);<br />
$href = $site_url.'/boat_classifieds/'.$href1.'-'.$title1.'.html';<br />
$description = $item['description'];<br />
$description = str_replace("a href","a target='_blank' rel='nofollow' title='$title' href", $description);<br />
echo"&lt;li&gt;&lt;a href=$href target='_blank' rel='follow' title='$title&gt;&lt;h2>$title&lt;/h2>lt;/a>&lt;/li> &lt;p>$description&lt;/p>";<br />
}<br />
echo"&lt;/ul>";<br />
?></code><br />
In this code, on line 3 we define the rss feed that we are going to show on our site. Lines 6-8 grab the information from the rss feed. On line 9 we define a function that will be useful for Search Engine Optimization by replacing all irregular characters with an underscore. In the rest of the code, we define the links, description, and then show them in html with the echo command. Specifically, lines 18-20 define the new url that we are going to redirect. On line 22 we redefine how the link opens so that it opens in a new window or tab and allows your original window open.</p>
<p>Preview the code here at <a href="http://alabamatombigbeefishing.info/boat_classifieds/mobile_al.html" target="_blank">Mobile Alabama Boat Classifieds</a>.<br />
You may copy this code now and test it, modify or etc, as you see fit.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/30/mod_rewrite-with-htacess-to-change-links-in-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding RSS or XML to php site</title>
		<link>http://phppig.org/25/adding-rss-or-xml-to-php-site/</link>
		<comments>http://phppig.org/25/adding-rss-or-xml-to-php-site/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 16:58:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=25</guid>
		<description><![CDATA[A lot of people locally have asked me how to add an xml or rss feed to their site. A lot of people may wonder what the benefits of adding a feed to your site and basically it keeps fresh content updating to your site. If the search engines come by and snap what you [...]]]></description>
			<content:encoded><![CDATA[<p>A lot of people locally have asked me how to add an xml or rss feed to their site. A lot of people may wonder what the benefits of adding a feed to your site and basically it keeps fresh content updating to your site. If the search engines come by and snap what you have got from your own personal content, then more content from a feed, it helps you get more traffic for different keywords.</p>
<p>It is rather simple, so simple that anybody can do it, techie or non-techie. I am going to show you how to do it briefly and then send you to a demo page to see it in action. First, you will need an rss aggregator script. The best free script to download is magpie. You can download it <a href="http://sourceforge.net/projects/magpierss/files/" target="_blank">here</a>.</p>
<p>For this post, I downloaded Magpie RSS 0.72 and extracted it to a folder on my local machine. If you don&#8217;t have a good zip program, you can download 7zip for free <a href="http://www.7-zip.org/download.html" target="_blank">here</a>. Once you extract the Magpie archive, it should automatically unzip to folder magpierss-0.72. You will want to rename the folder magpierss.</p>
<p>Next you will need to FTP this folder into your webhost. If you don&#8217;t have good FTP software, you can download Filezilla for free <a href="http://filezilla-project.org/download.php" target="_blank">here</a>. It is Open Source and very fast.</p>
<p>Now once this is done, on the php page that you want the feed to appear, somewhere in the code you will need to add the following line:<br />
<code>&lt;?php<br />
require_once('magpierss/rss_fetch.inc');<br />
?&gt;</code></p>
<p>Once you add that bit of code to the page, wherever you want the rss feed to appear, add the following code:<br />
<code>&lt;?php<br />
$url = "your_url_here";<br />
$rss = fetch_rss ( $url );<br />
echo "Channel Title: " . $rss-&gt;channel['title'] . "&lt;p&gt;";<br />
echo "&lt;ul&gt;";<br />
foreach ($rss-&gt;items as $item) {<br />
$href = $item['link'];<br />
$title = $item['title'];<br />
$description = $item['description'];<br />
echo"&lt;li&gt;&lt;a href=$href&gt;$title&lt;/a&gt;&lt;/li&gt;&lt;p&gt;$description&lt;/p&gt;";<br />
}<br />
echo"&lt;/ul&gt;";<br />
?&gt;</code></p>
<p>If you use wordpress like I am using for this and my other blog, you can easily manipulate an rss feed into any page that you want to in your blog by adding the EXEC-PHP plugin for wordpress. It can be downloaded here: <a href="http://bluesome.net/post/2005/08/18/50/" target="_blank">http://bluesome.net/post/2005/08/18/50/</a>.  Once you install the EXEC-PHP plugin, activate it and then paste the code above into any page of your blog by changing the following line:</p>
<p>$url = &#8220;your_url_here&#8221;;</p>
<p>Change the your_url_here to the url of the feed that you want to add to your site. Whenever you publish this, it goes live and is available for all of your site&#8217;s visitors.</p>
<p>Preview <a href="http://scottpdaugherty.com/tombigbee-river-level-leroy-al/" target="_blank">here</a> and <a href="http://scottpdaugherty.com/mobile-al-boat-classifieds/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/25/adding-rss-or-xml-to-php-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CJ affiliates and eBay affiliates: Prepare for a new set of free tools</title>
		<link>http://phppig.org/22/cj-affiliates-and-ebay-affiliates-prepare-for-a-new-set-of-free-tools/</link>
		<comments>http://phppig.org/22/cj-affiliates-and-ebay-affiliates-prepare-for-a-new-set-of-free-tools/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 07:26:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=22</guid>
		<description><![CDATA[I have been showing you how to add links to your wordpress sites using the CJ api service but the code is almost ready to upload for a brand new CMS. The script will be released under GNU/GPL and will feature plug-ins that will search the CJ advertiser of your choice for your keywords in [...]]]></description>
			<content:encoded><![CDATA[<p>I have been showing you how to add links to your wordpress sites using the CJ api service but the code is almost ready to upload for a brand new CMS. The script will be released under GNU/GPL and will feature plug-ins that will search the CJ advertiser of your choice for your keywords in both your article posting and page posting.</p>
<p>The script features a user-friendly admin section and an SEO friendly front-end that will guarantee that your site gets higher optimization and you can start making profits strictly from organic traffic.</p>
<p>Also, a plug-in has been written to search YouTube for videos relating to your specified keywords in your post and article. </p>
<p>The script will be available to demo starting on December 1, 2009 and the code will be available immediately. </p>
<p>I look forward to seeing/ hearing from you in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/22/cj-affiliates-and-ebay-affiliates-prepare-for-a-new-set-of-free-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>New ebay and CJ affiliate script almost ready for launch</title>
		<link>http://phppig.org/19/new-ebay-and-cj-affiliate-script-almost-ready-for-launch/</link>
		<comments>http://phppig.org/19/new-ebay-and-cj-affiliate-script-almost-ready-for-launch/#comments</comments>
		<pubDate>Sun, 22 Nov 2009 19:42:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=19</guid>
		<description><![CDATA[So, I know that I have spoken about this script several times in the past. I am in the last few days of testing and adding more features to the script before releasing it to the public.
The latest design has videos from youtube included in the page to show video results of whatever product you [...]]]></description>
			<content:encoded><![CDATA[<p>So, I know that I have spoken about this script several times in the past. I am in the last few days of testing and adding more features to the script before releasing it to the public.</p>
<p>The latest design has videos from youtube included in the page to show video results of whatever product you are promoting. This feature helps sell a product, especially a music instrument. <a href="http://rockbottommusicgear.com/music_instruments/563-Behringer_CS100_CompressorSustainer_Pedal.html" target="_blank">Behringer CS100 Compressor Sustainer Pedal</a> at RockBottomMusicGear.com. RockBottomMusicGear.com isn&#8217;t the exact design of the script but it is the closest version that we have up running right now. This script uses a data feed from Zzounds.com and you click the link to go direct to Zzounds. Below that we have the ebay listings, the video results then results from commission junction advertisers.</p>
<p>If you would like to receive a beta version of this script to test out, leave a comment. When we get it ready we will offer it to our beta testers first.</p>
<p>We are still deciding whether or not to release the script under GNU open source or to copyright and sell the script, however, beta testers will receive a FREE version of the script to test drive for us.</p>
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/19/new-ebay-and-cj-affiliate-script-almost-ready-for-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CJ API service with Wordpress</title>
		<link>http://phppig.org/5/using-cj-api-service-with-wordpress/</link>
		<comments>http://phppig.org/5/using-cj-api-service-with-wordpress/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 20:14:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://phppig.org/?p=5</guid>
		<description><![CDATA[Many affiliate marketers don&#8217;t know how easy the use of an API program is. I have been using the CJ API service for about two weeks and have noticed an increase in revenue because of it. Since I figured out how to put it to you in Wordpress, I am going to share the code [...]]]></description>
			<content:encoded><![CDATA[<p>Many affiliate marketers don&#8217;t know how easy the use of an API program is. I have been using the CJ API service for about two weeks and have noticed an increase in revenue because of it. Since I figured out how to put it to you in Wordpress, I am going to share the code with you. First, you need to download and install the EXEC-PHP plugin for wordpress. It can be downloaded here: <a href="http://bluesome.net/post/2005/08/18/50/" target="_blank">http://bluesome.net/post/2005/08/18/50/</a>.</p>
<p>Next you will need a couple of bits of information from CJ. First, if you haven&#8217;t signed up for the CJ API service, you can sign up here: <a href="http://webservices.cj.com/" target="_blank">http://webservices.cj.com/</a>. For the code to work, you will need you API number and the advertiser id. If you haven&#8217;t signed up for an advertiser that has a product catalog, now would be the time to do so.</p>
<p>Finally you will need to download the <a href="http://phppig.org/nusoap.zip" target="_blank">Nusoap library</a> by clicking the link. Unzip it and ftp into your sites root directory.</p>
<p>Once you have an advertiser that has a product catalog, you need to click on the advertiser details and look at the url. In Firefox, you are not able to edit the url but rather only view it. The url will look like this: https://members.cj.com/member/1234567890/accounts/publisher/getadvertiserdetail.do?ispopup=true&amp;<strong><span style="text-decoration: underline;">advertiserId=123456.<br />
</span></strong>I have highlighted the area by making the advertiser id bold and underlined. You will need to copy the number only and paste it into wordpad or some other text editor for now. You will also need to go to your account settings in CJ by clicking account. Click website settings and choose the site from the list of sites that you have entered that you will be making your post on. Once you get in here, copy the PID number and paste it in the same text editor file that you have saved the advertiser id on. Save the file for future reference.</p>
<p>Once you get your API number, you are ready to go.</p>
<p>Whenever you get the EXEC-PHP plugin installed into Wordpress, you will now need to edit the header of your theme. You can do this by clicking Appearance &#8211;&gt;Editor. On the right hand side of the screen, you will see header. Click it. At the bottom of the code, you will need to add this snippet of code:<br />
<code>&lt;?php<br />
/*CJ API FOR WORDPRESS<br />
COPYRIGHT (C) 2009<br />
SCOTT P DAUGHERTY<br />
*/<br />
include("nusoap/lib/nusoap.php");</code><br />
<code>?></code></p>
<p>Save the header file with this code in it. Now you will be able to add the rest of the CJ API code on each individual post just as you would the twp-auction code for ebay. Now you are ready for your API id number and advertiser id. At the end of the post that you want the cj ads on, you will insert this code:</p>
<p><code>&lt;?php<br />
/*<br />
CJ API SEARCH AND RETURN<br />
PHPPIG<br />
COPYRIGHT (C)2009<br />
SCOTT P DAUGHERTY<br />
*/<br />
//Define user information<br />
$developerkey ="Your API key here";<br />
$websiteIdx ="Your website id here";<br />
$cjword = "Your keyword here";<br />
$advertiserIds = "Your advertiser id here";<br />
$serviceableArea = "";<br />
$upcOrIsbnOrEan = "";<br />
$manufacturerName = "";<br />
$advertiserSku = "";<br />
$lowPrice = "";<br />
$highPrice = "";<br />
$currency = "";<br />
$sortBy = "";<br />
$orderIn = "";<br />
$startAt = 0;<br />
$maxResultsx = 15;<br />
$soapclient = new nusoap_client("https://product.api.cj.com/wsdl/literal_wrapped/productSearchService.wsdl", true);<br />
$params = array(<br />
"developerKey" =&gt; $developerkey,<br />
"websiteId" =&gt; $websiteIdx,<br />
"advertiserIds" =&gt; $advertiserIds,<br />
"keywords" =&gt; $cjword,<br />
"serviceableArea" =&gt; "",<br />
"upcOrIsbnOrEan" =&gt; "",<br />
"manufacturerName" =&gt; "",<br />
"advertiserSku" =&gt; "",<br />
"lowPrice" =&gt; "",<br />
"highPrice" =&gt; "",<br />
"currency" =&gt; "",<br />
"sortBy" =&gt; "",<br />
"orderIn" =&gt; "",<br />
"startAt" =&gt; $startAt,<br />
"maxResults" =&gt; $maxResultsx<br />
);<br />
$proxy = $soapclient-&gt;getProxy();<br />
$result = $proxy-&gt;search($params);<br />
$count = $result['searchReturn']['count'];<br />
if($count &gt; 0) {<br />
for($i = 0; $i &lt; $count; $i++) {<br />
$advertiser_id  = $result['searchReturn']['products']['products'][$i]['advertiserId'];<br />
$advertiser_name = $result['searchReturn']['products']['products'][$i]['advertiserName'];<br />
$click_url = $result['searchReturn']['products']['products'][$i]['clickUrl'];<br />
$currency = $result['searchReturn']['products']['products'][$i]['currency'];<br />
$description = $result['searchReturn']['products']['products'][$i]['description'];<br />
$image_url = $result['searchReturn']['products']['products'][$i]['imageUrl'];<br />
$name = $result['searchReturn']['products']['products'][$i]['name'];<br />
$price = $result['searchReturn']['products']['products'][$i]['price'];<br />
$sku = $result['searchReturn']['products']['products'][$i]['sku'];<br />
$upc = $result['searchReturn']['products']['products'][$i]['upc'];<br />
echo "&lt;table border='0'&gt;&lt;tr&gt;&lt;td&gt;&lt;a href='$click_url' title='$name'&gt;&lt;font size='3'&gt;$name";<br />
echo "&lt;/font&gt;&lt;/a&gt;&lt;br&gt;&lt;font size='2'&gt;&lt;b&gt;$ $price &lt;/font&gt;&lt;/b&gt;";<br />
echo "&lt;br&gt;SKU: $sku";<br />
echo "&lt;br&gt;&lt;a href='$click_url'&gt;&lt;img src='$image_url'  title='$name'&gt;&lt;/a&gt;";<br />
echo "&lt;br&gt;&lt;font color='#000000'&gt;$description&lt;/font&gt;";<br />
echo " &lt;br&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;hr size='1'&gt;";<br />
}}<br />
?&gt;</code></p>
<p>At the top of the code, you will see the following:</p>
<p><code>$developerkey ="Your API key here";<br />
$websiteIdx ="Your website id here";<br />
$cjword = "Your keyword here";<br />
$advertiserIds = "Your advertiser id here";</code></p>
<p>Enter the information in on the appropriate lines and insert complete code into your post. It will return the results from the advertiser that you choose with your affiliate id. For an example, visit my site at <a href="http://scottpdaugherty.com/2009/11/15/choosing-a-guitar-for-a-christmas-present/">http://scottpdaugherty.com</a> to review the code in use.</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
]]></content:encoded>
			<wfw:commentRss>http://phppig.org/5/using-cj-api-service-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
