isInstalled('calendar_menu'))
{
header('Location: '.e_BASE.'index.php');
exit();
}
require_once(e_PLUGIN.'calendar_menu/ecal_class.php');
if (!is_object($ecal_class)) $ecal_class = new ecal_class;
include_lan(e_PLUGIN .'calendar_menu/languages/'.e_LANGUAGE.'.php');
define('PAGE_NAME', EC_LAN_80);
require_once(HEADERF);
if ((USER) && (isset($ecal_class->pref['eventpost_asubs']) && ($ecal_class->pref['eventpost_asubs'] == '1')))
{
$cal_db = new db; // Probably best to keep this
if (isset($_POST['upsubs']))
{
$cal_cats = e107::getParser()->toDB($_POST['event_list']); // IDs of allowed categories
$cal_subs = e107::getParser()->toDB($_POST['event_subd']); // Checkbox results
$cal_db->db_Delete('event_subs', "event_userid='" . USERID . "'"); // Delete all for this user to start
foreach($cal_cats as $cal_row)
{ // Now add in a subscription for each allowed category
if ($cal_subs[$cal_row])
{
$cal_inargs = "0,'" . USERID . "','" . $cal_row . "'";
$cal_db->db_Insert('event_subs', $cal_inargs);
}
// print $cal_row . $cal_subs[$cal_row] . "
";
}
$caltext = "
" . EC_LAN_130 . " |
" . EC_LAN_131 . " |