2.00 check if (!function_exists("imagecreatetruecolor")) { echo "

Error: MiniGal cannot run!

\n"; echo "

Function \"imagecreatetruecolor\" is not available. You should install the correct GD library version with PHP

"; exit(); } //Folder access check if (!mkdir("thumbs2") && !is_file("settings.php")) { echo "

Error: MiniGal cannot run!

\n"; echo "

MiniGal does not have write access to gallery dir. Change gallery dir chmod to 777 and run script again.

"; exit(); } if (is_dir("thumbs2")) { rmdir("thumbs2"); } // safe_mode check if (ini_get("safe_mode")) { echo "

Error: MiniGal cannot run!

Your PHP installation is running in safe_mode which is unsupported due to heavy file system restrictions.

What you can do:
- Change \"safe_mode\" to off in php.ini (if you run the server yourself).
- Ask your host to turn it off and alternatively use \"open_basedir\" which is less restrictive but still safe.
- Find a better host!

NOTE: A safe mode compatible version of MiniGal is being planned. Watch the website/forum for news about this

"; exit(); } ////////////////////////////// // // // INITIAL STUFF // // // ////////////////////////////// //Set variables if (isset($_REQUEST['list'])) { $list = (get_magic_quotes_gpc()) ? stripslashes($_REQUEST['list']) : $_REQUEST['list']; } if (isset($_REQUEST['image'])) { $image = (get_magic_quotes_gpc()) ? stripslashes($_REQUEST['image']) : $_REQUEST['image']; } $folder = (get_magic_quotes_gpc()) ? stripslashes($_REQUEST["folder"]) : $_REQUEST["folder"]; $action = (isset($_REQUEST["action"])) ? $_REQUEST["action"] : ""; $selectfile = (isset($_REQUEST["selectfile"])) ? $_REQUEST["selectfile"] : ""; $addtext = (isset($_REQUEST["addtext"])) ? $_REQUEST["addtext"] : ""; $fileaction = (isset($_REQUEST["fileaction"])) ? $_REQUEST["fileaction"] : ""; $newfilename = (isset($_REQUEST["newfilename"])) ? $_REQUEST["newfilename"] : ""; $dirname = (isset($_REQUEST["dirname"])) ? $_REQUEST["dirname"] : ""; $renamedir = (isset($_REQUEST["renamedir"])) ? $_REQUEST["$renamedir"] : ""; $phpself = (isset($_SERVER["PATH_TRANSLATED"]))? dirname($_SERVER["PATH_TRANSLATED"]) . "/" : ""; //Includes include($phpself."settings.php"); include($phpself."classes.php"); include($phpself."classes_admin.php"); if (is_file("counter.php")) { include("counter.php"); } //Classes $MGaction = new Minigal; $MGaction->list = $list; $MGaction->gallerydir = $gallerydir; $MGadmin = new MGadmin; include("language.php");// Load language file $MGadmin->headline = $gallerytitle; $MGadmin->list = $list; $MGadmin->image = $image; $MGadmin->charset = $charset; $MGadmin->folder = $folder; // Pass settings to MGadmin $MGadmin->gallerytitle = $gallerytitle; $MGadmin->gallerydir = $gallerydir; $MGadmin->owneremail = $owneremail; $MGadmin->activestyle = $activestyle; $MGadmin->sendmail = $sendmail; $MGadmin->showexif = $showexif; $MGadmin->showcomments = $showcomments; $MGadmin->thumbcaptions = $thumbcaptions; $MGadmin->resizelargeimg = $resizelargeimg; $MGadmin->dateformat = $dateformat; $MGadmin->images_side = $images_side; $MGadmin->pagerows = $pagerows; $MGadmin->upload_height = $upload_height; $MGadmin->upload_width = $upload_width; $MGadmin->upload_quality = $upload_quality; $MGadmin->gallerycopyright = $gallerycopyright; $MGadmin->adminpass = $adminpass; $MGadmin->version = "B13"; $movie_ext= array(".mov",".avi",".mpg",".mpeg",".wmv",".asf"); $MGaction->debug(); $MGadmin->initialsetup(); if (!is_dir("thumbs")) { mkdir("thumbs"); } //Create gallery thumb dir if not already ////////////////////////////// // // // OUTPUT SCRIPT // // // ////////////////////////////// ?> <? echo $gallerytitle; ?> accesscontrol(); if ($_REQUEST["upload"] == "set") { $status = $MGadmin->uploads(); } $MGaction->list = $MGadmin->list; if ($_REQUEST["createthumbs"] == "yes") { // mod by Vitez echo "----> pokrecem process...
"; ob_end_flush(); error_reporting(E_ERROR && E_WARNING); set_time_limit(0); $time_start = time(); $status = $MGadmin->createthumbs("{$gallerydir}/"/*.$_GET["list"]."/"*/); echo "

----------------
Proces zavrsen
"; exit; } //Create thumbs if ($_REQUEST["chmodall"] == "yes") { $status = $MGadmin->chmodall("$gallerydir/",$_REQUEST["chmod"]); } //Change chmod //------------------------------------Main display ?> 0) { $status = $MGadmin->fileactions($action); } if (isset($status)) { ?> dirlist(); $introimg = (is_file("$gallerydir/$list/description.dir")) ? "introtext.gif" : "introtext_off.gif"; ?> list)>0) { $MGaction->list .= "/"; } //Set list variable ending slash if ((@count($MGaction->dirarray) < 1) && (@count($MGaction->filearray) < 1)) { ?> dirarray); $i++) { ?> filearray); $i++) { if (!in_array(strrchr($MGaction->filearray[$i], "."), $movie_ext)) { //Check if movie=false list($width, $height, $type, $attr) = getimagesize("$gallerydir/$MGaction->list" . "thumbs/tn_" . $MGaction->filearray[$i]); } $width = $width / 5; $height = $height / 5; $totalfilesize += filesize("$gallerydir/$MGaction->list" . $MGaction->filearray[$i]); $dec = "1"; $val = "bytes"; if (strlen(filesize("$gallerydir/$MGaction->list" . $MGaction->filearray[$i])) > 3) { $dec="1000"; $val="KB"; } if (strlen(filesize("$gallerydir/$MGaction->list" . $MGaction->filearray[$i])) > 6) { $dec="1000000"; $val="MB"; } ?> list) > 0) { rtrim($MGaction->list,"/"); } //Set list variable ending slash ////////////////////////////// // // // STATUS BAR // // // ////////////////////////////// $dec = "1"; $val = "bytes"; if (@strlen($totalfilesize) > 3) { $dec = "1000"; $val = "KB"; } if (@strlen($totalfilesize) > 6) { $dec = "1000000"; $val = "MB"; } ?>
lang["admin"] . ": $gallerytitle" ?>
Chmodaj sve na 777    " alt="lang["nav1"] ?>" />    " alt="lang["nav2"] ?>" />    " alt="lang["nav3"] ?>"/>    " alt="lang["nav4"] ?>" />    " alt="lang["nav5"] ?>"/>    " alt="lang["nav6"] ?>" />    " alt="lang["nav7"] ?>" />    " alt="lang["nav8"] ?>" />    " alt="lang["nav9"] ?>" />    " alt="lang["logoff1"] ?>" />
navigation(); // Do the rest ?> headline ?>
lang["select"] ?> lang["preview"] ?> lang["filename"] ?> lang["filesize"] ?> lang["chmod"] ?> lang["actions"] ?>
lang["folderempty"] ?>
list" . $MGaction->dirarray[$i])) ?>">dirarray[$i] ?> list)>0) { $MGadmin->list .= "/"; } // Add slash to end of $this->list if ($MGadmin->is_dir_empty($MGadmin->list . $MGaction->dirarray[$i]) === true) { $MGadmin->list = rtrim($MGadmin->list, "/"); //Remove trailing slash again echo $MGadmin->lang["empty"]; } ?>   list . $MGaction->dirarray[$i])), -3) ?> list.$MGaction->dirarray[$i] . "/locked.dir")) { //Display padlock if subfolder is locked ?> " alt="lang["nav4"] ?>" /> list" . $MGaction->dirarray[$i] . "/thumbs/tn_thumb.jpg")) { //Display delete thumb ?> &selected=dirarray[$i] ?>&action=unsetthumb">" alt="lang["deletethumb"] ?>" /> " alt="lang["renamefolder"] ?>" /> list.$MGaction->dirarray[$i] . "/caption.dir")) { ?> " alt="lang["editcaption"] ?>" /> " alt="lang["addcaption"] ?>" /> " alt="lang["deletefolder"] ?>" />
filearray[$i], "."), $movie_ext)) { //Check if movie=true ?> " alt="lang["presstoview"] ?>" /> list" . $MGaction->filearray[$i])) ?>" alt="" /> filearray[$i] ?> list" . $MGaction->filearray[$i])/$dec),2) . " " . $val ?> list.$MGaction->filearray[$i])), -3) ?> list . "thumbs/" . $MGaction->filearray[$i] . ".txt")) { // Edit comments icon ?> " alt="lang["editcomments"] ?>" /> list) > 0 && !in_array(strrchr($MGaction->filearray[$i], "."),$movie_ext)) { //Lets user set default thumb unless in gallery root ?> " alt="lang["setthumb"] ?>" /> " alt="lang["renamefile"] ?>" /> filearray[$i] . ".cmt")) { ?> " alt="lang["editcaption"] ?>" /> " alt="lang["addcaption"] ?>" />  
" onclick="checkAll()" /> " onclick="uncheckAll()" /> " />
lang["total"] . ": " . @count($MGaction->filearray) . " " . $MGadmin->lang["files"] . " (" . @round(($totalfilesize/$dec), 2) . " $val), " . @count($MGaction->dirarray) . " " . $MGadmin->lang["subfolders"]; ?>
lang["newversion"] ?>

lang["admininterface"] . " ($version)" ?>