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)

WhSox21 09-18-2004 10:00 PM

Reason for Closing Thread
 
This hack is my first released free hack.

It runs no extra queries so it should not make any load times longer.

How it works:
Once you click on Close thread in the Thread Tools menu, it will pop up with a javascript alert asking for the reason you are closing. You may click cancel or ok. If you inputted something into the box it will save it and appear at the top right above the first post.

Modifications:
1 Table Modification
3 File Modifications
5 Template Modifications
1 Template Addition

Please click install if you install this hack.

www.hackvb.com - For your custom hacks!

*Note: This was only tested on vb 3.0.3. I have not tested it on any other versions and theoretically it should work, but I'm not sure.

Boofo 09-19-2004 02:55 PM

Interesting hack. ;) You need to fix the instructions file for the following, though.

FIND:
-------------------
<!-- / toolbar -->
-------------------
BELOW IT ADD:
-------------------
$reaons
-------------------

Shouldn't that be $reason?

* Boofo clicks the install button. ;)

WhSox21 09-19-2004 03:04 PM

Should be fixed now... Let me know if you have any troubles. I'd like to know if everything goes smoothly.

alqafelah 09-19-2004 03:13 PM

thanks WhSox21
Great work :)
i'm clicked install it but i have error whene i save modification of SHOWTHREAD template :


The following error occurred when attempting to evaluate this template:

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in ***/***/includes/adminfunctions_template.php(3055) : eval()'d code on line 131

This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.

WhSox21 09-19-2004 03:15 PM

I forgot the biggest part of the hack. I reuploaded the instructions!

Working on that for you. I have no idea why it gave you that error. It didn't give me that error.

WhSox21 09-19-2004 03:18 PM

I see the problem. Where it says:
Code:

<if condition="$show['closethread']">
<script type="text/javascript">
<!--
function get_reason()
{
        if (document.getElementById('ao_oct').checked == true)
        {
                var answer = prompt('What is your reason for closing this thread?', '');
                document.threadadminform.reason.value = answer;
        }
}
// -->
</script>
<if condition="$show['closethread']">

It has <if condition="$show['closethread']"> at the bottom that should be </if>

I fixed that now. I also updated the install file.

alqafelah 09-19-2004 03:28 PM

work fine .. thanks alot :)

Vivi Ornitier 09-19-2004 04:15 PM

does it work for quick reply closin?

WhSox21 09-19-2004 04:33 PM

What do you mean exactly? As of now it only works when you use the thread tools menu.

alqafelah 09-19-2004 04:38 PM

back :)

Whene i not write reason it show :

Reason thread was closed:
null

can you cancel show all table of reason if not reason? OR can i put default reason ?

WhSox21 09-19-2004 04:41 PM

How did you get that error? That should not happen. I made it so that if you did not fill in a reason it would not display. What were the steps you took to do that? Did you click cancel or ok or how did you do it?

EDIT:
Are you sure you did all the steps in the install? Are you sure you edited postings.php file correctly?

alqafelah 09-19-2004 04:48 PM

oh, yes .. your right .. i'm clicked Cancel ! with click Ok no problem .

thanks for support me :)

WhSox21 09-19-2004 04:52 PM

If you click cancel you shouldn't recieve that either.

alqafelah 09-19-2004 04:58 PM

that is what happened for me !

if i not write reason and click OK it's not display anything .. if CANCEL it's display !

WhSox21 09-19-2004 05:01 PM

What version of vb are you using? Can you post me lines 165-182 of your postings.php file? It's not doing that for me when I click cancel nor should it for you. There is something wrong with your install or something.

alqafelah 09-19-2004 05:10 PM

i'm using 3.03 ..
i will reinstall this hack and take what you request : ( all open/close section )

PHP Code:

// ############################### start do open / close thread ###############################
if ($_POST['do'] == 'openclosethread')
{
    
// permission check
    
if (!can_moderate($threadinfo['forumid'], 'canopenclose'))
    {
        
$forumperms fetch_permissions($threadinfo['forumid']);
        if (!(
$forumperms CANVIEW) OR !($forumperms CANOPENCLOSE))
        {
            
print_no_permission();
        }
        else
        {
            if (!
is_first_poster($threadid))
            {
                
print_no_permission();
            }
        }
    }

    
// check if there is a forum password and if so, ensure the user has it set
    
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

    if (
$threadinfo['open'])
    {
        
$threadinfo['open'] = 0;
        
$logaction $vbphrase['closed_thread'];
        
$action $vbphrase['closed'];
    }
    else
    {
        
$threadinfo['open'] = 1;
        
$logaction $vbphrase['opened_thread'];
        
$action $vbphrase['opened'];
        
$_POST['reason'] = null;
    }

    
log_moderator_action($threadinfo$logaction);

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

    
$_REQUEST['forceredirect'] = 1;
    
$url "showthread.php?$session[sessionurl]t=$threadid";
    eval(
print_standard_redirect('redirect_openclose'));

}

// ############################### start delete thread ############################### 


WhSox21 09-19-2004 05:12 PM

Well, that file is correct. I'll see if I can't figure something else out?

WhSox21 09-19-2004 05:16 PM

I figured it out. It's related to IE. You can do this to simply fix the problem:
postings.php
***************
Code:

FIND:
-------------------
                $action = $vbphrase['closed'];
-------------------
BELOW IT ADD:
-------------------
                if($_POST['reason'] == 'null') $_POST['reason'] = null;


shadiguy1 09-19-2004 05:19 PM

i installed it the box pops up But after wards there is no reason listed for closing thread.

WhSox21 09-19-2004 05:21 PM

Did you add the hidden field in showthread template?

shadiguy1 09-19-2004 05:22 PM

i added everything in the instructions. do you have aim i can talk to you on?

alqafelah 09-19-2004 05:33 PM

Excellent, fixed :)

thx and best wishes :)

shadiguy1 09-20-2004 11:50 PM

whsox fixed it up for me thanks bro much appreciated.

drumsy 09-21-2004 03:43 AM

One issue that arose with the vB2 version of this was that if the thread was closed, a reason was entered, and then the thread was reopened, the reason still showed. Has this been fixed in the vB3 version?

WhSox21 09-21-2004 11:57 AM

Yep. I set the reason to null if they reopened the thread. If the reason is set to null then there is no displaying of the reason. let me know if you have any problems with my hack as I'm interested in having 100% proof hacks released by me! :)

Dan 09-21-2004 09:11 PM

Interesting and very useful hack :) Thanks!

WhSox21 09-21-2004 09:19 PM

Not a problem!

HarryBO 10-15-2004 11:48 PM

I have the same Problem as shadyguy1

Quote:

i installed it the box pops up But after wards there is no reason listed for closing thread.
I hope somebody can help me!

Edit: Fixed it by myself!

WhSox21 10-16-2004 03:53 AM

Can you share what the problem was for future fixes?

mtha 10-16-2004 05:14 AM

interesting.

This can lead to another mod "Reason for moving thread" too, isnt it?

dmark101 10-31-2004 10:38 PM

Quote:

Originally Posted by drumsy
One issue that arose with the vB2 version of this was that if the thread was closed, a reason was entered, and then the thread was reopened, the reason still showed. Has this been fixed in the vB3 version?

i used to have this hack installed on the vB2 version of my board. that hack also showed the reason and who closed it in the 'last post' field.

is there any reason for not having this functionality in this hack?



i did install BTW. :up:

WhSox21 10-31-2004 11:25 PM

No, I never knew that. I'm aweful busy right now or I could do that, but I'm affraid I can't do it as of right now.

silentwille 11-10-2004 06:31 PM

It's possible to edit the reason without open and reclose the thread ?

WhSox21 11-10-2004 06:35 PM

Via the database. It is not possible as of now.

silentwille 11-10-2004 06:41 PM

Ok, thanks

shadiguy1 12-30-2004 07:52 PM

any chance at an updated version that will also list who closed the thread.

WhSox21 12-30-2004 09:00 PM

Post in this thread in about a week and I'll try to get that done.

shadiguy1 12-30-2004 09:17 PM

alright thanks...be Cool if it Said Thread Closed By:

shadiguy1 01-05-2005 03:53 PM

Bumping thread like u asked you said you would add the thread closed by info to the hack in a small update

WhSox21 01-07-2005 04:38 AM

I'll package everything up and send out an update tomorrow but since you've been waiting here it is:

Note this only applies when this is already installed!

Replace showthread_reason with this:
Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-bottom-width:0px">
<tr>
        <td class="alt1" width="100%">
                <b>Reason thread was closed:</b> <br />
                <div class="smallfont">
                        $thread[reason]
                </div>
                <if condition="!empty($thread[who])"><b>Thread Closed By:</b> <span class="smallfont">$thread[who]</span></if>
        </td>
</tr>
</table>

Run this query:
Code:

ALTER TABLE thread ADD `who` VARCHAR(50) NOT NULL;
In postings.php find this:
Code:

$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET open = $threadinfo[open], reason = '" . addslashes($_POST[reason]) . "' WHERE threadid = $threadid");
...and replace with...
Code:

$DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET open = $threadinfo[open], reason = '" . addslashes($_POST[reason]) . "', who = '" . addslashes($bbuserinfo[username]) . "' WHERE threadid = $threadid");
On a side note. Any previously closed threads will not have who closed them. Only threads closed in the future.

Let me know how it works! :up: :)


All times are GMT. The time now is 05:32 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.01343 seconds
  • Memory Usage 1,827KB
  • 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
  • (6)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)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
  • (40)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