group-categorys'; if($_GET['action']=="add") { echo'
Group-Name:
 
'; } elseif($_GET['action']=="edit") { $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery_groups WHERE groupID='".$_GET['groupID']."'"); $ds=mysql_fetch_array($ergebnis); echo'
Group-Name:
'; } else { echo'

'; $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery_groups ORDER BY sort"); echo'
'; while($ds=mysql_fetch_array($ergebnis)) { $list = ''; $list = str_replace('value="'.$ds[groupID].'-'.$ds[sort].'"','value="'.$ds[groupID].'-'.$ds[sort].'" selected',$list); echo''; } echo'
Group-Name: Actions: Sort
'.$ds[name].' '.$list.'
'; } } //part: gallerys elseif($_GET['part'] == "gallerys") { if($_POST['save']) { safe_query("INSERT INTO ".PREFIX."gallery ( name, date, groupID ) values( '".$_POST['name']."', '".time()."', '".$_POST['group']."' ) "); $id = mysql_insert_id(); } elseif($_POST['saveedit']) { safe_query("UPDATE ".PREFIX."gallery SET name='".$_POST['name']."', groupID='".$_POST['group']."' WHERE galleryID='".$_POST['galleryID']."'"); } elseif($_POST['saveftp']) { $dir = '../images/gallery/'; $comment = $_POST['comment']; $name = $_POST['name']; $i=0; foreach($_POST['pictures'] as $picture) { $typ = getimagesize($dir.$picture); switch ($typ[2]) { case 1: $typ = '.gif'; break; case 2: $typ = '.jpg'; break; } if($name[$i]) $insertname = $name[$i]; else $insertname = $picture; safe_query("INSERT INTO ".PREFIX."gallery_pictures ( galleryID, name, comment, comments) VALUES ('".$_POST['galleryID']."', '".$insertname."', '".$comment[$i]."', '".$_POST['comments']."' )"); $insertid = mysql_insert_id(); copy($dir.$picture, $dir.'large/'.$insertid.$typ); $galclass->savethumb($dir.'large/'.$insertid.$typ, $dir.'thumb/'.$insertid.'.jpg'); @unlink($dir.$picture); $i++; } } elseif($_POST['saveform']) { $dir = '../images/gallery/'; $picture = $_FILES[picture]; if($picture[name] != "") { if($_POST['name']) $insertname = $_POST['name']; else $insertname = $picture[name]; safe_query("INSERT INTO ".PREFIX."gallery_pictures ( galleryID, name, comment, comments) VALUES ('".$_POST['galleryID']."', '".$insertname."', '".$_POST['comment']."', '".$_POST['comments']."' )"); $insertid = mysql_insert_id(); $typ = getimagesize($picture[tmp_name]); switch ($typ[2]) { case 1: $typ = '.gif'; break; case 2: $typ = '.jpg'; break; } move_uploaded_file($picture[tmp_name], $dir.'large/'.$insertid.$typ); $galclass->savethumb($dir.'large/'.$insertid.$typ, $dir.'thumb/'.$insertid.'.jpg'); } } elseif($_GET['delete']) { //SQL if(safe_query("DELETE FROM ".PREFIX."gallery WHERE galleryID='".$_GET['galleryID']."'")) { //FILES $ergebnis=safe_query("SELECT picID FROM ".PREFIX."gallery_pictures WHERE galleryID='".$_GET['galleryID']."'"); while($ds=mysql_fetch_array($ergebnis)) { @unlink('../images/gallery/'.$_GET['galleryID'].'/thumb/'.$ds[picID].'.jpg'); //thumbnails $path = '../images/gallery/'.$_GET['galleryID'].'/large/'; if(file_exists($path.$ds[picID].'.jpg')) $path = $path.$ds[picID].'.jpg'; else $path = $path.$ds[picID].'.gif'; @unlink($path); //large safe_query("DELETE FROM ".PREFIX."comments WHERE parentID='".$ds[picID]."' AND type='ga'"); } safe_query("DELETE FROM ".PREFIX."gallery_pictures WHERE galleryID='".$_GET['galleryID']."'"); } } echo'

Gallerys

'; if($_GET['action']=="add") { $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery_groups"); $groups = ''; echo'
Gallery-Name:
Group: '.$groups.'
Picture Upload:
 

Upload your images to "http://'.$hp_url.'/images/gallery" via FTP to add files.'; } elseif($_GET['action']=="edit") { $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery_groups"); $groups = ''; $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery WHERE galleryID='".$_GET['galleryID']."'"); $ds=mysql_fetch_array($ergebnis); $groups = str_replace('value="'.$ds[groupID].'"','value="'.$ds[groupID].'" selected',$groups); echo'
Group-Name:
Group: '.$groups.'
'; } elseif($_GET['action']=="upload") { $dir = '../images/gallery/'; if($_POST['upload'] == "ftp") { $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery_groups WHERE groupID='".$_GET['groupID']."'"); $ds=mysql_fetch_array($ergebnis); echo'
'; $pics = Array(); $picdir = opendir($dir); while (false !== ($file = readdir($picdir))) { if ($file != "." && $file != "..") { if(is_file($dir.$file)) { if($info = getimagesize($dir.$file)) { if($info[2]==1 OR $info[2]==2) $pics[] = $file; } } } } closedir($picdir); natcasesort ($pics); reset ($pics); echo ''; foreach($pics as $val) { if(is_file($dir.$val)) { echo ''; } } echo '
FilenameNameComment
'.$val.'
'; echo '
Visitor comments
'; } elseif($_POST['upload'] == "form" OR $_GET['upload'] == "form") { if($_GET['upload'] == "form") $id=$_GET['galleryID']; echo'
Name:
Comment:
Visitor comments:
Picture:
'; } } else { echo'

'; $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery WHERE userID='0'"); echo'Pagegalleries

'; while($ds=mysql_fetch_array($ergebnis)) { echo''; } echo'
Gallery-Name: Actions:
'.$ds[name].'


'; $ergebnis=safe_query("SELECT * FROM ".PREFIX."gallery WHERE userID!='0'"); echo'Usergalleries

'; while($ds=mysql_fetch_array($ergebnis)) { echo''; } echo'
Gallery-Name: User: Actions:
'.$ds[name].' '.getnickname($ds[userID]).'
'; } } ?>