|
This guest book is free for use and modification under the
condition that you must keep the link to http://www.vwin.co.th/
on your page. (Since you borrow someone source code, you should give them credits)
If you want to know that you have the latest version or not, So please
check at http://www.vwin.co.th/download/.
(You'll also find a number of free PHP script by KP (Krerk Piromsopa).
Feature The
exciting feature of this guest book are - Thank you mail support.
- Admin
Notification of new signing.
- Freely format template to adjust the guest
book to your need.
- Can act as support Queue or simple webboard.
- etc...
Installation
This script is develope with PHP 4.0pl2 on Linux System. Anyway, it's
already test with Win 32 binary of PHP (Also with PHP 3.0 on both Linux and Win
32). The distributioin come in the format of tar.gz. ex. KP-Guest_Book-xxx.tar.gz.
(Where xxx is the version no.) The installation step will show as follow. In case
that your system don't have PHP installed, please get one from http://www.php.net/
and install it first. - Linux
1. Untar the file
into your web directory. $ tar zxvf KP-Guest_Book-xxx.tar.gz (On AT&T
Style Unix System you might need to run) $ gzip -d KP-Guest_Book-xxx.tar.gz
| tar xvf of $ gzip - KP-Guest_Book-xxx.tar.gz $ tar xvf KP-Guest_Book-xxx.tar 2.
Change the file owner and permission (every page should have permission 644 and
every directory should have permission 755) to make sure that the web user can
write to the file by using the command chown and chmod (ex. if your web
server is own by user nobody $ chown nobody guestbook $
chmod 755 guestbook $ cd guestbook $ chmod 644 * In case that
you don't want to change the owner to the web server owner you must change the
directory permission to chmod 777. And change the permission of body.inc
to 777 . 3. Set up the config file gbook.cfg (For more detail
see next section) 4.Check the extension of your
php server configure. Normally for PHP 4 the extension is .php and
.php3 for PHP 3. On some system the extension will be .phtml
or .phtm depend on the server configuration, So all you have to do
is rename of index.php to your deferred extention.
- Window
1.
Use Win ZIP to unpack the file to your directory 2. Set up the config file
gbook.cfg (For more detail see next section)
3. Check the extension of your php server configure. Normally for PHP 4
the extension is .php and .php3 for PHP 3. On some system
the extension will be .phtml or .phtm depend on the server
configuration, So all you have to do is rename of index.php to your deferred extention.
Configuration
File The configuration of KP-Guest Book can
be devided in to 2 parts. One for generic Configuration and another is the template
for format the web and email (In next Section). This part will show you the customization
of each parameters. Each parameter will be specify in gbook.cfg as PHP
define style. (Don't forget to escape the PHP block first.) The parameters will
show as follow. - NOTIFY_GUEST set to 1 if want to send the
thank you email to the guest (using THANK_TEMPLATE) or set to 0 for no thank you
email.
- NOTIFY_ADMIN set to 1 if want to send the notification email
to site admin specify in ADMIN_MAIL (using ADMIN_TEMPLATE) or set to 0 for no
notification email
- ADMIN_NAME the name of the admin (Show in email
and body.)
- ADMIN_EMAIL the email of the admin (use for send email)
- HOST_NAME
the name of the host
- DATE_FORMAT the format of date to show in
the guest book and email.
- THANK_TEMPLATE thank you email template.
- ADMIN_TEMPLATE
notification email template.
- POST_TEMPLATE the body template of
guest book
Sample config file.[gbook.cfg] <?
//--------------------------------------------------- // Guest book
Configuration File [KP-Guest Book 1.0] // Free guest book // From http://www.vwin.co.th
// By Krerk Piromsopa. //---------------------------------------------------
// NOTIFY_GUEST // set to 0 if you don't want to notify. // 1 for
mailing thank you to guest. define(NOTIFY_GUEST,1); // NOTIFY_ADMIN //
set to 0 if you don't want to notify admin. // 1 to notify the ADMIN for the
incoming guest of guest book. define(NOTIFY_ADMIN,1);
// ADMIN_NAME &
ADMIN_EMAIL // The email address of the guest book admin.. // (Which will
use in mailing to the guest) // eg. ADMIN_NAME "Guest Book Admin" // ADMIN_EMAIL
"my@email.com" define(ADMIN_NAME,"Krerk Piromsopa (KP)"); define(ADMIN_EMAIL,"krerk@vwin.co.th");
// HOST_NAME // The name of the host. define(HOST_NAME,"www.vwin.co.th");
// DATE_FORMAT // The format of date in guest book and email. //
The following characters are recognized in the format string: // a - "am"
or "pm" // A - "AM" or "PM" // d - day of the month, 2 digits with leading
zeros; i.e. "01" to "31" // D - day of the week, textual, 3 letters; i.e.
"Fri" // F - month, textual, long; i.e. "January" // h - hour, 12-hour
format; i.e. "01" to "12" // H - hour, 24-hour format; i.e. "00" to "23" //
g - hour, 12-hour format without leading zeros; i.e. "1" to "12" // G - hour,
24-hour format without leading zeros; i.e. "0" to "23" // i - minutes; i.e.
"00" to "59" // j - day of the month without leading zeros; i.e. "1" to "31"
// l (lowercase 'L') - day of the week, textual, long; i.e. "Friday" //
L - boolean for whether it is a leap year; i.e. "0" or "1" // m - month; i.e.
"01" to "12" // n - month without leading zeros; i.e. "1" to "12" // M
- month, textual, 3 letters; i.e. "Jan" // s - seconds; i.e. "00" to "59"
// S - English ordinal suffix, textual, 2 characters; i.e. "th","nd" //
t - number of days in the given month; i.e. "28" to "31" // U - seconds since
the epoch // w - day of the week, numeric, i.e. "0" (Sunday) to "6" (Saturday)
// Y - year, 4 digits; i.e. "1999" // y - year, 2 digits; i.e. "99" //
z - day of the year; i.e. "0" to "365" // Z - timezone offset in seconds (i.e.
"-43200" to "43200") // eg. "d M Y H:i:s" define(DATE_FORMAT,"d M Y H:i:s");
// THANK_TEMPLATE // The template that uses to format the thank you
mail result. // The avaliable fields are // gname - guest name //
gemail - guest email // remote_addr - remote_addr // aname - admin name
// aemail - admin email // msg - message // date - current date /
time. // Leave blank if you don't have any template.. // (Don't forget
to set NOTIFY_GUEST = 1) define(THANK_TEMPLATE,"thank.txt");
// ADMIN_TEMPLATE
// The template that uses to format the admin notify mail result. // The
avaliable fields are the same as THANK_TEMPLATE // Leave blank if you don't
have any template.. // (Don't forget to set NOTIFY_ADMIN = 1) define(ADMIN_TEMPLATE,"thank.txt");
// POST_TEMPLATE // the template that uses to format the result to
guest book. // the avaliable fields are // gname - guest name // gemail
- guest email // remote_addr - remote_addr // aname - admin name //
aemail - admin email // msg - message // date - current date / time. //
Leave blank if you don't have any template.. define(POST_TEMPLATE,"book.txt");
?>
Template Format Template
for mail format can be edit by any text editor. If you don't specify the file
name the system will use the template default.tmp. The avaliable fields
that can be use in template are - gname - the guest name
- gemail
- the guest email
- aname - the admin name
- aemail - the admin email
- remote_addr
- remote address
- date - post date
- msg - message
Sample email
Template
Thank you for sign in the Guest book of http://www.Vwin.co.th/
on <date>. From : <gname> [<gemail>] Remote
Address : <remote_addr> Message : <msg> Please
take time to visit us again.
Sample Web Body Template <hr
width=40%> <B>From </B>: <a href="mailto:<gemail>"><gname>
[<gemail>]</a><BR> <B>On</B> : <date> (<remote_addr>)<BR> <B>Message
:</B> <PRE> <msg> </PRE>
Admin
/ Edit the guest book. The posted message will be save in body.inc
locate in your home directory of your guestbook you can edit this file with any
html editor. Suggesstion / Comment. If you have any suggestion,
feel free to comment at krerk@vwin.co.th.
Or go to http://www.vwin.co.th. Your comment
will help me improve this public guest book service. Enjoy. Krerk
Piromsopa (KP). krerk@vwin.co.th October
17, 2000.
|