#native_company# #native_desc#

Creating a Printer Version Grab Method Page 2

By Jim Fletcher
on April 1, 2004

Bells & Whistles
A few extra features are included to provide additional
  • Ability to exclude some text within the printable region.
  • Ability to optionally cache the grabbed pages in a
    MySQL database to improve performance.
  • Ability to extend script to accommodate multiple
    websites with each using its own Printer Version template.
  • Optional javascript to add Printer Version button to webpages.
Set up MySQL database tables
The first table to create will hold member settings. If you
create an interface for members to manage their own data, then
username and password will be useful. Name and email may be
useful for you to contact your users or notify them with custom
email messages via an error subroutine. The “activeyn”
field should be set to “y” if you want the user??s printer
version to work. You may specify a different template file such
as “customername.html” in the “template” field.
The “subject”, “logo”, and “emailbody”
fields field are added in anticipation of having an “Email
This Page To A Friend” script to interact with this same data
in the future. The “domain” field is the allowed domain
name for this user. The “sitename” field should be
the name of the user??s company and will be available for
integration with templates.
CREATE TABLE `member` (
  `id` tinyint(7) NOT NULL auto_increment,
  `username` varchar(25) NOT NULL default '',
  `password` varchar(25) default NULL,
  `name` varchar(50) default NULL,
  `email` varchar(50) default NULL,
  `activeyn` char(1) default NULL,
  `template` varchar(50) default NULL,
  `subject` varchar(100) default NULL,
  `domain` varchar(50) default NULL,
  `logo` varchar(100) default NULL,
  `emailbody` mediumtext,
  `sitename` varchar(100) default NULL,
  PRIMARY KEY  (`id`),
  UNIQUE KEY `id` (`id`)