vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Add Usergroup as Moderator (https://vborg.vbsupport.ru/showthread.php?t=93543)

Andreas 08-02-2005 10:00 PM

Add Usergroup as Moderator
 
Add Usergroup as Moderator
Description
This Hack allows you to add a whole Usergroup as Moderators.
(Of course you can not only add but also remove it, change Permissions, etc. ;))

Details
1 Product XML with 1 Plugin, 16 Phrases and 2 Queries
1 ACP Navigation XML
1 ACP Applet
1 Datamanager Class

History
1.0.0
Initial Version

1.0.1
Fixed a slight Bug regarding Table Prefixes

1.0.2
Removed Multi-Table DELETEs to improve mySQL compatibility

1.0.3
Fixed a missing s that caused Moderator Permissions not being removed when a User is being removed from the Moderator Usergroup

1.0.4
Fixed a Bug regarding Table Prefixes

1.0.5
Code optimization
Usergroup is now being shown instead of individual Moderators on Forumhome/Forumdisplay

1.0.6
Fixed a Problem with conflicting column Names

1.0.7
Added a few checks to prevent Moderators of Moderator Usergroups from being modified/deleted individually

1.0.8
Added Support for moderated public Usergroups as Moderator Usergroup

1.0.9
Fixed a Bug which caused Moderator Usergroups not being displayed properly in subforums.

1.0.10
Fixed a a slight problem that could cause mySQL errors

Please only click Install if you actually have installed/are using this Hack, and click Uninstall whan you don't use it any longer!

Dean C 08-03-2005 06:52 PM

[high]* Dean C wishes this was a default vB features :)[/high]

Andreas 08-03-2005 06:54 PM

:)
I know it's not an ideal solution, but maybe better then nothing.

Mephisteus 08-03-2005 09:26 PM

*worship*

Thank you kind sir, I really really needed this and you have now saved me valuable time (which I dont have).

Once again, thanks :)

[edit]
Doesnt work, getting mysql errors all over the place (including when editing a user). When usergroup is added. members of the usergroup (additional) dont have moderator rights.

Code:

Database error in vBulletin 3.5.0 Release Candidate 1:

Invalid SQL:

                DELETE FROM moderator AS moderator
                USING moderator AS moderator, moderatorusergroup AS moderatorusergroup
                WHERE moderator.userid = 8
                        AND moderator.moderatorusergroupid = moderatorusergroup.moderatorusergroupid
                        AND NOT (moderatorusergroup.usergroupid IN (17, 29,30,32,36));

MySQL Error  : You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS moderator
                USING moderator AS moderator, moderatorusergroup Error Number : 1064
Date        : Wednesday, August 3rd 2005 @ 06:33:22 PM
Script      : forums/admincp/user.php
Referrer    : forums/admincp/user.php?do=edit&u=8
Classname    : vb_database


jluerken 08-04-2005 08:51 AM

Looks like this hack doesn't support table prefixes :D

Andreas 08-04-2005 08:59 AM

It should support Table Prefixes.
But it needs an up-to-date mySQL Version

@DarkSSJ3
Which mySQL Version do you use?

Mephisteus 08-04-2005 09:09 AM

4.0.24-standard

I have to go out for a bit, when I get back Ill load it back up and go through it more extensivly

Andreas 08-04-2005 09:23 AM

Aargh, there was a Problem with Table Prefixes - 1 Space where it should not have been.
ZIP updated.
Just import the new Product XML to update.

But I still think this isn't the cause for your Problem, as you don't seem to use Table Prefixes?

Asterik 08-04-2005 09:48 AM

Code:

Database error in vBulletin 3.5.0 Release Candidate 1:

Invalid SQL:

                DELETE FROM moderator AS moderator
                USING moderator AS moderator, moderatorusergroup AS moderatorusergroup
                WHERE moderator.userid = 9
                        AND moderator.moderatorusergroupid = moderatorusergroup.moderatorusergroupid
                        AND NOT (moderatorusergroup.usergroupid IN (2));

MySQL Error  : You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS moderator
                USING moderator AS moderator, moderatorusergroup
Error Number : 1064
Date        : Thursday, August 4th 2005 @ 03:47:21 AM
Script      : admincp/user.php
Referrer    : admincp/user.php?do=edit&u=9
IP Address  : x.x.x.x
Username    : Union Jack
Classname    : vb_database

Yea, i have prefixes and ur newest update and still nothin :surprised:

* BTW * This was from me just editing a user. Nothing more. ;)

Andreas 08-04-2005 10:04 AM

Hmm. Works fine on my Testboard that has a Table Prefix :(
Which Prefix do you use?

Asterik 08-04-2005 10:15 AM

Silly me, actually i have no prefix. :P. But it gives me the same error eventhough I did set a usergroup as moderator of a forum o_O.

Code:

Database error in vBulletin 3.5.0 Release Candidate 1:

Invalid SQL:

                DELETE FROM moderator AS moderator
                USING moderator AS moderator, moderatorusergroup AS moderatorusergroup
                WHERE moderator.userid = 11
                        AND moderator.moderatorusergroupid = moderatorusergroup.moderatorusergroupid
                        AND NOT (moderatorusergroup.usergroupid IN (2));

MySQL Error  : You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS moderator
                USING moderator AS moderator, moderatorusergroup
Error Number : 1064
Date        : Thursday, August 4th 2005 @ 04:13:59 AM
Script      : admincp/user.php
Referrer    : admincp/user.php?do=edit&u=11
IP Address  : x.x.x.x
Username    : Union Jack
Classname    : vb_database


Andreas 08-04-2005 10:18 AM

That's what I thought.
Seems like your mySQL Version does not support this Query Syntax.

Can you try the following Query in phpMyAdmin if it generates errors?

[sql]
DELETE moderator FROM moderator AS moderator, moderatorusergroup AS moderatorusergroup
WHERE moderator.userid = 11
AND moderator.moderatorusergroupid = moderatorusergroup.moderatorusergroupid
AND NOT (moderatorusergroup.usergroupid IN (2));
[/sql]

Asterik 08-04-2005 10:33 AM

Code:

Database error in vBulletin 3.5.0 Release Candidate 1:

Invalid SQL:

                DELETE FROM moderator AS moderator
                USING moderator AS moderator, moderatorusergroup AS moderatorusergroup
                WHERE moderator.userid = 11
                        AND moderator.moderatorusergroupid = moderatorusergroup.moderatorusergroupid
                        AND NOT (moderatorusergroup.usergroupid IN (2));

MySQL Error  : You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS moderator
                USING moderator AS moderator, moderatorusergroup
Error Number : 1064

hmm..... Ran ur query but it went through, but i still get this :(

:: EDIT :: Actually it didn't delete anything :I

Mephisteus 08-04-2005 10:57 AM

I have the same as Asterik. When editing a user it gives me that error.

Marco van Herwaarden 08-04-2005 03:03 PM

Quote:

Originally Posted by KirbyDE
That's what I thought.
Seems like your mySQL Version does not support this Query Syntax.

Can you try the following Query in phpMyAdmin if it generates errors?

[sql]
DELETE moderator FROM moderator AS moderator, moderatorusergroup AS moderatorusergroup
WHERE moderator.userid = 11
AND moderator.moderatorusergroupid = moderatorusergroup.moderatorusergroupid
AND NOT (moderatorusergroup.usergroupid IN (2));
[/sql]

That is a completly different query.

PS Not all MySQL versions support multi table deletes.

Mephisteus 08-04-2005 03:09 PM

The only place where I get that error is when editing a user. Also (the user already is a part of that group) the user doesnt have moderator rights.

Asterik 08-04-2005 06:27 PM

Quote:

Originally Posted by DarkSSJ3
The only place where I get that error is when editing a user. Also (the user already is a part of that group) the user doesnt have moderator rights.

Exactlly the same :).

Andreas 08-04-2005 07:45 PM

Hmpf. Ppl should use more up-to-date mySQL Versions ;)
OK, doing it the old-fashined way then - without multi-table DELETEs.

Mephisteus 08-04-2005 09:59 PM

Woho! Pretty please let us know when its updated :)

Andreas 08-04-2005 10:04 PM

Will do.
Btw: If you add a Usergroup that already has Members (be it primary or secondary) as Moderator, do these members get Moderators?

Boofo 08-04-2005 10:41 PM

Quote:

Originally Posted by MarcoH64
That is a completly different query.

PS Not all MySQL versions support multi table deletes.

Which versions of MySQL support it?

Andreas 08-04-2005 10:43 PM

4.0.2 up does ... if I understand the manual correctly.
But as there is one report from 4.0.24 where it is not working, maybe only 4.1.X does support this Syntax?

Bob, could you test if it's working for you?

Boofo 08-04-2005 10:46 PM

I'm running 4.0.24-Standard, but I will install it and give it a shot. ;)

Andreas 08-04-2005 10:48 PM

Thanks :)
I guess editing a User will not work, but I am interested if it does add Usergroup Members as Mods (when you add the Usergroup as Mod) on this Version

Boofo 08-04-2005 10:55 PM

Ok, installed fine and I just added the administrators as the mod group to a forum. Is that what you needed to know or do you need me to check something else while I am playing? ;)

Boofo 08-04-2005 10:57 PM

And when I check the forum it shows each admin in the mods drop down listing.

Andreas 08-04-2005 10:57 PM

Great, so this part is working - only the multi-table delete causing Problem then :)

Boofo 08-04-2005 10:59 PM

What do I need to do to test that part of it to make sure it just isn't a fluke on another system?

Andreas 08-04-2005 11:00 PM

Just Edit a User

Boofo 08-04-2005 11:04 PM

Sorry, got the same error on that one. :(

Andreas 08-05-2005 12:23 PM

I have removed the multi-table DELETEs.
Hopefully this does work with older mySQL Versions now too.

Mephisteus 08-05-2005 01:52 PM

everything seems like its working fine. Minus one thing, remove the user form the additional usergroup and the moderator access remains (yet disappears if the moderator usergroup is removed as such)

Andreas 08-05-2005 02:06 PM

One missing s, aargh.
Should be fixed now, just import the new product XML.

Mephisteus 08-05-2005 02:30 PM

Looks like its working now :) Thanks again :)

HuangA 08-09-2005 06:04 AM

Kirby, can I make a translation of this and post on vbulletin chinese's hacks forum (crediting you of course)?

Andreas 08-09-2005 01:48 PM

Feel free to post an XML with Translated Phrases/Installation instructions, but the Product XML should only be available for Download from here.
Thanks for your understanding :)

If you do, please send me a copy as well.

HuangA 08-09-2005 05:22 PM

Hm... aren't the phrases part of the product xml? I wonder how I'm gonna translate just the phrases without putting up a different xml :p oh well, I'll go probe around and see what I can do :)

Andreas 08-09-2005 05:54 PM

Take a look at the 3.5 Modification Tips&Tricks Forum, I posted a How-To for translating Hacks :)

ack 08-23-2005 03:58 AM

Oh man, it works perfect! This is exactly what I needed!

I know this is stupid and I probably shouldn't ask, but would there be anyway to just have the name of the usergroup as the moderator, instead of all of the moderators showing up?

It's no biggy, it would just look nicer. *whistles*

Oh man, but this is awesome. Thanks like.. A MILLION. Really. *worships*

Andreas 08-23-2005 08:43 AM

Quote:

Originally Posted by ack
I know this is stupid and I probably shouldn't ask, but would there be anyway to just have the name of the usergroup as the moderator, instead of all of the moderators showing up?

Not possible (without major File Edits).


All times are GMT. The time now is 10:22 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.01368 seconds
  • Memory Usage 1,819KB
  • 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
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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