diff --git a/img/index.php b/img/index.php index 77c52fa..60b2e3b 100755 --- a/img/index.php +++ b/img/index.php @@ -89,6 +89,41 @@ } } + function search(){ + if(!empty($_GET['search']) && $_GET['submit'] == "Search"){ // Show list of pictures according to search term + $search = sanitize($_GET['search']); + $search = explode(" ", $search); + echo "

Pictures found using search terms: "; + foreach ($search as $searches){ + echo $searches." "; + } + echo ":

"; + require('dbsettings.php'); + $sql = "SELECT id, name, location, type, size, time, comment, username, tags FROM $tbl_name WHERE tags LIKE '%".$search[0]."%'"; + for($i=1; $i= 1){ + $i = 0; + while ($row = mysql_fetch_assoc($result)){ + $id = $row['id']; + $img = $row['name']; + $location = $row['location']; + $type = $row['type']; + $size = $row['size']; + $time = $row['time']; + $comment = $row['comment']; + $username = $row['username']; + $tags = $row['tags']; + echo "$img - $time - $size - Uploader: $username
"; + } + } + echo "



"; + } + } + function sanitize($input){ if ($input == null) die("Sanatize() - No Input Provided, Aborting\r\n
"); $output = strip_tags($input); @@ -101,6 +136,7 @@ function imgstuff(){ uname(); tag(); + search(); if (empty($_GET['img']) || $_GET['img'] == null || $_GET['img'] == ''){ $img = ''; }else{ @@ -264,7 +300,7 @@
- Tagging System is still WIP + Tagging and Search Systems are still WIP
@@ -276,6 +312,17 @@