Hi, I've spent a bunch of time creating a dozen calendars, and assigning my dozen groups to the appropriate calendars. No one except admins has the authority to add events to the calendar, but, that option still shows to all. Is there a way to remove this to reflect the usergroup one is logged in as? Make sense? I'd rather not have visitors click it and get an error message. Would rather the link only show up to usergroups who are assigned to be able to add calendar events. IS there a way to do this?
Remove Add New Event (Calendar) if group is not allowed
Collapse
X
-
That is the normal behavior. You can hide it by using template conditionals. For example:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Calendar Templates -> CALENDAR
Add the red code:
Code:<if condition="$show['popups']"> <td class="vbmenu_control"><a href="calendar.php?$session[sessionurl]c=$calendarinfo[calendarid]&month=$today[mon]&year=$today[year]">$vbphrase[show_today]</a></td> <td class="vbmenu_control" id="cal_mode"> <if condition="$show['weeklyview']"> <a href="$show[nojs_link]#goto_viewtype">$vbphrase[weekly_view]</a> </if> <if condition="$show['monthlyview']"> <a href="$show[nojs_link]#goto_viewtype">$vbphrase[monthly_view]</a> </if> <if condition="$show['yearlyview']"> <a href="$show[nojs_link]#goto_viewtype">$vbphrase[yearly_view]</a> </if> <script type="text/javascript"> vbmenu_register("cal_mode"); </script> </td> [color=red]<if condition="$bbuserinfo[usergroupid] == 6">[/color] <td class="vbmenu_control" id="add_event"><a href="#goto_newevent">$vbphrase[add_new_event]</a> <script type="text/javascript"> vbmenu_register("add_event"); </script></td> [color=red]</if>[/color] </if> </tr> </table> <if condition="!$show['popups']"> <a name="goto_viewtype"></a> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center" style="border-top-width:0x"> <tr align="center">
-
I would like to bump this up.
The addition above works fine for removing the link to add a new event on the top, but how can i make the box on the bottom that has the same links, only visible to members or certain user groups as well?
Also instead of
Code:<if condition="$bbuserinfo[usergroupid] == 6">
Code:<if condition="in_array($bbuserinfo[usergroupid], array(5,6))">
ThanksLast edited by Greek Wizard; Thu 30 Nov '06, 4:52am.Comment
-
Never mind,
I figured it out, I was looking in the wrong spot.
For those interested, calendar_monthly, etc were the places to make the conditionals.Comment
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Comment