insertRow("events",array('user_id' => ''.$_SESSION['id'].'','user_user' => ''.$_SESSION['username'].'','day' => ''.$eventdaya.'','month' => ''.$eventmontha.'','year' => ''.$eventyeara.'','start' => ''.$eventstarta.'','end' => ''.$eventenda.'','message' => ''.$sendmessage.'')); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/events&d=$eventdaya&m=$eventmontha&i=44"); } break; //----------------------------------------------------------------- // Edit events case //----------------------------------------------------------------- case 2: //----------------------------------------------------------------- // Check if he has acces //----------------------------------------------------------------- if(isset($is_moderator) || isset($is_administrator) || isset($is_webmaster)) { //----------------------------------------------------------------- // BBcode check //----------------------------------------------------------------- for ($i = 1; $i <= 5; $i++) if(check_tag_order($sendmessage) == $i) { header("location: $PHP_SELF?n=modules/events&a=5&d=$eventdaye&m=$eventmonthe&o=$o&i=9$i"); exit; } //----------------------------------------------------------------- // Make time for start and end //----------------------------------------------------------------- if($eventstarteh == 0 || $eventstartem == 0 || $eventendeh == 0 || $eventendem == 0) { $eventstarte = 0; $eventende = 0; } else { if($eventstartem == 1) $eventstartem = 0; if($eventstartem == 2) $eventstartem = 15; if($eventstartem == 3) $eventstartem = 30; if($eventstartem == 4) $eventstartem = 45; if($eventendem == 1) $eventendem = 0; if($eventendem == 2) $eventendem = 15; if($eventendem == 3) $eventendem = 30; if($eventendem == 4) $eventendem = 45; $eventstarte = mktime($eventstarteh, $eventstartem, 0, $eventmonthe, $eventdaye, $eventyeare); $eventende = mktime($eventendeh, $eventendem, 0, $eventmonthe, $eventdaye, $eventyeare); } //----------------------------------------------------------------- // Take care of some things //----------------------------------------------------------------- $sendmessage = jcm_linebreaks(trim(jcm_stripslashes($sendmessage))); if($overflow = check_tag_order($sendmessage)) $sendmessage = substr($sendmessage, 0, $overflow[0]).substr($sendmessage, $overflow[1], (strlen($sendmessage) - $overflow[0])); //----------------------------------------------------------------- // Update the database //----------------------------------------------------------------- $db->updateRow("events",array('day' => ''.$eventdaye.'','month' => ''.$eventmonthe.'','year' => ''.$eventyeare.'','start' => ''.$eventstarte.'','end' => ''.$eventende.'','message' => ''.$sendmessage.''),"id = $o"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/events&d=$eventdaye&m=$eventmonthe&i=45"); } break; //----------------------------------------------------------------- // Delete events case //----------------------------------------------------------------- case 3: //----------------------------------------------------------------- // Check if he has acces //----------------------------------------------------------------- if(isset($is_moderator) || isset($is_administrator) || isset($is_webmaster)) { //----------------------------------------------------------------- // Delete from the database //----------------------------------------------------------------- $db->deleteRow("events","id = '$o'"); //----------------------------------------------------------------- // Redirect when finished //----------------------------------------------------------------- header("location: $PHP_SELF?n=modules/events&d=$d&m=$m&i=46"); } break; //----------------------------------------------------------------- // View Form for adding events case //----------------------------------------------------------------- case 4: //----------------------------------------------------------------- // Check if he has acces //----------------------------------------------------------------- if(isset($is_loged_in)) { ?>
: / :
getLine("SELECT * FROM events WHERE id = '$o'") ?>
: / :
getTable("SELECT e.id, e.type, e.user_id, e.user_user, e.start, e.day, e.month, e.year, e.end, e.message, u.age FROM events AS e LEFT JOIN users AS u ON e.user_id = u.id WHERE day = '$d' AND month = '$m' ORDER BY start ASC,type DESC"); foreach($events_db as $idx=>$event) { //----------------------------------------------------------------- // Figure out the start and end //----------------------------------------------------------------- if($event['type'] == "normal") { if($event['year'] == date('Y')) { //----------------------------------------------------------------- // Code Layout //----------------------------------------------------------------- if($event['start'] != 0 || $event['end'] != 0) $layout .= "".date("H:i",$event['start'])." - ".date("H:i",$event['end']).""; else $layout .= "{$language['Events view desc2']}"; } else $layout .= NULL; } else $layout .= "{$language['Events view desc2']}"; //----------------------------------------------------------------- // Figure out if it's a bday or just event //----------------------------------------------------------------- if($event['type'] == "normal") { if($event['year'] == date('Y')) { //----------------------------------------------------------------- // Code Layout //----------------------------------------------------------------- if(isset($event['age'])) $layout .= "{$event['user_user']}: ".parse_message($event['message']).""; else $layout .= "{$event['user_user']}: ".parse_message($event['message']).""; if(isset($is_moderator) || isset($is_administrator) || isset($is_webmaster)) $layout .= "{$language[{$language[\n"; else $layout .= "\n"; } else $layout .= NULL; } else { //----------------------------------------------------------------- // Calculate Age //----------------------------------------------------------------- if($event['day'] > date("j") || $event['month'] > date("n")) { $surplus = (date("Y") + 1) - date("Y"); $bday_age = find_age("{$event['age']}", $surplus); } else $bday_age = find_age("{$event['age']}"); //----------------------------------------------------------------- // Calculate Time for bday //----------------------------------------------------------------- if($event['day'] == date("j") && $event['month'] == date("n")) { $bday_date_1 = $language['Events view desc3']; $bday_date_2 = $language['Events view desc4']; $bday_date_3 = $language['Events view desc5']; } else { $bday_date_1 = NULL; $bday_date_2 = $language['Events view desc6']; $bday_date_3 = "{$language['Events view desc7']} {$event['day']}-{$months[$event['month']]}"; } //----------------------------------------------------------------- // Code Layout //----------------------------------------------------------------- $layout .= "$bday_date_1 {$event['user_user']} $bday_date_2 $bday_age $bday_date_3\n"; if(isset($is_moderator) || isset($is_administrator) || isset($is_webmaster)) $layout .= "{$language[{$language["; else $layout .= ""; } } //----------------------------------------------------------------- // If no event that day, show error //----------------------------------------------------------------- if($events_db == FALSE) $layout .= "{$language['Events view desc']}"; //----------------------------------------------------------------- // Start Layout //----------------------------------------------------------------- ?>  "; } ?>