The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||
At this time this mod is not functioning correctly. Cafepress has redone their free site template and it will take a rewrite of this mod to get it to work again. Not extremely difficult, just time consuming. Unfortunately, 2 jobs, a sick kid and commercial work leaves free time few and far between nowadays. I will try and work on it when I can. If any other coder out there is interested they are free to take what I have and run with it, just like Creed posted on his original code.
This is a reworked version of the abandoned Cafe Press mod done by Creed. This add-on will allow you to add all the items from any of your Cafe Press store's or multiples if you so choose. If you have multiple stores you are going to use, make sure you separate each store name with a comma. This add-on works with Cafe Press basic store, as well as with premium stores. Two files to upload. One (optional) Template Edit. Basic Store Demo Basic Store Single Item Demo If you have at least 2.0.3 installed then only change needed is to replace the shop.php file. You do not need to reimport the product. PREMIUM OWNERS PLEASE READ!! I will not be able to officially support the shops of premium owners. The main problem is that there is no standardization on the templates available to premium users, especially in the css and notes markup which is what I count on for the script, and it's unrealistic to try and code for each one. The shop works for premium shops with the default template and no css added. A lot of the templates mess up the formatting. I will help with what I can but there is only so much I can do. When asking for help please include the following: path to your shop.php file store id template used (if possible) Version History v2.0.8 - [Tue 22th July 2008] Removed Call-time pass-by-reference Modified code to be xhtml valid (Thanks Enclave) v2.0.7 - [Fri 11th July 2008] Fixed category links v2.0.6 - [Fri 27th June 2008] Fixed link to create your own online shop v2.0.5 - [Fri 27th June 2008] Moved View Cart button to get it out of the Add to Cart form Fixed hard code from store.php to shop.php Added security for GET variable *Thanks Tim ![]() v2.0.4 - [Fri 27th June 2008] Removed cream background color on item view Added navbar link to go back to main shop Fixed mouseover color changes Fixed Larger Image link v2.0.3 - [Thur 26th June 2008] Changed into a VB Product Moved settings to AdminCP Added AdSense capabilities fixed bug with accessing some images on local drive instead of cafepress v2.0.1 - [Sat 14th June 2008] Changed qualification to pull in content to deal with multiple page types (shop.php File Change only, nothing else needed) v2.0.0 - [Fri 13th June 2008] Initial Release Show Your Support
|
Comments |
#32
|
||||
|
||||
![]()
installed and uninstalled Didnt work so hot with moded Cafe Press CSS
www.cafepress.com/DieselBombers |
#33
|
|||
|
|||
![]() Quote:
|
#34
|
|||
|
|||
![]()
Hmmm.... When I click on an item to test out the single item view I get sent directly to cafepress...
Have I done something odd? |
#35
|
|||
|
|||
![]()
No, right now it sends you to cafe press. I'm reworking it so it'll keep it locally except for adding to the cart and checkout.
|
#36
|
|||
|
|||
![]()
i have uploaded the file in the right pace and edited the navbar template like you and
i get this message when i click to navbar shop Code:
CafePress.com Product Not Found We are sorry, but the product you requested could not be found. The page you are looking for may have been renamed, moved, or deleted. You may click on the "reload" button on your browser, or wait and try connecting again later. Please check the URL for spelling, capitalization, and punctuation errors, and click the "reload" button on your browser. Are you having trouble finding something? Let us personally help you. Call us. It's toll-free! US Phone: 1-877-809-1659 Service Hours Or contact Customer Service via email. Code:
-------------- SCRIPT BEGINS AFTER THIS LINE -----------------------------------------------*/ // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'shop'); // change this depending on your filename // ################### PRE-CACHE TEMPLATES AND DATA ###################### // get special phrase groups $phrasegroups = array( ); // get special data templates from the datastore $specialtemplates = array( ); // pre-cache templates used by all actions $globaltemplates = array( 'CAFEPRESS', ); // pre-cache templates used by specific actions $actiontemplates = array( ); // ######################### REQUIRE BACK-END ############################ require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = array(); $navbits[$parent] = 'Cafe Press Shop'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); echo $stylevar[htmldoctype]; echo "<html dir=\"" . $stylevar[textdirection] . "\" lang=\"" . $stylevar[languagecode] . "\">\n"; echo "<head>\n"; echo "<title>" . $vboptions[bbtitle] . " Cafe Press Shop</title>\n"; echo $headinclude; echo "</head>\n"; echo "<body>\n"; echo $header; echo $navbar; echo "<style type=\"text/css\">\n"; echo ".head {font-weight: bold; font-size: 1.5em}\n"; echo "</style>\n"; // SET VARIABLES // $test = '<!-- SHOP CATEGORIES -->'; $test1 = '<!-- Start Main Content -->'; $stores = 'AbsolutGr_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 '<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); } $start = '<!-- Start Main Content -->'; $end = '<!-- End Content, Start Footer Include -->'; $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("/src=\"\/content/", "src=\"http://www.cafepress.com/content", $itemdetail); $itemdetail = preg_replace("/<form method=\"post\" name=\"prod_detail_form\" 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("/alt=\"Add to Cart\">/", "alt\"Add to Cart\" > <input type=image src=\"images/misc/btn_viewcart.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;\">", $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+'\"></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); if (eregi($test, $content)) { $start = '<!-- SHOP CATEGORIES -->'; $end = '<!-- End Content, Start Footer Include -->'; $null = eregi("$start(.*)$end", $content, $cparray); $pattern = "/<a href=\"\//"; $replacement = "<a href=\"http://www.cafepress.com/"; $storeitems = preg_replace($pattern, $replacement, $cparray[1]); $storeitems = preg_replace("/\/cp\//", "http://www.cafepress.com/cp/", $storeitems); $storeitems = preg_replace("/src=\"\/content/", "src=\"http://www.cafepress.com/content", $storeitems); echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo "<tr>\n"; echo "<td VALIGN=\"TOP\">\n"; echo $storeitems; echo "</td>\n"; echo "</tr>\n"; echo "</table>\n"; } elseif (eregi($test1, $content)) { $start = '<!-- Start Main Content -->'; $end = '<!-- End Content, Start Footer Include -->'; $null = eregi("$start(.*)$end", $content, $cparray); $pattern = "/<a href=\"\//"; $replacement = "<a href=\"http://www.cafepress.com/"; $storeitems = preg_replace($pattern, $replacement, $cparray[1]); $storeitems = preg_replace("/\/cp\//", "http://www.cafepress.com/cp/", $storeitems); $storeitems = preg_replace("/src=\"\/content/", "src=\"http://www.cafepress.com/content", $storeitems); echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo "<tr>\n"; echo "<td VALIGN=\"TOP\">\n"; echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td VALIGN=\"TOP\">\n"; echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td VALIGN=\"TOP\">\n"; echo $storeitems; } else { $start = '<!-- basic shop coupon goes here \(max width 600px\)-->'; $end = '<!-- End Body Table -->'; $null = eregi("$start(.*)$end", $content, $cparray); $pattern = "/<a href=\"\//"; $replacement = "<a href=\"http://www.cafepress.com/"; $storeitems = preg_replace($pattern, $replacement, $cparray[1]); $storeitems = preg_replace("/\/cp\//", "http://www.cafepress.com/cp/", $storeitems); $storeitems = preg_replace("/src=\"\/content/", "src=\"http://www.cafepress.com/content", $storeitems); echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo "<tr>\n"; echo "<td VALIGN=\"TOP\">\n"; echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td VALIGN=\"TOP\">\n"; echo " <table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo " <tr>\n"; echo " <td VALIGN=\"TOP\">\n"; echo $storeitems; } } echo $footer; echo "</body>\n"; echo "</html>"; ?> |
#37
|
|||
|
|||
![]()
Great! I'm glad to have this finally working again. Wonderful job.
One question, if you have an item in your shop that is available in more colors they put an image beneath the product that says "More Colors Available." For some reason those images aren't being shown when viewing the shop.php, but once I'm at the Cafepress site they work fine (obviously). Any idea on a way to make this work? http://www.elantraxd.com/forums/shop.php |
#38
|
|||
|
|||
![]()
The part in shop.php where you set the $stores variable is wrong. If you go to your shop it's pretty much
http://www.cafepress.com/your_store_name That is what you need to put there. I went to yours http://www.cafepress.com/AbsolutGr_shop and got the same error. Quote:
|
#39
|
|||
|
|||
![]() Quote:
|
#40
|
|||
|
|||
![]()
Good stuff.
|
#41
|
||||
|
||||
![]()
I notice the more colors image is trying to load directly from my site, rather then CafePress: http://www.cafepress.com/content/mar...morecolors.gif Any way to fix that?
|
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|