vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Reason for Closing Thread (https://vborg.vbsupport.ru/showthread.php?t=69625)

shadiguy1 01-07-2005 03:26 PM

works awsome Thanks agian bro...

j_86 01-08-2005 05:07 PM

This hack is VB 3.05 compatiable.

chet 01-08-2005 07:16 PM

I have 3.05 and just installed it, closing the thread brings up the pop up box askng for the reason, I put in the reason and click ok but I do not get the reason showing up when viewing the thread, what did I miss out or is this a none worker on the latest version of VB

Thanks

Chet

OK forget that, yes it does work with 3.0.5, I missed out the last template modification :o

dmark101 01-26-2005 04:16 PM

cool on all the updates, including what i had originally asked about.

i just upgraded from 3.0.3 to 3.0.6 and it looks like i have to reinstall the hack, although it does show me the pop-up (it doesn't show the reason). i'll report back when i check all the files with the updated instructions. :)

WhSox21 01-26-2005 04:52 PM

This is going to be a template problem most likely.

skydancer 10-08-2005 09:34 PM

I can report that this hack still works in 3.5.0 with a few small changes.

I got rid of the last postings.php modification in the .txt which read
Quote:

FIND:
-------------------
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET open = $threadinfo[open] WHERE threadid = $threadid");
-------------------
REPLACE WITH:
-------------------
$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET open = $threadinfo[open], reason = '" . addslashes($_POST[reason]) . "' WHERE threadid = $threadid");
Instead, I did the following:

Quote:

FIND:
$vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "t=$threadid";

BEFORE IT, ADD:
$db->query("UPDATE " . TABLE_PREFIX . "thread SET reason='".addslashes($_POST[reason])."' WHERE threadid = $threadid");
It also may be useful to store the name of the moderator who closed it. To do this, I added:
Quote:

FIND
if($_POST['reason'] == 'null') $_POST['reason'] = null;

BELOW IT, ADD:
$_POST['reason'] = "(".$vbulletin->userinfo['username'].") " . $_POST['reason'];
Cheers!
sd

COBRAws 10-10-2005 03:14 AM

skydancer ure the man!

dmark101 11-18-2005 04:23 PM

Quote:

Originally Posted by WhSox21
This is going to be a template problem most likely.

that's pretty much what it turned out to be.

my thanks to skydancer for porting this over to vB 3.5.x because i recently upgraded my board to that version. kudos. :D

now i have to install 3.5.1 and we're set. :)

serhat_kk 12-11-2005 04:02 PM

it works ...Propz

Justice 12-14-2005 01:31 AM

thanks to the author, and skydancer... does that 3.5.0 mod work with 3.5.2?

dmark101 12-14-2005 05:30 PM

Quote:

Originally Posted by Justice
thanks to the author, and skydancer... does that 3.5.0 mod work with 3.5.2?

yes, it does. :)

Justice 12-15-2005 08:07 AM

thanks

serhat_kk 12-17-2007 08:40 AM

i need this for 3.6.x please

Pirat3 12-17-2007 11:16 PM

Quote:

Originally Posted by serhat_kk (Post 1402704)
i need this for 3.6.x please

same

MediaHound 12-25-2007 03:13 PM

Same here, I need this for 3.6.x - have you guys attempted it?

dmark101 02-24-2008 10:28 PM

Quote:

Originally Posted by MediaHound (Post 1408917)
Same here, I need this for 3.6.x - have you guys attempted it?

i just updated my 3.5.x software to 3.6.8 and it works PERFECTLY.

just remember to follow skydancer's advice toward the end of the text file. :D

sv1cec 03-25-2008 09:39 AM

One question, does this mod take into consideration the permissions? In other words, I would like only the mods, supermods and admins to be able to see the reason for which a thread is closed. I can do it myself, but before installing everything, I would like to know if this is taken care of.

Many thanks.

MediaHound 05-30-2008 06:53 PM

Quote:

Originally Posted by dmark101 (Post 1450308)
i just updated my 3.5.x software to 3.6.8 and it works PERFECTLY.

just remember to follow skydancer's advice toward the end of the text file. :D

Thank you! May I ask what version you are up to now with it working?

MediaHound 05-30-2008 07:25 PM

OK I have it working on 3.7, thanks skydancer, dmark101, and WhSox21.
For the record, regarding skydancers fix -
This line appeared often:
PHP Code:

$vbulletin->url 'showthread.php?' $vbulletin->session->vars['sessionurl'] . "t=$threadid"

So I had to determine where to place:
PHP Code:

$db->query("UPDATE " TABLE_PREFIX "thread SET reason='".addslashes($_POST[reason])."' WHERE threadid = $threadid"); 

Mine appears on about line 263... but I use some extra lines of comments in places. ymmv.
Here's to fixing it with each update!
I wish it used hooks and I wish it was a built in feature of vb! I hate editing core files, but we really need this modification on a board of mine.

MediaHound 06-09-2008 07:18 PM

OK we're onto something here.
The big problem with this hack is that it does not use hooks.
Well, I added one of the file edits to a hook. So, if you do this as well, its one less manual edit each time you upgrade.
Visit your admin panel and under Plugins & Products, click add new plugin.
Product is vbulletin
Hook location is showthread_complete
For title you can use "Reason Post Closed - showthread_complete hook"
Execution order you can leave at 5 or whatever your default is
Code is:
PHP Code:

if (!empty($thread['reason']))
{
    eval(
'$reason = "' .fetch_template('showthread_reason') . '";');


Plugin is active - yes
then hit save.
Don't forget to remove the same code from the bottom of your showthread.php file.
Thats one less file edit each time you upgrade.
Now if we could figure out somehow to get the other file edits in postings.php to use hooks, we will be all set....
Its not fun that this breaks with each upgrade, I hate editing core files...
Whats the process to suggest new hook locations, anyway?

regitbull 07-15-2008 03:23 PM

verry nice mod.
I installed it on my 3.7.2 board and its working perfect.

And thanks skydancer for posting the solution for
Quote:

$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET open = $threadinfo[open] WHERE threadid = $threadid");
That helped me to get the mod running on my board.

TheInsaneManiac 11-11-2008 02:47 PM

Is it possible to do this for the mass close option?


All times are GMT. The time now is 03:33 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.01197 seconds
  • Memory Usage 1,774KB
  • 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
  • (3)bbcode_php_printable
  • (9)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (22)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