News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Apply permissions to custom actions

Started by Elijah Bliss, October 31, 2004, 05:32:54 PM

Previous topic - Next topic

hitsquaduk

ok im having problems witch is a first for smf i never have coding problems i have added the arcade with no problems and i also added the custom flashchat as well and that was not a problem and adding the buttons was not a problem i. i want to stop mods from seeing some buttons i added some flashchat admin buttons but at the moment admins and mods can see them i only want admins to see them??? how do i do this i tryed
['is_admin']
and the button did nto show at.
????

TechnoDragon

You can also add an extra functionality to your buttons on the menu by modifying the Subs.php

find:
// Set up the menu privileges.

add in the array:
    $context['allow_arcade'] = allowedTo('view_arcade');
or whatever your permission you create is.

This will make it so that if the permissions are not allowed, then the button won't show up either...
Don't tell me to get into shape...I have a shape...It is round!


hitsquaduk

well i fixed my button problem i know what i was doing wrong i think i was adding

if ($context['is_admin'])

echo '

now i added in globals $user_info;

and then to show the button to only admin i added

if ($user_info['is_admin'])

echo '

and that fixed that..lol.


im trying to add permissiotns for the shout box so far i have done it so guest can see shouts


     if ($user_info['is_guest'])

echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg', '">
<td><b><center>Sorry only member can view the shout box</center></B> </td>';


else

foreach ($context['arc_shouts'] as $shout)


i added the permissions like said
and tryed


if (allowedTo('view_shouts'))
echo '
<tr class="', $alternate ? 'windowbg' : 'windowbg', '">
<td><b><center>Sorry only member can view the shout box</center></B> </td>';

else
foreach ($context['arc_shouts'] as $shout)



Dannii

else effects online one line unless you put the following code within { brackets }.
"Never imagine yourself not to be otherwise than what it might appear to others that what you were or might have been was not otherwise than what you had been would have appeared to them to be otherwise."

bigjoe11a

in my Sources/ManagePermissions.php file. I need to find this.

$permissionList = array(
      'membergroup' => array(
         'general' => array(

Well. the 'general' => array( is missing. Does this have to do with a new SMF install or what version is this for. I didn't see that listed.
SMF Forums http://www.df-barracks.com Where gamers go.

Arantor

That's certainly not how 2.0 does it. Look around line 1462 or thereabouts of ManagePermissions.php.

bigjoe11a

Thanks, I fount the right one, Yesterday and forgot about it. It's just I don't under stand this at all. So I'll have to see Kays about using his custom permissions mod.

I don't know what else to do
SMF Forums http://www.df-barracks.com Where gamers go.

Advertisement: