vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Deleting Thread/post question: (https://vborg.vbsupport.ru/showthread.php?t=44543)

Baptizer 10-12-2002 02:55 PM

Deleting Thread/post question:
 
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 05: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:
PHP Code:

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:
PHP Code:

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 10: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-12-2002 11:01 PM

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 08:18 AM

you're welcome.

yes right 3600 secs/hour * 2 hours


All times are GMT. The time now is 01:45 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01808 seconds
  • Memory Usage 1,728KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete