![]() |
||||
| Please send contributions to: "Green Party of Suffolk County," 14 Robin Drive, Huntington, NY 11743-4712. Please include your name, address, occupation, and employer. This information is needed to comply with election law. Contributions are not tax deductible. We do not accept corporate contributions. |
||||
|
Ecological Wisdom Grassroots Democracy Social & Economic Justice Nonviolence |
/*
-----------------------------------------
CafePress Custom Store Script 1.0.9
-----------------------------------------
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 scanman20@hotmail.com Mar-23-2003
Last updated: Oct-08-2003
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
-Scanman20
-------------- SCRIPT BEGINS AFTER THIS LINE -----------------------------------------------*/
// SET VARIABLES //
$start = '';
$end = '';
$stores = 'gpsuffolk,gpsuffolk1,gpsuffolk2,gpsuffolk3'; //EDIT THIS VARIABLE TO BE A LIST OF YOUR STORES
$url = 'http://www.cafeshops.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.cafeshops.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno) \n"; } else { fputs ($fp, "GET /$item HTTP/1.0\r\nHost: www.cafeshops.com\r\nUser-Agent: MS Internet Explorer\r\n\r\n"); while (!feof($fp)) { $content .= fgets($fp,1024); } fclose ($fp); } $null = eregi("$start(.*)$end", $content, $cparray); $pattern = "/\/cp/"; $replacement = "http://www.cafeshops.com/cp"; $itemdetail = preg_replace($pattern, $replacement, $cparray[1]); $largeImgPattern = "//i", " | ", $itemdetail);
$itemdetail = preg_replace("/law. ";
echo "function e (z, h, w, b, g) {";
echo "document.write('|