1
|
<?/* Written by Gerben Schmidt, http://scripts.zomp.nl */include('config.php');include('session.php');include('header.php');include("../language/$language");$username = $_SESSION['login'];$query = mysql_query("SELECT * FROM $table_users WHERE (login = '$username')"); while ($row = mysql_fetch_array ($query)) {$admin = $row['permissions'];$id = $row['id'];// user can only edit own postsecho "<table width='600' border='0' cellspacing='0' class='admin'>";echo "<tr>";echo "<td> </td>";echo "</tr>";echo "<tr>";echo "<td class='admin_title'>$lang_yourposts</td>";echo "</tr>";echo "<tr>";echo "<td> </td>";echo "</tr>";$query = mysql_query("SELECT * FROM $table WHERE (userid = $id) ORDER BY 'id' DESC");while($row = mysql_fetch_array($query)) {$id = $row['id'];$title = $row['title'];$text = $row['text'];$date = $row['date'];echo "<tr>"; echo "<td width='350' class='admin'>";echo "$title";echo "</td>";echo "<td width='150'>";echo "<a href='editor.php?id=$id'>$edit</a> | <A HREF='schredder.php?tablename=$table&id=$id' onclick=\"return verify()\">$delete</A>";echo("");echo "</td>";echo "</tr>";}echo "<tr>";echo "<td> </td>";echo "</tr>";echo "</table>";// admin can edit all entries$username = $_SESSION['login'];$query = mysql_query("SELECT * FROM $table_users WHERE (login = '$username')"); while ($row = mysql_fetch_array ($query)) {$admin = $row['permissions'];$id = $row['id'];}if($admin!=0){echo "<table width='600' border='0' cellspacing='0' class='admin'>";echo "<tr>";echo "<td> </td>";echo "</tr>";echo "<tr>";echo "<td class='admin_title'>$lang_postsothers</td>";echo "</tr>";echo "<tr>";echo "<td> </td>";echo "</tr>";$query2 = mysql_query("SELECT * FROM $table WHERE (username != '$username') ORDER BY 'id' DESC");while($row = mysql_fetch_array($query2)) {$id = $row['id'];$title = $row['title'];$text = $row['text'];$date = $row['date'];echo "<tr>"; echo "<td width='350' class='admin'>";echo "$title";echo "</td>";echo "<td width='150'>";echo "<a href='editor.php?id=$id'>$edit</a> | <A HREF='schredder.php?tablename=$table&id=$id' onclick=\"return verify()\">$delete</A>";echo("");echo "</td>";echo "</tr>";}echo "<tr>";echo "<td> </td>";echo "</tr>";echo "</table>";}}include('footer.php');?>
|