Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 601
0 Users 4 Guests Online
Forum Index » PHP + MySQL » [REG] addon to gallery
Posted on Monday 5th May 2008 at 05:37 AM
Adam981
templates/default/images/noavatar.png's Avatar
Junior Member
I'm looking for a addon to the gallery part of the usersystem that you guys have here.. im trying to make it so the admin can delete pictures that were accepted. any help would be great thanks
Posted on Monday 5th May 2008 at 05:55 AM
jambomb
templates/default/images/noavatar.png's Avatar
Junior Member
there is a tut on the PHP - User System about a gallery addon

http://rmb-scripting.com/tutorials.php?tutorial&tid=293
Posted on Monday 5th May 2008 at 02:41 PM
Adam981
templates/default/images/noavatar.png's Avatar
Junior Member
yes i know im using that now, but i cant figure how i could setup a page for admins so i can delete pictures that was uploaded. without going into myphpadmin all the time.
Posted on Wednesday 7th May 2008 at 02:04 AM
ShadowMage
templates/default/images/noavatar.png's Avatar
Senior Member
i think i've already helped with this but yeh if you still need this give me a shout on MSN PMs or shoutbox. ^^
Posted on Wednesday 14th May 2008 at 07:44 PM
new2old
templates/default/images/noavatar.png's Avatar
Junior Member
Ok

simple way

change gallery.php to

[php]

<? //gallery.php
session_start(); //starts session

include ( "config.php" ); // includes config

$display = mysql_query( "SELECT * FROM `gallery` ORDER BY `id` ASC " ); // get values
while ($imgs = mysql_fetch_array($display))
{

echo "<table width='900'>
<tr>
<td width='300'><a href='http://$imgs[url]' target='_BLANK'><img src='$imgs[image]' height='250' width='250'></a>
<a href='members.php?user=$imgs[username]'>$imgs[username]</a><br />";
if ($logged["username"] && $logged["userlevel"] == 6) {
echo "<a href=\"?delete&id=$imgs[id]\">Delete</a></td>"; //delete link
} else {
echo "</td>";
}
</tr>
</table>"; //echos the image
}
if ($_GET["delete"]) { // gets delete page
if ($_GET["id"]) { //gets image id
$sql = mysql_query(DELETE FROM `gallery` WHERE `id` = '" . $_GET['id'] . "'); // delete it
echo "image deleted"; //confirm
} else { //or
echo "no id selected"; //couldnt get the images id
} // end or
} //end delete page
?>