/*
GIS is a freeware open source image gallery.
It uses php-gd or imagemagick to make thumbnails and previews.
If you have a standard installation of apache php4 and imagemagick or php-gd GIS will work.
If you want to use imagemagick the webbserver must have the shell-command "convert".
convert is a part of imagemagick.
GIS Homepage: http://gis.sohtell.se/
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
License file is called license.txt.
GIS is primarly maintained by Gustav "Gussoh" Sohtell.
Version 2 was mostly done in January 2004.
Work on what is now called GIS was started in 2001.
*/
/*
CONFIGURATION HELP:
The configuration you find in this file is the configuration that will be used if there is no other setting in the "gis.conf.php"-file.
If you want to keep any special setting across version upgrades you should put the setting inside gis.conf.php instead.
As an example I'll set the quality-setting to 100, the use_previews-setting to true and the usertag-setting to "Hello World":
These settings in gis.conf.php would look like:
quality = 100
usertag = "Hello World"
use_previews = yes
;All the usual ways of setting a configuration key works but always use "=" between key and value.
;These lines are comments in the configuration-file.
;This is how you use groups. Groups are groups of settings. Settings that all have to do with the same thing, like uploading and icons.
;You'll see the available groups in the settings further down.
[upload]
enabled = true
password = "god"
These settings in index.php would look like:
$conf['quality'] = 100;
$conf['usertag'] = "Hello World";
$conf['use_previews'] = true;
// As this is PHP-code the rules are much stricter. Quotes around strings and ";" at the end of each setting.
// These lines are comments in PHP
// Groups:
$conf['upload']['enabled'] = true;
$conf['upload']['password'] = "god";
If a setting exists in both index.php and gis.conf.php, the setting in gis.conf.php will be used!
*/
/* If you want to use the config file - the location of it should be specified below. like: define('CONFIG_FILE', 'location-of-gis.conf.php')
remember to use double slashes on windows (c:\\www\\gis\\_imagesystem\\gis.conf.php)
the first row in a configfile should be ";" without the outer quotes */
define('CONFIG_FILE', '.gis/gis.conf.php');
/* Start dir. Defines the root of web archive. Start dir also needs to be specified in a define-constant */
define('START_DIR', '.'); /* Webserver must be able to link to files in this location - Set to "." for current directory */
define('MODULES', '.gis/googleModule.php'); /* Modules to add example: define('MODULES', '.gis/testModule.php .gis/testModule2.php'); Each module filename separated by spaces */
// define('MODULES', ''); /* Modules to add example: define('MODULES', '.gis/testModule.php .gis/testModule2.php'); Each module filename separated by spaces */
/* CONFIGURATION: */
$conf["helpful"] = true; /* Popups help-messages */
$conf["style"] = "gis.css";
$conf["user_tag"] = ""; /* Top of the archive, use
text
if you use ascii-art */
$conf["icons"]["folder"] = "folder.gif";
$conf["icons"]["folder_unreadable"] = "folder_unreadable.gif";
$conf["icons"]["folder_up"] = "folder_up.gif";
$conf["icons"]["folder_open"] = "folder_open.gif";
$conf["icons"]["empty"] = "icon_empty.gif";
/* Icons, lower case extension. If you are good at desgining icons - please send me a pack and I'll include them. I dont mind if you redo mine ;)'*/
$conf["icons"]["doc"] = "icon_doc.gif";
$conf["icons"]["gif"] = "icon_gif.gif";
$conf["icons"]["aac"] = "icon_itunes.gif";
$conf["icons"]["jpg"] = "icon_jpg.gif";
$conf["icons"]["jpeg"] = "icon_jpg.gif";
$conf["icons"]["avi"] = "icon_movie.gif";
$conf["icons"]["mpg"] = "icon_movie.gif";
$conf["icons"]["mpeg"] = "icon_movie.gif";
$conf["icons"]["mp4"] = "icon_quicktime.gif";
$conf["icons"]["mp3"] = "icon_mp3.gif";
$conf["icons"]["mp2"] = "icon_mp3.gif";
$conf["icons"]["nfo"] = "icon_nfo.gif";
$conf["icons"]["png"] = "icon_png.gif";
$conf["icons"]["ppt"] = "icon_ppt.gif";
$conf["icons"]["mov"] = "icon_quicktime.gif";
$conf["icons"]["rm"] = "icon_realone.gif";
$conf["icons"]["ram"] = "icon_realone.gif";
$conf["icons"]["rtf"] = "icon_rtf.gif";
$conf["icons"]["tif"] = "icon_tif.gif";
$conf["icons"]["tiff"] = "icon_tif.gif";
$conf["icons"]["txt"] = "icon_txt.gif";
$conf["icons"]["text"] = "icon_txt.gif";
$conf["icons"]["log"] = "icon_txt.gif";
$conf["icons"]["pls"] = "icon_winamp.gif";
$conf["icons"]["m3u"] = "icon_winamp.gif";
$conf["icons"]["wmv"] = "icon_windowsmedia.gif";
$conf["icons"]["wma"] = "icon_windowsmedia.gif";
$conf["previous_arrow"] = "arrow_previous.gif";
$conf["next_arrow"] = "arrow_next.gif";
$conf["up_arrow"] = "arrow_up.gif";
$conf["gallery_name"] = "Gussoh Imagesystem";
$conf["layout"] = "gis1"; /* "gis1" will give you the old layout, "gis2" will give you the new one. No other defined (so far). gis1 layout is faster than gis2 */
$conf["thumbnail_max_width"] = 150; /* Pixels */
$conf["thumbnail_max_height"] = 100;
$conf["thumbnail_image_quality"] = 80; /* 0 worst, 100 best */
$conf["thumbnail_permission_mode"] = 0664; /* Permission mode of created thumbnails, as chmod */
$conf["preview_max_width"] = 800;
$conf["preview_max_height"] = 600;
$conf["preview_image_quality"] = 80;
$conf["preview_permission_mode"] = 0664; /* Permission mode of created previews, as chmod */
$conf["image_columns"] = 0; /* Number of columns with images, Set to 0 to make the web browser autowrap, any other numbers than 1 or 0 seem to bug in mozilla */
$conf["column_width"] = 180; /* Width of each image column in pixels, this should be greater than max_width of the thumbnails */
$conf["column_height"] = 150; /* Height of each image row in pixels, this should be greater than max_height of the thumbnails */
$conf["thumbnails_per_page"] = 20; /* Number of thumbnails per page, set to 0 for no pages */
$conf["click_on_image"] = 1; /* Click on a preview-image takes you: 0) not a link 1) back to archive 2) to fullsize image */
$conf["click_on_thumbnail"] = 1; /* Click on a thumbnail takes you: 0) not a link 1) to preview 2) popups preview in popup - dont set "click_on_image" to 1 if popups are used */
$conf["popup_width"] = 0; /* Width of popupbox for previews (if used). Set to 0 to make dynamic (previw_maxwidth + ~30)*/
$conf["popup_height"] = 0; /* Height of popupbox for previews (is used). Set to 0 to make dynamic (preview_maxheight + ~100)*/
$conf["date_format"] = "H:i:s, d F Y"; /* Timestamp format as in function date() found on php.net */
$conf["hide_directories_starting_with"] = "."; /* separated by spaces */
$conf["hide_files_starting_with"] = ". LICENSE.TXT README.TXT VERSIONS.TXT CHANGELOG.TXT Thumbs.db"; /* separated by spaces */
$conf["hide_files_ending_with"] = ".php"; /* if you want to hide only index.php, write "index.php" instead of only ".php" */
$conf["follow_links"] = true; /* Should GIS follow file system links? */
$conf["version"] = "2.3 Developer";
$conf["system_dir"] = ".gis"; /* name of subdirectory containing thumbnails, comments and counters. In the lowest system directory the icons for the filetypes are placed */
$conf["system_dir_permission_mode"] = 0775; /* Permission as chmod of the system folder created in each directory. The web server must be able to read from this folder. */
$conf["folder_up_text"] = " up";
$conf["image_filename_format"] = "%filename %descriptionAndComment"; /* Usually written below the image, set it to "" for nothing. Valid strings are: %filename, %filesize, %descriptionAndComment (will display something like D/C if both description and comment exists) and %descriptionText wich will display the discription */
$conf["file_filename_format"] = "%filename (%filesize)"; /* File list format. Valid strings are %filename and %filesize */
$conf["thumbnail_allowed_tags"] = ""; /* Tags allowed in the description in thumbnail view */
$conf["preview_allowed_tags"] = ""; /* Tags allowed in descriptions in previews */
$conf["filesize_units"] = "B KiB MiB GiB TiB"; /* "Bytes Kilobytes Megabytes Gigabytes ..." Each unit separated by spaces, maxsize (which php can handle) is usually 2GB */
$conf["exif"]["enabled"] = true; /* Read exif-information from pictures */
$conf["exif"]["display_attributes"] = "DateTimeOriginal=Date DateTimeDigitized=Date DateTime=Date Make=Camera Manufacturer Model"; /* What exif attributes to display in format [attribute]=[name]. Name and the "=" can be omitted. Use name if you want another name of the attribute than the original name, or if you want to group name attributes into one (like date of the photograph). Separate each one with space. */
$conf["exif"]["show_full"] = false; /* Show ALL exif-information avalable in image. Looks ugly but is very informative ;) */
$conf["not_images"] = "avi mpg mpeg txt"; /* extensions that aren't images but supported by imagemagick (or gd). Separated by spaces. All in lowercase! */
$conf["only_these_are_images"] = "jpeg jpg gif bmp png tif tiff"; /* if this is set to anything, only the extensions here are marked as images. if it says "jpg gif png" then only these three images are counted as images (unless there already is a thumbnail for the file) Each extension should be separated by spaces */
$conf["these_are_images"] = ""; /* If you are having PROBLEMS with GIS not understanding that these extensions ARE REALLY images then add them here. Each extension separated by space. */
$conf["description_end"] = ".desc.txt"; /* $image.description.txt */
$conf["thumbnail_end"] = ".thumb.jpg"; /* $image.jpg.thumb.jpg. Also specifies wich imagetype to use for thumbnails if using Imagemagick */
$conf["preview_end"] = ".prev.jpg"; /* $image.jpg.prev.jpg. Also specifies wich imagetype to use for previews if using Imagemagick*/
$conf["counter_end"] = ".counter.txt";
$conf["comments_end"] = ".comments.txt"; /* $image.comment.txt */
$conf["archive_comments_filename"] = "comments.txt"; /* Filename for achive comments, put in system_dir */
$conf["archive_description_filename"] = "description.txt"; /* Filename for archive descriptions, put in system_dir */
$conf["desription_thumbnail_maxlength"] = 0; /* longer strings will be cut from thumbnail description. If set to 1, full description is displayed. If set to 0, no characters are displayed. This option does not work if "thumbnail_allowed_tags" is set */
$conf["sort_directories"] = 1; /* Sort order of directories, 0) As in filesystem 1) Sort by natural-case-insensitive order 2) (1) but reversed 3) simple sort() */
$conf["sort_files"] = 1; /* Sort order of files, 0) As in filesystem 1) Sort by natural-case-insensitive order 2) (1) but reversed 3) simple sort() */
$conf["sort_images"] = 1; /* Sort order of images, 0) As in filesystem 1) Sort by natural-case-insensitive order 2) (1) but reversed 3) simple sort() */
$conf["use_preview_counter"] = true; /* Prints (and logs) the number of times an image has been viewed. It makes a logfile of all viewings with IP and timestamp */
$conf["preload"] = true; /* Puts the next and previous image in the web browser cache by displaying them below the big image with height=0 and width=0 */
$conf["use_archive_descriptions"] = true; /* descriptions for a whole archive */
$conf["use_image_descriptions"] = true; /* descriptions for a single image */
$conf["use_previews"] = true; /* show and create preview-files */
$conf["use_archive_comments"] = true; /* show and submit comments for a whole archive */
$conf["use_preview_comments"] = false; /* show and submit comments for a single picture */
$conf["max_execution_time"] = 30; /* Time in seconds allowed for resizeing each image (if using GD). If safemode is on, this has no effect */
$conf["imagemagick_output"] = "/dev/null"; /* Output from imagemagick is written here. Specify a file for logging from IM if you get errors */
$conf["true_color_and_resample_off_with_gd"] = false; /* Makes thumbnails and previews without true color and resampling when using GD2. Good on slow machines. */
$conf["path_to_imagemagick_convert"] = "/usr/bin/convert"; /* set to false to disable imagemagick or to a correct path if convert cannot be found
automatically (Ex: "/usr/local/bin/convert") */
$conf["write_htaccess"] = false; /* writes a ".htaccess"-file in each system_dir containing "Options -Indexes" */
$conf["write_index.php"] = true; /* writes a "index.php"-file in each system_dir containing die("Not allowed!"); */
$conf["log_comment_host"] = 2; /* 0) does not log ip/host for comments 1) logs md5()-sum of ip/host 2) log ip/hostname in commentfile */
$conf["log_viewer_host"] = 2; /* As above but logs every time an image is viewed */
$conf["log_viewer_timestamp"] = true; /* Log timestamp of the view. If you have a heavy load on your archive you should consider setting log_viewer_host to 0 and log_timestamp to false - this will make much smaller logfiles! */
$conf["header"] = "Content-Type: text/html; charset=UTF-8"; /* Header default: "Content-type: text/html; charset=UTF-8" - specifing charset. If you got problems with characters like åäö try setting charset to
"ISO-8859-1" instead. Setting it to false or 0 disables the header-command. */
$conf["encode_comments_to_utf8"] = false; /* encodes comments to UTF-8, this should be set if a UTF-8-header is sent and comments are not submitted by UTF-8-browser */
$conf["encode_descriptions_to_utf8"] = true; /* encodes thumbnailes to UTF-8, this should be set if a UTF-8-header is sent and descriptions are not submitted by UTF-8-browser (probably not) */
/* Upload Settings */
$conf["upload"]["enabled"] = false; /* Enable upload feature (If you only want this in one folder use a gis.conf.php-file in that folder's .gis-folder) */
$conf["upload"]["password"] = "You wish :)"; /* The upload password, remove for no password. The password is crypted if "password_crypted_level" is set to 1 or 2 */
$conf["upload"]["password_crypted_level"] = 0; /* if set to 0 - the password written here is plaintext. 1: the password an md5()-sum 2: the password is crypt(). Plaintext if omitted */
$conf["upload"]["allowed_files"] = "log txt jpeg jpg gif bmp png tif tiff mp3 avi mpg mpeg mov swf zip rar"; /* Allowed file extensions. If omitted the "disallowed_files"-setting is used instead */
$conf["upload"]["disallowed_files"] = "exe vbs doc pif scr bat"; /* if "allowed_files is not set then this will be used to filter out bad files */
$conf["upload"]["allow_new_folder"] = true; /* Allow creation of new folders */
$conf["upload"]["new_folder_text"] = "Nickname: (new folder)"; /* Text to tell the user what the textinput does, This is useful if you want the user to enter his/hers nick or similar */
$conf["upload"]["new_folder_error_text"] = "Your nickname contains disallowed characters."; /* Error message when user tries to create a folder with disallowed characters */
$conf["upload"]["new_folder_permission_mode"] = 0775; /* Permission mode, as chmod, for new folder. The web server must be able to read in this folder. */
$conf["upload"]["allowed_characters"] = "abcdefghijklmnopqrstuvwxyzåäöABCDEFGHIJKLMNOPQRSTUVWXYZÅÄÖ1234567890-_()[]{}!¤%&=+§½,. ";
/* END OF CONFIGURATION */
/* LOAD MODULES */
if(MODULES) {
$modules = explode(' ', MODULES);
foreach($modules as $module)
require_once($module);
}
/* END OF LOAD MODUES */
/* FUNCTIONS: */
if(!function_exists("printUsertag")) {
function printUsertag() {
if(getConfig("user_tag")) {
echo("
" . getConfig("user_tag") . "
");
}
}
}
if(!function_exists("fileExistsAndIsReadable")) {
function fileExistsAndIsReadable($file) {
if(file_exists($file)) {
if(is_readable($file)) {
return true;
}
help("File '" . substr($file, strlen(START_DIR)) . "' exists but the web server cannot read it.");
}
return false;
}
}
if(!function_exists("readableByGD")) {
function readableByGD($extension) {
/* Modified function from php.net */
$aPossibleImageTypeBits = array(
IMG_GIF=>'gif',
IMG_JPG=>'jpg',
IMG_PNG=>'png',
IMG_WBMP=>'bmp'
);
foreach($aPossibleImageTypeBits as $iImageTypeBits => $sImageTypeString) {
if(imagetypes() & $iImageTypeBits) {
$aSupportedTypes[] = $sImageTypeString;
}
}
return in_array(strtolower($extension), $aSupportedTypes);
}
}
if(!function_exists("readableByImagemagick")) {
function readableByImagemagick($extension) {
static $types;
static $done;
if(!$done) {
if(getConfig("path_to_imagemagick_convert")) {
$convert = getConfig("path_to_imagemagick_convert");
}
else
$convert = "convert";
/* Get Imagemagick Version */
$versionText = shell_exec($convert . " -version");
$versionStartPos = strpos($versionText, "ImageMagick ") + strlen("ImageMagick ");
$versionEndPos = strpos($versionText, " ", $versionStartPos);
$version = substr($versionText, $versionStartPos, $versionEndPos - $versionStartPos);
$formats = explode("\n",(shell_exec($convert . " -list format")));
$done = true;
if(is_array($formats)) {
foreach($formats as $format) {
$formatArray = str_word_count($format, 1);
if($version < 6)
$word = 0;
else
$word = 1;
if(trim($formatArray[$word]) && strtoupper($formatArray[$word]) == $formatArray[$word])
$types[] = $formatArray[$word];
}
/* Seem as if Imagemagick 6 does not list jpg - added manually */
if($version >= 6 && is_array($types))
$types[] = "JPG";
}
/* Old Algorithm for Imagemagick 5 ONLY */
/*if(getConfig("path_to_imagemagick_convert"))
$convertPath = getConfig("path_to_imagemagick_convert") . "/";
$formats = explode("\n",(shell_exec($convertPath . "convert -list format")));
$done = true;
if(is_array($formats))
foreach($formats as $format)
if($temp = str_replace("*", "", trim(substr($format,0,strpos($format, " r")))))
if(strtoupper($temp) == strtoupper($temp))
$types[] = $temp;*/
}
if(!is_array($types)) {
help("Could not list supported Imagemagick formats. Imagemagick 5.x and 6.x is supported.");
return false;
}
return in_array(strtoupper($extension), $types);
}
}
if(!function_exists("imagemagickInstalled")) {
function imagemagickInstalled() {
static $set;
static $returnCode;
if(!$set) {
if(getOS() != "UNIX") { /* needs to be fixed if imagemagick is run under windows */
return false;
}
if(getConfig("path_to_imagemagick_convert")) {
$convert = getConfig("path_to_imagemagick_convert");
} else {
$convert = "convert";
}
if(getConfig("path_to_imagemagick_convert") != false) {
$system = system($convert . " > " . getConfig("imagemagick_output"), $returnCode);
}
$set = true;
}
if($returnCode === 0) {
return true;
}
else
return false;
}
}
if(!function_exists("gdInstalled")) {
function gdInstalled() {
static $done;
static $gdInstalled;
if(!$done) {
$done = true;
$gdInstalled = function_exists("imagecreate") || (extension_loaded("gd") || (!ini_get("safe_mode") && @dl("gd.so")));
}
return $gdInstalled;
}
}
if(!function_exists("isImage")) {
function isImage($filename) {
$extension = end($tmp = explode(".", $filename));
$areImages = explode(" ", getConfig("these_are_images"));
if(is_array($areImages))
if(in_array(strtolower($extension), $areImages))
return true;
$notImages = explode(" ", getConfig("not_images"));
if(is_array($notImages))
if(in_array(strtolower($extension), $notImages))
return false;
$onlyTheseAreImages = explode(" ", getConfig("only_these_are_images"));
if(is_array($onlyTheseAreImages))
if(!in_array(strtolower($extension), $onlyTheseAreImages))
return false;
if(imagemagickInstalled())
return readableByImagemagick($extension);
if(gdInstalled())
return readableByGD($extension);
help("No imagemanager is installed. You either need php-gd (gd2 is better) or imagemagick. Safe mode has to be turned off (php.ini) to use imagemagick. If you have imagemagick installed, try setting the convert_path-setting in index.php.");
return false;
}
}
if(!function_exists("getDir")) {
function getDir() { /* get fixed url from get (makes url safe(er?)) !! DO NOT USE getConfig() IN THIS FUNCTION. (getConfig() uses getDir())*/
$dir = getVariable("dir");
if(!$dir && getVariable("direc"))
$dir = "/" . getVariable("direc");
if(substr_count($dir, ".."))
return START_DIR;
while(substr_count($dir, "//")) /* Replaces all //, /// and /////... with / */
$dir = str_replace("//", "/", $dir);
$dir = START_DIR . $dir;
return $dir;
}
}
if(!function_exists("printListDirectories")) {
function printListDirectories($strDir = false, $level = 0) {
if(!$strDir) {
if(getConfig("layout") == "gis1")
$strDir = getDir() ? getDir() : START_DIR;
else
$strDir = START_DIR;
}
$hideDirectoriesStartingWith = getConfig("hide_directories_starting_with");
$hideDirectoriesStartingWith = explode(" ", $hideDirectoriesStartingWith); /* make an array of the strings */
$follow_links = getConfig("follow_links");
$systemDir = getConfig("system_dir");
$startDir = START_DIR;
$folderUnreadableIcon = getConfig("folder_unreadable", "icons");
$folderIcon = getConfig("folder", "icons");
$folderUpIcon = getConfig("folder_up", "icons");
$folderOpenIcon = getConfig("folder_open", "icons");
/* define("UNREADABLE_FILE", "<§UNREADABLE/$>"); NOT FINISHED!! */
if(!fileExistsAndIsReadable($systemDir . "/" . $folderUpIcon))
$folderUpIcon = false;
if(!fileExistsAndIsReadable($systemDir . "/" . $folderIcon))
$folderIcon = false;
if(!fileExistsAndIsReadable($systemDir . "/" . $folderOpenIcon))
$folderOpenIcon = false;
if(!fileExistsAndIsReadable($systemDir . "/" . $folderUnreadableIcon))
$folderUnreadableIcon = false;
if(getOS() == "UNIX" && substr($strDir, -1) != "/" || getOS() == "Windows" && substr($strDir, -1) != "\\")
$strDir = $strDir . "/";
if ($dir = @opendir($strDir)) {
if($level == 0 && getConfig("layout") != "gis1") { /* make pseudo-root-dir containing gallery name */
echo("");
if(getDir() == START_DIR) {
if($folderOpenIcon)
echo(" ");
elseif($folderIcon)
echo(" ");
}
elseif($folderIcon)
echo(" ");
echo(getConfig("gallery_name") . "");
$level++;
}
if(getConfig("layout") == "gis1") {
if(getDir() != START_DIR) {
/* .. - link */
$link = substr(getDir(), strlen(START_DIR));
$link = "?dir=" . urlencode(substr($link, 0, strrpos($link, "/"))); /* can be made into one substr */
if($link == "?dir=")
$link = "";
echo("");
if($folderUpIcon)
echo("");
echo(getConfig("folder_up_text") . " ");
}
}
while(false !== ($file = readdir($dir))) {
$hide = false;
if(@is_dir($strDir . "/" . $file) && $file != "." && $file != "..") {
if(is_array($hideDirectoriesStartingWith)) {
foreach($hideDirectoriesStartingWith as $start) {
if(strlen($start) && substr($file, 0, strlen($start)) == $start) {
$hide = true;
}
}
}
if(@is_readable($strDir . "/" . $file)) {
if(!$follow_links && is_link($strDir . "/" . $file)) {
$hide = true;
}
if(!$hide) {
$directories[] = $file;
}
}
else {
if(!$hide) {
$directories["<§UNREADABLE/$>" . $file] = $file;
}
}
}
}
if(is_array($directories)) {
if(getConfig("sort_directories")) {
switch(getConfig("sort_directories")) {
case 1:
natcasesort($directories);
break;
case 2:
natcasesort($directories);
$directories = array_reverse($directories);
break;
case 3:
sort($directories);
break;
}
}
if(getConfig("layout") != "gis1")
echo("
\n"); /* mmm */
foreach($directories as $key => $file) {
/*for($i = 0; $i < $level; $i++) { /* To use instead of
"); foreach($comments as $comment) { if($className == "commentDivEven") $className = "commentDivOdd"; else $className = "commentDivEven"; echo("
"); echo("Comment: