gCards User Guide


About gCards

Installing gCards

Miscellaneous



About gCards

gCards Overview

gCards is a free PHP-based eCard system that is easy to setup and use. gCards simple Administration Console allows the administrator to upload images, add eCard categories, and modify existing settings - no more messing with HTML or PHP to get your eCard site up and running!

gCards is my first stab at a PHP application (or any other programming endeavour) so go easy on me.

gCards Feature Overview

  • JPEG and GIF image support
  • User-defined categories
  • WYSIWYG editor for composing eCards (IE 5.5+)
  • Add smilies to eCards
  • Multiple recipients
  • Background music
  • Multiple lanuage support via language files (only English provided). Ability to switch languages on the fly.
  • Cards stored in mySQL database - database access via ADODB library
  • E-mails URL to recipients to pickup eCard - no messy HTML mail
  • Sender can be notified when recipient picks up eCard (optional)
  • Automatic deletion of old eCards (configurable and optional)
  • Secure Administration Console
    • Image uploading
    • Optional automatic thumbnail generation for JPEGs (Using GD or GD2)
    • Create and edit Site News
    • Category maintenance
    • Statistics
  • Easy setup and configuration - get up and running in 10 minutes!
    • Setup script creates database tables
    • Configuration script contains all gCards options
    • No fancy libraries or packages required - uses PHP's GD or GD2 library
    • Modify look and feel quickly with CSS
  • Great browser support!
    • Internet Explorer
    • Mozilla
    • Netscape 4.7
    • Maybe more! That's all I've tested

Credits

gCards is created, designed, and maintained by me - Greg Neustaetter. It was originally developed as a self-imposed project to learn PHP. It seemed like a good project - combining database interaction, dynamic user interfaces, image manipulation, and email. When I finished I posted it on HotScripts.com and was VERY surprised when about 500 people downloaded it in the first week.

In the great tradition of the open source community I like to reuse existing technology whenever possible. The following scripts or other technologies are used in gCards:
  • ADOdb Database Library (http://php.weblogs.com/ADODB) - ADOdb is a database abstraction library created for PHP. It supports a wide-range of commercial and open-source databases. This is used for all database interactions within gCards.
  • htmlArea (http://www.interactivetools.com/products/htmlarea/) - htmlArea is a WYSIWYG editor that can be used to replace any textarea field for Windows users on IE 5.5+. Other users see a standard textarea. gCards uses htmlArea for composing eCards and for news item creation in the gCards Administration Console.
  • PHPMailer (http://phpmailer.sourceforge.net/) - PHPMailer is an object-oriented PHP class that simplifies the process of sending email with PHP. PHPMailer lets gCards users use the standard PHP mail functions or SMTP instead. PHPMailer was added to gCards in release 1.21 of gCards
  • Image Resizer (http://horobey.com/demos/imgresize/v5/article/index.html) - Image Resizer is an object-oriented PHP class that simplifies the process of resizing images with the GD or GD2 Graphics Library. gCards uses image resizer to (optionally) automatically generate thumbnails for JPEG images

Installing gCards

Requirements

  • PHP - Not quite sure what version is required - version 4.1 used to be required but now it uses the $HTTP_*_VARS instead of the autoglobals, so support should go back a bit further now!
  • MySQL - gCards was written to use the free MySQL relational database. It was written with the ADODB database library and could probably be modified to use other databases fairly easily
  • GD or GD2 Image Library - The GD or GD2 image libraries are used to automatically create thumbnails in the gCards administration console. These are commonly bundled with PHP - GD2 is bundled with PHP 4.3 by default. GD2 will provide much higher quality thumbnails.

gCards Installation

  1. Download the latest gCards version from the official site
  2. Create a database to hold the gCards database tables (or use an existing database)
  3. Open the config.php and change the values to reflect your database connection properties and your gCards options
  4. If PHP's mail functions don't work on your server, change the mail settings for gCards in config_email.php
  5. Upload the files to your web server
  6. Browse to the setup.php file and choose to do a new install - this will create the database tables and create an admin user. If there are errors creating the tables then your database information is probably incorrect - fix it in the config.php and try again
  7. CHMOD the 'images' and 'sound' directories to '777' to allow image/sound uploads and modification
  8. Delete setup.php or CHMOD it to '000' so that it cannot be accessed
  9. Login to the gCards Administration Console with the user: 'admin' password: 'admin'. You can access the login page at login.php
  10. Click the 'Change Password' link in the upper right to change the admin password
  11. Add a Category using the 'Category Maintenance' link in the gCards Administration Console
  12. Add a new Card using the 'Card Maintenance' link in the gCards Administration Console
  13. Click the link in the bottom right to go to the index page of gCards - you're new Card should show up here!
  14. Done!!!

Upgrading gCards

  1. Download the latest gCards version from the official site
  2. Read the readme to see if there are any version-specific instructions
  3. Backup your current config.php
  4. Modify the new config.php to reflect the settings in your old config.php
  5. Upload all of the files to your web host, overwriting the old files
    • If you get an error trying to upload setup.php try CHMODing the file on the server to '644' first
  6. Run setup.php to create new database tables or to modify the existing tables to take advantage of new features

Miscellaneous

Image Formats

gCards has support for all image formats that can be displayed within an img html tag. This would primarily be JPEGs and GIFs. Though gCards supports GIFs, it will not automatically create thumbnails for GIF images. This is due to the fact that gCards uses the GD or GD2 library to create thumbnails, and GD does not support the GIF file format due to patent issues. If it were supported gCards would have support for GIF thumbnail creation, but for now you'll have to live with creating your own!

Multiple Language Support

gCards has support for multiple languages via language files. If multiple languages are enabled, flags will be shown in the user interface. When a user clicks a flag it will use that language for the rest of the session. Only an English version is included, though others are available at http://www.gregphoto.net/gcards/lang.phphttp://www.gregphoto.net/gcards/lang.php. If you create files for another language please send them to me and I will include them and give you credit!

To create a new language file:
  1. Make a copy inc/lang/language_en.php
  2. Change the name of the file to reflect the language - i.e. language_sp.php for Spanish
  3. Change the text in this file to the appropriate language
  4. Open config.php and add a new value to the language array to point to your new language file. A commented example is included in config.php
  5. Done!

Adding Extra Smilies

Starting with version 1.1, gCards has support for smilies :)
If you'd like to modify the smilies it's pretty easy! Here's how:
  1. Open inc/smileyClass.php
  2. Find the $smileys array at the top
  3. Add new values to the array
    1. Adding ":#o"=>"weirdNose.gif" would add the weirdNose.gif image when someone typed :#o or clicked the image
  4. That's it!

Image Templates

Starting with version 1.2, gCards includes the images/imageTemplates directory. This folder has templates for various images used in gCards. You can use these templates as a starting point for creating smilies, new drop shadows, or stamps.

Drop Shadows

Starting with version 1.2, gCards includes an option (configurable in config.php) to use drop shadows on image thumbnails, full-size images, and cards. Choosing the drop shadow mode also enables a postcard style layout that includes stamp images.
The drop shadow option is simple to use if you use the default background color that ships with gCards. If you're using a custom color then it's a bit more difficult - the drop shadow images include the background color on them, so you'll need to create new images. I've provided a template for this and instructions on how to do it in the readme in the dropshadow template directory.
I tried to make a dropshadow image that would work with all backgrounds, but using a transparent background on the image made the quality much worse....


© Greg Neustaetter