/*
+---------------------------------------------------------------+
| e107 website system
|
| ©Steve Dunstan 2001-2002
| http://e107.org
| jalist@e107.org
|
| Released under the terms and conditions of the
| GNU General Public License (http://gnu.org).
+---------------------------------------------------------------+
*/
//$ec_dir = e_PLUGIN."calendar_menu/";
$lan_file = $ec_dir."languages/".e_LANGUAGE.".php";
include(file_exists($lan_file) ? $lan_file : e_PLUGIN."calendar_menu/languages/English.php");
$datearray = getdate();
$current_day = $datearray['mday'];
$current_month = $datearray['mon'];
$current_year = $datearray['year'];
// get first and last days of month in unix format---------------------------------------------------
$monthstart= mktime(0,0,0,$current_month,1,$current_year);
$firstdayarray = getdate($monthstart);
$monthend = mktime(0,0,0,$current_month+1,0,$current_year);
$lastdayarray = getdate($monthend);
// ----------------------------------------------------------------------------------------------------------
// get events from current month----------------------------------------------------------------------
$sql -> 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 .= "| ".$day." | ";
}
$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 .= "";
}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 .= " | \n";
$loop++;
if($loop == 7){
$loop = 0;
$text .= " ";
}
}
}
for($a=($loop+1); $a<=7; $a++){
$text .="| | ";
}
$text .= "
";
$ns -> tablerender($calendar_title, $text);
?>
|
$caption = 'COMCENT System v2.0';
$text = ' ';
if ($_GET['cmd']){ // Just for future capabilities
} else {
$text .= "Who out there hasn't wanted to get paid to shoot that pilot that is flying everywhere, scoring
all the points, sitting up at the top of the scores list? I know I have. Thus we have the Bounties,
this finally gives you a good reason to go after that pilot that is showing up everyone on the server.
If you know of a pilot who really needs to be on this list, post it in our forums!
";
// Next, we should show bounties
// We will only show Active and Top 5
// SO first get the active bounties
$bquery = $GLOBALS['services']->sql_query('SELECT nick,price
from hitlist
left join hitmoney on hitlist.hit_id=hitmoney.hit_id
left join nick on nick.nick_id=hitlist.nick_id');
if ($GLOBALS['services']->sql_numrows($bquery) > 0) { // there are active bounties
$text .= '|
Active Bounties | ';
$text .= '| Bounty Out For |
Amount To Be Paid |
# Of Times On List |
';
while ($array = $GLOBALS['services']->sql_fetchrow($bquery)){
$text .= '
| '.$array['nick'].' |
$ '.$array['price'].' |
1 |
';
}
$text .= '
';
}
// Now get the top 5
$text .= '|
Bounty Hunters | ';
$text .= '| Bounty Hunter |
Last Tagged |
For Amount |
Total Money |
# of Bounties |
';
$bquery = $GLOBALS['services']->sql_query('SELECT hit_id,nick,hitmoney.nick_id,money,num_hits
from hitmoney
left join nick on nick.nick_id=hitmoney.nick_id
ORDER BY money DESC');
while ($array = $GLOBALS['services']->sql_fetchrow($bquery)){
$barray = $GLOBALS['services']->sql_autofetch('SELECT nick,price
FROM completedhits
LEFT JOIN nick ON completedhits.nick_id=nick.nick_id
WHERE hit_by = '.$array['nick_id'].' ORDER BY hit_id');
$text .= '
| '.$array['nick'].' |
'.$barray['nick'].' |
'.$barray['price'].' |
$ '.$array['money'].' |
'.$array['num_hits'].' |
';
}
$text .= '
';
}
// Fix caption
$caption =''.$caption.' ';
if ($_GET['cmd']){
$caption .= '[ « ]';
}
$caption .= '[ ^ ] ';
// Display main Box
$ns->gen_tablerend($caption,$text);
?>
|
// Seconday area for holding things like the search tools and linked pilots info
// Do we have linked pilots?
if ($_SESSION['uobject'] && $_SESSION['uobject']->hasLinkedPilots()){
$ns->tablerender("Linked Pilots",$_SESSION['uobject']->displayPilots());
}
?>
|
// Display external template
require_once(FOOTERF);
?>
|