View Full Version : Deleting Thread/post question:
Baptizer
10-12-2002, 03:55 PM
Is there a way to allow my users to have a specific time-period, say 2 hours, to delete the thread or post they created? My users sometimes get a 'change of heart' and would like to delete what they posted, but i dont want to give them the power to delete it after a long period of time, like after 2 hours or so after they initially posted it.
Xenon
10-12-2002, 06:46 PM
hmm, give em the ability to delete own posts and threads by deleting the first post of a thread.
then open editpost.php
find:
if ($action=="deletepost") {
// is thread being deleted? if so check delete specific permissions
if (!ismoderator($threadinfo[forumid],"candeleteposts")) {
if (!$threadinfo[open]) {
eval("standardredirect(\"".gettemplate("redirect_threadclosed")."\",\"showthread.php?s=$session[sessionhash]&threadid=$postinfo[threadid]\");");
exit;
}
if (!$getperms[candeletepost]) {
show_nopermission();
} else {
if ($bbuserinfo[userid]!=$postinfo[userid]) {
// check user owns this post since they failed the Mod Delete permission check for this forum
show_nopermission();
}
}
}
and change it to:
if ($action=="deletepost") {
// is thread being deleted? if so check delete specific permissions
if (!ismoderator($threadinfo[forumid],"candeleteposts")) {
if (!$threadinfo[open]) {
eval("standardredirect(\"".gettemplate("redirect_threadclosed")."\",\"showthread.php?s=$session[sessionhash]&threadid=$postinfo[threadid]\");");
exit;
}
if (!$getperms[candeletepost]) {
show_nopermission();
} else {
if ($bbuserinfo[userid]!=$postinfo[userid] or time()>$postinfo[dateline]+3600*2) {
// check user owns this post since they failed the Mod Delete permission check for this forum
show_nopermission();
}
}
}
normally this should work
Baptizer
10-12-2002, 11:42 PM
Woa, thanks for the reply and code work! I am going to try it out asap! thanks again for the help!
Baptizer
10-13-2002, 12:01 AM
How exactly would i go about adjusting the time they are allowed to delete a post/thread? 3600*2...is that for 2 hours? 3600 seconds in an hour * 2 hours, right?
Xenon
10-13-2002, 09:18 AM
you're welcome.
yes right 3600 secs/hour * 2 hours
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.