TinyPortal

Development => Support => Topic started by: foreverpurple on May 20, 2006, 09:03:34 PM

Title: Cafepress block?
Post by: foreverpurple on May 20, 2006, 09:03:34 PM
I was wondering about getting a Cafepress block to display items from my store.  It would be even better if the block let you choose which items were displayed based on their tags.
Title: Re: Cafepress block?
Post by: RoarinRow on May 20, 2006, 09:10:32 PM
Quote from: foreverpurple on May 20, 2006, 09:03:34 PM
I was wondering about getting a Cafepress block to display items from my store.  It would be even better if the block let you choose which items were displayed based on their tags.

I use the random image snippet to display the items on my Cafepress store.  When members click on the picture it brings them to the main page of the store, however, you can configure it to go directly to the pictured item.  Check it out here on the right block - AVS Gift Shop (http://www.avalanchestyle.com/forum/index.php?action=forum)
Title: Re: Cafepress block?
Post by: foreverpurple on May 20, 2006, 10:44:17 PM
Could you walk me through setting it up?  I'm fairly php illiterate though I'm trying.  I tried the coppermine random image block and it's not working so I must be doing something wrong.  I know there is a code snippet for this so I'll get it, try it and see if I can make it work.
Title: Re: Cafepress block?
Post by: RoarinRow on May 20, 2006, 11:03:46 PM
I got the snippet from here - A Random Picture/Banner Script (http://www.tinyportal.net/smf/index.php?topic=4220.0).  To me it was easier than the instructions for the random Coppermine setup.
Title: Re: Cafepress block?
Post by: foreverpurple on May 20, 2006, 11:24:39 PM
I think I got it.  I just save copies of my cafepress images to the folder and its working :)

Now to figure out coppermine ...grr
Title: Re: Cafepress block?
Post by: RoarinRow on May 20, 2006, 11:33:48 PM
Quote from: foreverpurple on May 20, 2006, 11:24:39 PM
I think I got it.  I just save copies of my cafepress images to the folder and its working :)

Now to figure out coppermine ...grr

I don't have patience for that one.  Good luck!   :up:
Title: Re: Cafepress block?
Post by: SoulPleX on August 22, 2007, 06:22:31 PM
Here is a snippet of code i us on my phpnuke site. It doesnt work on SMF. If anyone wants to convert it.

<?php

if (eregi("block-CafePress.php",$PHP_SELF)) {
    
Header("Location: index.php");
    die();
}

/************************************************************************/
/* CAFEPRESS.COM Block V1.1 : For PHP-NUKE: A FREE Web Portal System    */
/* =================================================================    */
/*                                                                      */
/* Copyright (c) 2002 by Carl W. Brooks (info@palmloyal.com)            */
/* http://www.palmloyal.com                                             */
/*                                                                      */
/* To use this PHPNuke block you only need to download .jpg images      */
/* from CafePress.com site and copy them to the /images/cafepress       */
/* directory, then edit the $cafepress_id variable to fit your ID       */
/* of the Associates program. If you don't change the ID, all           */
/* the comissions ($) will go to my account! You're advised.            */
/* But if you want to help Palmloyal.com out, you can leave the         */
/* $cafepress_id variable intact.                                       */
/*                                                                      */
/* Dec 31, 2002 - V1.0 Created Block                                    */
/* Jan 01, 2003 - V1.1 Modified to include CafePress Referral Link      */
/* Jan 03, 2003 - V1.1 Modified to have fixed 150 x 150 size for images */
/*                                                                      */
/* PHP-NUKE - Copyright(c) 2001 by Francisco Burzi(fbc@mandrakesoft.com)*/
/* http://phpnuke.org                                                   */
/*                                                                      */
/* Both are 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.       */
/************************************************************************/

$cafepress_id "soulplex";

mt_srand((double)microtime()*1000000);
$imgs dir('images/cafepress');
while (
$file $imgs->read()) {
    if (
eregi("gif"$file) || eregi("jpg"$file)) {
        
$imglist .= "$file ";
    }
}
closedir($imgs->handle);
$imglist explode(" "$imglist);
$a sizeof($imglist)-2;
$random mt_rand(0$a);
$image $imglist[$random];
$prodid explode("."$image);
if ((
$prodid) AND ($image)) {
$content "<center><a href=\"http://www.cafeshops.com/cp/prod.aspx?p=$cafepress_id.$prodid[0]\" target=\"_blank\">";
$content .= "<img src=\"images/cafepress/$image\" border=\"0\" width=\"150\" height=\"150\" alt=\"Support this site by buying Logo Products\"></center>";
        }
$content .= "<center><a href=\"http://www.cafeshops.com/$cafepress_id\" target=\"_blank\">Click Here To See More Items...</a></center>";
$content .= "<hr><center><font size=-2><a href=\"http://www.cafepress.com/cp/info/storeref.aspx?refby=$cafepress_id\" target=\"_blank\">Sell Your Own Logo Items</a></font></center>";

?>