include("config.ini") ?>
include("includes/header.inc");
if ($killPic) {
$delresult1 = @MYSQL_QUERY("select * from gallery where id = \"$killPic\"");
$row = mysql_fetch_array($delresult1);
$filePath = "$picPATH/$row[file_name]";
unlink ($filePath) or $null = "done";
$delresult2 = @MYSQL_QUERY("delete from gallery where id = '$killPic'");
}
if ($img_binary_name) {
mt_srand (time());
$prefix = mt_rand();
$suffix = explode (".", $img_binary_name);
$fileName = $prefix.".$suffix[1]";
$filePath = "$picPATH"."/"."$fileName";
copy($img_binary, $filePath) or $error[] = "Error Creating File: ".$basePath."/".$picPath."/".$img_binary_name;
if ($error) {
print("
|
Error Processing Your Request:");
while(list($key, $val) = each($error)) {
print("$val");
};
print(" |
");
exit;
}else{
if($newCat){$gallery=$newCat;}else{$gallery=$oldCat;};
$inssql = "INSERT INTO gallery (uid,gallery,file_name,img_name,img_type,img_size,img_title) VALUES (\"$slUid\",\"$gallery\",\"$fileName\",\"$img_binary_name\",\"$img_binary_type\",\"$img_binary_size\",\"$imgtitle\")";
$insresult=MYSQL_QUERY($inssql) or $error[] = "Error Executing SQL: $sql";
// $id= mysql_insert_id();
}
unset($gallery);
}
print ("");
if ($addImage){
print ("
Add An Image
|
|
");
} else {
print (" |
Image Galleries
|
");
$result = @MYSQL_QUERY("select distinct gallery from gallery order by gallery");
if ($record = mysql_fetch_array($result, MYSQL_ASSOC)) {
do { $gallery[] = $record[gallery];
} while($record = mysql_fetch_array($result));
}else{};
// $result = @MYSQL_QUERY("select distinct gallery from gallery order by gallery");
// $gallery = mysql_fetch_array($result, MYSQL_ASSOC) or $tmp=null;
// print (count($gallery)." galleries found ");
$gallery[] = "Members Pictures";
$count=0;print("");
while(list($key, $val) = each($gallery)) {
$count++;
if ($count=='1') {
print ("");
}
$urlVal = urlencode($val);
print ("| $val | ");
if ($count=='3') {
print (" ");
$count=0;
}
}
print(" ");
print ("
|
");
if ($gal) {
$count=0;print("");
switch ($gal) {
case "Members Pictures":
$result = @MYSQL_QUERY("select * from directory where file_name > 0 order by last");
if ($record = mysql_fetch_array($result)) {
do { $keyname = "$record[first] $record[last]";
$images[$keyname]="$record[file_name]";
} while($record = mysql_fetch_array($result));
}else{$images[]="";};
break;
default:
$result = @MYSQL_QUERY("select * from gallery where gallery = \"$gal\" order by img_title");
if ($record = mysql_fetch_array($result)) {
do { $images[$record[img_title]] = $record[file_name];
} while($record = mysql_fetch_array($result));
}else{$images[]="";};
break;
}
while(list($key, $val) = each($images)) {
$count++;
if ($count=='1') {
print ("");
}
print ("| $key | ");
if ($count=='3') {
print (" ");
$count=0;
}
}
print(" ");
}
if ($slUid) {
print(" ");
print("| Your Uploaded Images | ");
print("");
$count=0;print("");
unset($images);
$result = @MYSQL_QUERY("select * from gallery where uid = \"$slUid\" order by img_title");
if ($record = mysql_fetch_array($result)) {
do {
print ("
|
$record[img_title]
|
$record[gallery]
|
( Delete )
|
");
} while($record = mysql_fetch_array($result));
}else{$images[]="";};
print(" ");
print(" | ");
print(" | ");
print("| Add A New Image | ");
print(" ");
}
}
print (" |
");
include("includes/footer.inc");
?>