Penguin Greetings is copyright © Edouard Lagache, 2003-2005. Penguin Greetings is released under the GNU General Public License, Version 2. For more information, see the COPYING file included with this software or visit: http://www.gnu.org/copyleft/gpl.html
The artistic content included with this software is also
copyright © Edouard Lagache, 2003-2005. It is released
under the Design Science License. For more information, see
the DSL.txt file included with the software or visit: http://www.dsl.org/copyleft/.
Powered by Penguin Greetings
web badge
If you use Penguin
Greetings in your own web cards application.
Please give credit were credit is due by displaying the
following web badge or something equivalent on your web
site:
There are now quite a few different badges included in
Penguin Greetings with the various secondary ecard sites,
so take a look if you want something different.
Better still, if you make a nicer web badge, please share
it with me so that I can spread the wealth! 
). However, even the most
un-artistic sys-admin will sooner or later want to add some
cards of their own to their system. Those with more
ambitious plans will find a simple example a good point of
departure.| # File: cards.conf ###################################################################### # Greeting card configuration file for # # ** PENGUIN GREETINGS (pgreet) ** # # A Perl CGI-based web card application for LINUX and probably any # other UNIX system supporting standard Perl extensions. # # Edouard Lagache, elagache@canebas.org, April 2003 # # # The pgreet system uses the Perl Config::General module for # reading in configuration file information. The file format # is the same as for the Apache web server. The general # configuration module contains information for both the # CGI script and the system daemon. These are kept in # separate categories for simplicity of management. # ###################################################################### # Card category definitions: # .... <category Birthday> caption = "Birthday Cards" cards = Birthday_blooms_on_trail cards = Bay_bridge_birthday cards = Fishing_Birthday </category> # .... # 21 <card Fishing_Birthday> caption = "Fishing around for a way to say: Happy Birthday!" template = "picture_frame_card.tpl.html" image = "Fishing_Birthday.jpg" thumb = "Fishing_Birthday.thb.jpg" </card> # .... |


| [# # Penguin Greetings HTML/Embperl template for an HTML formatted # greeting card. # # This template is usually called from within # other template either for previewing or displaying a card. # # E. Lagache, 3/2003 #] [# Set Embperl options to avoid interpreting characters that could be URLs #] [* $ENV{'optRawInput'} = 16; *] [* $escmode = 0; *] [# Interface with Penguin Greeting script (pgreet.pl.cgi) #] [$ var $trans %card_hash %card $] [- # Retrieve parameters from Penguin Greetings script (pgreet.pl.cgi) $trans = shift(@param); # $trans is a hash reference # All card configuration data %card_hash = %{$trans->{'card_hash'}}; # "record" for selected card. %card = %{$card_hash{'card'}->{$trans->{'card'}}}; -] <center> <table cellpadding="2" cellspacing="4" border="2" style= "text-align: left; width: 400px;"> <tbody> <tr align="center"> <td style="vertical-align: top;"> [# retrieve image URL and image name #] <img src="[+ $trans->{'imageurl'} +]/[+ $card{'image'} +]"><br> </td> </tr> <tr> <td style="vertical-align: top;"> <table cellpadding="2" cellspacing="2" border="0" style="text-align: left; width: 100%;"> <tbody> <tr> <td style="vertical-align: top;"><span style= "font-family: times new roman,times,serif; font-style: italic;"> [# Insert the message text #] [+ $trans->{'html_message'} +] </span><br> </td> </tr> <tr> <td style="vertical-align: top;"> <br> <font size="-1"><br> </font> <table cellpadding="2" cellspacing="2" border="1" style= "text-align: left; width: 100%;"> <tbody> <tr> <td style= "vertical-align: top; width: 50%;"> <font size="-1"> [# Insert the sender's name and email #] From: [+ $trans->{'sender_name'} +]<br> [+ $trans->{'sender_email'} +]</font><br> </td> <td style="vertical-align: top;"> <font size="-1"> [# Insert recipients name and email #] To: [+ $trans->{'recipient_name'} +]<br> [+ $trans->{'recipient_email'} +]</font></td> </tr> </tbody> </table> <br> <div style="text-align: center;"> <a href="http://www.canebas.org/pgreet/"> <img src="[+ $trans->{'imageurl'} +]/powered_by_pgreet.gif" border="0" align="center"></a> </div> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </center> |
This
is NOT an introduction
into how Penguin
Greetings really works. However, if you want to
know, keep reading! If you think you can get on without
reading more - well, you've been warned!!


| [*
$ENV{'optRawInput'} = 16; *] [* $escmode = 0; *] [- # Retrieve parameters from Penguin Greetings script (pgreet.pl.cgi) $trans = shift(@param); -] Dear [+ $trans->{'recipient_name'} +], [+ $trans->{'sender_name'} +] has sent you a Penguin Greeting! If your email reader doesn't support email with images, you can view your Penguin Greeting on the world wide web. Just point your browser to: [+ $trans->{'URL_short_cut'} +] and, if needed, enter the following information: Card ID: [+ $trans->{'number'} +] Password: [+ $trans->{'password'} +] The text of the message from [+ $trans->{'sender_name'} +] is provided below: ----------------------------------------------------------------- [+ $trans->{'message'} +] ----------------------------------------------------------------- We hope you enjoy your Penguin Greeting! |
| %card_hash = ( 'card' => { 'Flower_in_rocks' => { 'template' => 'picture_frame_card.tpl.html', 'caption' => 'Californian Poppy in rocky ground', 'thumb' => 'Flower_in_rocks.thb.jpg', 'image' => 'Flower_in_rocks.jpg' }, 'Barrel_of_cheer' => { 'template' => 'picture_frame_card.tpl.html', 'caption' => 'A barrel of cheerful flowers', 'thumb' => 'Barrel_of_cheer.thb.jpg', 'image' => 'Barrel_of_cheer.jpg' }, }, 'cards' => [ 'Barrel_of_cheer', 'Flower_in_rocks', ], 'category' => { 'Encouragement' => { 'caption' => 'Cards for encouragement', 'cards' => [ 'Barrel_of_cheer', 'Flower_in_rocks' ] }, }, 'categories' => [ 'Encouragement', ] ); |
| CGI Variable |
Purpose |
|
state_file |
Name of state file where
user's previous entries are stored on the server |
|
action |
Action that pgreet.pl.cgi should do
on its next call. See discussion on action
below. |
| next_template |
Name of the next
template to be displayed by the CGI script. Do not
include a filename extension, the default extension
defined in pgreet.conf is appended
to the filename. |
|
message |
Text of message |
|
sender_name |
Name of sender |
|
sender_email |
Email of sender |
| recipient_name | Name of recipient
(primary) |
| recipient_name-2 to 5 | Names of any
supplemental recipients (up to 4 additional) |
| recipient_email | Email of recipient (primary) |
| recipient_email-2 to 5 | Emails of any supplemental recipients (up to 4 additional) |
|
code |
access code for card
(old WebGrams number) |
|
password |
access password for
card |
| card | The name of the card selected |
|
login |
User login for accessing
Penguin
Greetings on this server |
|
UserPassword |
User password for
accessing Penguin
Greetings on this server |
|
schedule |
Binary flag - should
card be scheduled to emailing later |
|
day |
Day to email card
later |
|
month |
Month to email card
later |
|
year |
Year to email card
later |
|
copy_for_you |
Binary flag - do you
want a copy of ecard emailed to sender? |
| site |
Name of a secondary
ecard site if your server has more than one ecard site
running at the same time. |
| subject |
Contains text of a
user-supplied subject for the email message. The
subject text will be appended after the identifying tag
[pgreet]. If the
user does not supply a subject line, the line Penguin Greeting from
user name
will be used. |
| Action |
Notes |
| <none> |
This is the screen that
will be displayed if a user accesses Penguin Greetings
without any action specified. |
| build |
These are the templates
to select and outfit a card. You can have any
number of build stages. Each time, the CGI script
will collect the variables from the previous stage, and
output the template specified by the variable next_template. |
| login |
Display login and
password page for installations of Penguin Greetings were
only authorized users may create cards. |
|
preview |
State to review the
resulting card and schedule when it will be sent. |
|
send |
Confirmation that a
Penguin Greeting has been sent. A link from this
page can be added to go back to build state so to allow
users to send multiple cards during the same session. |
|
view |
State and template for a user who has already received a Penguin Greeting and wants to view the card via the web site. This is the page that this also displayed if URL_short_cut is enabled. |
| <tr> <td style="text-align: center; vertical-align: middle;"> [# The URL will be the general URL above + card selected #] <a href="[+ $script_URL +]&card=[+ $card +]"> [# The image is the image URL + the image name #] <img src="[+ $trans->{'imageurl'} +]/[+ $card_data{$card}->{'thumb'} +]" > </a> </td> </tr> |
| <HTML> <HEAD> <TITLE>Penguin Greetings - Select a picture</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF"> [* $ENV{'optRawInput'} = 16; *] [* $escmode = 0; *] [$ var $trans $script_URL %card_hash %category_hash @cards_list %card_data $card $image_ref $] [- # Retrieve parameters from Penguin Greetings script (pgreet.pl.cgi) $trans = shift(@param); # Get the contents of card.conf into a single hash. %card_hash = %{$trans->{'card_hash'}}; # Get the category hash %category_hash = %{$card_hash{'category'}}; # Get the hash of card data %card_data = %{$card_hash{'card'}}; # Get the list of all the card names in the category chosen. @cards_list = @{$category_hash{$trans->{'category'}}->{'cards'}}; # Build up pieces of URLs to simplify represention. $script_URL = join('', $trans->{'cgiurl'}, "/", $trans->{'cgi_script'}, "?action=build&", "next_template=text&", $trans->{'varstring'} ); -] <CENTER> <table cellpadding="2" cellspacing="2" border="0" style="text-align: left; width: 640px;"> <tbody> <tr> <td style="vertical-align: top;"> <td style="vertical-align: top;"> <img src="[+ $trans->{'imageurl'} +]/pgreet_CGI_banner.jpg" align="center"> <img src="[+ $trans->{'imageurl'} +]/pgreet_status_bar-2.jpg" align="left"><br> <center> <FONT FACE="Arial"><b><small>Please select a picture for your Penguin Greeting below.</b></small></FONT></CENTER> <br><br><hr> <CENTER> <H3>[+ $category_hash{$trans->{'category'}}->{'caption'} +]</H3><br> <table cellpadding="2" cellspacing="2" border="0" style="text-align: left; width: 600px;"> <tbody> [# Loop through every card in the category #] [$ foreach $card (@cards_list) $] <tr> <td style="text-align: center; vertical-align: middle;"> [# The URL will be the general URL above + card selected #] <a href="[+ $script_URL +]&card=[+ $card +]"> [# The image is the image URL + the image name #] <img src="[+ $trans->{'imageurl'} +]/[+ $card_data{$card}->{'thumb'} +]" > </a> </td> </tr> [$ endforeach $] </tbody> </table> </CENTER> </td> </tr> </tbody> </table> </center> [- Execute($trans->{'templatedir'} . "/pgreet_credit.tpl.html", $trans) -] </BODY> </HTML> |
| # Request that all card entries
be array references. <category Force_to_array> fields = cards </category> # 01 <category Hello> caption = "Hello and general interest cards" cards = Camel_racers_unite cards = Camel_fun_yet </category> # 02 <category Love> caption = "Cards for Love and Romance" cards = Sweet_camel_two </category> |