Posted on: 10/13/04 09:49pm
By: jhackwith
<?php // This path should point to your lib-common.php require_once('/home/jasonhackwith/intotheflame.com/lib-common.php'); $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 /* global $storeid; include("cpstore.inc"); ##### ##### the first field is all your store ids seperated by a comma ##### in the second field just change this to your website. open_store($storeid, "/store.php"); */ /* ----------------------------------------- CafePress Custom Store Script 1.0.11 ----------------------------------------- Fixes by James "destr0yr" Bothe - www.okanagangirlz.com - Fixed "Questions?" link when viewing larger image. Line 116 preg_replace was not replacing the code properly. - Fixed "View Larger Images". Cafepress changed something and line 124 needed updating. ----------------------------------------- CafePress Custom Store Script 1.0.10 ----------------------------------------- Incorperated into GeekLog by Neal "ScurvyDawg" Cropper - www.scurvydawg.com - Added Geelog Wrapper Functions - Removed PHPNuke calls I found that the Cafepress stores that I had created in 2002 were different in structure than than newly created stores. If the script does not function correctly in your GeekLog try creating a new store. If you would like it, my Cafepress referrer URL is http://www.cafepress.com/cp/info/storeref.aspx?refby=scurvyd scurvydawg@scurvydawg.com ----------------------------------------- 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 (<HTML><HEAD><BODY> 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 = '<!-- Start Main Content -->'; $end = '<!-- End Content, Start Footer Include -->'; $stores = 'itfstore'; //EDIT THIS VARIABLE TO BE A LIST OF YOUR STORES $url = 'http://www.cafepress.com/'; $item = $_GET['item']; // WRITE CAFEPRESS JAVASCRIPT TO PAGE // echo '<script language="JavaScript1.1" src="http://www.cafepress.com/commonscripts.js"></script>'; 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)<br>\n"; } else { fputs ($fp, "GET /$item HTTP/1.0\r\nHost: www.cafepress.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.cafepress.com/cp"; $itemdetail = preg_replace($pattern, $replacement, $cparray[1]); $largeImgPattern = "/<a href=\"\//"; $largeImgReplacement = "<a href=\"store.php?item="; $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 (vey handy) and 3) change the link to the CP legal questions page // $itemdetail = preg_replace("/<form method=\"post\" action=\"http:\/\/www.cafepress.com\/cp\/addtocart.aspx\">/i", "<form method=\"post\" name=cart action=\"http://www.cafepress.com/cp/addtocart.aspx?keepshopping=javascript:self.close()\" target=\"cartWin\">", $itemdetail); $itemdetail = preg_replace("/<input type=\"submit\"/", "<input type=submit onClick=\"cartWin = window.open ('','cartWin','toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500'); cartWin.focus(); return true;\"", $itemdetail); $itemdetail = preg_replace("/Value=\"Add to Cart\"><\/td>/", "Value=\"Add to Cart\" > <input type=image src=viewcart_btn.gif onClick=\"cartWin = window.open ('http://www.cafepress.com/cp/viewcart.aspx','cartWin','toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500'); cartWin.focus(); return true;\"></td>", $itemdetail); // Fixed (works): $itemdetail = preg_replace("/<a href=\"http:\/\/www.cafepress.comhttp:\/\/www.cafepress.com/" , "<a href=\"http://www.cafepress.com", $itemdetail); echo "<script>"; echo "function e (z, h, w, b, g) {"; // Fixed (works): echo "document.write('<div style=\"width:'+w+';height:'+h+';background:white url(http://zoom.cafepress.com/'+(z%10)+'/'+z+'_zoom.jpg) no-repeat center center;\"><img border=\"'+b+'\" class=\"imageborder\" src=\"http://www.cafepress.com/cp/img/'+(g?'zoom':'spacer')+'.gif\" width=\"'+w+'\" height=\"'+h+'\"></div>')"; echo "}"; echo "</script>"; 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.0\r\nHost: www.cafepress.com\r\nUser-Agent: MS Internet Explorer\r\n\r\n"; $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 = "/<a href=\"\//"; $replacement = "<a href=\"store.php?item="; $storeitems = preg_replace($pattern, $replacement, $cparray[1]); $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(); $display .= COM_siteFooter(); // use yes if you want the right blocks echo $display; ?>
Posted on: 10/13/04 10:00pm
By: destr0yr
<?php require_once('/home/okanagan/public_html/lib-common.php'); echo COM_siteHeader(); $start = '<!-- Start Main Content -->'; $end = '<!-- End Content, Start Footer Include -->'; $stores = 'okanagangirlz,okanagangirls'; //EDIT THIS VARIABLE TO BE A LIST OF YOUR STORES $url = 'http://www.cafepress.com/'; $item = $_GET['item']; echo '<script language="JavaScript1.1" src="http://www.cafepress.com/commonscripts.js"></script>'; 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 = "/<a href="//"; $largeImgReplacement = "<a href="store.php?item="; $itemdetail = preg_replace($largeImgPattern, $largeImgReplacement, $itemdetail); $itemdetail = preg_replace("/<form method="post" action="http://www.cafepress.com/cp/addtocart.aspx">/i", "<form method="post" name=cart action="http://www.cafepress.com/cp/addtocart.aspx?keepshopping=javascript:self.close()" target="cartWin">", $itemdetail); $itemdetail = preg_replace("/<input type="submit"/", "<input type=submit onClick="cartWin = window.open ('','cartWin','toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500'); cartWin.focus(); return true;"", $itemdetail); $itemdetail = preg_replace("/Value="Add to Cart"></td>/", "Value="Add to Cart" > <input type=image src=viewcart_btn.gif onClick="cartWin = window.open ('http://www.cafepress.com/cp/viewcart.aspx','cartWin','toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500'); cartWin.focus(); return true;"></td>", $itemdetail); $itemdetail = preg_replace("/<a href="http://www.cafepress.comhttp://www.cafepress.com/" , "<a href="http://www.cafepress.com", $itemdetail); echo "<script>"; echo "function e (z, h, w, b, g) {"; echo "document.write('<div style="width:'+w+';height:'+h+';background:white url(http://zoom.cafepress.com/'+(z%10)+'/'+z+'_zoom.jpg) no-repeat center center;"><img border="'+b+'" class="imageborder" src="http://www.cafepress.com/cp/img/'+(g?'zoom':'spacer')+'.gif" width="'+w+'" height="'+h+'" alt="" /></div>')"; echo "}"; echo "</script>"; echo $itemdetail; } else { from all stores in the $stores variable. $allitems = $url . $stores; $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 = "/<a href="//"; $replacement = "<a href="store.php?item="; $storeitems = preg_replace($pattern, $replacement, $cparray[1]); $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; } // echo COM_siteFooter(); // use yes if you want the right blocks echo $display; ?>
Posted on: 10/14/04 06:59pm
By: ScurvyDawg
Posted on: 10/14/04 07:59pm
By: jhackwith
Posted on: 10/14/04 08:10pm
By: ScurvyDawg
Posted on: 10/14/04 11:51pm
By: jhackwith
Posted on: 10/15/04 09:44am
By: ScurvyDawg
Posted on: 10/15/04 12:41pm
By: jhackwith
<?php // This path should point to your lib-common.php require_once('/home/.halima/jasonhackwith/intotheflame.com/lib-common.php'); $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 /* global $storeid; include("cpstore.inc"); ##### ##### the first field is all your store ids seperated by a comma ##### in the second field just change this to your website. open_store($storeid, "/store.php"); */ /* ----------------------------------------- CafePress Custom Store Script 1.0.11 ----------------------------------------- Fixes by James "destr0yr" Bothe - www.okanagangirlz.com - Fixed "Questions?" link when viewing larger image. Line 116 preg_replace was not replacing the code properly. - Fixed "View Larger Images". Cafepress changed something and line 124 needed updating. ----------------------------------------- CafePress Custom Store Script 1.0.10 ----------------------------------------- Incorperated into GeekLog by Neal "ScurvyDawg" Cropper - www.scurvydawg.com - Added Geelog Wrapper Functions - Removed PHPNuke calls I found that the Cafepress stores that I had created in 2002 were different in structure than than newly created stores. If the script does not function correctly in your GeekLog try creating a new store. If you would like it, my Cafepress referrer URL is http://www.cafepress.com/cp/info/storeref.aspx?refby=scurvyd scurvydawg@scurvydawg.com ----------------------------------------- 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 (<HTML><HEAD><BODY> 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 = '<!-- Start Main Content -->'; $end = '<!-- End Content, Start Footer Include -->'; $stores = 'itfstore'; //EDIT THIS VARIABLE TO BE A LIST OF YOUR STORES $url = 'http://www.cafepress.com/'; $item = $_GET['item']; // WRITE CAFEPRESS JAVASCRIPT TO PAGE // echo '<script language="JavaScript1.1" src="http://www.cafepress.com/commonscripts.js"></script>'; 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)<br>\n"; } else { fputs ($fp, "GET /$item HTTP/1.0\r\nHost: www.cafepress.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.cafepress.com/cp"; $itemdetail = preg_replace($pattern, $replacement, $cparray[1]); $largeImgPattern = "/<a href=\"\//"; $largeImgReplacement = "<a href=\"store.php?item="; $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 (vey handy) and 3) change the link to the CP legal questions page // $itemdetail = preg_replace("/<form method=\"post\" action=\"http:\/\/www.cafepress.com\/cp\/addtocart.aspx\">/i", "<form method=\"post\" name=cart action=\"http://www.cafepress.com/cp/addtocart.aspx?keepshopping=javascript:self.close()\" target=\"cartWin\">", $itemdetail); $itemdetail = preg_replace("/<input type=\"submit\"/", "<input type=submit onClick=\"cartWin = window.open ('','cartWin','toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500'); cartWin.focus(); return true;\"", $itemdetail); $itemdetail = preg_replace("/Value=\"Add to Cart\"><\/td>/", "Value=\"Add to Cart\" > <input type=image src=viewcart_btn.gif onClick=\"cartWin = window.open ('http://www.cafepress.com/cp/viewcart.aspx','cartWin','toolbar=yes,location=no,directories=no,status=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=800,height=500'); cartWin.focus(); return true;\"></td>", $itemdetail); // Original (broken): // $itemdetail = preg_replace("/law. <a href=\"http:\/\/www.cafepress.comhttp:\/\/www.cafepress.com/" , "law. <a href=\"http://www.cafepress.com", $itemdetail); // Fixed (works): $itemdetail = preg_replace("/<a href=\"http:\/\/www.cafepress.comhttp:\/\/www.cafepress.com/" , "<a href=\"http://www.cafepress.com", $itemdetail); echo "<script>"; echo "function e (z, h, w, b, g) {"; // Original (broken) // echo "document.write('<div style=\"width:'+w+';height:'+h+';url(http://zoom.cafepress.com/'+(z%10)+'/'+z+'_zoom.jpg) no-repeat center center;\"><img border=\"'+b+'\" class=\"imageborder\" src=\"http://www.cafepress.com/cp/img/'+(g?'zoom':'spacer')+'.gif\" width=\"'+w+'\" height=\"'+h+'\"></div>')"; // Fixed (works): echo "document.write('<div style=\"width:'+w+';height:'+h+';background:white url(http://zoom.cafepress.com/'+(z%10)+'/'+z+'_zoom.jpg) no-repeat center center;\"><img border=\"'+b+'\" class=\"imageborder\" src=\"http://www.cafepress.com/cp/img/'+(g?'zoom':'spacer')+'.gif\" width=\"'+w+'\" height=\"'+h+'\"></div>')"; echo "}"; echo "</script>"; 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.0\r\nHost: www.cafepress.com\r\nUser-Agent: MS Internet Explorer\r\n\r\n"; $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 = "/<a href=\"\//"; $replacement = "<a href=\"store.php?item="; $storeitems = preg_replace($pattern, $replacement, $cparray[1]); $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(); $display .= COM_siteFooter(); // use yes if you want the right blocks echo $display; ?>
// 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 (vey handy) and 3) change the link to the CP legal questions page //
Posted on: 10/15/04 05:54pm
By: ScurvyDawg
Posted on: 10/16/04 07:10pm
By: Anonymous (Spider)
Posted on: 10/16/04 07:32pm
By: ScurvyDawg
Posted on: 10/25/04 06:12pm
By: jhackwith
Posted on: 10/25/04 06:22pm
By: ScurvyDawg
Posted on: 10/25/04 11:20pm
By: Anonymous (anon)
Posted on: 10/26/04 12:52am
By: ScurvyDawg
Posted on: 10/26/04 07:18pm
By: ScurvyDawg