from the site, where this extra is included!
// -> use absolute path if you have it included in files with different directories!
// (e.g. /home/www/htdocs/mysite.com/vwar/)
// -> if included in your _header.php/_footer.php, it is normally: './'
// -> if not, use: './../'
$vwar_xroot = "./../";
// 0 = show wars & events / 1 = show only events / 2 = show only wars
$whattoshow = 0;
// how many entries are displayed (set '0' to display them all!)
$showactions = 2;
// set 1 to display a link to your vwar-calendar
// if more events are fetched than you want to display
$calendarlink = 1;
// include header- & footer-information (1=enabled / 0=disabled)
$include = 0;
// ######################################################################################
// ################################### display events #################################
// check, if we need to get some global vars or if we need to include them
if (!defined ("VWAR_COMMON_INCLUDED"))
{
$vwar_root = $vwar_xroot;
require_once ($vwar_root . "includes/functions_common.php");
}
if ($include == 1)
{
include_once ($vwar_root . "_header.php");
}
switch ($whattoshow)
{
case 0:
$title = "Ocassions";
break;
case 1:
$title = "Events";
break;
case 2;
$title = "Wars";
break;
}
$tocalendar = "more " . $title . " in the Calendar!";
$time = "H:i";
$current_date = getdate();
$current_day = $current_date['mday'];
$current_month = $current_date['mon'];
$current_year = $current_date['year'];
if ($current_month < 10)
{
$searchmonth = "0" . $current_month;
} else {
$searchmonth = $current_month;
}
if ($current_day < 10)
{
$searchday = "0" . $current_day;
} else {
$searchday = $current_day;
}
$searchstring = $searchmonth . "-" . $searchday;
$dateline_low = mktime( 0, 0, 0, $searchmonth, $searchday, $current_year);
$dateline_high = mktime( 23, 59, 59, $searchmonth, $searchday, $current_year);
?>
on .. |
query("
SELECT eventid, event
FROM vwar".$n."_calendarevents
WHERE ( (eventdate >= $dateline_low AND eventdate <= $dateline_high)
OR (eventdate <= $dateline_high AND $dateline_high <= enddate)
OR (enddate >= $dateline_low AND enddate <= $dateline_high) )
AND deleted = '0'
");
$numevents = $vwardb->num_rows($events);
$birthdays = $vwardb->query("
SELECT memberid,name,birthday FROM vwar".$n."_member
WHERE birthday LIKE '%$searchstring%' ORDER BY name ASC");
$numbirthdays = $vwardb->num_rows($birthdays);
}
if($whattoshow == 0 || $whattoshow == 2)
{
$wars = $vwardb->query("
SELECT warid, status, dateline, oppnameshort
FROM vwar".$n."
LEFT JOIN vwar".$n."_opponents ON (vwar".$n.".oppid = vwar".$n."_opponents.oppid)
WHERE dateline >= '$dateline_low' AND dateline <= '$dateline_high'
" . getPublicMatchtypes(1) . "
ORDER BY dateline ASC
");
$numwars = $vwardb->num_rows($wars);
}
$numactions = $numwars + $numbirthdays + $numevents;
if ($numactions == 0)
{
$handler = 0;
}
else if ($numactions <= $showactions || $showactions == 0)
{
$handler = 1;
$todisplay = $numactions;
}
else if ($showactions == 1 && $calendarlink == 1)
{
$handler = 2;
$todisplay = 1;
}
else if ($calendarlink == 1 && $numactions > $showactions)
{
$handler = 2;
$todisplay = $showactions - 1;
}
else if ($calendarlink != 1 && $numactions > $showactions)
{
$handler = 3;
$todisplay = $showactions;
}
//display
if ($handler)
{
$display_this = 0;
//events
if ($numevents > 0)
{
while ($display_this < $todisplay && $event = $vwardb->fetch_array($events))
{
dbSelect ($event);
$display_this++;
?>
» |
0)
{
while ($display_this < $todisplay && $birthday = $vwardb->fetch_array($birthdays))
{
dbSelect ($birthday);
$display_this++;
$birthdayarray = split("-", $birthday['birthday']);
$age = $current_year - $birthdayarray[0];
if (($birthdayarray[1] > date("m")) || (($birthdayarray[1] == date("m")) && ($birthdayarray[2] > date("d"))))
{
$age--;
}
?>
» 's Birthday () |
0)
{
while ($display_this < $todisplay && $war = $vwardb->fetch_array($wars))
{
dbSelect ($war);
$display_this++;
$wartime = date($time, $war['dateline']);
if ($war['status'] == 1)
{
?>
» War vs. at |
» War vs. at |
» |
No today! |