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 . "
 
"; } else { $caltext = "
"; // Get list of currently subscribed $cal_db->db_Select('event_subs', 'event_cat', "where event_userid='" . USERID . "'", "nowhere"); while ($cal_s = $cal_db->db_Fetch()) { extract($cal_s); $cal_array[] = $event_cat; } // while // Get list of categories that have subscriptions and are visible to this member $cal_args = "select * from #event_cat where event_cat_subs>0 and (find_in_set(event_cat_class,'".USERCLASS_LIST."') OR find_in_set(event_cat_force_class,'".USERCLASS_LIST."'))"; if ($cal_db->db_Select_gen($cal_args)) { // echo $cal_args."
"; while ($cal_row = $cal_db->db_Fetch()) { extract($cal_row); $caltext .= ""; } $caltext .= ""; } } else { $caltext .= ""; } $caltext .= ""; $caltext .= "
" . EC_LAN_125 . "
" . EC_LAN_126 . "" . EC_LAN_127 . "" . EC_LAN_136 . "
"; if (check_class($event_cat_force_class)) { $caltext .= EC_LAN_126; } else { $caltext .= " {$event_cat_name}{$event_cat_description}
" . EC_LAN_128 . "
"; } } else { if (isset($ecal_class->pref['eventpost_asubs']) && ($ecal_class->pref['eventpost_asubs'] == '1')) $caltext = EC_LAN_142; // Register or log in else $caltext = EC_LAN_143; // No facility } e107::getRender()->tablerender(EC_LAN_124, $caltext); require_once(FOOTERF); ?>