Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases

Reply
 
Thread Tools
Details »»

Version: , by JJR512 JJR512 is offline
Developer Last Online: Jun 2006 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-01-2002 Last Update: Never Installs: 76
 
No support by the author.

This very simple hack will show a checkbox in the options area (with show signature, email notification, etc.) of the Reply
to Topic screen that allows you to close the thread at the same time as posting your reply to the thread. The checkbox will
only show to those that have permission to close the thread.

Tested by me on 2.2.1. Compatibility with earlier versions is likely but not proven.

This hack was requested by Freestyler here.

EDIT: This hack has been updated; the attachment is now in Post #9.

Show Your Support

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

Comments
  #12  
Old 01-02-2002, 06:06 PM
FWC's Avatar
FWC FWC is offline
 
Join Date: Oct 2001
Location: Ontario, CA
Posts: 821
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Good job, JJR! This will come in handy.
Reply With Quote
  #13  
Old 01-02-2002, 07:08 PM
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wouldn't it be better to add "newpost_closethread" to the $templatesused variable at the top of newreply.php, to save one SQL query on every reply page?

Also, to preserve the checkbox's state when previewing post, I would put this in newreply.php:
PHP Code:
  if ($permissions['canopenclose']==1) {
    
$closethreadchecked = ($closethread) ? " checked" "";
    eval(
"\$closethreadbox = \"".gettemplate("newpost_closethread")."\";");
  } else {
    
$closethreadbox="";
  } 
And this as the newpost_closethread template:
Quote:
<br><input type="checkbox" name="closethread" value="yes"$closethreadchecked> <b>Close Thread After Reply</b>
Reply With Quote
  #14  
Old 01-02-2002, 07:42 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How does putting the template name in the $templateused variable save a query?
Reply With Quote
  #15  
Old 01-02-2002, 08:01 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have updated the instructions so that the check box maintains its status during a reply preview, although I used a slightly different way (I used the iif function).

EDIT: Another update attached in the next reply.
Reply With Quote
  #16  
Old 01-02-2002, 08:31 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sorry...

There was a potential problem I was unaware of, until I started testing with the preview function. Due to where in newreply.php I specified to place the code that actually closed the thread, the thread would have been closed immediately upon hitting the Preview button. Now I think that anyone that could use the checkbox and actually close the thread could probably also post a reply to a closed thread, so that wouldn't have been a problem...but if, after hitting Preview, the user just abandoned the reply (clicked the navigation link back into the forum or the home page or whatever, without submitting the reply), the thread would still be closed. Therefore, I have adjusted the instructions so the thread isn't closed until the reply is actually submitted.

If you have already installed this hack, you should undo the first step of modifying newreply.php (just find what it tells you to add, and remove it). Then download the new instructions and do what it says in the same step.
Reply With Quote
  #17  
Old 01-02-2002, 09:00 PM
Tommy Boy Tommy Boy is offline
 
Join Date: Nov 2001
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by JJR512
How does putting the template name in the $templateused variable save a query?
All the templates mentioned in this variable are loaded first, using one SQL query for all of them together. If you then request a template which was not mentioned there, an additional SQL query is made to retrieve it.

Thanks for fixing your hack! I think I accidently closed a thread while I was playing with it, but now I can't find it... Oh well, let my users think I'm a bad administrator.
Reply With Quote
  #18  
Old 01-02-2002, 09:06 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, thanks for explaining that...I didn't really know what the point of that variable was. Now I have some hacks to go fix...

(I've updated the previously-posted instructions to reflect an appropriate change.)
Reply With Quote
  #19  
Old 01-03-2002, 11:30 AM
Lucky Lucky is offline
 
Join Date: Dec 2001
Posts: 234
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Man is this a time saver! Thanks

It would be even better if you could add sticky, move, etc...
Just a thought.
Reply With Quote
  #20  
Old 01-03-2002, 11:37 AM
Mystics's Avatar
Mystics Mystics is offline
 
Join Date: Oct 2001
Location: Germany
Posts: 273
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

@JJR512

Thx for the Hack, but in your last updated instructions is a new (small) bug

@Point 3. you wrote:
Quote:
Go to the end of that line, which by default should look like this:

newpost_closethread";

Before the double quotes, add this:

,newpost_closethread
It better should look like this:
Quote:
Go to the end of that line, which by default should look like this:

vbcode_colorbits";

Before the double quotes, add this:

,newpost_closethread
Greetz ,
Mystics
Reply With Quote
  #21  
Old 01-03-2002, 04:17 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK, thanks...I've updated the instructions.
Reply With Quote
Reply

Thread Tools

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 01:07 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05136 seconds
  • Memory Usage 2,304KB
  • 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
  • (1)bbcode_php
  • (4)bbcode_quote
  • (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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • postbit_imicons
  • 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