Max,
Far from being an expert, but if you've already installed your store and the problems I was having was that the icons from cafepress did not display properly. I simply downloaded some new code that displays all images except the view cart icon. You have to download the viewcart icon and save it in your store directory. The only thing that needs to be changed is the path to your lib-common.php and the name of your cafepress store...mine is "irish_shop". I am on a windows server... Here's the code I used after you can the path in the following code save it as your store.php file in your store directory:
// This path should point to your lib-common.php
require_once('C:/aohweb/public_html/lib-common.php'); // You MUST enter the correct path here
$start_display .= COM_siteHeader(); // use 'none' if you do not want the left blocks
echo $start_display;
// Put your php code here and add everything to the $display variable you want displayed
/*
-----------------------------------------
CafePress Custom Store Script 1.0.16
-----------------------------------------
This script is designed to allow CafePress Basic (free) store owners to incorporate
their store into their own web site. This script can also be used with my random
item script which features any randomly selected item from your store(s) on any
page of your site.
Created and copyright by admin@notonebit.com Mar-23-2003
Last updated: Jan-13-2006
This code is released under the terms of the GNU General Public License
A copy of the GPL can be found at http://www.gnu.org/copyleft/gpl.html
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
Please retain this message at the top of this script if you modify it in any way.
---------------------------------------------------------------------------------
INSTRUCTIONS:
1. First, your web server must have PHP 4.1.0 or later installed for this script to function properly.
You must also be able to run the fsockopen() function.
2. This script will display all the products from the stores you specify on one page. Each item
is linked to a detailed version of itself using this same script. Items are retrieved in real time,
so if you have many items in many stores, your page may take several seconds to fully load all of
CafePress' hosted images.
3. To setup the script, edit the $stores variable below to be a list of your stores. THAT'S IT!
4. You can run this script as an include file within an existing PHP page, cutting-and-pasting the script
into your own PHP page, or as a standalone page. If you choose to run it as a standalone page, you'll
need to add the appropriate HTML around it in order for it to display properly ( etc...).
5. Rename this script to store.php.
Your feedback is welcomed. If you have any questions or comments please email me at scanman20@hotmail.com
-Admin
-------------- SCRIPT BEGINS AFTER THIS LINE -----------------------------------------------*/
// SET VARIABLES //
$start = '';
$end = '';
$stores = 'irish_shop'; //EDIT THIS VARIABLE TO BE A LIST OF YOUR STORES
$url = 'http://www.cafepress.com/';
$item = $_GET['item'];
// WRITE CAFEPRESS JAVASCRIPT TO PAGE //
echo '';
if ($item) { // Script has been called with a specific item, bring up detail page.
$detail = $url . $item;
$fp = fsockopen ("www.cafepress.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)
n";
} else {
fputs ($fp, "GET /$item HTTP/1.0rnHost: www.cafepress.comrnUser-Agent: MS Internet Explorerrnrn");
while (!feof($fp)) {
$content .= fgets($fp,1024);
}
fclose ($fp);
}
$null = eregi("$start(.*)$end", $content, $cparray);
$pattern = "//cp/";
$replacement = "http://www.cafepress.com/cp";
$itemdetail = preg_replace($pattern, $replacement, $cparray[1]);
$largeImgPattern = "/
$largeImgReplacement = "
$itemdetail = preg_replace($largeImgPattern, $largeImgReplacement, $itemdetail);
// The next four lines aren't truly necessary. They 1)make the add to cart button pop up //
// in its own window with the keep shopping button returning you to your custom store //
// 2)add a view cart button (very handy) and 3) change the link to the CP legal questions page //
// The view cart button can be found at http://www.notonebit.com/forum/viewtopic.php?t=95
$itemdetail = preg_replace("//i", "", $itemdetail);
$itemdetail = preg_replace("/
$itemdetail = preg_replace("/alt="Add to Cart">/", "alt="Add to Cart"> ", $itemdetail);
$itemdetail = preg_replace("/
$itemdetail = preg_replace("/src="/content//", "src="http://www.cafepress.com/content/", $itemdetail);
echo "";
echo "function e (z, h, w, b, g) {";
echo "document.write('')";
echo "}";
echo "";
echo $itemdetail;
}
else { // No item was requested when script was called, show items from all stores in the $stores variable.
$allitems = $url . $stores;
// connect to CP
$reqheader = "GET /$stores HTTP/1.0rnHost: www.cafepress.comrnUser-Agent: MS Internet Explorerrnrn";
$socket = @fsockopen("www.cafepress.com", 80, &$errno, &$errstr);
if ($socket)
{
fputs($socket, $reqheader);
while (!feof($socket))
{
$content .= fgets($socket, 4096);
}
}
fclose($socket);
$null = eregi("$start(.*)$end", $content, $cparray);
$pattern = "/
$replacement = "
$storeitems = preg_replace($pattern, $replacement, $cparray[1]);
$storeitems = preg_replace("/src="/content/promo//", "src="http://www.cafepress.com/content/promo/", $storeitems);
$storeitems = preg_replace("//cp/img/saletag.gif/", "http://www.cafepress.com/cp/img/saletag.gif", $storeitems);
$storeitems = preg_replace("//cp/img/fathersday_prodtag.gif/", "http://www.cafepress.com/cp/img/fathersday_prodtag.gif", $storeitems);
$storeitems = preg_replace("//cp/popupsurvey.aspx/", "http://www.cafepress.com/cp/popupsurvey.aspx", $storeitems);
echo $storeitems;
}
//
//$display .= COM_endBlock(yes);
$display .= COM_siteFooter(yes); // use yes if you want the right blocks
echo $display;
?>