More PHP editing.
Oct 14th, 2004 by Brian A. Thomas
Over to your right, you will see a randomly selected item from either Sara's Amazon Wishlist, or mine. While I got the initial script from Two Ells, I modified it to randomly select Sara's wishlist or mine, as it initally did just one wishlist.
Basically I modified the original code:
-
$aw_wishlist_id=' '; //The id of the wish list you wish to search. Hint: Search for (don't simply go to) your wish list and copy the id from the end of the URL.
with the following:
-
if ($list_to_use == 1) {
-
$aw_wishlist_id=' '; //The id of the first wish list you wish to search. Hint: Search for (don't simply go to) your wish list and copy the id from the end of the URL.
-
}
-
else {
-
$aw_wishlist_id=' '; //The id of the second wish list you wish to search. Hint: Search for (don't simply go to) your wish list and copy the id from the end of the URL.
-
// replace above with
-
// else if ($list_to_use == next number) if using more then two wishlists & modify from there.
-
}
I then had to replace:
-
$aw_header = 'Amazon Wish List'; //Used to label the box.
with:
-
if ($list_to_use == 1) {
-
$aw_header = '1st names Amazon Wish List'; //Used to label the box.
-
}
-
else {
-
$aw_header = '2nd names Amazon Wish List'; //Used to label the box.
-
}
As the original is under GNU licence obviously the above modifications are as well, feel free to add them to your Amazon Wishlist plugin if you wish (in the unlikely even that anyone visiting is actually using WordPress and the Amazon Wishlist plugin).
Update: I am using the PHPizer plugin now as well from the same site to add color to the code. Also, it seems somebody did come here to get information on it.
Update 2: It seems WordPress changes the apostrophe (') to a single quote mark in the above code listings. If you are going to use the code, you will need to replace the single quote marks with apostrophes.







Well, I did find this comment while trying to debug the Amazon Wish List-thingie in Wordpress. It didn't help.
After e-mailing him, it seems his problem has been fixed. While I am no PHP expert, I know how my modification works, so I was going to try and help anyhow.