From 530b60977187fea3a8caae5832b81d750018ec4c Mon Sep 17 00:00:00 2001
From: alopexc0de
Date: Fri, 15 Feb 2013 17:29:23 -0500
Subject: [PATCH] Better thumbnails on noimg and all functions working again
---
img/index.php | 53 +++++++++++++++++++++++++++++++++------------------
1 file changed, 34 insertions(+), 19 deletions(-)
diff --git a/img/index.php b/img/index.php
index fe2ef08..a139d7a 100755
--- a/img/index.php
+++ b/img/index.php
@@ -12,11 +12,9 @@
*
* JavaScript fo show bigger image if clicked
* Recently Uploaded Pictures on sidebar
- * DONE - Thumbnails for image list on main page (100px x 100px)
+ * Automatic thumbnail generation - genthumb() (100px x 100px)
* Fix headstuff() and title()
- * DONE = Picture Thumbnail for uname, tag, and search
* Multiple tags without search?
- * DONE - Convert to mysqli
* Classes?
*
* -----------------------------------------------------------
@@ -32,6 +30,7 @@
$comment = '';
$username = '';
$tags = '';
+ $_SESSION['noimg'] = '';
// GET functions
@@ -234,6 +233,8 @@
//$result=mysql_query($sql);
//if($result){
move_uploaded_file($_FILES["file"]["tmp_name"], "Pictures/" . $name);
+ $donefile = 'Pictures/'.$name;
+ genthumb($donefile);
echo "Stored at: ". $name."";
//}else{
// echo "There was a problem uploading this file.";
@@ -243,7 +244,6 @@
}else{
echo "There was a problem trying to upload your file - Could be a database error";
}
- $result->free();
}
}
}
@@ -255,6 +255,10 @@
// END OF GET FUNCTIONS
+ function genthumb($input){
+ echo "Placeholder for automatic 100x100px thumbnail generation of new pictures
\n";
+ }
+
function sanitize($input){
if ($input == null) die("Sanatize() - No Input Provided, Aborting\r\n
");
include('dbsettings.php');
@@ -370,7 +374,8 @@
if($handle = opendir('Pictures')){
while(false != ($file = readdir($handle))){
if($file != "." && $file != ".." && $file != ".htaccess"){
- $thelist .= '
└ '.$file.'
'."\n";
+ //$thelist .= '
└ '.$file.'
'."\n";
+ $thelist .= "-".$file;
}
}
closedir($handle);
@@ -383,18 +388,17 @@
-
-
-
- List of Uploaded Pictures:
- |
-
-
-
- $thelist
- |
-
-
+ Uploaded Pictures:
+ ";
+ $thelist = explode("-", $thelist);
+ foreach($thelist as $pics){
+ if($pics == '' || $pics == null){
+ echo '';
+ }else{
+ echo ''."\n ";
+ }
+ }
+ echo"
";
}
@@ -425,7 +429,6 @@
* Fix headstuff() and title()
* DONE - Picture Thumbnail for uname, tag, and search
* Multiple tags without search?
- * DONE - Convert to mysqli
* Classes?
*
* -----------------------------------------------------------
@@ -537,6 +540,18 @@
+