PDA

View Full Version : how to allow a user to delete the his first post, without deleting a thread?


Stasik
06-19-2001, 08:00 PM
how to allow a user to delete the his first post, without deleting a thread?

TXH

kippesp
01-24-2002, 12:06 AM
Same question for admins and mods.

Does this require a hack?

Xenon
01-24-2002, 10:18 AM
open editpost.php and find this lines:


if ($getfirst[postid]==$postid) {
// delete thread
if ($getperms[candeletethread]) {
deletethread($threadinfo[threadid],$foruminfo[countposts]);
updateforumcount($threadinfo[forumid]);
eval("standardredirect(\"".gettemplate("redirect_deletethread")."\",\"forumdisplay.php?s=$session[sessionhash]&forumid=$threadinfo[forumid]\");");
} else {
show_nopermission();
}
}


just change

if ($getfirst[postid]==$postid) {


to

if (($getfirst[postid]==$postid && bbuserinfo[usergroupid]!=2) {

when only normal users cannot delete the thread

or just kill the whole true clause when nobody should delete a thread on this way