[ Index ] |
|
Code source de e107 0.7.8 |
1 <?php 2 /* 3 + ----------------------------------------------------------------------------+ 4 | e107 website system 5 | 6 | ©Steve Dun.an 2001-2002 7 | http://e107.org 8 | jali.@e107.org 9 | 10 | Released under the terms and conditions of the 11 | GNU General Public License (http://gnu.org). 12 | 13 | $Source: /cvsroot/e107/e107_0.7/e107_plugins/calendar_menu/subscribe.php,v $ 14 | $Revision: 1.4 $ 15 | $Date: 2007/01/28 11:40:10 $ 16 | $Author: e107steved $ 17 | 18 +----------------------------------------------------------------------------+ 19 */ 20 21 require_once ("../../class2.php"); 22 include_lan(e_PLUGIN . "calendar_menu/languages/".e_LANGUAGE.".php"); 23 24 define("PAGE_NAME", EC_LAN_80); 25 require_once(HEADERF); 26 27 28 if ((USER) && (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs'] == '1'))) 29 { 30 $cal_db = new db; // Probably best to keep this 31 32 if (isset($_POST['upsubs'])) 33 { 34 $cal_cats = $tp -> toDB($_POST['event_list']); // IDs of allowed categories 35 $cal_subs = $tp -> toDB($_POST['event_subd']); // Checkbox results 36 $cal_db->db_Delete("event_subs", "event_userid='" . USERID . "'"); // Delete all for this user to start 37 foreach($cal_cats as $cal_row) 38 { // Now add in a subscription for each allowed category 39 if ($cal_subs[$cal_row]) 40 { 41 $cal_inargs = "0,'" . USERID . "','" . $cal_row . "'"; 42 $cal_db->db_Insert("event_subs", $cal_inargs); 43 } 44 // print $cal_row . $cal_subs[$cal_row] . "<br>"; 45 } 46 $caltext = "<table class='fborder' width='97%'> 47 <tr><td class='fcaption' >" . EC_LAN_130 . "</td></tr> 48 <tr><td class='forumheader3' ><a href='calendar.php'>" . EC_LAN_131 . "</a></tr> 49 <tr><td class='fcaption' > </td></tr></table>"; 50 } 51 else 52 { 53 $caltext = "<form id='calsubs' action='" . e_SELF . "' method='post' > 54 <table class='fborder' width='97%'> 55 <tr><td class='fcaption' colspan='3'>" . EC_LAN_125 . "</td></tr> 56 <tr><td class='forumheader2' >" . EC_LAN_126 . "</td><td class='forumheader2' >" . EC_LAN_127 . "</td><td class='forumheader2' >" . EC_LAN_136 . "</td></tr>"; 57 // Get list of currently subscribed 58 $cal_db->db_Select("event_subs", "event_cat", "where event_userid='" . USERID . "'", "nowhere"); 59 while ($cal_s = $cal_db->db_Fetch()) 60 { 61 extract($cal_s); 62 $cal_array[] = $event_cat; 63 } // while 64 65 // Get list of categories that have subscriptions and are visible to this member 66 $cal_args = "select * from #event_cat 67 where event_cat_subs>0 and (find_in_set(event_cat_class,'".USERCLASS_LIST."') OR find_in_set(event_cat_force_class,'".USERCLASS_LIST."'))"; 68 if ($cal_db->db_Select_gen($cal_args)) 69 { 70 // echo $cal_args."<br />"; 71 while ($cal_row = $cal_db->db_Fetch()) 72 { 73 extract($cal_row); 74 $caltext .= "<tr><td class='forumheader3' style='width:10%;'>"; 75 if (check_class($event_cat_force_class)) 76 { 77 $caltext .= EC_LAN_126; 78 } 79 else 80 { 81 $caltext .= "<input type='hidden' name='event_list[]' value='" . $event_cat_id . "' /> 82 <input type='checkbox' class='tbox' value='1' name='event_subd[$event_cat_id]' " . (in_array($event_cat_id, $cal_array)?"checked='checked' ":"") . " /> </td>"; 83 } 84 $caltext .= "<td class='forumheader3'>{$event_cat_name}</td><td class='forumheader3'>{$event_cat_description}</td></tr>"; 85 } 86 } 87 else 88 { 89 $caltext .= "<tr><td class='forumheader3' colspan='3'>" . EC_LAN_128 . "</td></tr>"; 90 } 91 $caltext .= "<tr><td class='forumheader3' colspan='3'><input class='tbox' type='submit' value='" . EC_LAN_129 . "' name='upsubs' /></td></tr>"; 92 $caltext .= "</table></form>"; 93 } 94 } 95 else 96 { 97 if (isset($pref['eventpost_asubs']) && ($pref['eventpost_asubs'] == '1')) 98 $caltext = EC_LAN_142; // Register or log in 99 else 100 $caltext = EC_LAN_143; // No facility 101 } 102 $ns->tablerender(EC_LAN_124, $caltext); 103 require_once(FOOTERF); 104 105 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |