From c6b0ee85646fa861f59489cf81c96ccff53ea054 Mon Sep 17 00:00:00 2001 From: David Todd Date: Sat, 9 Feb 2013 01:29:47 -0500 Subject: [PATCH] Uses an even more modified Prymont2 theme and cleaner code inside --- img/index.php | 378 +++++++++++++++++++++++++++++++------------------- 1 file changed, 233 insertions(+), 145 deletions(-) diff --git a/img/index.php b/img/index.php index c268cb3..14681dd 100755 --- a/img/index.php +++ b/img/index.php @@ -1,11 +1,134 @@ - +"); + $output = strip_tags($input); + $output = stripslashes($output); + $output = mysql_real_escape_string($output); + $output = strtolower($output); + return $output; + } + + function imgstuff(){ + if (empty($_GET['img']) || $_GET['img'] == null || $_GET['img'] == ''){ + $img = ''; + }else{ + $img = $_GET["img"]; // get the image + } + if(!empty($img) || $img != null || $img != ''){ + require('dbsettings.php'); + $img = sanitize($img); // clean image string + $sql = "SELECT id, name, location, type, size, time, comment, username, tags FROM $tbl_name WHERE name='$img' LIMIT 1;"; + $result = mysql_query($sql); + $row = mysql_fetch_assoc($result); + if ($row){ + $_SESSION['noimg'] = false; + $_SESSION['id'] = $row['id']; + $_SESSION['img'] = $row['name']; + $_SESSION['location'] = $row['location']; + $_SESSION['type'] = $row['type']; + $_SESSION['size'] = $row['size']; + $_SESSION['time'] = $row['time']; + $_SESSION['comment'] = $row['comment']; + $_SESSION['username'] = $row['username']; + $_SESSION['tags'] = $row['tags']; + echo "

"; + //echo "$id
$img
$location
$type
$size
$time
$comment
$username
$tags\n"; + mysql_close(); + }else{ + $_SESSION['noimg'] = true; + echo "

That image was not found in our database D:

"; + } + }else{ + noimg(); + $_SESSION['noimg'] = true; + } + } + + function headstuff(){ + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + + function textstuff(){ + if($_SESSION['noimg'] == false){ + echo "
\n"; + echo "

Image Name:

- ".$_SESSION['img']."\n"; + echo "

Image Type:

- ".$_SESSION['type']."\n"; + echo "

Image Size:

- ".$_SESSION['size']."\n"; + echo "

Time Uploaded:

- ".$_SESSION['time']."\n"; + echo "

Username:

- ".$_SESSION['username']."\n"; + echo "

Comment:

- ".$_SESSION['comment']."\n"; + echo "

Tags:

- ".$_SESSION['tags']."\n"; + echo "
"; + } + } + + function noimg(){ + $thelist = ''; + //include('getfiles.php'); + echo " +

+ Please specify an image with the url: + + img.unps-gama.info/?img=(IMGAGE STUFF HERE) + +

+
+ + + + + + + +
+
List of files:
+
+ $thelist +
+
+ "; + } + + function title(){ + if(empty($img) || $img = null || $img = ''){ + return; + }else{ + return " - Now Showing: ".$img; + } + } +?> + + + - + + - - - + + UnPS-GAMA Image Host<?php echo title(); ?> + + + + - - -
- - To UnPS-GAMA - -
- -"); - $output = strip_tags($input); - $output = stripslashes($output); - $output = mysql_real_escape_string($output); - $output = strtolower($output); - return $output; -} - -$img = $_GET["img"]; // get the image -if(isset($img) || $img != null || $img != ''){ -require('dbsettings.php'); - -$img = sanatize($img); // clean image string - -$sql = "SELECT id, name, location, type, size, time, comment, username FROM $tbl_name WHERE name='$img'"; -$result = mysql_query($sql); -$count = mysql_num_rows($result); -if($count == 1){ - $i = 0; - while ($row = mysql_fetch_assoc($result)){ // Attempt to pull all data concerning that one user from table - $id = $row['id']; - $img = $row['name']; - $location = $row['location']; - $type = $row['type']; - $size = $row['size']; - $time = $row['time']; - $comment = $row['comment']; - $username = $row['username']; - - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - $title = " - Now Showing: " . $img; - echo "GAMA IMGShare" . $title ."\n"; - echo " - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- Currently Viewing: $img -
- Image Type: $type -
- Image Size: $size -
- Time/Date Posted: $time -
- Poster's Username: $username -
- Poster's Comment: $comment -
- Back to index -
-
+ +
+ + +
+
+
+
+ New design underway :D +
+
+
+ +
+
+
+
- + }else{ + echo " +
+ + "; + } + ?> +
+
+
+ + + \ No newline at end of file