afterfl0w
06-24-2006, 12:27 AM
I'm trying to code something into banning.php, where in it's set of queries that add the user to the ban table, it edits their post and adds a message saying "User was banned for this post".
So far, I have this :
if(!$vbulletin->GPC['postid']){
$banmessage = '';
}
else
{
$q_post = "select postid, pagetext
from " . TABLE_PREFIX . "post
where postid = '$vbulletin->GPC['postid']' and userid = '$user[userid]'";
while($postz = $db->query_first($q_post))
{
$post['postid'] = $postz['postid'];
$post['pagetext'] = $postz['pagetext'];
}
$banmessage = "<b>(User was banned for this post (Reason: $vbulletin->GPC['reason'])";
$pagetext = $post['pagetext'] . "\n\n\n" . $banmessage;
$db->query_write("
UPDATE " . TABLE_PREFIX . "post SET pagetext = '$pagetext' WHERE postid = '$post[postid]'");
}
No idea why this won't work, can someone help? Thanks :)
So far, I have this :
if(!$vbulletin->GPC['postid']){
$banmessage = '';
}
else
{
$q_post = "select postid, pagetext
from " . TABLE_PREFIX . "post
where postid = '$vbulletin->GPC['postid']' and userid = '$user[userid]'";
while($postz = $db->query_first($q_post))
{
$post['postid'] = $postz['postid'];
$post['pagetext'] = $postz['pagetext'];
}
$banmessage = "<b>(User was banned for this post (Reason: $vbulletin->GPC['reason'])";
$pagetext = $post['pagetext'] . "\n\n\n" . $banmessage;
$db->query_write("
UPDATE " . TABLE_PREFIX . "post SET pagetext = '$pagetext' WHERE postid = '$post[postid]'");
}
No idea why this won't work, can someone help? Thanks :)