форум vBSupport.ru > vBulletin > Old vB versions (3.0.x & 2.x.x) > vBulletin 3.6.x > Hacks, mods and scripts [3.6.x]
  • »
VBsupport перешел с домена .ORG на родной .RU Ура! Пожалуйста, обновите свои закладки - VBsupport.ru
 
 
 
 
VipeR
Private Person
Developer
 
VipeR's Avatar
Default Group Access Control By Day(s)
2

It blocks access to any given Group by a selected day or group of selected days!

Follow me!

1. './admincp/usergroup.php'

FIND

Code:
require_once(DIR . '/includes/functions_ranks.php');
UNDER THAT, ADD

Code:
include_once ( DIR . '/includes/functions_access.php' );
FIND

Code:
print_submit_row(iif($_REQUEST['do'] == 'add', $vbphrase['save'], $vbphrase['update']));
ABOVE THAT, ADD

Code:
print_table_header ( $vbphrase['group_access_permissions'] ); print_yes_no_row ( $vbphrase['new_group_access'], 'usergroup[newgroupaccess]', $usergroup['newgroupaccess'] ); $new_access = fetch_group_days ( $usergroup['newgroupdays'] ); print_label_row($vbphrase['new_group_days'], "<select name='access[]' tabindex='1' class='bginput' multiple size='5'>" . construct_select_options ( $new_access[0], $new_access[1] ) . "</select>", '', 'top', 'newgroupdays'); print_table_break();
FIND

Code:
$vbulletin->input->clean_array_gpc('p', array( 'usergroup' => TYPE_ARRAY, 'ugid_base' => TYPE_INT, ));
REPLACE WITH

Code:
$vbulletin->input->clean_array_gpc('p', array( 'usergroup' => TYPE_ARRAY, 'ugid_base' => TYPE_INT, 'access' => TYPE_ARRAY, )); $vbulletin->GPC['usergroup']['newgroupdays'] = update_group_days ( $vbulletin->GPC['access'] );
// end code edits './admincp/usergroup.php'

2. './global.php'

FIND

Code:
require_once(CWD . '/includes/init.php');
BELOW THAT, ADD

Code:
include_once ( CWD . '/includes/functions_access.php' );
FIND

Code:
// phpinfo display for support purposes if ($_REQUEST['do'] == 'phpinfo') {
ABOVE THAT, ADD

Code:
/* test the group day access permissions */ if ( $vbulletin->userinfo['permissions']['newgroupaccess'] ) { if ( group_access_test ( $vbulletin->userinfo['permissions']['newgroupdays'] ) === false ) { // no access today, give the error message eval ( standard_error ( fetch_error ( 'uganottoday', $vbulletin->userinfo['permissions']['title'], $vbulletin->userinfo['permissions']['usergroupid'] ) ) ); } }
// end of code edits for './global.php'

3.

DB ALTER AND ADD PHRASES.... (add your db prefix, if your using one!)

Code:
### # - alter the user groups table to add the access permissions ### ALTER TABLE usergroup ADD newgroupaccess TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', ADD newgroupdays INT(10) UNSIGNED NOT NULL DEFAULT '0'; ### ##- admin cp helper phrases! ### INSERT INTO phrase VALUES ( '', -1, 'group_access_permissions', 'Group Board Access Permissions', 3, 'group_access' ); INSERT INTO phrase VALUES ( '', -1, 'new_group_access', 'Place This User Group Under Forum Access Control', 3, 'group_access' ); INSERT INTO phrase VALUES ( '', -1, 'usergroup_add_edit_newgroupaccess_title', 'Place This User Group Under Forum Access Control', 6000, 'group_access' ); INSERT INTO phrase VALUES ( '', -1, 'usergroup_add_edit_newgroupaccess_text', 'If this option is set to (yes) then the user group access control will check if this group can access your forum on that given day!', 6000, 'group_access' ); INSERT INTO adminhelp VALUES ( '', 'usergroup', 'add,edit', 'newgroupaccess', 990, 1, 'group_access' ); INSERT INTO phrase VALUES ( '', -1, 'new_group_days', 'Select The Days This User Group Can\'t Access The Forum, (*) = selected', 3, 'group_access' ); INSERT INTO phrase VALUES ( '', -1, 'usergroup_add_edit_newgroupdays_title', 'Select The Days This User Group Can\'t Access The Forum', 6000, 'group_access' ); INSERT INTO phrase VALUES ( '', -1, 'usergroup_add_edit_newgroupdays_text', 'This option is only used if the above option * Place This User Group Is Under Forum Access Control * is set to (yes). This option allows you to select the days that this user group is not allowed to view any content on your forum.', 6000, 'group_access' ); INSERT INTO adminhelp VALUES ( '', 'usergroup', 'add,edit', 'newgroupdays', 991, 1, 'group_access' ); ### ##- no access today error! ### INSERT INTO phrase VALUES ( '', -1, 'uganottoday', 'Sorry the administrator has limited your usergroup {1}, (id:{2}), to certain days that you may view the forum. This is one of those days you don\'t have access to the forum. Please consider joining the forum to remove this restriction!', 1000, 'group_access' );
Be sure to go to Languages & Phrases >> Language Manager >> Click -> [Rebuild All Languages]

4.

upload the attached script (functions_access.php.txt), to you './includes/' directory, rename to 'functions_access.php'!

done

enjoy

me!

snap shots....

Forum Access Error Message

error.png

Group Option, Admin CP

option.png


:::UPDATE:::

Fixed the first phrase...

It was... (wrong)

Code:
INSERT INTO phrase VALUES ( '', -1, 'new_group_permissions', 'Group Board Access Permissions', 3, 'group_access' );
it should be... (fixed)

Code:
INSERT INTO phrase VALUES ( '', -1, 'group_access_permissions', 'Group Board Access Permissions', 3, 'group_access' );


Attached Files
File Type: txt functions_access.php.txt (880 Bytes, 13 views)
Bot
Yandex Bot Yandex Bot is online now
 
Join Date: 05.05.2005
Реклама на форуме А что у нас тут интересного? =)
 
 
ViolentOr
АнтиГуру
Default
0

забавная штукенция...
 
 
VipeR
Private Person
Developer
 
VipeR's Avatar
Default
0

Quote:
Originally Posted by ViolentOr
забавная штукенция...
Да уж, чего только не придумают..
 


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




All times are GMT +4. The time now is 10:06 AM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Loading...