PHP Code:
else // use combined permissions
{
$user['forumpermissions']["$forumid"] = $user['permissions']['forumpermissions'];
}
}
} // end if access masks enabled and is logged in user
if (!empty($user['membergroupids']))
{
$sqlcondition = "IN($USERGROUPID, $user[membergroupids])";
}
else
{
$sqlcondition = "= $USERGROUPID";
}
// query calendar permissions
if (THIS_SCRIPT == 'online' OR THIS_SCRIPT == 'calendar' OR (THIS_SCRIPT == 'adv_index') OR (THIS_SCRIPT == 'index' AND $vboptions['showevents']))
{ // Only query calendar permissions when accessing the calendar or subscriptions or index.php
$_PERMQUERY[4] = "
SELECT calendarpermission.usergroupid, calendarpermission.calendarpermissions,calendar.calendarid,calendar.title, displayorder
FROM " . TABLE_PREFIX . "calendar AS calendar
LEFT JOIN " . TABLE_PREFIX . "calendarpermission AS calendarpermission ON (calendarpermission.calendarid=calendar.calendarid AND usergroupid IN(" . implode(', ', $membergroupids) . "))
ORDER BY displayorder ASC
";
$cpermscache = array();
$calendarcache = array();
$displayorder = array();
$calendarpermissions = $DB_site->query($_PERMQUERY[4]);
while ($calendarpermission = $DB_site->fetch_array($calendarpermissions))
{
$cpermscache["$calendarpermission[calendarid]"]["$calendarpermission[usergroupid]"] = intval($calendarpermission['calendarpermissions']);
$calendarcache["$calendarpermission[calendarid]"] = $calendarpermission['title'];
$displayorder["$calendarpermission[calendarid]"] = $calendarpermission['displayorder'];
}
Hope this helps
Anyone?? :ermm: