######################################################################
#################   PostCard Plugin  version 1.0  ####################
######################################################################                        
# Postcard Plugin for perlshop.cgi                                   #
# Author : Chris Jacobs.(aka Jack)                                   # 
#          (email: Jack@sarune, chris_jacobs_nj@yahoo.com)           #
#                                                                    #
# I created this Postcard script from a script available on the net  #
# I simply changed it to work as a plugin to use with the free       #
#                 shopping cart program PERLSHOP.CGI                 #
#                The latest version is available from                #
#                       waveridersystems.com                         #
#                                                                    #
#           WORKING DEMO  @ www.sarune.com/Sarunatic/                #
#                                                                    #
#                                                                    #
######################################################################
# Revision History                                                   #
######################################################################
#                                                                    #
#                                                                    #
#                                                                    #
######################################################################
#                                                                    #
# I have tried to document the script for changing the variables     #
# that will need to be changed. Any suggestions, comments, questions #
# for improving the script or this ReadME file please send me eMail  #
#                          jack@sarune.com                           #   
#                                or                                  #
#                      chris_jacobs_nj@yahoo.com                     #
#                and I will do my best to help out                   #
#                          Thank you, Jack                           #
#                                                                    #
#                                                                    #
######################################################################
                                                                     #
This plugin allows your users to send a virtual greeting card        #
from within the perlshop program.                                    #
postcard.cgi is the plugin script.                                   #
                                                                     #
Also included is view_card.cgi which is a simple script for          #
the recipient of the card to come and view it.                       #
                                                                     #
Also included is a sample page called postcard.html                  #
This should be used as an example of how to set up a postcard page   #
                                                                     #
######################################################################
#                           OK, HERE IT IS                           #
#                                                                    #
# File By File:
     1) postcard.cgi:
            It has the following 8 variables that need setting.
            
	     $basepath = ##  The Directory Path to your directory where
	                 ##  temp files are written and the data.dat(a file that stores card info, explained below) is located
	    
	     $perlshop = ## This is the URL location of your perlshop program. 
	                 ## i.e. (http://www.YOUR-SITE.com/cgi-bin/perlshop.cgi)
   	    
	     $cgi      = ## THE URL FOR YOUR view_card.cgi
	                 ## i.e. (http://www.YOUR-SITE.com/cgi-bin/view_card.cgi)
	    
	     $basepic  = ## THE URL OF THE DIRECTORY WHERE YOU KEEP YOUR PICTURES
	                 ## i.e. (http://www.YOUR-SITE.com/images/postcard/images/)
	    
	     $data     = ## This is $basepath plus the name of your data.dat file 
	                 ## This is done because basepath is used elsewhere also
	                 ## Plus allows you to give a more descriptive name to your data.dat
	    
	     $mailprog = ## PATH TO YOUR MAIL PROGRAM
	                 ## i.e. (/usr/sbin/sendmail -t)
	    
	     $MAX_DAYS = ## THE NUMBER OF DAYS TO KEEP CARDS ON FILE
	    
	     $subject1 = ## THE SUBJECT LINE FOR THE RECIPIENTS EMAIL
	       
	    
                             
            Make sure the first line points to Perl on your server
            
            Place in same folder as perlshop and set permissions(755)
            
            Feel free to change the HTML for viewing cards
            and the text for the email sent
            These area can be easily located by finding the comments
            in the script that look like this:
            
            
            #
	    ##
	    ###
	    ##########################################################
	    ###
	    ### Description of routine that follows
	    ###
	    ##########################################################
	    ###
	    ##
            #
            
     2) view_card.cgi:
            It has the following 7 variables that need setting.
	                
	     $sitename = ##  The name of your wesite
	    	         ##  i.e (YOUR-SITE.com)
	    	    
	     $site     = ##  The address to enter your store for the first time
	                 ##  i.e.(http://www.YOUR-SITE.com/cgi-bin/perlshop.cgi?action=ENTER&thispage=page1.html&order_id=!ORDERID!)
	     
	     $basepic  = ##  The url of the directory where the images are kept
	                 ##  i.e (http://www.YOUR-SITE.com/images/postcard/images/)
	     
	     $data     = ##  PATH of your data.dat file
	                 ##  i.e (/www/YOUR-SITE/images/postcard/data.dat)
	     
	     $mailprog = ##  PATH TO YOUR MAIL PROGRAM
	                 ##  i.e. (/usr/sbin/sendmail -t)
	     
	     $MAX_DAYS = ##  THE NUMBER OF DAYS TO KEEP CARDS ON FILE
	     
	     $subject2 = ## Subject for the Email that notifies the 
                         ## sender that the recipient looked at the card
             
             Make sure the first line points to Perl on your server
	                 
             Place in same folder as perlshop and set permissions(755)
                         
             As with postcard.cgi
             Feel free to change the HTML for viewing cards
	     and the text for the email sent
	     These area can be easily located by finding the comments
	     in the script that look like this:
	                 
	     #
	     ##
	     ###
	     ##########################################################
	     ###
	     ### Description of routine that follows
	     ###
	     ##########################################################
	     ###
	     ##
             #
	     
             
     3) postcard.html:
            This is an example card page to refer to so you have an idea
            of how to set yours up.
            Dont forget the form name and hidden values:
              <FORM NAME="postcard" method="POST" ACTION="!MYURL!">
	      <input type=hidden name="order_id" value="!ORDERID!">
	      <input type=hidden name="action" value="plugin">
              <input type=hidden name="plugin" value="postcard">
              
            Also keep the plugin_param names the same and in the same order
              or the script wont work.
            The value for plugin_param1 only needs to be 
              the picture.jpg(not the full path).
            Other than that it can look however
            you want it to.
            
     
     4)data.dat:
            This is a file that is created by the postcard.cgi script
            and it stores information about the card that was created.
            Also this is the file used by the view card script to create
            the card when the recipient come to view it.
            
             
######################################################################             
#                                                                    #
#  You will also need to add the postcard.cgi script to the          #
#  ps.cfg file in the area that SAYS:                                #
######################################################################
                                                                     
# Plugin modules.  See the external documentation for details.
%plugins =
(
	# Calendar example plugin
	'calendar'  => 
	{
		'program'	=> 'ps_plugin_gencal.pl'
	}
######################################################################
# Add the postcard  plugin as follows:                               #
######################################################################

# Plugin modules.  See the external documentation for details.
%plugins =
(
	# Calendar example plugin
	'calendar'  => 
	{
		'program'	=> 'ps_plugin_gencal.pl'
	},

	'postcard'	=> 
	{
		'program'	=> 'postcard.cgi'
	}
);


######################################################################
#                                                                    #
#                         Thats all,                                 #
#    just refer to your postcard.html like any other catalog page    #
#                 Any suggestions for a plugin?                      #
#              Email me - chris_jacobs_nj@yahoo.com                  #
#                                                                    #
######################################################################
