![]() | ||||||||
|
Click here to get a copy for free | ||||||||
|
release 3.1 : preview or purchase CHECK OUT EZWEBALABUM FOR MORE FEATURES! this is the actual header of the script
#!/usr/bin/perl
use CGI qw(:standard);
##################################################################
# "PhotoAlbum3.cgi" - Scripted by Brian Viehland #
# E-mail: scripts@viehland.org #
# VERSION 3.1 (c) 2003 #
# #
# ///// description ///// #
# #
# This script will allow users to create photo albums and upload #
# images with descriptions to those albums. It also records the #
# date of the posting and has display options and multiple #
# passwords for security and access control. You can set up #
# email notification for each parts of the script. #
# Please leave some mention of me in this header and that you #
# modified the script I provided. If you come up with an update #
# to this script that is really good, PLEASE email it to me at #
# scripts@viehland.org #
# #
# If it don't work, email me and I'll help you get it runnning. #
# #
# The perl module CGI.pm is required on your server. If you #
# don't have it installed, get it. You also need to have POSIX #
# installed or some other date getting plugin. #
# #
# BUGS AND THINGS TO BE LOOKED INTO #
# On some servers, you must create your own folder called #
# PhotoAlbums in the base html directory and chmod it to 755 #
##################################################################
##################################################################
# Editable Variables (just a few)
##################################################################
# use this for set up problems - it will closely track the progress
# of the script using hidden html tags. When this is set to yes,
# the html source will show where the script is at each point
$debug = "no";
##################################################################
# Enter your own custom html header to make this page match the
# look of your own site. Careful of " and @ signs, use \" and \@
##################################################################
$header = "
<!-- Begin HTML Header -->
<html>
<head>
<title>Photo Album</title>
</head>
<BODY BGCOLOR=black TEXT=white LINK=aa0000 VLINK=aa0000>
<center>
<table width=500 border=0 cellpadding=0 cellspacing=0>
<tr valign=top><td><center>
<font face=\"Times New Roman\" size=4>
<b><i>My Photo Albums</b></i></font><br>
</center></td></tr>
<tr valign=top><td><center>
<br>
<!-- End HTML Header -->
";
# This quote and semicolon are necessary! Don't backslash them!
##################################################################
# Enter your own custom html footer to make this page match the
# look of your own site. Careful of " and @ signs, use \" and \@
##################################################################
$footer = "
<!-- Begin HTML Footer -->
<p>
</td>
</tr>
<tr valign=middle><td colspan=2>
<br>
</td></tr></table></td></tr></table>
<table cellpadding=4 border=1>
<tr><td colspan=2>
<center><font size=-1>
Photo Actions
</td></tr>
<tr valign=top>
<td>
<center><font size=-1>
Post:
<font color=red>
password1
</td><td>
<center><font size=-1>
Delete:
<font color=red>
delete1
</td></tr>
<tr><td colspan=2>
<center><font size=-1>
Album Actions
</td></tr>
<tr valign=top>
<td>
<center><font size=-1>
Create:
<font color=red>
password2
</td><td>
<center><font size=-1>
Delete:
<font color=red>
delete2
</td></tr>
<tr><td colspan=2>
<center>
<b>Albums are reset every 12 hours</b>
</td></tr>
</table>
</body>
</html>
";
# This quote and semicolon are necessary! Don't backslash them!
##################################################################
# Set the paths to the directories as absolute and as url paths
# use / between folders for unix and \ for dos
##################################################################
# this should automatically retrieve the site name
# otherwise, enter your site http://www.site.com
$parentURL = "http://$ENV{'HTTP_HOST'}";
# this should automatically retrieve the path
# otherwise, enter the path to your site /home/username/www/
$parentDirectory = "$ENV{'DOCUMENT_ROOT'}";
# this should automatically retrieve the script URL
# otherwise, enter the URL to your script http://www.site.com/cgi-bin/script.cgi
$URLToThisFile = "http://$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}";
# this should automatically retrieve the script path
# otherwise, enter the URL to your script /home/username/www/cgi-bin/script.cgi
$pathToThisFile = "$ENV{'SCRIPT_FILENAME'}";
##################################################################
# These options are for controlling the posting of Photos
# All very straight forward
##################################################################
$showPhotoPostOption = "yes"; # yes or no
$usePostingPassword = "yes"; # yes or no
$postingPassword = "password1";
$maximumFileSize = "500000"; # in bytes
@allowedFileExtensions = ('jpg','jpeg','gif','bmp');
$useMimeTypeDetection = "yes"; # yes or no
##################################################################
# These options are for controlling the deleting of Photos
##################################################################
$showPhotoDeleteButton = "yes"; # yes or no
$usePasswordForPhotoDelete = "yes"; # yes or no
$deletePassword = "delete1";
##################################################################
# These options are for controlling the adding of Albums
##################################################################
$allowUserDefinedAlbums = "yes"; # yes or no
$usePasswordForAlbumAdd = "yes"; # yes or no
$addAlbumPassword = "password2";
##################################################################
# These options are for controlling the deleting of Albums
##################################################################
$showAlbumDeletionOption = "yes"; # yes or no
$usePasswordForAlbumDelete = "yes"; # yes or no
$deleteAlbumPassword = "delete2";
##################################################################
# These variables are used to set the date format that ends up
# as the prefix for the filename. They should work as is, but
# they may need to be configured to your server
##################################################################
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$month = ($mon + 1);
$year += 1900;
$year %= 100;
$date = sprintf("%02d-%02d-%02d",$month,$mday,$year);
##################################################################
# These variables are used for email notification of actions
##################################################################
$sendNotificationUponPostPhoto = "yes"; # yes or no
$sendNotificationUponDeletePhoto = "yes"; # yes or no
$sendNotificationUponCreateAlbum = "yes"; # yes or no
$sendNotificationUponDeleteAlbum = "yes"; # yes or no
$emailAddress = "webmaster\@viehland.org"; # use \@ in address
$sendmailpath="/usr/sbin/sendmail";
##################################################################
# This sets the file directory structure, unix or dos
##################################################################
$servertype = "unix"; # unix or dos
##################################################################
# If you are going to use this for an adult site, please change
# this to yes. With this set to no, the script will edit out
# bad words listed in the array below for both album names and
# file descriptions. Setting this to yes disables the bad words
# check and also takes my name off of the bottom of the page.
##################################################################
$usedAsAdultGallery = "no"; # yes or no
##################################################################
# Predefined variables, you may change them, but be careful
##################################################################
# use PhotoAlbums in the base directory to store all pics
if ($servertype eq "unix") {
$parentDirectory = $parentDirectory . "/PhotoAlbums";
$parentURL = $parentURL . "/PhotoAlbums";
}
else {
$parentDirectory =~ s/\\/\\\\/g;
$parentDirectory = $parentDirectory . "\\PhotoAlbums";
$parentURL = $parentURL . "/PhotoAlbums";
}
# words that will not be allowed in the file names or descriptions
@badwords = ('****','****','****','****');
##################################################################
# That's It!!! You are ready to go now!
##################################################################
# Just dump this file into your cgi-bin directory, name it
# with the extention .pl or .cgi and CHMOD it to 755
##################################################################
##################################################################
everything else is just the script!
check out the actual thing! | ||||||||
| ||||||||