group members view only

Mods etc.

Moderator: Integra Moderator

group members view only

PostAuthor: Skywalker » Fri Apr 14, 2006 5:40 pm

is it possible to create a function like admin view only but then for a user group

example of admin view only script

Code: Select all
# #-----[ OPEN ]------------------------------------------ #  includes/page_header.php  # #-----[ FIND ]------------------------------------------ #  $template->assign_block_vars('switch_user_logged_in', array());  # #-----[ AFTER, ADD ]------------------------------------------ #  // Admin Only View Mod       if ( $userdata['user_level'] == ADMIN )    {       $template->assign_block_vars('switch_admin_view_only', array());    } // Admin Only View Mod  # #-----[ OPEN ]------------------------------------------ ### templates/subSilver/**file_you_want_to_place_swicth_in**.tpl  # #-----[ FIND ]------------------------------------------ ## The code you want to remain hidden from everyone except Administrators  # #-----[ BEFORE **CODE**, ADD ]------------------------------------------ #  <BEGIN>  <END># #-----[ AFTER **CODE**, ADD ]------------------------------------------ #  


but then for example a group called beta testers.
the function would be that only beta testers can acces beta mod pages on my board and al the other members iff the visit that page get an empty page
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

PostAuthor: Adrian Rea » Fri Apr 14, 2006 6:47 pm

This feature is already available as I see it. If you are making a block for a new page, you will find check boxes at the bottom for the usergroups you have. tick the apropriate box and only they will see the block. You may need a second block open to all stating that t'this is a Beta testers page, only they can see the content on this page' otherwise you see a quite bare page.

A
Last edited by Adrian Rea on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
User avatar
Adrian Rea
Sr Integra Member
Sr Integra Member
 
Posts: 1263
Likes: 0 post
Liked in: 0 post
Joined: Sun Mar 12, 2006 12:59 am
Cash on hand: 0.00

PostAuthor: Skywalker » Sat Apr 15, 2006 5:00 am

"Adrian Rea";p="1677" wrote:This feature is already available as I see it. If you are making a block for a new page, you will find check boxes at the bottom for the usergroups you have. tick the apropriate box and only they will see the block. You may need a second block open to all stating that t'this is a Beta testers page, only they can see the content on this page' otherwise you see a quite bare page.

A


no i mean for pages of new mods i'm willing to install and need to be tested.

the function you recall i can't use
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

Re: group members view only

PostAuthor: found it » Wed May 03, 2006 6:11 am

I have a mod that allows only one group to view an image or a link is that what you are after...

:mrgreen:
Last edited by found it on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]themes.[/url]
http://www.founditforum.com :: [url=http]Joining people together[/url]

[url=http][img=left]http://www.bbful.com/bbful_banner2.png[/img][/url]
User avatar
found it
Dev Team
Dev Team
 
Posts: 792
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 4:29 am
Cash on hand: 0.00

Re: group members view only

PostAuthor: Skywalker » Wed May 03, 2006 9:45 am

"found it";p="4290" wrote:I have a mod that allows only one group to view an image or a link is that what you are after...

:mrgreen:


i mean i script like the one i posted but then for usergroups.
but maybe i can expand your script to work like i need to you may always post it
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

Re: group members view only

PostAuthor: found it » Wed May 03, 2006 9:57 am

this is really rough but does work.....

if you make any progress with this i would be gratefull for any updates


First, get the group id number.
You can get this by clicking on usergroups and selecting the group.
The number will be at the end of the URL like groupcp.php?g=19
So the group id number would be 19

Second, open includes/page_header.php
Find:

Code: Select all
$template->assign_block_vars('switch_user_logged_in', array());



Now add after that]// SQL to get the user's group$sql = "SELECT * FROM " . USER_GROUP_TABLE . " WHERE user_id = " . $userdata['user_id'] . " AND group_id = 'GROUP_NUMBER_HERE' AND user_pending != " . TRUE;  // Did the SQL process successfully?if ( ! ($group_result = $db->sql_query($sql) ) ){    message_die(GENERAL_ERROR, "Could not obtain usergroup", '', __LINE__, __FILE__, $sql);}  // Is the user in the group?if ( $group = $db->sql_fetchrow($group_result) ){    $template->assign_block_vars('switch_user_in_group', array() );}  //No, they aren't in that groupelse{    $template->assign_block_vars('switch_user_not_in_group', array() );} [/code]

(Replace GROUP_NUMBER_HERE with the group id number.)
Now, in any template file you can use


in your template files

Code: Select all
 <BEGIN>image/link whatever here for the special group<END>


or

Code: Select all
<BEGIN>image/link whatever for people not in group<END>


I hope that is of some use

:mrgreen:
Last edited by found it on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]themes.[/url]
http://www.founditforum.com :: [url=http]Joining people together[/url]

[url=http][img=left]http://www.bbful.com/bbful_banner2.png[/img][/url]
User avatar
found it
Dev Team
Dev Team
 
Posts: 792
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 4:29 am
Cash on hand: 0.00

Re: group members view only

PostAuthor: Skywalker » Wed May 03, 2006 10:47 am

this is exactly what i'm looking for.
Last edited by Skywalker on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.

Skywalker
Sr Integra Member
Sr Integra Member
 
Posts: 236
Likes: 0 post
Liked in: 0 post
Joined: Fri Apr 14, 2006 5:25 pm
Cash on hand: 0.00

Re: group members view only

PostAuthor: found it » Wed May 03, 2006 10:48 am

glad to help...

:mrgreen:
Last edited by found it on Wed Dec 31, 1969 5:00 pm, edited 1 time in total.
[url=http]themes.[/url]
http://www.founditforum.com :: [url=http]Joining people together[/url]

[url=http][img=left]http://www.bbful.com/bbful_banner2.png[/img][/url]
User avatar
found it
Dev Team
Dev Team
 
Posts: 792
Likes: 0 post
Liked in: 0 post
Joined: Mon Mar 27, 2006 4:29 am
Cash on hand: 0.00


Return to IntegraMOD Modifications

Who is online

Registered users: App360MonitorBot, Bing [Bot]