initial commit

This commit is contained in:
Ben Ramey
2017-03-02 21:57:21 -06:00
commit fd8ad64063
22097 changed files with 1960930 additions and 0 deletions

View File

@@ -0,0 +1,84 @@
<?php
#########################################################
# #
# Main functions to operate pae.co.at site #
# written by benjamin ramey #
# bsr@rameydesign.net #
# #
# best viewed with: #
# resolution = 1280x960 #
# tab = 4 spaces #
# indent = 8 spaces #
# #
########################################################################################## main_get_commands
# parameters: none
# returns: array of commands to be executed in order
function main_get_commands()
{
global $_CLEAN_PATH,$_CONFIG;
$anchor_pos = strpos($_CLEAN_PATH,'#'); // if this link has an anchor, delete it
if($anchor_pos !== FALSE) {
$_CLEAN_PATH = substr($_CLEAN_PATH,0,$anchor_pos);
}
$parts = explode('/',$_CLEAN_PATH);
for($c=0; $c <= count($parts)-1; ) {
if(empty($parts[$c]) or ($parts[$c] == 'pae.php') or ($parts[$c] == 'pae.co.at')) {
array_splice($parts,$c,1);
}
else { $c++; }
}
$commands = array( 'lang' => array_shift($parts),
'cmd' => array_shift($parts),
'query' => $parts );
if((array_search($commands['cmd'],$_CONFIG['commands']) === FALSE)
or empty($commands['cmd']))
{
$commands['cmd'] = 'display';
$commands['query'] = array('home');
}
return($commands);
}
########################################################################################## main_sort_schedule_by_month
# parameters: the two elements to compare
# returns: 0 for equavalent, 1 for a > b, -1 for a < b
function main_sort_schedule($a,$b)
{
global $_NEXT_MONTHS;
$a_date = explode('.',$a['startdate']);
$b_date= explode('.',$b['startdate']);
$a_year = $a_date[2];
$b_year = $b_date[2];
if($a_year == $b_year)
{
# if the years are the same, compare by month
$a_month = $a_date[1];
$b_month = $b_date[1];
if($a_month == $b_month)
{
# if the month AND year the same, sort by day
$a_day = $a_date[0];
$b_day = $b_date[0];
if($a_day == $b_day) { return(0); }
else if($a_day > $b_day) { return(1); }
else if($a_day < $b_day) { return(-1); }
}
else if($a_month > $b_month) { return(1); }
else if($a_month < $b_month) { return(-1); }
# if, for some reason, none of the above ifs work,
# just return that they are equivalent
return(0);
}
else if($a_year > $b_year) { return(1); }
else if($a_year < $b_year) { return(-1); }
}