rlm@3: <?php include('../e2config.php'); include ("password_protect.php"); ?> rlm@3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" rlm@3: "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> rlm@3: <html xmlns="http://www.w3.org/1999/xhtml"> rlm@3: <head> rlm@3: <title>(E)2 Gallery Pro File Manager</title> rlm@3: <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> rlm@3: <link rel="shortcut icon" href="http://e2interactive.com/favicon.ico" /> rlm@3: <style type="text/css"> rlm@3: body { rlm@3: font-size: 11px; rlm@3: font-family: Tahoma, sans-serif; rlm@3: background: #F1F1F1 url(images/bodybg.png) repeat-x top center; rlm@3: } rlm@3: .dsep{ rlm@3: clear:both; rlm@3: border-bottom: dotted 1px #999; rlm@3: margin:20px 0; rlm@3: } rlm@3: #maincontent img{ rlm@3: margin: 0 10px 10px; rlm@3: } rlm@3: #container #header { rlm@3: background-image: url(images/adminheader.png); rlm@3: background-repeat: no-repeat; rlm@3: background-position: center top; rlm@3: width:750px; rlm@3: text-align: center; rlm@3: height: 87px; rlm@3: } rlm@3: #container { rlm@3: text-align: center; rlm@3: width: 750px; rlm@3: margin:0 auto; rlm@3: } rlm@3: #container #maincontent { rlm@3: text-align: left; rlm@3: padding: 10px 10px; rlm@3: border: dotted #CCC 1px; rlm@3: -moz-border-radius: 10px; rlm@3: -khtml-border-radius: 10px; rlm@3: -webkit-border-radius: 10px; rlm@3: border-radius: 10px; rlm@3: margin-top: 10px; rlm@3: background: #E1E1E1; rlm@3: } rlm@3: #container #navigation { rlm@3: height: 35px; rlm@3: padding: 0 10px; rlm@3: } rlm@3: #navigation #manage, #navigation #managexml, #navigation #outputxml, #navigation #seegallery { rlm@3: background-image: url(images/tab_bg.png); rlm@3: background-repeat: repeat-x; rlm@3: background-position: center top; rlm@3: height: 19px; rlm@3: float: left; rlm@3: padding: 5px 6px 0; rlm@3: margin: 1px 5px 5px; rlm@3: border-left: solid 1px #CCC; rlm@3: border-right: solid 1px #CCC; rlm@3: border-bottom: solid 1px #CCC; rlm@3: -moz-border-radius: 0 0 5px 5px; rlm@3: -webkit-border-bottom-left-radius: 5px; rlm@3: -webkit-border-bottom-right-radius: 5px; rlm@3: -khtml-border-bottom-left-radius: 5px; rlm@3: -khtml-border-bottom-right-radius: 5px; rlm@3: border-bottom-left-radius: 5px; rlm@3: border-bottom-right-radius: 5px; rlm@3: cursor:pointer; rlm@3: } rlm@3: #navigation #logout{ rlm@3: background-image: url(images/tab_bg.png); rlm@3: background-repeat: repeat-x; rlm@3: background-position: center top; rlm@3: height: 19px; rlm@3: float: right; rlm@3: padding: 5px 6px 0; rlm@3: margin: 1px 5px 5px; rlm@3: border-left: solid 1px #CCC; rlm@3: border-right: solid 1px #CCC; rlm@3: border-bottom: solid 1px #CCC; rlm@3: -moz-border-radius: 0 0 5px 5px; rlm@3: -webkit-border-bottom-left-radius: 5px; rlm@3: -webkit-border-bottom-right-radius: 5px; rlm@3: -khtml-border-bottom-left-radius: 5px; rlm@3: -khtml-border-bottom-right-radius: 5px; rlm@3: border-bottom-left-radius: 5px; rlm@3: border-bottom-right-radius: 5px; rlm@3: cursor:pointer; rlm@3: } rlm@3: #navigation a{ rlm@3: text-decoration:none; rlm@3: color:#333; rlm@3: } rlm@3: #navigation a:hover{ rlm@3: text-decoration:underline; rlm@3: color:#333; rlm@3: } rlm@3: .xmloutput{ rlm@3: padding:15px; rlm@3: background: #FFF; rlm@3: margin:10px 3px; rlm@3: } rlm@3: #maincontent .textinput{ rlm@3: width:550px; rlm@3: font:16px "Trebuchet MS", Verdana, Arial, sans-serif; rlm@3: } rlm@3: #maincontent .alrignright{ rlm@3: float:right; rlm@3: } rlm@3: .floatleft{ rlm@3: float:left; rlm@3: padding:0 15px; rlm@3: } rlm@3: .clear{ rlm@3: clear:both; rlm@3: } rlm@3: .error{ rlm@3: color:#990000; rlm@3: font-size:16px; rlm@3: } rlm@3: </style> rlm@3: rlm@3: <link rel="stylesheet" media="all" type="text/css" href="Css/FileManager.css" /> rlm@3: <link rel="stylesheet" media="all" type="text/css" href="Css/Additions.css" /> rlm@3: rlm@3: <script type="text/javascript" src="js/mootools-core.js"></script> rlm@3: <script type="text/javascript" src="js/mootools-more.js"></script> rlm@3: rlm@3: <script type="text/javascript" src="Source/FileManager.js"></script> rlm@3: <script type="text/javascript" src="Source/Language/Language.en.js"></script> rlm@3: <script type="text/javascript" src="Source/Language/Language.de.js"></script> rlm@3: <script type="text/javascript" src="Source/Additions.js"></script> rlm@3: rlm@3: <script type="text/javascript" src="Source/Uploader/Fx.ProgressBar.js"></script> rlm@3: <script type="text/javascript" src="Source/Uploader/Swiff.Uploader.js"></script> rlm@3: rlm@3: <script type="text/javascript" src="Source/Uploader.js"></script> rlm@3: rlm@3: <script type="text/javascript"> rlm@3: window.addEvent('domready', function(){ rlm@3: /* Simple Example */ rlm@3: var manager = new FileManager({ rlm@3: url: 'manager.php', rlm@3: assetBasePath: 'Assets', rlm@3: language: 'en', rlm@3: uploadAuthData: {session: 'MySessionId'} rlm@3: }); rlm@3: $('manage').addEvent('click', manager.show.bind(manager)); rlm@3: rlm@3: /* XML upload*/ rlm@3: var manager = new FileManager({ rlm@3: url: 'managerxml.php', rlm@3: assetBasePath: 'Assets', rlm@3: language: 'en', rlm@3: uploadAuthData: {session: 'MySessionId'} rlm@3: }); rlm@3: $('managexml').addEvent('click', manager.show.bind(manager)); rlm@3: rlm@3: }); rlm@3: </script> rlm@3: </head> rlm@3: <body> rlm@3: <div id="container"> rlm@3: <a href="index.php"><div id="header"></div></a> rlm@3: <div id="navigation"> rlm@3: <div id="manage">Upload/Manage Images</div> rlm@3: <div id="managexml">Upload/Edit XML</div> rlm@3: <a href="outputxml.php"><div id="outputxml">Output XML</div></a> rlm@3: <a href="../"><div id="seegallery">See Gallery</div></a> rlm@3: <a href="?logout=1"><div id="logout">Log Out</div></a> rlm@3: </div> rlm@3: <div id="maincontent"> rlm@3: <a href="xml/e2galleryproXMLsample.xml" class="alrignright">Download XML Sample File</a> rlm@3: <h2>Output XML for Image Gallery</h2> rlm@3: Create the xml for the image inside which folder? Set the folder to look at to create the XML automagically. rlm@3: <br /> rlm@3: <br /> rlm@3: Default file paths are:<br /> rlm@3: <?php rlm@3: function rp($path) { rlm@3: $out=array(); rlm@3: foreach(explode('/', $path) as $i=>$fold){ rlm@3: if ($fold=='' || $fold=='.') continue; rlm@3: if ($fold=='..' && $i>0 && end($out)!='..') array_pop($out); rlm@3: else $out[]= $fold; rlm@3: } return ($path{0}=='/'?'/':'').join('/', $out); rlm@3: } rlm@3: ?> rlm@3: <strong>Gallery Path:</strong> Galleries/gallery1/ rlm@3: <br /> rlm@3: <strong>Large Path:</strong> Galleries/gallery1/large/ rlm@3: <br /> rlm@3: <strong>Thumbnail Path:</strong> Galleries/gallery1/thumbs/ rlm@3: <br /><br /> rlm@3: <?php rlm@3: rlm@3: function getImages($path, $thumbPath) { rlm@3: rlm@3: $files = array(); rlm@3: $fileNames = array(); rlm@3: $i = 0; rlm@3: $errorMessage=''; rlm@3: if (is_dir($path)) { rlm@3: if ($dh = opendir($path)) { rlm@3: while (($file = readdir($dh)) !== false) { rlm@3: if ($file == "." || $file == ".." || $file == ".DS_Store") continue; rlm@3: $fullpath = $path . "/" . $file; rlm@3: $fkey = strtolower($file); rlm@3: while (array_key_exists($fkey,$fileNames)) $fkey .= " "; rlm@3: $a = stat($fullpath); rlm@3: $files[$fkey]['size'] = $a['size']; rlm@3: if ($a['size'] == 0) $files[$fkey]['sizetext'] = "-"; rlm@3: else if ($a['size'] > 1024) $files[$fkey]['sizetext'] = (ceil($a['size']/1024*100)/100) . " K"; rlm@3: else if ($a['size'] > 1024*1024) $files[$fkey]['sizetext'] = (ceil($a['size']/(1024*1024)*100)/100) . " Mb"; rlm@3: else $files[$fkey]['sizetext'] = $a['size'] . " bytes"; rlm@3: $files[$fkey]['name'] = $file; rlm@3: $files[$fkey]['type'] = filetype($fullpath); rlm@3: $fileNames[$i++] = $fkey; rlm@3: } rlm@3: closedir($dh); rlm@3: } else {$errorMessage= true; echo "<strong class='error'>Cannot open directory: $path | Fill out a valid Gallery Path</strong>";} rlm@3: } else {$errorMessage= true; echo "<strong class='error'>Path is not a directory: $path | Fill out a valid Gallery Path</strong>";} rlm@3: sort($fileNames,SORT_STRING); rlm@3: $sortedFiles = array(); rlm@3: $i = 0; rlm@3: $photos = array(); rlm@3: $relativePath = rp( dirname($_SERVER['PHP_SELF']) ); rlm@3: if($errorMessage != true){ rlm@3: foreach($fileNames as $f) $sortedFiles[$i++] = $files[$f]; rlm@3: rlm@3: rlm@3: echo'Copy the below XML and create your XML file and upload it via the Upload XML button above:'; rlm@3: echo'<a href="outputxml.php" class="alrignright">Reset Output</a><div class="clear"></div>'; rlm@3: echo '<div class="xmloutput">'; rlm@3: echo'<gallery><br />'; rlm@3: echo' <title>'.$_GET['gallerytitle'].'</title><br />'; rlm@3: echo' <description>'.$_GET['galleryDescription'].'</description><br />'; rlm@3: echo' <gallerypath>'.$relativePath.'/'.$_GET['gallerypath'].'</gallerypath> <br />'; rlm@3: echo' <largeimgpath>'.$relativePath.'/'.$_GET['largepath'].'</largeimgpath><br />'; rlm@3: echo' <thumbpath>'.$relativePath.'/'.$_GET['thumbpath'].'</thumbpath><br />'; rlm@3: echo' <mainthumb>'.$relativePath.'/'.$_GET['gallerypath'].'</mainthumb><br />'; rlm@3: echo' <mainthumbsrc>mainthumb.jpg</mainthumbsrc><br />'; rlm@3: $j = 0; rlm@3: rlm@3: foreach ($sortedFiles as $file) { rlm@3: rlm@3: if($file['type']!='dir'&& $file['name']!='mainthumb.jpg'){ rlm@3: // get image sizes rlm@3: list($width, $height, $type, $attr) = getimagesize($path."/".$file['name'], $info); rlm@3: $size = $file['sizetext']; rlm@3: if(isset($info['APP13'])){ rlm@3: $iptc = iptcparse($info['APP13']); rlm@3: $title = $iptc['2#005'][0]; rlm@3: if(isset($iptc['2#120'][0])){ rlm@3: $description = $iptc['2#120'][0]; rlm@3: $description = str_replace("\r", "<br/>", $description); rlm@3: $description = addslashes($description); rlm@3: } rlm@3: if(isset($iptc['2#025'][0])){ rlm@3: $keywords = $iptc['2#025'][0]; rlm@3: } rlm@3: $author = $iptc['2#080'][0]; rlm@3: $copyright = $iptc['2#116'][0]; rlm@3: rlm@3: }else if(isset($info['APP0']) && !isset($info['APP13'])){ rlm@3: $iptc = iptcparse($info['APP0']); rlm@3: $title = $iptc['2#005'][0]; rlm@3: $description = $iptc['2#120'][0]; rlm@3: $description = str_replace("\r", "<br/>", $description); rlm@3: $description = addslashes($description); rlm@3: $keywords = $iptc['2#025'][0]; rlm@3: $author = $iptc['2#080'][0]; rlm@3: $copyright = $iptc['2#116'][0]; rlm@3: }else{ rlm@3: $title = ''; rlm@3: $description = ''; rlm@3: $description = ''; rlm@3: $keywords = ''; rlm@3: $author = ''; rlm@3: $copyright = ''; rlm@3: } rlm@3: rlm@3: rlm@3: array_push($photos, $width); rlm@3: array_push($photos, $height); rlm@3: rlm@3: //echo'<image Thumb="galleries/'.$thumbePath.'/thumbs/'.$file[name].'" Large="galleries/'.$path."/".$file[name].'" Caption="'.$title.'" Colour="000000">'; rlm@3: //'<copy><![CDATA['.$title.']]></copy>'; rlm@3: //echo'</image>'; rlm@3: rlm@3: echo' <item type="image"><br />'; rlm@3: echo' <title>'.$title.'</title><br />'; rlm@3: echo' <author>'.$author.'</author><br />'; rlm@3: echo' <copyright>'.$copyright.'</copyright><br />'; rlm@3: echo' <description>'.$description.'</description><br />'; rlm@3: echo' <src>'.$file['name'].'</src><br />'; rlm@3: echo' <demensions width="'.$width.'" height="'.$height.'" /><br />'; rlm@3: if(isset($_GET['largepath'])){ rlm@3: $largePath = $_GET['largepath']; rlm@3: if(is_file($largePath."/".$file['name'])){ rlm@3: list($largeWidth, $largeHeight, $largeType, $largeAttr) = getimagesize($largePath."/".$file['name'], $info); rlm@3: echo' <large width="'.$largeWidth.'" height="'.$largeHeight.'" /><br />'; rlm@3: } rlm@3: } rlm@3: if(isset($_GET['showforsale'])){ rlm@3: $showforsale = $_GET['showforsale']; rlm@3: if($showforsale=='true'){ rlm@3: if($_GET['currency']=="USD"){$currencySymbol='$';}else if($_GET['currency']=="EURO"){$currencySymbol='€';} rlm@3: echo' <sellprint type="'.$_GET['checkouttype'].'" currency="'.$_GET['currency'].'" currencysymbol="'.$currencySymbol.'"><br />'; rlm@3: echo' <price size="8x10">15</price><br />'; rlm@3: echo' <price size="11x14">25</price><br />'; rlm@3: echo' <price size="16x20">55</price><br />'; rlm@3: echo' <price size="20x24">65</price><br />'; rlm@3: echo' </sellprint><br />'; rlm@3: } rlm@3: echo' </item><br />'; rlm@3: rlm@3: $j++; rlm@3: } rlm@3: } rlm@3: rlm@3: } rlm@3: echo' <totalitems>'.$j.'</totalitems><br />'; rlm@3: echo'</gallery><br />'; rlm@3: echo'</div>'; rlm@3: } rlm@3: } rlm@3: if(isset($_GET['gallerypath'])&&isset($_GET['thumbpath'])){ rlm@3: getImages($_GET['gallerypath'], $_GET['thumbpath'] ); rlm@3: ?> rlm@3: <a href="outputxml.php" class="alrignright">Reset Output</a><div class="clear"></div> rlm@3: <h2>Create New Gallery XML:</h2><br /> rlm@3: <br /> rlm@3: <form name="form1" method="get" action="<?php echo $_SERVER['PHP_SELF'] ;?>"> rlm@3: <label id="gallerytitle"><strong>Gallery Title</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="gallerytitle" value="" /> rlm@3: <br /><br /> rlm@3: <label id="galleryDescription"><strong>Gallery Description</strong> <small>(No Special Characters)</small></label> rlm@3: <br /> rlm@3: <textarea name="galleryDescription" rows="4" class="textinput"></textarea> rlm@3: <br /><br /> rlm@3: <label id="gallerypath"><strong>Gallery Path</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="gallerypath" value="Galleries/gallery1/" /> rlm@3: <br /><br /> rlm@3: <label id="thumbpath"><strong>Thumbnail Path</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="thumbpath" value="Galleries/gallery1/thumbs/" /> rlm@3: <br /> <br /> rlm@3: <label id="largepath"><strong>Large Path</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="largepath" value="Galleries/gallery1/large/" /> <br /> rlm@3: <small>(Fill out path even if you uploaded no large images it will detect that they're not there. unless there is no large folder)</small> rlm@3: <br /> <br /> rlm@3: <div class="floatleft"><h3>Sell Prints?</h3> rlm@3: <input type="radio" name="showforsale" id="true" value="true" align="absmiddle" /><label for="true">Yes</label> <input type="radio" id="false" name="showforsale" value="false" align="absmiddle" /><label for="false">No</label> rlm@3: <br /> <br /></div> rlm@3: <div class="floatleft"><h3>Checkout Type</h3> rlm@3: <input type="radio" value="google" name="checkouttype" id="google" align="absmiddle" /><label for="google">Google Checkout</label> <input type="radio" id="paypal" value="paypal" name="checkouttype" align="absmiddle" /><label for="paypal">Paypal</label> rlm@3: <br /> <br /></div> rlm@3: rlm@3: <div class="floatleft"><h3>Currency:</h3> rlm@3: <input type="radio" value="USD" name="currency" id="USD" align="absmiddle" /><label for="USD">USD</label> <input type="radio" id="EURO" value="EURO" name="currency" align="absmiddle" /><label for="EURO">EURO</label> rlm@3: <br /> <br /></div> rlm@3: <div class="clear"></div> rlm@3: <input type="submit" name="submit" value="Output XML"> rlm@3: </form> rlm@3: <br /> rlm@3: <?php rlm@3: }else{ rlm@3: ?> rlm@3: <form name="form1" method="get" action="<?php echo $_SERVER['PHP_SELF'] ;?>"> rlm@3: <label id="gallerytitle"><strong>Gallery Title</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="gallerytitle" value="" /> rlm@3: <br /><br /> rlm@3: <label id="galleryDescription"><strong>Gallery Description</strong> <small>(No Special Characters)</small></label> rlm@3: <br /> rlm@3: <textarea name="galleryDescription" rows="4" class="textinput"></textarea> rlm@3: <br /><br /> rlm@3: <label id="gallerypath"><strong>Gallery Path</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="gallerypath" value="Galleries/gallery1/" /> rlm@3: <br /><br /> rlm@3: <label id="thumbpath"><strong>Thumbnail Path</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="thumbpath" value="Galleries/gallery1/thumbs/" /> rlm@3: <br /> <br /> rlm@3: <label id="largepath"><strong>Large Path</strong></label> rlm@3: <br /> rlm@3: <input type="text" class="textinput" name="largepath" value="Galleries/gallery1/large/" /> <br /> rlm@3: <small>(Fill out path even if you uploaded no large images it will detect that they're not there. unless there is no large folder)</small> rlm@3: <br /> <br /> rlm@3: <div class="floatleft"><h3>Sell Prints?</h3> rlm@3: <input type="radio" name="showforsale" id="true" value="true" align="absmiddle" /><label for="true">Yes</label> <input type="radio" id="false" name="showforsale" value="false" align="absmiddle" /><label for="false">No</label> rlm@3: <br /> <br /></div> rlm@3: <div class="floatleft"><h3>Checkout Type</h3> rlm@3: <input type="radio" value="google" name="checkouttype" id="google" align="absmiddle" /><label for="google">Google Checkout</label> <input type="radio" id="paypal" value="paypal" name="checkouttype" align="absmiddle" /><label for="paypal">Paypal</label> rlm@3: <br /> <br /></div> rlm@3: rlm@3: <div class="floatleft"><h3>Currency:</h3> rlm@3: <input type="radio" value="USD" name="currency" id="USD" align="absmiddle" /><label for="USD">USD</label> <input type="radio" id="EURO" value="EURO" name="currency" align="absmiddle" /><label for="EURO">EURO</label> rlm@3: <br /> <br /></div> rlm@3: <div class="clear"></div> rlm@3: <input type="submit" name="submit" value="Output XML"> rlm@3: </form> rlm@3: <?php rlm@3: } rlm@3: ?> rlm@3: rlm@3: rlm@3: rlm@3: rlm@3: <div class="dsep"></div> rlm@3: </div> rlm@3: </div> rlm@3: </body> rlm@3: </html>