vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Close Thread with Reply (https://vborg.vbsupport.ru/showthread.php?t=33718)

FWC 01-02-2002 06:06 PM

Good job, JJR! This will come in handy. :)

Tommy Boy 01-02-2002 07:08 PM

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>

JJR512 01-02-2002 07:42 PM

How does putting the template name in the $templateused variable save a query?

JJR512 01-02-2002 08:01 PM

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 :rolleyes: attached in the next reply.

JJR512 01-02-2002 08:31 PM

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.

Tommy Boy 01-02-2002 09:00 PM

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. ;)

JJR512 01-02-2002 09:06 PM

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...:( :D

(I've updated the previously-posted instructions to reflect an appropriate change.)

Lucky 01-03-2002 11:30 AM

Man is this a time saver! Thanks:)

It would be even better if you could add sticky, move, etc...
Just a thought.

Mystics 01-03-2002 11:37 AM

@JJR512

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

@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 :p,
Mystics

JJR512 01-03-2002 04:17 PM

OK, thanks...I've updated the instructions.


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

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.01143 seconds
  • Memory Usage 1,740KB
  • 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
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete