#VERSION: 2.7.beta3c ##################################################################### # This script is copyright (c)2002-2008 - 1001 Media Group. # # Please do not distribute it without permission. # ##################################################################### # __ __ # # /\ \ /\ \ # # ___ _____ ____\ \ \___ ___ _____\ \ \ # # /'___\/\ '__`\ /',__\\ \ _ `\ / __`\/\ '__`\ \_\ # # /\ \__/\ \ \L\ \/\__, `\\ \ \ \ \/\ \L\ \ \ \L\ \/_/_ # # \ \____\\ \ ,__/\/\____/ \ \_\ \_\ \____/\ \ ,__/ /\_\ # # \/____/ \ \ \/ \/___/ \/_/\/_/\/___/ \ \ \/ \/_/ # # \ \_\ \ \_\ # # \/_/ \/_/ # # # ########### ports multiple CafePress stores to your server ########## ################ http://cgi.marty.net/scripts/cpshop/ ############### ##################################################################### ##################################################################### ##################################################################### ##################################################################### # # SUBROUTINES # ##################################################################### ##################################################################### ##################################################################### ##################################################################### use locale; $servertime = time; if (-e "${script_dir}onesetup.dat") { $script_dir = ""; } if ($ENV{'SCRIPT_NAME'} && ($ENV{'PATH_INFO'} =~ /$ENV{'SCRIPT_NAME'}/)) { $badpathinfo = 1; $ENV{'PATH_INFO'} =~ s/$ENV{'SCRIPT_NAME'}//; } $ENV{'PATH_INFO'} =~ s|^/||; $ENV{'PATH_INFO'} =~ s|/$||; $ENV{'PATH_INFO'} =~ s|^/||; if ($ENV{'PATH_INFO'}) { $ENV{'PATH_INFO'} = "/$ENV{'PATH_INFO'}"; } if ($ENV{'QUERY_STRING'} eq "logout") { print "Set-Cookie: cpadminpass=; path=/; expires=Tuesday, 01-Jan-80 00:00:00 GMT;\n"; if ($ENV{'OS'} =~ /windows/i) { print "Content-Type: text/html\n\n"; print qq(Logging Out...Logging out...\n); } else { print "Location: http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}$ENV{'PATH_INFO'}\n\n"; } exit; } &parseform; unless (-e "${script_dir}demo.dat") { print "Set-Cookie: cjpid=; path=/; expires=Tuesday, 01-Jan-80 00:00:00 GMT;\n"; %cookies = &getcookies; $crc_password = &crc32_calc($password); if ($cookies{'cpadminpass'} eq $crc_password) { $good_user = 1; } elsif ($FORM{'password'} eq $password) { print "Set-Cookie: cpadminpass=$crc_password; path=/\n"; $good_user = 1; } unless ($good_user) { &login; } } $main_script = $ENV{'PATH_INFO'}; $main_script =~ s|.*/||g; if ($main_script =~ /cpadmin/i) { $main_script = ""; } if ($FORM{'x'}) { $main_script = $FORM{'x'}; } elsif ($FORM{'xl'}) { $main_script = $FORM{'xl'}; $view_logs = 1; } elsif ($FORM{'editfile'}) { &editfile; exit; } unless ($main_script) { if ($cpshop_filename && -e "${script_dir}$cpshop_filename") { $main_script = "$cpshop_filename"; } elsif ((-e "${script_dir}cpshop.cgi") || (-e "cpshop.cgi")) { $main_script = "cpshop.cgi"; } } &find_other_cpshops; unless ($main_script) { $main_script = $other_cpshops[0]; } &assemble_other_cpshops; unless ((-e "${script_dir}$main_script") || (-e $main_script)) { &error("You're not referencing the script correctly. Please refer to the documentation and try again."); } if ($FORM{'update'} && (!-e "${script_dir}demo.dat")) { &update; } $admin_script = $ENV{'SCRIPT_NAME'}; $admin_script =~ s|.*/||; if ($badpathinfo) { $main_script_url = "$main_script"; $admin_script_url = "http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}"; $admin_script_url_only = "http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}"; } elsif ($ENV{'PATH_INFO'} =~ /$main_script/) { $main_script_url = "../$main_script"; $admin_script_url = "../$admin_script/$main_script"; $admin_script_url_only = "../$admin_script"; } else { $main_script_url = $main_script; $admin_script_url = "$admin_script/$main_script"; $admin_script_url_only = "$admin_script"; } &get_css; if ($view_logs) { &view_logs; } §ions("SECTION","${script_dir}$main_script.config"); &getversions("cpdata","cppage","cplogin"); sub find_other_cpshops { opendir(DIR,"${script_dir}."); @files = readdir(DIR); closedir(DIR); chomp @files; foreach $file(@files) { next if $file =~ /^\W+$/; next if $file =~ /\.(lib|lang)$/; open(FILE,"<$file"); { local $/; $tempfile = ; } if ($tempfile =~ /\&prepare\;/) { push @other_cpshops, $file; } } @other_cpshops = sort @other_cpshops; } sub assemble_other_cpshops { if (scalar(@other_cpshops) > 1) { $other_cpshops = qq(
you\'re currently working with $main_script   |   work with another cpshop:

\n); } } &process_vars; $background_color = "#222222"; if (-d "${script_dir}cplogs") { $poploglink = qq[View Stats]; $poploglink_parens = "($poploglink)"; $poploglink_spacer = "$poploglink   •  "; } $content = <<"ENDHTML"; cpshop Admin: $main_script $css

$other_cpshops
ENDHTML if (-e "demo.dat") { $content .= <<"ENDHTML";
demo mode - saving disabled - view store
ENDHTML } $savebutton = qq(); $savebutton2 = qq(); $content .= <<"ENDHTML";
.
versions: cpdata.lib $VERSION{'cpdata.lib'} / cppage.lib $VERSION{'cppage.lib'} / cplogin.lib $VERSION{'cplogin.lib'}
 cpshop admin
.
.
$main_script   •   $poploglink_spacer Install Guide   •   FAQ   •   Message Board / Search   •   Email Marty   •   Logout
program options   •   logs/statistics   •   homepage   •   linkbar   •   thumbnail page   •   product page   •   other options   •   store ids   •   affiliate
.

..
program options + click here to expand $savebutton2
Basic cpshop settings, including store name, cache settings, default font and template settings, etc.
ENDHTML $content =~ s/\/\?logout/\?logout/; if ($SECTION{'Maintenance'}) { $content .= <<"ENDHTML"; ENDHTML } if ($FORM{'error'}) { $content .= <<"ENDHTML"; ENDHTML } $content .= <<"ENDHTML";
..
program options - click here to minimize $savebutton
YOUR STORE IS CURRENTLY DOWN FOR MAINTENANCE
$FORM{'error'}
Close Store For Maintenance? Check this box to replace your store's content with a "store down for maintenance" message.
Empty Cache Now
Check this box and press the <save all changes> button to empty your cpshop cache, which includes all the files in your "cpcache" directory stored by $main_script. This is something you might want to do if you make changes your products at CafePress (added a product, changed prices, etc.), and want the changes to appear immediately in your cpshop store.
empty cpshop cache when I save changes
Store Name
The name of your store, in text only. No HTML.

Example: Larry's Gift Shop
Display Language
The language you'd like displayed in your store. Most items will be translated to this language, though some text (like Product Information) won't.
Default Store Keywords
The keywords for your main page, also used on other pages if you don't enter store keywords. In the template for your store, use the <[keywords]> tag.

Example: cats, dogs, shirts, hats, stuff to buy
Usage: <meta name=keywords value="<[keywords]>">
Default Store Description
The description for your main page, also used on other pages if you don't enter a store description. In the template for your store, use the <[description]> tag.

Example: Looking for shirts on animals? Look here!
Usage: <meta name=description value="<[description]>">
Error Page URL
If cpshop has trouble connecting to CafePress, it will redirect your customers to this page. If you leave this blank, cpshop will display the maintenance message.

Example: http://$ENV{'HTTP_HOST'}/sorry.html
Default HTML Template
The default template for the site. If you leave this blank, cpshop will use its own boring template.

Example: cptemplate.html or $ENV{'SCRIPT_FILENAME'}_files/ cptemplate.html
Default Font Attributes
The default font attributes for links, captions, etc.

Example: face="arial,helvetica,verdana" size=2
Page Table Width
The width of cpshop page tables, in either pixels or percentage. (It should be at least 450 pixels wide.)

Example: 500 or 100%
Use Clean Store URLs
If you keep getting strange error messages saying that you haven\'t generated a .config file, you should set this to "use query strings." Otherwise, set it to "use clean store URLs." (Note: Windows servers do NOT support clean URLs, so be sure to set this to "use query strings.")
use clean store URLs (with a "/")
use query strings with store URLs (with a "?i=")
Cache Expiration Time
The length of time, in weeks, that cpshop should cache files from CafePress\' server. This really doesn\'t need to be frequent at all; in fact, it\'s a better experience for your customers if it\'s rarely updated. (Instead, you should empty the cache manually when you make changes to your store.)
Refresh cpshop\'s data every
Primary Cache Size
The maximum disk space (in MB) that the primary cache is allowed to use to store product page data. It can fill up pretty quickly, and performance can degrade if the folder gets too big. I recommend setting this to somewhere between 10 and 50 MB.

Example: 25 (or 0 for no limit)
Output Cache Size
The maximum disk space (in MB) that the output cache is allowed to fill. It can fill up pretty quickly, and performance can degrade if the folder gets too big. I recommend setting this to somewhere between 20 and 100 MB. Note: only applicable if you have a correctly configured cpoutput directory.

Example: 50 (or 0 for no limit)
Update Notification Email
If you enter an email address into this field, cpshop will check for updates once a day, and notify you by email if this installation is out of date.

Example: you\@emailaddress.com
..
logs/statistics options + click here to expand $savebutton2
Settings for cpshop\'s basic logging and statistics system.
..
logs/statistics options - click here to minimize $savebutton
Log Detail Level $poploglink_parens
Do you want to keep logs of your traffic, and if so, how detailed do you want that information to be? Do you want to know how many individual users you have, and what they\'re looking at, or do you just want a count of pageviews? Keep in mind that more detailed logs take up more disk space.
keep simple logs (keeps number of pageviews per month, uses negligible disk space)
keep detailed logs (daily info, pageviews, unique visitors, referring pages & more, uses substantially more disk space)
keep no logs
Ignore Bots?
Do you want cpshop to automatically exclude common search engine spiders and bots from your logs?
please ignore spiders and bots when logging (cpshop won\'t log them)
don\'t ignore spiders and bots when logging (cpshop will log them)
IP Ignore List
Enter a comma-separated list of IP addresses you\'d like cpshop to ignore when logging. Partial IP addresses will be treated as wildcards (e.g. "10.1.1." would match 10.1.1.1, 10.1.1.2, etc.). If you don\'t understand this, leave it blank.

Example: 127.0.0.1, 10.2.3., 127.0.0.2
..
store homepage options + click here to expand $savebutton2
Options for your store's main page, either generated by cpshop or created by you.
..
store homepage options - click here to minimize $savebutton
Option 1: If you only have one store, cpshop will consider the product thumbnails page for that store the homepage.
Option 2: Main Store URL
If you have a store homepage separate from cpshop, put the full URL here.

Example: http://$ENV{'HTTP_HOST'}/store/
Homepage as SSI
If you've entered a Main Store URL: Are you inserting the cpshop homepage into another page as a server-side include? (This prevents cpshop from redirecting the user to the Main Store URL.)
yes     no
Option 3: Main Insert File
If you don't have a store homepage, you can create some custom HTML, save it to a file (listed here) and cpshop will insert it on your main store homepage.

Example: homemenu.html or $ENV{'SCRIPT_FILENAME'}_files/ homemenu.html
Option 4: Homepage Greeting
If you leave both of the above two options blank, cpshop will use your homepage cell to make your store's homepage.

Example: Welcome to our store.<br>Please select a category to browse our products.
List my store IDs in , limited to per column (0 for unlimited), organized .
..
thumbnail page options + click here to expand $savebutton2
Settings for the appearance and behavior of thumbnail pages, also known as sections or categories.
..
thumbnail page options - click here to minimize $savebutton
Thumbnail Page HTML Template
A special HTML template for thumbnail pages. Leave this blank to use the Default HTML Template instead.

Example: cptemplate_store.html or $ENV{'SCRIPT_FILENAME'}_files/ cptemplate_store.html
Thumbnail Page Greeting
The greeting on product thumbnail pages/individual stores.
simple advanced
Display individual section descriptions?
If you display custom text or HTML above the sections in your CafePress premium shop, you can have that text/code displayed here too.
show section descriptions
don\'t show section descriptions
Thumbnail Sort Order
Define the order products are sorted into. The default is CafePress\' default order. (Note that the date added is based on the first time you added the product to that store.)
Number Of Thumbnail Columns
The number of thumbnails in each row of the thumbnail grid. CafePress uses 3.

Example: 3
Number Of Thumbnail Rows Per Page
The number of thumbnail rows per page of a category. Multiply the number of columns by the number of rows to get the total thumbnails per page.

Example: 4
(or enter 0 to keep all results on one page)
Dimensions Of Product Thumbnails
Height and width of product thumbnails, in pixels. At CafePress its 150x150.
Height:     Width:
Homepage Thumbnail Grid Layout
The HTML code for an individual store ID entry thumbnail cell on the homepage. (Only for use in stores with multiple store ID entries.) This should start with a <td> and end with a </td>, unless you\'re hiding the thumbnail grid table wrapper code (below).

If you don\'t know HTML, you should probably leave this section alone.
Product Thumbnail Grid Layout
The HTML code for an individual product thumbnail cell in the thumbnail grid. This should start with a <td> and end with a </td>, unless you\'re hiding the thumbnail grid table wrapper code (below).

If you don\'t know HTML, you should probably leave this section alone.
Section Thumbnail Grid Layout
The HTML code for an individual section thumbnail cell in the thumbnail grid (for premium shops only). This should start with a <td> and end with a </td>, unless you\'re hiding the thumbnail grid table wrapper code (below).

If you don\'t know HTML, you should probably leave this section alone too.
Display Thumbnail Grid Table Wrapper Code?
cpshop usually generates the surrounding HTML table code for thumbnail grids, including <table> and <tr> tags. You can choose to suppress these tags, if you want do something creative with the grid layouts (like use floating divs), but be aware that it\'ll break the "Number of Thumbnail Columns" option above.
yes, display cpshop\'s standard thumbnail grid table HTML
no, don\'t generate the standard thumbnail grid table HTML -- instead, use the following HTML before and after the grid:
          before:     after:
Product Type Block List
A comma-separated list of product types (by number) that should never appear in your shop. (This is great for discontinued products, or product types you hate.)

Example: 87, 131, 151
Sale Price Text Style
Optional CSS style attributes for sale prices, on both thumbnail and product pages.

Example: color:#CC0000;
..
product page options + click here to expand $savebutton2
Customize the appearance and content of individual product pages.
..
product page options - click here to minimize $savebutton
Product Page HTML Template
A special HTML template for individual product pages. Leave this blank to use the Default HTML Template instead.

Example: cptemplate_product.html or $ENV{'SCRIPT_FILENAME'}_files/ cptemplate_product.html
Display store caption above product?
You know how you can write a caption for each store ID? You can also have that caption appear on the pages of that store ID\'s products.
show store ID\'s caption
don't show store ID's caption
Product Page Greeting
The greeting on an individual product page. It\'s usually a good idea to tell them about the "Zoom In" link here.

Example: If you want to get a closer look, click the "Zoom In" link below.
Product Image Box Color
Normally there\'s a white box encompassing the product image and the front/back & zoom links. You can change the color of that box here, or enter "none" (without the quotes) to make the box transparent. Note: It won\'t change the color of the product image graphic.

Example: #FFFFFF or white or none
Order Form Box Color
Basic shops have a yellow background behind the order form. If you want a background color, set it here.

Example: #FFFFFF or white or none
Display Order Form On Right Side Of Page?
This option allows you to have the order form appear in a third column to the right of the product description, as it does in basic shops. (Note: It will make the page wider.)
yes, display the order form on the right side of the page, like in basic shops
no, display the order form above the product description, like in premium shops
Show Front And Back Of Product Simultaneously?
This option allows you to have the secondary product image (usually the back) appear beneath the primary one, instead of using the "click to view front/back" links.
show front and back of image at the same time (for double-sided items only)
use "click to view front/back" links
Show "View Larger Image" and "More Details" Links?
Normally an individual product page offers links to a more details popup window, with a larger version of the image, and other information. You can leave those links as is, or disable them entirely.
show "View Larger Image" and "More Details" links
hide "View Larger Image" and "More Details" links
Show "Tell A Friend About This Product" Link?
Product pages normally have a link to a CafePress pop-up window, with a form asking the user to recommend the product to other people. This option removes that link.
show "Email Friend About This Product" link
hide "Email Friend About This Product" link
Show Product Information Content?
At the bottom of product pages you\'ll find CafePress-provided promotional text about their production (like the kind of fabric they use, how "comfy" they are, yada yada yada). This option can hide all that (somewhat useful) content.
show product information
hide product information
Show Currency Converter Link?
The currency converter is a pop-up window produced by XE.com, which allows your customers to automatically convert a price from US dollars to their currency. Converter links generally appear wherever there's a price. It's handy for non-US visitors who\'d like to know how much $19.99 is, exactly.
show currency converter link using this text:
          
don\'t show currency converter link
Use Fit/Fabric CSS?
Include the style information for the Fit/Fabric info content, so it looks like it does at CP?
use fit/fabric CSS
don\'t use fit/fabric CSS
Show Product Carousel?
The product carousel displays and links to similar products on the product page.
show product carousel
don\'t show product carousel
..
other display options + click here to expand $savebutton2
Configure other settings, like cart links, breadcrumbs, css, sidebar, etc.
..
other display options - click here to minimize $savebutton
Show Shopping Cart In Pop-Up Window?
The shopping cart can either open up a pop-up window, or it can just load in the current window. (I personally prefer staying in the same window.)
open shopping cart in same window
open shopping cart in same window, overriding frames
open shopping cart in pop-up window
          display pop-up window menus (File, Edit, etc.)
          display pop-up window toolbar buttons
          display pop-up window address/location bar
          display pop-up window status bar
open shopping cart in new full browser window
Show Breadcrumb Linktrail?
Breadcrumb links show the user how they got to the page they\'re at from the homepage, such as Homepage > Store Page > Product Page. You can include this in your template with the <[breadcrumb]> tag.
yes
          start breadcrumb link with this text: linked to this URL:
no

display breadcrumb text on storefront, if possible/applicable

Breadcrumb delimiters:
Separate breadcrumb sections with in the main breadcrumb, and in the title breadcrumb
Show Horizontal Lines?
You can have black horizontal rules above and below the CafePress content. (I always set this to no, personally.)
yes     no
Open Credit/Referral Links In New Window?
You can choose to have the "CafePress" and "cpshop" links at the bottom of your store open a new window.
yes, open credit and referral links in new windows
no, open credit and referral links in the same window
SEOify links? (experimental!)
cpshop can use page titles to generate SEO-friendly URLs that relate to the content of the page, which may improve SEO positioning.
use built-in SEO-friendly URLs, and end them with
append this text to the end of each cpshop URL:
no, use standard cpshop URLs
Try to fix outdated links?
cpshop can try to guess what to do with outdated URLs. (It isn\'t always right, but it can try, can\'t it?)
yes, attempt to determine best page to display (default behavior)
no, return "404: Page Not Found" error, with this message:
no, redirect to this URL:
          append requested URL path to redirect URL (be careful of endless loops!)
Block Dynamic Direct Linking?
You can link directly to cpshop with store IDs that you haven\'t pre-entered through cpadmin. However, if you want to prevent this from ever happening, then you can choose to actively block it below.
block dynamic direct linking
allow dynamic direct linking
Display nested subsections in sidebar?
If you use the <[sidebar]> tag in your template, you can choose to display all nested subsections, or just the top-level options in your sidebar menu.
yes, display all nested subsections in my sidebar
expand to display nested subsections within the current page\'s path
no, don\'t display nested subsections in my sidebar
Process Hooks?
Hooks are a neato feature that allow you to specify content in your template based on the type and content of the page. However, since using hooks may (very slightly) impact processing time, you can enable/disable them here.
process hooks in template and code
ignore hooks completely
Display "Now Loading" screen during CP data downloads?
If cpshop takes a while to load information from CafePress, you can choose to have cpshop display a "now loading" message during the download. The message will disappear when the page is done loading, and the page will display as usual.
yes, display "now loading" screen during data downloads, using this HTML:
no, do not display "now loading" screen during data downloads
CSS Style Override
If you want to include a stylesheet (internal or external) or javascript after cpshop\'s internal styles, enter it here.

Example: <style type="text/css">.boldText { font-weight:bold; }</style>
hide cpshop\'s built-in stylesheets
hide cpshop\'s built-in javascript function library
..
store ids + click here to expand $savebutton2
Store IDs determine the product content and organization of your store.
ENDHTML foreach $storeid_line(split(/(\r?\n)+/,$SECTION{'StoreIDs'})) { next if ($storeid_line =~ /^\s*$/); ($storeid,$store_name,$store_text,$store_keys,$store_desc,$store_code,$store_thumb,$store_hide,$store_type,$store_file,$store_url,$store_mask,$crap) = split(/\s*\|\|\|\|\s*/,$storeid_line,13); $store_text =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $store_keys =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $store_desc =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $store_text =~ s//\>\;/g; $store_text =~ s/\"/\"\;/g; $store_keys =~ s//\>\;/g; $store_keys =~ s/\"/\"\;/g; $store_desc =~ s//\>\;/g; $store_desc =~ s/\"/\"\;/g; $store_name =~ s/\"/\"\;/g; $store_code =~ s/\W//g; $store_thumb =~ s/\s//g; $STORE_ID{$storeid_line} = $storeid; $STORE_NAME{$storeid_line} = $store_name; $STORE_TEXT{$storeid_line} = $store_text; $STORE_KEYS{$storeid_line} = $store_keys; $STORE_DESC{$storeid_line} = $store_desc; $STORE_CODE{$storeid_line} = $store_code; $STORE_THUMB{$storeid_line} = $store_thumb; $STORE_HIDE{$storeid_line} = $store_hide; $STORE_TYPE{$storeid_line} = $store_type; $STORE_FILE{$storeid_line} = $store_file; $STORE_URL{$storeid_line} = $store_url; $STORE_MASK{$storeid_line} = $store_mask; push @storeids, $storeid_line; } $number_of_stores = @storeids; $number_of_entries = $number_of_stores + 3; $content .= <<"ENDHTML"; ENDHTML $storeid_counter = "0"; while ($storeid_counter < ($number_of_entries)) { $rank_counter = $storeid_counter + 1; $storeid_counter = sprintf("%5.8d",$storeid_counter); $next_storeid_counter = $storeid_counter + 1; $next_storeid_counter = sprintf("%5.8d",$next_storeid_counter); $previous_storeid_counter = $storeid_counter - 1; $previous_storeid_counter = sprintf("%5.8d",$previous_storeid_counter); if ($STORE_HIDE{$storeids[$storeid_counter]}) { $hidechecked = "checked"; } else { $hidechecked = ""; } if ($STORE_MASK{$storeids[$storeid_counter]}) { $maskchecked = "checked"; } else { $maskchecked = ""; } if ($storeid_counter >= ($number_of_entries - 1)) { $js_down = qq[]; } else { $js_down = qq[]; } if ($storeid_counter == 0) { $js_up = qq[]; } else { $js_up = qq[]; } $js_clear = qq[
   
]; unless ($STORE_TYPE{$storeids[$storeid_counter]}) { $STORE_TYPE{$storeids[$storeid_counter]} = "store"; } $content .= <<"."; . $storeid_counter++; } $content .= <<"ENDHTML";
..
store ids - click here to minimize $savebutton
Dummy Store ID: The Store ID of your CafePress dummy store (the one with the <script> tags).
Also, if this is a premium shop, the shopping cart will display using its template.
Wildcard Store IDs: This list of store IDs can be denoted in the store ID fields below with one or more asterisks *.
Store IDs Entry Field Glossary

Name:
  Alias:   Type: $js_up $js_down
If you want to add more store IDs, just press the "save all changes" button to get more blank spaces.
..
marty.net affiliate options + click here to expand $savebutton2
Options for both the CafePress Affiliate Program and the Marty.net Affiliate Links.
..
marty.net affiliate options - click here to minimize $savebutton
CafePress Affiliate Settings
Fill in the following fields, and you can make money by adding other people\'s products to cpshop. (Just make sure they\'re not opted out of the Affiliate Program.) You can get your CJ PID by signing up for the CP Affiliate Program powered by Commission Junction.
CafePress Account ID (formerly known as PID):
You can find this in on the CafePress Your Account page, in the upper right next to your join date.
Commission Junction Publisher Web Site ID (CJ PID):
You can find this in your Commission Junction account, by clicking on "Web Site Settings," and selecting the appropriate website profile.
CJ Tracking Code/Shopping ID:
This is an alphanumeric (letters and numbers, no spaces) name for your cpshop CJ links. Most people just enter "cpshop" (without the quotes).
Accept external PIDs?
You can allow other CafePress Affiliates to link to cpshop with their CJ PIDs, by adding?cjpid=12345678 to the end of the URL. This can allow you to promote your cpshop store to Affiliates (somewhat like your very own Affiliate Program). Note that selecting "yes" will allow other affiliates to override the CJ PID you (may or may not have) entered above.
yes, accept external Affiliate PIDs
no, don\'t accept external Affiliate PIDs
Marty.net Affiliate Code
If someone clicks the cpshop link (at the bottom of every page), and then buys one of my scripts, you earn a commission. This is the same as your Marty.net download area username.

Example: myusername
  $savebutton




















































ENDHTML print "Content-Type: text/html\n\n"; print "$content"; exit; sub error { print "Content-Type: text/html\n\n"; print "There has been an error. $_[0]\n"; exit; } sub process_vars { foreach $key(keys %SECTION) { $SECTION{$key} =~ s/\&/\&\;/g; $SECTION{$key} =~ s//\>\;/g; $SECTION{$key} =~ s/^\s+//; $SECTION{$key} =~ s/\s+$//; $SECTION{$key} =~ s/\"/\"\;/g; } unless ($SECTION{'tablewid'}) { $SECTION{'tablewid'} = "100%"; } unless ($SECTION{'expiretime'}) { $SECTION{'expiretime'} = "30"; } if ($SECTION{'expiretime'} == 0.5) { $expire30selected = " selected"; } elsif($SECTION{'expiretime'} <= 7) { $expire7selected = " selected"; } elsif($SECTION{'expiretime'} <= 14) { $expire14selected = " selected"; } elsif($SECTION{'expiretime'} <= 30) { $expire30selected = " selected"; } elsif($SECTION{'expiretime'} <= 90) { $expire90selected = " selected"; } else { $expire9999selected = " selected"; } unless (exists $SECTION{'MaxOutputCacheSize'}) { $SECTION{'MaxOutputCacheSize'} = "25"; } unless (exists $SECTION{'MaxCacheSize'}) { $SECTION{'MaxCacheSize'} = "25"; } if ($SECTION{'ShowLinkBar'} eq "no") { $ShowLinkBarNoChecked = " checked"; } else { $ShowLinkBarYesChecked = " checked"; } unless ($SECTION{'homelink'}) { $SECTION{'homelink'} = "Store Home"; } # unless ($SECTION{'cartlink'}) { $SECTION{'homelink'} = "View Cart"; } if ($SECTION{'ShowPrevNextLinks'} eq "full") { $ShowPrevNextLinksFullChecked = " checked"; } elsif ($SECTION{'ShowPrevNextLinks'} eq "none") { $ShowPrevNextLinksNoneChecked = " checked"; } else { $ShowPrevNextLinksNormalChecked = " checked"; } $SECTION{'thumbcolumns'} += 0; unless (($SECTION{'thumbcolumns'} > 0) && ($SECTION{'thumbcolumns'} < 12)) { $SECTION{'thumbcolumns'} = 3; } $SECTION{'thumbcolumns'} = int($SECTION{'thumbcolumns'}); $SECTION{'thumbrows'} += 0; $SECTION{'thumbrows'} = int($SECTION{'thumbrows'}); if ($SECTION{'thumbrows'} < 0) { $SECTION{'thumbrows'} = "0"; } unless ($SECTION{'searchrows'}) { $SECTION{'searchrows'} = 5; } $SECTION{'searchrows'} += 0; $SECTION{'searchrows'} = int($SECTION{'searchrows'}); if ($SECTION{'searchrows'} < 0) { $SECTION{'searchrows'} = "5"; } $SECTION{'thumbheight'} += 0; unless (($SECTION{'thumbheight'} > 0) && ($SECTION{'thumbheight'} < 1000)) { $SECTION{'thumbheight'} = 75; } $SECTION{'thumbheight'} = int($SECTION{'thumbheight'}); $SECTION{'thumbwidth'} += 0; unless (($SECTION{'thumbwidth'} > 0) && ($SECTION{'thumbwidth'} < 1000)) { $SECTION{'thumbwidth'} = 75; } $SECTION{'thumbwidth'} = int($SECTION{'thumbwidth'}); unless ($SECTION{'homecelltemplate'}) { $SECTION{'homecelltemplate'} = qq(<[linkstarts]>
<[thumbnail]>
<[storename]>
<[linkends]>); } unless ($SECTION{'productcelltemplate'}) { $SECTION{'productcelltemplate'} = <<".";
<[linkstarts]><[thumbnail]><[linkends]> <[linkstarts]><[productname]><[linkends]>
our price: <[productcost]>
<[producttext]>
. } unless ($SECTION{'storecelltemplate'}) { $SECTION{'storecelltemplate'} = <<".";
<[linkstarts]><[thumbnail]>
<[storename]><[linkends]>
. } $SECTION{'productcelltemplate'} =~ s/[\r\n]+/\n/g; $SECTION{'storecelltemplate'} =~ s/[\r\n]+/\n/g; $SECTION{'gridheader'} =~ s/[\r\n]+/\n/g; $SECTION{'gridfooter'} =~ s/[\r\n]+/\n/g; $SECTION{'zoomtext'} =~ s/[\r\n]+/\n/g; $SECTION{'greeting'} =~ s/[\r\n]+/\n/g; $SECTION{'clickfor'} =~ s/[\r\n]+/\n/g; $SECTION{'ThumbnailGreetingSectionsOnly'} =~ s/[\r\n]+/\n/g; $SECTION{'ThumbnailGreetingProductsOnly'} =~ s/[\r\n]+/\n/g; $SECTION{'ThumbnailGreetingBoth'} =~ s/[\r\n]+/\n/g; $SECTION{'HomeTableMaxRows'} = int($SECTION{'HomeTableMaxRows'}); if ($SECTION{'HomeTableMaxRows'} <= 0) { $SECTION{'HomeTableMaxRows'} = "0"; } $SECTION{'HomeCols'} = int($SECTION{'HomeCols'}); if ($SECTION{'HomeCols'} <= 0) { $SECTION{'HomeCols'} = 1; } elsif ($SECTION{'HomeCols'} > 7) { $SECTION{'HomeCols'} = 7; } while($colcounter < 7) { $colcounter++; $homecoloptions .= qq(