diff --git a/img/index.php b/img/index.php index c3488f6..d9faec3 100755 --- a/img/index.php +++ b/img/index.php @@ -5,15 +5,14 @@ * * UnPS-GAMA Image Host * Copyright (c) 2013 UnPS-GAMATechnologies - * Author: David Todd (c0de) of http://www.unps-gama.info + * Author: David Todd (c0de) of http://www.unps-gama.info and http://unps.us * * ----------------------------------------------------------- * TODO: * - * Properly align image in post box - * DONE - Make better uploader - better naming, autotag username and filename * JavaScript fo show bigger image if clicked - * Fix Last Modified for uploaded files + * Thumbnails for image list on main page (100px x 100px) + * Fix headstuff() and title() * Picture Thumbnail for uname, tag, and search * Multiple tags without search? * Convert to mysqli @@ -95,7 +94,7 @@ } function search(){ - if(!empty($_GET['search']) && $_GET['submit'] == "Search"){ // Show list of pictures according to search term + if(!empty($_GET['search'])){ // Show list of pictures according to search term $search = sanitize($_GET['search']); $search = explode(" ", $search); echo "

Pictures found using search terms: "; @@ -203,14 +202,17 @@ $tags = sanitize($tags); $upusername = sanitize($upusername); + //$notspace = array("\,", ".", "/", "\\", ":", "-", "_", "+", "=", "~", "#", "&", ""); + //$tags = preg_replace($notspace, " ", $tags); + $size = round($size, 2)." Kb"; - $time = date("D jS F Y g:i:s a T"); + $time = date("d/j/y - g:i:s a"); $file_ext = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION); if(!in_array($file_ext, $extensions))die("Wrong or no file extension"); // stop the upload if it's wrong $name = $short.".".$file_ext; - if (($_FILES["file"]["size"] < 400000)){ + if (($_FILES["file"]["size"] < 4000000000)){ if ($_FILES["file"]["error"] > 0){ echo "Return Code: " . $_FILES["file"]["error"] . "
"; }else{ @@ -224,7 +226,7 @@ $result=mysql_query($sql); if($result){ move_uploaded_file($_FILES["file"]["tmp_name"], "Pictures/" . $name); - echo "Stored at: ". $name.""; + echo "Stored at: ". $name.""; }else { echo "There was a problem trying to upload your file - Could be a database error"; } @@ -258,7 +260,7 @@ function cln_file_name($string) { $cln_filename_find=array("/\.[^\.]+$/", "/[^\d\w\s-]/", "/\s\s+/", "/[-]+/", "/[_]+/"); - $cln_filename_repl=array("", ""," ", "-", "_"); + $cln_filename_repl=array("", "", " ", "-", "_"); $string=preg_replace($cln_filename_find, $cln_filename_repl, $string); return trim($string); } @@ -266,10 +268,12 @@ // MAIN PROGRAM function imgstuff(){ + // My little cheat to be able to display all the different items in the same area uname(); tag(); search(); upload(); + // Basically all my functions are used as part of one big one, but more organized into smaller sections if (empty($_GET['img']) || $_GET['img'] == null || $_GET['img'] == ''){ $img = ''; }else{ @@ -292,7 +296,7 @@ $_SESSION['comment'] = $row['comment']; $_SESSION['username'] = $row['username']; $_SESSION['tags'] = $row['tags']; - echo "

"; + echo "

"; //echo "$id
$img
$location
$type
$size
$time
$comment
$username
$tags\n"; mysql_close(); }else{ @@ -374,7 +378,7 @@ "; } - function title(){ + function title(){ // Suffers same problem as headstuff() if(!isset($_SESSION['img'])){ echo ""; }else{ @@ -384,13 +388,34 @@ ?> + - - UnPS-GAMA Image Host<?php title(); ?> + + UnPS-GAMA Image Host<?php //title(); ?> @@ -438,7 +463,7 @@
- Tagging is WIP ----- Need Thumbnails + Head meta tags and title not working properly
@@ -455,7 +480,7 @@ @@ -528,4 +553,5 @@
- \ No newline at end of file + + \ No newline at end of file