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

Reply
 
Thread Tools
Details »»

Version: 1.00, by Martz Martz is offline
Developer Last Online: Aug 2010 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 01-15-2002 Last Update: Never Installs: 5
Is in Beta Stage  
No support by the author.

A simple hack

When creating a new usergroup, this hack allows you to specify a usergroup to "clone" or be equal too. I have many private forums and usergroups, all with different permissions. By default when a new usergroup is added, it has no forum permissions on private forums. On large boards, correcting this is a time consuming and tedious task - just to create 1 more community hosted forum!

Heres how it works in prinicipal:
  • Click Add new Usergroup.
  • Fill in all the usual stuff and default permissions.
  • Select from the drop down list the existing usergroup you would like the new usergroup to clone.
  • A list of forum permissions is grabbed from the forumpermission table
  • There are then re-inserted into the database under the new usergroup id.


This is my first hack! I'd really appreciate any suggestions on how to tidy up the code or make it more efficient.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 01-16-2002, 01:26 AM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Screenshot (a bad one at that)
Reply With Quote
  #3  
Old 01-16-2002, 04:41 PM
Jawelin Jawelin is offline
 
Join Date: Nov 2001
Posts: 557
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Very nice.
Just a question: why are you still in beta ? What's the problem ?
Thanks
Reply With Quote
  #4  
Old 01-16-2002, 04:47 PM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, afaik its bugfree - I'm using it live on my forums.

Please could someone move this thread to the Full Releases forum.

Thanks
Reply With Quote
  #5  
Old 01-17-2002, 10:43 AM
Arathorn Arathorn is offline
 
Join Date: Nov 2001
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Implemented all instructions exacly, but this hack doesn't work for me (vb 2.2.1). I don't get any errors, and the listbox appears, but the new usergroup does not inherit the permissions.

A feature suggestion : Add the drop list to the edit usergroup function, and allow us to alter forum permissions easily after creating the usergroup.
Reply With Quote
  #6  
Old 01-17-2002, 02:16 PM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you try and clone a group which doesn't have any forum/usergroup permissions then obviously the new group isn't going too either.

Could you paste the 2 sections of code you modified in the usergroup.php so I can try and track down the bug? Thanks
Reply With Quote
  #7  
Old 01-17-2002, 04:54 PM
Arathorn Arathorn is offline
 
Join Date: Nov 2001
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Right, just to make sure I'm not just confused. You can view your usergroup permissions in Admin CP > Modify > (group) Edit, right? I tried to create a new usergroup based on the Admin usergroup (which has all permissions on) but the new usergroup only had the default options. Do I have a problem? If I do, here's the code:

------------------------------------------------
maketableheader("Adminstrative Permissions");
makeyesnocode("Is Super Moderator","ismoderator",0);
makeyesnocode("Can access control panel<br><font size='1'>Be careful! Allowing CP access will allow a usergroup to change their own permissions!</font>","cancontrolpanel",0);

// Set equal forum permission on new usergroup
maketableheader("Default forum permissions");
makechoosercode("New Usergroup forum permissions equal too","usergroupid","usergroup",$bbuserinfo[usergroupid]);
// End Set equal forum permission on new usergroup

doformfooter("Save");
}
------------------------------------------------

and

------------------------------------------------
$action="modify";
// Set equal forum permission on new usergroup
$addedgroup=$DB_site->query_first("SELECT MAX(usergroupid) AS max FROM usergroup");
$ugperms=$DB_site->query("SELECT * FROM forumpermission WHERE usergroupid=$usergroupid");

while ($ugperm=$DB_site->fetch_array($ugperms)) {
$permforuminfo=$DB_site->query_first("SELECT * FROM forum WHERE forumid=$ugperm[forumid]");
// SQL Insert
$DB_site->query("INSERT INTO forumpermission (forumpermissionid,forumid,usergroupid,canview,can search,canemail,canpostnew,can move,canopenclose,candeletethread,canreplyown,canr eplyothers,canviewothers,caned itpost,candeletepost,canpostattachment,canpostpoll ,canvote,cangetattachment)
VALUES (NULL,'$ugperm[forumid]','$addedgroup[max]','$ugperm[canview]','$ugperm[cansearch]','$ugperm[canemail]','$ugperm[canpostnew]','$ugperm[canmove]','$ugperm[canopenclose]','$ugperm[candeletethread]','$ugperm[canreplyown]','$ugperm[canreplyothers]','$ugperm[canviewothers]','$ugperm[caneditpost]','$ugperm[candeletepost]','$ugperm[canpostattachment]','$ugperm[canpostpoll]','$ugperm[canvote]','$ugperm[cangetattachment]')");
// End SQL Insert
}

// End Set equal forum permission on new usergroup
echo "<p>Record added</p>";

}
------------------------------------------------
Reply With Quote
  #8  
Old 01-18-2002, 07:50 AM
Martz's Avatar
Martz Martz is offline
 
Join Date: Oct 2001
Location: UK
Posts: 156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, by default the Administrators usergroup doesn't have any entries in the forumaccess table - as they should have rights to everything already.

This hack is solve problems for when you have a lot of private forums and usergroups. If you create a new usergroup (without this hack), it doesn't have any custom permissions and you have to spend hours going though each private forum, and blocking access to the new usergroup. This clone hack becomes usefull when you clone a usergroup which is restricted to many forums, or has custom permissions as it saves a lot of time.

So in a nutshell, if you clone the admins group it won't do anything (much).
Reply With Quote
  #9  
Old 01-18-2002, 08:10 AM
Arathorn Arathorn is offline
 
Join Date: Nov 2001
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ah, I get it, thanks.
Reply With Quote
  #10  
Old 08-09-2002, 05:57 PM
ladyfyre's Avatar
ladyfyre ladyfyre is offline
 
Join Date: Nov 2001
Posts: 151
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

any ideas on why this will not work in the 2.2.6 version? i have tried re-installing it repeatedly, and it just ain't working.

i love this hack....
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 09:43 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.04381 seconds
  • Memory Usage 2,303KB
  • Queries Executed 23 (?)
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
  • (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
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)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