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)

Alex 01-27-2002 03:28 PM

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.

djr 01-27-2002 04:06 PM

AlexD.

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

- djr

Warlord 01-27-2002 10:56 PM

Installed, works like a charm.

Alex 01-28-2002 04:10 AM

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

Alex 01-28-2002 04:15 AM

Oh, yes.. if you allready installed it, you can use this changes in your newreply.php...

djr 01-28-2002 05:08 AM

Super fix! :up: Major thanks!

Lesane 01-28-2002 07:12 AM

Thnx for the fix AlexD

pwr_sneak 02-05-2002 02:33 PM

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

JJR512 02-05-2002 11:27 PM

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.

pwr_sneak 02-06-2002 07:32 AM

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.


All times are GMT. The time now is 04:55 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,754KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_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