Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 12-12-2000 Last Update: Never Installs: 0
 
No support by the author.

I wonder if it exists a vB version?
Did a search for a thread about this but had no success...

What it does:
Allows forum moderators and admins to close threads after posting.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 12-13-2000, 09:03 PM
Guest
 
Posts: n/a
Default

OK, as nobody answered here I started trying to do it myself and managed it to work.
I copied the "openclosethread" part located on postings.php and pasted it into newreply.php. Then I added a "Close Thread after posting" box on the "newreply" template.
Only... I get two "thank you" messagges at once on the same page! The first tnx is about closing the thread while the second tnx is about posting a reply to this thread. How can I get rid of the reply one?
Reply With Quote
  #3  
Old 12-14-2000, 07:23 AM
Guest
 
Posts: n/a
Default

Excellent, care to post the whole hack?
Reply With Quote
  #4  
Old 12-14-2000, 10:31 AM
Guest
 
Posts: n/a
Default

Aren't you interested on waiting for a fix to the double message? No? Well, here's what I did:


Open newreply.php and look for:
Code:
      eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
    }
  }
and add just below:
Code:
  //check valid username and password and get user id
  $userid=verifyusername($username,$password);

  $getthread=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$threadid");
  $forumid=$getthread[forumid];

  $foruminfo=$DB_site->query_first("SELECT active,allowposting FROM forum WHERE forumid=$forumid");
  if ($foruminfo[active]==0) {
    echo standarderror($bbtitle,gettemplate("error_forumclosed",0));
    exit;
  }
  $threadinfo=$DB_site->query_first("SELECT open FROM thread WHERE threadid=$threadid");

  $permissions=getpermissions($bbuserid,$bbusergroupid,$forumid);
  if ($permissions[canview]==0 or ($permissions[canopenclose]==0 and $permissions[canadminedit]==0)) {
    $firstpostinfo=$DB_site->query_first("SELECT userid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
    eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
    exit;
  } elseif ($permissions[canadminedit]==0) {
    $firstpostinfo=$DB_site->query_first("SELECT userid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
    if ($bbuserid!=$firstpostinfo[userid]) {
      eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
      exit;
    }
  }

  if ($threadinfo[open]==1) {
    $DB_site->query("UPDATE thread SET open=0 WHERE threadid=$threadid");
    $action="closing";
  } else {
    $DB_site->query("UPDATE thread SET open=1 WHERE threadid=$threadid");
    $action="opening";
  }

  eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_openclose")."\",\"showthread.php?threadid=$threadid\");");
Save and upload the modified file.


Now open the template "newreply" and insert into the FORM code wherever you want:
Code:
<INPUT TYPE="CHECKBOX" NAME="openclosethread" VALUE="yes"><b>Close Thread after posting?</b>
Apply the new changes and you're finished.

AGAIN...
if someone could plz plz plz plz plz fix the double "thank you" message that would be VERY apreciated!!
Reply With Quote
  #5  
Old 12-14-2000, 10:53 AM
Guest
 
Posts: n/a
Default

WARNING !!!!
Do NOT use this hack as it does ALWAYS close threads even if you don't check the "Close thread" checkbox !!!


Help...
Reply With Quote
  #6  
Old 12-14-2000, 09:14 PM
Guest
 
Posts: n/a
Default

LOL Sorry man I'm glad I didn't test it
Reply With Quote
  #7  
Old 12-15-2000, 08:44 PM
Guest
 
Posts: n/a
Default

Here is the code for this hack that had worked for me very well:

Open newreply.php and look for:

Code:
// redirect
      if ($visible==1) {
        $goto="showthread.php?postid=$postid#post$postid";
      } else {
        $goto="forumdisplay.php?forumid=$forumid";
      }
and add just below:

Code:
if ($close) {

  //check valid username and password and get user id
  $userid=verifyusername($username,$password);

  $getthread=$DB_site->query_first("SELECT forumid FROM thread WHERE threadid=$threadid");
  $forumid=$getthread[forumid];

  $foruminfo=$DB_site->query_first("SELECT active,allowposting FROM forum WHERE forumid=$forumid");
  if ($foruminfo[active]==0) {
    echo standarderror($bbtitle,gettemplate("error_forumclosed",0));
    exit;
  }
  $threadinfo=$DB_site->query_first("SELECT open FROM thread WHERE threadid=$threadid");

  $permissions=getpermissions($bbuserid,$bbusergroupid,$forumid);
  if ($permissions[canview]==0 or ($permissions[canopenclose]==0 and $permissions[canadminedit]==0)) {
    $firstpostinfo=$DB_site->query_first("SELECT userid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
    eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
    exit;
  } elseif ($permissions[canadminedit]==0) {
    $firstpostinfo=$DB_site->query_first("SELECT userid FROM post WHERE threadid=$threadid ORDER BY dateline LIMIT 1");
    if ($bbuserid!=$firstpostinfo[userid]) {
      eval("echo standarderror(\$bbtitle,\"".gettemplate("error_nopermission")."\");");
      exit;
    }
  }

  $DB_site->query("UPDATE thread SET open=0 WHERE threadid=$threadid");
  $action="closing";
 
  eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_openclose")."\",\"showthread.php?threadid=$threadid\");");
  exit;

}
Save and upload the modified file.

Now open the template "newreply" and under:

Code:
<BR><INPUT TYPE="CHECKBOX" NAME="signature" VALUE="yes" $signaturechecked> <B>Show Signature:</B> include your profile signature.  Only registered users may have signatures.
add this:

Code:
<BR><INPUT TYPE="CHECKBOX" NAME="close" VALUE="yes"> <B>Close Thread after posting</B>

I hope that will help anyone
Reply With Quote
  #8  
Old 12-15-2000, 09:02 PM
Guest
 
Posts: n/a
Default

Thank you very much man!!
It worked perfectly except... there's still a double "thank you" msg. Could tell me how to display only the
Code:
"Thank you for closing the thread, Cr4z33. You are now being taken to the thread."
?
Reply With Quote
  #9  
Old 12-15-2000, 09:19 PM
Guest
 
Posts: n/a
Default

Mhhm...on my test-board there is no double "thank you" msg. displayed are you sure you have added the code corectly in the right place ??
Reply With Quote
  #10  
Old 12-16-2000, 06:41 AM
Guest
 
Posts: n/a
Default

When you say to look for:
Code:
      // redirect
      if ($visible==1) {
        $goto="showthread.php?postid=$postid#post$postid";
      } else {
        $goto="forumdisplay.php?forumid=$forumid";
      }
I've another piece just under it with the obsolete tnx msg:
Code:
      eval("echo standardredirect(\$bbtitle,\"".gettemplate("redirect_postthanks")."\",\"$goto\");");
    }
How shall I edit it so that there's no more double messages while closing a thread?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:13 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.04529 seconds
  • Memory Usage 2,279KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (10)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete