Notice: Undefined variable: link_prefix in /home/sol/public_html/comcent/comcent_e107.php on line 45 Dark Horizons Lore Players Site
  Map

Welcome

Username:

Password:


Remember me

[ Signup ]
[ Forgot password? ]


db_Select("event", "*", "(event_start>='$monthstart' AND event_start<= '$monthend') OR (event_rec_y='$current_month')"); $events = $sql -> db_Rows(); while($row = $sql -> db_Fetch()){ extract($row); $evf = getdate($event_start); $tmp = $evf['mday']; $event_true[$tmp] = $event_category; } // ----------------------------------------------------------------------------------------------------------- // set up arrays for calender display ------------------------------------------------------------------ $week = Array(EC_LAN_25,EC_LAN_19,EC_LAN_20,EC_LAN_21,EC_LAN_22,EC_LAN_23,EC_LAN_24); $months = Array(EC_LAN_0,EC_LAN_1,EC_LAN_2,EC_LAN_3,EC_LAN_4,EC_LAN_5,EC_LAN_6,EC_LAN_7,EC_LAN_8,EC_LAN_9,EC_LAN_10,EC_LAN_11); $calendar_title = $months[$datearray[mon]-1]." ".$current_year; // ----------------------------------------------------------------------------------------------------------- $text = "
"; if($events){ $text .= EC_LAN_26 . ": ".$events; }else{ $text .= EC_LAN_27; } $start = $monthstart; $text .= "

"; foreach($week as $day){ $text .= ""; } $text .= ""; $thismonth = $datearray['mon']; $thisday = $datearray['mday']; for($c=0; $c<$firstdayarray['wday']; $c++){ $text .= ""; } $loop = $firstdayarray['wday']; for($c=1; $c<=31; $c++){ $dayarray = getdate($start+($c*84460)); if($dayarray['mon'] == $thismonth){ if($thisday == $c){ $text .= "\n"; $loop++; if($loop == 7){ $loop = 0; $text .= ""; } } } for($a=($loop+1); $a<=7; $a++){ $text .=""; } $text .= "
".$day."

"; }else{ $text .=""; } if($event_true[($c)]){ $sql -> db_Select("event_cat", "*", "event_cat_id='".$event_true[($c)]."' "); $icon = $sql -> db_Fetch(); extract($icon); $img = ""; }else{ $img = ""; } $linkut = mktime(0 ,0 ,0 ,$dayarray['mon'], $c, $datearray['year']); $text .="$img
$c
"; if($thisday == $c){ } $text .= "
 
"; $ns -> tablerender($calendar_title, $text); ?>
DHL News
Our headlines can be syndicated by using either our rss or text feeds.
news.xml - news.txt


Command Area: [ SQUAD(S) ] [ GROUP(S) ] [ MESSAGE(S) ]
'; // Form processing follows here if ($_POST && !$error){ // Form processing requested switch($_GET['cmd']){ case 'rename': // SL is renaming his squad // First need to make sure they actually submitted data if (!$_POST['s_name']){ break; } // Now check to see if squad's name is already take or belongs to an already // created group. if ($GLOBALS['services']->sql_numrows( $GLOBALS['services']->sql_query(' select squad_name, group_name from squads,groups where (squad_name="'.$_POST['s_name'].'" or group_name="'.$_POST['s_name'].'") and squads.squad_id = groups.squad_id')) > 0){ // A squad was found with the same name $error = error_layout('The squad name already exists for a squad or group in the database. please choose a different one.'); break; } // We need to repeat the check for group name if it is defined if ($_POST['s_gname'] != ''){ if ($GLOBALS['services']->sql_numrows( $GLOBALS['services']->sql_query(' select squad_name, group_name from squads,groups where (squad_name="'.$_POST['s_gname'].'" or group_name="'.$_POST['s_gname'].'") and squads.squad_id = groups.squad_id')) > 0){ // A squad was found with the same name $error = error_layout('The group name already exists for a squad or group in the database. please choose a different one.'); break; } } // Update the squad name for the user $squad = $pinfo->squad; $result = $GLOBALS['services']->sql_query('UPDATE squads SET squad_name="'.$_POST['s_name'].'" WHERE squad_id='.$squad->id); if ($GLOBALS['services']->sql_affectedrows($result) < 0){ // query failed $error = error_layout('There was a problem getting data from the database:
'. join('
',$GLOBALS['services']->sql_error($result))); break; } // Everything worked well $successful = 1; break; case 'delete': // SL is Deleting a squad // First check that something was submitted if ($_POST['s_remove'] == ''){ break; } // Okay check what the response was if ($_POST['s_remove'] == 'Y'){ // answer was yes $squad = $pinfo->squad; $error = $squad->deleteSquad(); if ($error){ // there was a problem deleting $error = error_layout($error); break; } } else { $error = ''; // forces redirect break; } // Nothing went wrong, so make it successful $successful = 1; break; case 'remove': // SL removing a pilot from a squad // Grab the squad leader info to find out if this user can make this change or not $sldata = $GLOBALS['services']->sql_autofetch('SELECT squads.squad_id,squad_leader,sic FROM onweb LEFT JOIN squads on onweb.squad_id=squads.squad_id WHERE onweb.nick_id ='.$pinfo->id); $slinfo = $_SESSION['uobject']->getPilot($sldata['squad_leader']); if (!$slinfo){ $slinfo = $_SESSION['uobject']->getPilot($sldata['sic']); } if (!$slinfo){ // This user is not a Squad Leader $error = error_layout(HACKINGATTEMPT); break; } // This is user is a squad leader, and pilot info correct, now figure out which option user selected if ($_POST['s_remove'] == 'Y'){ // User said yes // Before sending email attempt to remove them first from the database information if ($pinfo->group){ // check to see if they are in a group or not // But first, check to see if they own a group or not. $group = $pinfo->group; if ($pinfo->isGroupLeader()){ // pilot is in charge of a group // This process will delete the group $error = $group->deleteGroup(); } else { // just remove the person from the group $error = $group->removeFromGroup($pinfo->id); } } // As this process should only be called by someone who is a SL on someone who is not // so this process should never be deleting a squad. but double check to make sure if (!$error && $pinfo->isSquadLeader()){ // This person is a squad leader.. HACK ATTEMPT $error = error_layout(HACKINGATTEMPT); break; } else { // pilot is not squad leader so it is okay $squad = $pinfo->squad; $error = $squad->removeFromSquad($pinfo->id); } if ($error){ // A problem occurred $error = error_layout($error); break; } } else { $error = ''; // forces redirect break; } // TODO: Add email stuff here // Everything worked without breaking; $successful = 1; break; case 'quit': // Quit a squad // First make sure there is something even worry about if (!$_POST['s_quit']){ break; } // Choice has been made. If yes, then remove them from the squad, if no, then send them back to pilots.php if ($_POST['s_quit'] == 'Y'){ // answer was yes $group = $pinfo->group; $squad = $pinfo->squad; print_r($group); if ($pinfo->isSquadLeader()){ // Is squad leader // Deleting squad completely also completely deletes group information $error = $squad->deleteSquad(); if ($error){ $error = error_layout($error); break; } } else if ($group && $pinfo->isGroupLeader()){ // Not Squad Leader but group leader // Delete group info first $error = $group->deleteGroup(); if ($error){ $error = error_layout($error); break; } // Delete squad info next $error = $squad->removeFromSquad($pinfo->id); if ($error){ $error = error_layout($error); break; } } else if ($group) { // Not Squad Leader or group leader // Delete group info first $error = $group->removeFromGroup($pinfo->id); if ($error){ $error = error_layout($error); break; } // Delete squad info next $error = $squad->removeFromSquad($pinfo->id); if ($error){ $error = error_layout($error); break; } } else { // Only in a squad, no group defined // Delete squad info next $error = $squad->removeFromSquad($pinfo->id); if ($error){ $error = error_layout($error); break; } } } else { $error = ''; // forces redirect break; } // No errors? Then mark as successful. $successful = 1; break; case 'join': // Takes care of initial join request for squad // First make sure something was actually submitted if(!$_POST['s_id']){ break; } // s_id exists, now we handle figureing out who to send it to $pinfo = $GLOBALS['services']->sql_autofetch('SELECT nick_id,nick FROM nick WHERE nick_id='.$_GET['id']); $slinfo = $GLOBALS['services']->sql_autofetch('SELECT nick_id,nick,email,squad_name FROM nick,squads WHERE nick_id=squad_leader AND squad_id='.$_POST['s_id']); if (!$pinfo || !$slinfo){ // one of the queries failed.. $error = error_layout('There was a problem getting data from the database:
'. join('
',$GLOBALS['services']->sql_error($result))); break; } // Everything still okay? Then report request to the database $result = $GLOBALS['services']->sql_query('INSERT INTO request_squad (requestor,requested_squad,timerequested,message) VALUES ('.$pinfo['nick_id'].','.$_POST['s_id'].','.time().',"'.$_POST['s_comment'].'")'); if ($GLOBALS['services']->sql_affectedrows($result) <= 0){ // query failed to insert $error = error_layout('There was a problem getting data from the database:
'. join('
',$GLOBALS['services']->sql_error($result))); break; } // insert completed, now send email request.. // TODO: create email processes $successful = 1; break; case 'create': // Need to create a squad // First need to make sure they actually submitted data if (!$_POST['s_name']){ break; } // Now check to see if squad's name is already take or belongs to an already // created group. if ($GLOBALS['services']->sql_numrows( $GLOBALS['services']->sql_query(' select squad_name, group_name from squads,groups where (squad_name="'.$_POST['s_name'].'" or group_name="'.$_POST['s_name'].'") and squads.squad_id = groups.squad_id')) > 0){ // A squad was found with the same name $error = error_layout('The squad name already exists for a squad or group in the database. please choose a different one.'); break; } // We need to repeat the check for group name if it is defined if ($_POST['s_gname'] != ''){ if ($GLOBALS['services']->sql_numrows( $GLOBALS['services']->sql_query(' select squad_name, group_name from squads,groups where (squad_name="'.$_POST['s_gname'].'" or group_name="'.$_POST['s_gname'].'") and squads.squad_id = groups.squad_id')) > 0){ // A squad was found with the same name $error = error_layout('The group name already exists for a squad or group in the database. please choose a different one.'); break; } } // Okay name doesn't already exist, so lets go about creating it. // Pass _POST array to pilot object to handle creating the squad // for the pilot. $error = $pinfo->createSquad($_POST); if (!$error){ // Nothing went wrong; $successful = 1; } break; } } // Display processing follows here if (!$_SESSION['uobject']){ // This person has not logged in yet. $text .= NOTLOGGEDINMSG; } else if ($_GET['cmd'] == 'rename'){ $caption .= '-- Rename Squad'; if (!$successful){ $squad = $pinfo->squad; $text .= 'You have chosen to rename the following squad:'; $text .= '

'; $text .= '[ X ] '.$squad->name.''; $text .= '

'; $text .= $error; if (!$_POST['s_name']){ $_POST['s_name'] = $squad->name; } $text .= $_SESSION['out']->formStart(); $text .= $_SESSION['out']->formLine('Rename Squad To:','text','s_name',$_POST['s_name']); $text .= $_SESSION['out']->formEnd(); } else { // processing was complete $text .= 'Squad was renamed to: '; $text .= '

'; $text .= '[ X ] '.$_POST['s_name'].''; $text .= '

'; $text .= 'To go back to viewing your squad information, click here.'; } } else if ($_GET['cmd'] == 'delete'){ $caption .= '-- Delete A Squad'; if (!$successful){ if (!$error){ $squad = $pinfo->squad; $text .= 'You have requested to delete the following squads:'; $text .= '

'; $text .= '[ X ] '.$squad->name.''; $text .= '

'; $text .= $_SESSION['out']->formStart(); $text .= $_SESSION['out']->formLine('Are You Sure?','radio','s_remove',$_POST['s_remove'], Array(Array('Y','YES'),Array('N','NO'))); $text .= $_SESSION['out']->formEnd(); } else { $text .= $error; } } else { $squad = $pinfo->squad; $text .= 'The following Squad has been deleted:'; $text .= '

'; $text .= '[ X ] '.$squad->name.''; $text .= '

'; $text .= 'The following has been removed as squad leader:'; $text .= '

'; $text .= '[ X ] '.$pinfo->nick.''; $text .= '

'; $text .= 'To go back to viewing your squad information, click here.'; } } else if ($_GET['cmd'] == 'remove'){ $caption .= '-- Remove A Pilot From Squad'; // A squad leader is removing an existing pilot from his squad if (!$successful){ if (!$error){ $text .= 'You have requested to remove the following pilot from your squad: '; $text .= '

'; $text .= '[ X ] '.$pinfo->nick.''; $text .= '

'; $text .= $_SESSION['out']->formStart(); $text .= $_SESSION['out']->formLine('Are You Sure?','radio','s_remove',$_POST['s_remove'], Array(Array('Y','YES'),Array('N','NO'))); $text .= $_SESSION['out']->formLine('Reason:','textarea','s_comment',$_POST['s_comment']); $text .= $_SESSION['out']->formEnd(); } else { $text .= $error; } } else { $text .= 'The following pilot has been removed from your squad: '; $text .= '

'; $text .= '[ X ] '.$pinfo->nick.''; $text .= '

'; $text .= 'To go back to viewing your squad information, click here.'; } } else if ($_GET['cmd'] == 'quit'){ $caption .= '-- Quit A Squad'; if (!$successful){ if (!$error){ $squad = $pinfo->squad; $text .= 'You have chosen to remove yourself from the following squad: '; $text .= '

'; $text .= '[ X ] '.$squad->name.''; $text .= '

'; $text .= $_SESSION['out']->formStart(); $text .= $_SESSION['out']->formLine('Are you sure?','radio','s_quit',$_POST['s_quit'], Array(Array('Y','YES'),Array('N','NO'))); $text .= $_SESSION['out']->formEnd(); } else { $text .= $error; } } else { // process was successful $squad = $pinfo->squad; $text .= 'You have been removed from the following squad: '; $text .= '

'; $text .= '[ X ] '.$squad->name.''; $text .= '

'; $text .= 'Go back to viewing your pilots by clicking here.'; } } else if ($_GET['cmd'] == 'join'){ $caption .= '-- Create A Squad'; // User is trying to join a squad with the pilot if (!$successful){ $text .= 'You must select the squad that you want to join. It should be noted that just becuase you hit submit, you do not immediately become a member of that squad. When you click submit, your request starts the following cycle :'; $text .= '

'; $text .= '
1) Your request to join the selected squad is emailed to the squad leader of the squad you have requested to join.
2) The Squad Leader then will either accept your request to join, or deny it.
3) Which ever choice the Squad Leader makes, you are emailed the result.
4) If accepted you will see the squad listed under your name.
'; $text .= '

'; $text .= 'Please select the squad that you want to join, and provide a little bit as to why the squad leader should accept you into their squad. You do not have to provide any extra information, but it may help your chances at being approved.'; $text .= $error; // Get the necessary Squad list $result = $GLOBALS['services']->sql_query('SELECT squad_id,squad_name FROM squads WHERE faction_id='.$pinfo->faction_id.' ORDER BY squad_name'); if ($GLOBALS['services']->sql_numrows($result) > 0){ // query successful while ($array = $GLOBALS['services']->sql_fetchrow($result)){ $options[] = Array($array['squad_id'],$array['squad_name']); } } $text .= $_SESSION['out']->formStart(); $text .= $_SESSION['out']->formLine('Join Squad:','select','s_id',$_POST['s_id'],$options); $text .= $_SESSION['out']->formLine('Comment:','textarea','s_comment',$_POST['s_comment']); $text .= $_SESSION['out']->formEnd('Submit Join Request'); } else { // Successful Form Processed // grab the Pilot that is the Squad Leader for display $array = $GLOBALS['services']->sql_autofetch('SELECT nick,squad_name FROM nick,squads WHERE squad_leader = nick_id AND squad_id='.$_POST['s_id']); $text .= 'Your request has been sent to '.$array['nick'].' of the following squad:'; $text .= '

'; $text .= '[ X ] '.$array['squad_name'].''; $text .= '

'; $text .= 'Now you must wait for them to get accept or deny your request. Good Luck.'; $text .= '

'; $text .= 'Go back to viewing your pilots by clicking here.'; } } else if ($_GET['cmd'] == 'create'){ $caption .= '-- Create A Squad'; // User is trying to create a squad. if (!$successful){ $text .= 'You are creating a squad for the following Pilot:'; $text .= '

'; $text .= '[ X ] '.$pinfo->nick.''; $text .= '

'; $text .= 'This means, by default, you will be made the squad leader for this squad, as well as making you the CO of the group that will be tied to this squad. '; $text .= 'If you want to create a squad, just fill in the form below and click submit:'; $text .= $error; // Fixes it so that group name is defaulted to be used if (!$_POST) { $_POST['s_keepname'] = 'Y'; } // Output form.. $text .= $_SESSION['out']->formStart(); $text .= $_SESSION['out']->formLine('Squad Name:', 'text', 's_name', $_POST['s_name']); $text .= $_SESSION['out']->formLine('Squad Abbrev:','text','s_abbrev',$_POST['s_abbrev']); $text .= $_SESSION['out']->formLine('Squad Password:','password','s_passwd', $_POST['s_passwd']); $text .= $_SESSION['out']->formLine('','checkbox','s_keepname',$_POST['s_keepname'], Array(Array('Y','Auto-create Group Name'))); $text .= $_SESSION['out']->formLine('Group Name:', 'text', 's_gname', $_POST['s_gname']); $text .= $_SESSION['out']->formEnd('Create Squad'); } else { // was successful // Correct _POST[s_gname] variable since it is based on the keepname options if ($_POST['s_keepname'] == 'Y' || (!$_POST['s_keepname'] && $_POST['s_gname'] == '')){ $_POST['s_gname'] = $_POST['s_name']; } $text .= 'You have successfully created the following squad, as well as being placed as the squad leader:'; $text .= '

'; $text .= '[ X ] '.$_POST['s_name'].''; $text .= '

'; $text .= 'The following group was also created, of which you are the CO:'; $text .= '

'; $text .= '[ X ] '.$_POST['s_gname'].''; $text .= '

'; $text .= 'To manage your newly created squad click here.'; } } else { // Default display // If an ID is passed, then they are wanting to view a specific squad. If not, then only the // squads their pilots are part of. if ($_GET['id']){ // Only shows information for the ID passed $text .= 'Here is the information on the squad that you requested: '; $text .= '

'; // First need to make sure this is a valid squad if ($GLOBALS['services']->sql_numrows($GLOBALS['services']->sql_query('SELECT * FROM squads WHERE squad_id='.$_GET['id'])) < 1){ // Invalid squad ID $text .= error_layout('This is not a valid squad.'); } // ID is good, now figure out if the user belongs to this squad if ($pinfo = $_SESSION['uobject']->isInSquad($_GET['id'])){ // yes $squad = $pinfo->squad; // Now request display of the squad's information $text .= $squad->displaySquad($pinfo->id); } else { //no $squad = new Squad_Class($_GET['id']); // Create squad information $text .= $squad->displaySquad(); } } else { // displays all squads that the User Belongs to // parse through pilots array on the user object if ($_SESSION['uobject']->countPilots() > 0){ foreach($_SESSION['uobject']->pilots as $pilot){ if ($pilot->squad != null){ $squad = $pilot->squad; $checkarray[$squad->id] = 1; if ($squad->co == $pilot->nick || $squad->sic == $pilot->nick){ // squad is controlled by pilot $squads['co'][$pilot->id] = $squad; } else { $squads['normal'][$pilot->id] = $squad; } } } // Now that we have gone through the Users squads lets give them back to the user // Controllable squads first, then non-controllable squads. And if none were found // display that as well. if (sizeof($squads['co']) > 0 || sizeof($squads['normal']) > 0){ // Are there squads to show? if (sizeof($squads['co']) > 0){ // Display controlled squads $text .= 'Here are the squads that you are in charge of:

'; foreach ($squads['co'] as $pid=>$cosquad) $text .= $cosquad->displaySquad($pid).'
'; } if (sizeof($squads['normal']) > 0){ // display non-controlled squads foreach($squads['normal'] as $pid=>$nsquad){ if (!$checkarray[$nsquad->id]){ // Does player have control of this squad due to another pilot? $output .= $nsquad->displaySquad($pid).'
'; } } if ($output){ $text .= 'Here are the squads that you are a part of:

'.$output; } } } else { $text .= 'None of your pilots are assigned to a squad. If you would like to join or create a squad click here.'; } } else { $text .= 'You do not have any pilots assigned to your user account. Click here if want to associate a pilot with your account.'; } } } // Fix caption $caption ='
'.$caption.'
'; if ($_GET['cmd']){ $caption .= '[ « ]'; } $caption .= '[ ^ ]
'; // Display main Box $ns->gen_tablerend($caption,$text); ?>
hasLinkedPilots()){ $ns->tablerender("Linked Pilots",$_SESSION['uobject']->displayPilots()); } ?>