This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ require_once('config.inc.php'); require_once('auth.php'); require_once('init.php'); $db = new dbcon(); //Initialize new database object echo "

Rapporterte bilder

"; if (isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id'],$db->link); $query = "SELECT * FROM `%sfiles` WHERE `id` = $id"; $db->query($query); $file = mysql_fetch_array($db->result); } switch ($_GET['a']) { case "slett": unlink($uploaddir.$file['path']); unlink($uploaddir.$file['path'].".jpg"); $sql = "DELETE FROM `%sfiles` WHERE `id` = '$id'"; $db->query($sql); echo "Sletta $id som var $file[path]"; echo " - Tilbake"; break; case "godkjenn": $sql= "UPDATE `%sfiles` SET `flagged` = '2' WHERE `id` = '$id'"; $db->query($sql); echo "Godkjente # $id"; echo " - Tilbake"; break; } $query = "SELECT * FROM `%sfiles` WHERE `flagged` = '1'"; $db->query($query); while ($item = mysql_fetch_array($db->result)) { if ($simpleurl) { $imgurl = "http://".$url.$basedir.$item['id']; } else { $imgurl = "http://".$url.$basedir.$item['id'].'x'.$item['code']; } print "

slett - godkjenn - $item[views] visninger

"; } echo "

Siste 10

"; $query = "SELECT * FROM `files` ORDER BY `id` DESC LIMIT 0,10"; $db->query($query); while ($item = mysql_fetch_array($db->result)) { if ($simpleurl) { $imgurl = "http://".$url.$basedir.$item['id']; } else { $imgurl = "http://".$url.$basedir.$item['id'].'x'.$item['code']; } print "

slett - $item[views] visninger.

"; } ?>