andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


Is CafeBox still working ?

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> CafePress Box
View previous topic :: View next topic  
Author Message
VictoriaDate
Newbie


Joined: 24 Aug 2004
Posts: 3

PostPosted: Tue Aug 24, 2004 4:08 pm    Post subject: Is CafeBox still working ? Reply with quote

I just downloaded the latest copy I could find, installed this as a module for Mambo, tweaked the settings, set up the online store at CP and I keep getting the "no products found" message in the box.

Here are my settings (this is a free account):

require_once 'class.cafepress.php';
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$cp = new cafePressBox('victoriadate');
$cp->setCacheDir('../uploadfiles');
$cp->setCacheTime(86000);
$cp->setCacheImages(true);
$cp->setTemplate('<div align="center">[IMG]<br>[TXT]</div>');
$content = "
<div align=center>
<TABLE width=\"100%\" border=0 cellPadding=0 cellSpacing=0 align=center>
<TBODY>
<TR>
<TD>
<CENTER>";
$cp->setResizeCachedImages(75);
$cp->setStore($params->store);
$cp->displayItem(true);
$content .= "
</CENTER>
</TD>
</TR>
</TBODY>
</TABLE>
</div>
";

HELP! =)
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Wed Aug 25, 2004 2:40 am    Post subject: Reply with quote

Hi, and welcome to the board!

I got word from a user the other day that CafePress were merging their domains, so instead of cafeshops.com and cafepress.com, it will just be cafepress.com. I haven't gotten aorudn to updating the script yet, so here's the email - perhaps it will lend you assistance in fixing the issue yourself? (note: I have not tried out the fix myself yet.)

Quote:
CafePress announced a couple of days ago the mergin of the cafeshops.com and cafepress.com domains, effectively moving everyone's stores to the cafepress.com domain. URL structures remain the same, however, and browsers are redirected automatically.

As the cafepressbox class you've written uses standard PHP sockets, this redirection fails, and the component needs to connect to the cafepress.com server directly, rather than cafeshops.com. A simple search and replace, changing one to the other, does the trick.


andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
VictoriaDate
Newbie


Joined: 24 Aug 2004
Posts: 3

PostPosted: Wed Aug 25, 2004 3:46 pm    Post subject: Reply with quote

I can confirm that this doesn't solve the problem, however, would caching need to be "flushed" at all in order to reload things ?
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Wed Aug 25, 2004 4:20 pm    Post subject: Reply with quote

yeah, probably best you clean out the cache files first.;
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
VictoriaDate
Newbie


Joined: 24 Aug 2004
Posts: 3

PostPosted: Wed Aug 25, 2004 6:16 pm    Post subject: Reply with quote

Cleared out the cache dir (there was nothing in it) and still no go. I still get the message "no products found".
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Fri Aug 27, 2004 5:49 am    Post subject: Reply with quote

Okay, I tried a fix and it worked just fine.

The lines in getProducts that look like this:

Code:

if ($this->categoryID === false)
{
    $reqheader = "GET /cp/store.aspx?s={$this->storeID} HTTP/1.0\r\nHost: www.cafeshops.com\r\nUser-Agent: RandomProduct\r\n\r\n";
}
else
{
    $reqheader = "GET /cp/store.aspx?s={$this->storeID}.{$this->categoryID} HTTP/1.0\r\nHost: www.cafeshops.com\r\nUser-Agent: RandomProduct\r\n\r\n";
}
$socket = @fsockopen("www.cafeshops.com", 80, $errno, $errstr, 60);


change to look like this:

Code:

if ($this->categoryID === false)
{
    $reqheader = "GET /cp/store.aspx?s={$this->storeID} HTTP/1.0\r\nHost: www.cafepress.com\r\nUser-Agent: RandomProduct\r\n\r\n";
}
else
{
    $reqheader = "GET /cp/store.aspx?s={$this->storeID}.{$this->categoryID} HTTP/1.0\r\nHost: www.cafepress.com\r\nUser-Agent: RandomProduct\r\n\r\n";
}
$socket = @fsockopen("www.cafepress.com", 80, $errno, $errstr, 60);


and that's it... Clear out your cache and reload.

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> CafePress Box All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group