PHPBuilder - Creating a Printer Version Grab Method Page 2



RSS Twitter
Articles Html

Creating a Printer Version Grab Method - Page 2

by: Jim Fletcher
|
April 1, 2004

Bells & Whistles
A few extra features are included to provide additional functionality:
  • 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`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;

« Previous Page
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
10
Next Page »

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Jim Fletcher

Comment:



Comment:

(Maximum characters: 1200). You have characters left.