Assassinator
28-09-2007, 07:26 PM
Ok well basicly, i want it so when you press "Delete" it replace's the text someone post's.
I.e if someone posted "Omg idiot" And i clicked Delete, i want the post to say "This post has been removed by $username who is moderating the forum"
Here is my code (At the moment it just delete's the post)
<?
session_start();
include "includes/db_connect.php";
include "includes/functions.php";
include"includes/smile.php";
logincheck();
$forum=$_GET['forum'];
$username=$_SESSION['username'];
$viewtopic = $_GET['viewtopic'];
$forum_look=$_GET['forum_look'];
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
if($_GET[clean]) {
$clean=$_GET[clean];
if($fetch->userlevel == "2" || $fetch->userlevel == "0") { die('You cannot delete this post!'); }
mysql_query("DELETE FROM replys WHERE id='$clean' AND forum='$forum'") or die ("<font color=white>Cannot delete reply</font>");
echo "<font color=white>Reply Deleted</font>!";
echo "<meta http-equiv='refresh' content='1;url=right.php?forum=$forum&viewtopic=$viewtopic'>";
}
if (!$viewtopic){
$viewtopic = "1";
}
I.e if someone posted "Omg idiot" And i clicked Delete, i want the post to say "This post has been removed by $username who is moderating the forum"
Here is my code (At the moment it just delete's the post)
<?
session_start();
include "includes/db_connect.php";
include "includes/functions.php";
include"includes/smile.php";
logincheck();
$forum=$_GET['forum'];
$username=$_SESSION['username'];
$viewtopic = $_GET['viewtopic'];
$forum_look=$_GET['forum_look'];
$fetch=mysql_fetch_object(mysql_query("SELECT * FROM users WHERE username='$username'"));
if($_GET[clean]) {
$clean=$_GET[clean];
if($fetch->userlevel == "2" || $fetch->userlevel == "0") { die('You cannot delete this post!'); }
mysql_query("DELETE FROM replys WHERE id='$clean' AND forum='$forum'") or die ("<font color=white>Cannot delete reply</font>");
echo "<font color=white>Reply Deleted</font>!";
echo "<meta http-equiv='refresh' content='1;url=right.php?forum=$forum&viewtopic=$viewtopic'>";
}
if (!$viewtopic){
$viewtopic = "1";
}