Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

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
  #32  
Old 01-27-2002, 03:28 PM
Alex Alex is offline
 
Join Date: Oct 2001
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

seems depending on Groups Permissions. But i have Stanard-Permissions for our Mods.

Must be one of these settings:
Can Move own threads to other forums
Can open / close own threads
Can delete own threads by deleting the first post

These settings are turned off for my mods.
Reply With Quote
  #33  
Old 01-27-2002, 04:06 PM
djr's Avatar
djr djr is offline
 
Join Date: Nov 2001
Location: Amsterdam
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

AlexD.

This is already discussed here. There's still no solution for the problem though.

- djr
Reply With Quote
  #34  
Old 01-27-2002, 10:56 PM
Warlord's Avatar
Warlord Warlord is offline
 
Join Date: Jan 2002
Location: TN, USA
Posts: 668
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed, works like a charm.
Reply With Quote
  #35  
Old 01-28-2002, 04:10 AM
Alex Alex is offline
 
Join Date: Oct 2001
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, i fixed it. Here we go:

In the Hack Instructions find:
Code:
    } else {
      if ($closethread=="yes" and $permissions['canopenclose']==1) {
        $DB_site->query("UPDATE thread SET open='0' WHERE threadid='$threadid'");
      }
      if ($attachmentid and !$foruminfo[moderateattach]) {
        $DB_site->query("UPDATE thread SET attach = attach + 1 WHERE threadid = '$threadid'");
      }
and replace it with:
Code:
    } else {
      if ($closethread=="yes" and ($bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7)) {
        $DB_site->query("UPDATE thread SET open='0' WHERE threadid='$threadid'");
      }
      if ($attachmentid and !$foruminfo[moderateattach]) {
        $DB_site->query("UPDATE thread SET attach = attach + 1 WHERE threadid = '$threadid'");
      }
Find:
Code:
  if ($permissions['canopenclose']==1) {
    $closethreadchecked=iif(trim($closethread)=="yes","checked","");
    eval("\$closethreadbox = \"".gettemplate("newpost_closethread")."\";");
  } else {
    $closethreadbox="";
  }
and replace it with:
Code:
   if ($bbuserinfo[usergroupid]==5 || $bbuserinfo[usergroupid]==6 || $bbuserinfo[usergroupid]==7)  {
    $closethreadchecked=iif(trim($closethread)=="yes","checked","");
    eval("\$closethreadbox = \"".gettemplate("newpost_closethread")."\";");
  } else {
    $closethreadbox="";
  }
This changes make the checkbox available for mods (usergroupid 7), Super Mods (usergroupid 5) and Admins (usergroupid 6). If you don't like any of these groups to have the checkbox, delete that usergroup from the if-question --> $bbuserinfo[usergroupid]==X and the || beetween the next group.

Sorry for my bad english...
Reply With Quote
  #36  
Old 01-28-2002, 04:15 AM
Alex Alex is offline
 
Join Date: Oct 2001
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Oh, yes.. if you allready installed it, you can use this changes in your newreply.php...
Reply With Quote
  #37  
Old 01-28-2002, 05:08 AM
djr's Avatar
djr djr is offline
 
Join Date: Nov 2001
Location: Amsterdam
Posts: 220
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Super fix! :up: Major thanks!
Reply With Quote
  #38  
Old 01-28-2002, 07:12 AM
Lesane's Avatar
Lesane Lesane is offline
 
Join Date: Oct 2001
Location: The Netherlands
Posts: 1,149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thnx for the fix AlexD
Reply With Quote
  #39  
Old 02-05-2002, 02:33 PM
pwr_sneak pwr_sneak is offline
 
Join Date: Oct 2001
Location: Germany
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if you still want it the way, it should work, try this:
PHP Code:
if ($permissions['canopenclose'] and (ismoderator($threadinfo[forumid],"canopenclose") or $isstarter=$DB_site->query_first("SELECT postuserid FROM thread WHERE threadid='$threadid' and postuserid='$bbuserinfo[userid]'")))  {
    
$closethreadchecked=iif(trim($closethread)=="yes","checked","");
    eval(
"\$closethreadbox = \"".gettemplate("newpost_closethread")."\";");
  } else {
    
$closethreadbox="";
  } 
it checks, if the user can open close own threads (and started this thread) or is moderator with this rights.

See it in Action on http://www.hotornot.de
Reply With Quote
  #40  
Old 02-05-2002, 11:27 PM
JJR512's Avatar
JJR512 JJR512 is offline
 
Join Date: Oct 2001
Location: Glen Burnie, MD, USA
Posts: 710
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I tried the fix by pwr_sneak.

What I found is that as an Admin, if I change the permissions for the admin user group to NOT be able to close own threads, that I did not see the checkbox for ANY thread, regardless of who started it.

Correct me if I'm wrong, but the way the hack is in the last version that I posted, will work just fine for the vast majority of people who use the default permissions scheme, where admins can close any thread, mods can close threads in their forums, and regular members cannot close any threads at all, right? If this is true, then I'm leaving my version posted as-is. If you use a different permission scheme, then it kind of complicates things, and I think part of the problem is that there is no permission setting (that I can find) that lets a user or user group be able to close any thread, just the one where they can close their own threads.
Reply With Quote
  #41  
Old 02-06-2002, 07:32 AM
pwr_sneak pwr_sneak is offline
 
Join Date: Oct 2001
Location: Germany
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your last Version uses hard-coded usergroupid and it don't let the user close his own thread if he started it.
If you changed your Admin Usergroup not to close their own threads, why should they have permission to close any thread??

Anyway, I got another Version which should work for not only the majority of forums but all, because its fully based upon the permission system in VBulletin.

PHP Code:
if (ismoderator($threadinfo[forumid],"canopenclose") or ($permissions['canopenclose'] and  $isstarter=$DB_site->query_first("SELECT postuserid FROM thread WHERE threadid='$threadid' and postuserid='$bbuserinfo[userid]'")))  {
    
$closethreadchecked=iif(trim($closethread)=="yes","checked","");
    eval(
"\$closethreadbox = \"".gettemplate("newpost_closethread")."\";");
  } else {
    
$closethreadbox="";
  } 
Try to understand what it does, and then use it on your forums
It first checks if the user is Moderator for this Forum or even SuperModerator and then (if not) asks for the permission "Close own threads" and if the User has started this 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 12:57 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.05383 seconds
  • Memory Usage 2,320KB
  • 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
  • (4)bbcode_code
  • (2)bbcode_php
  • (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