/** * Returns an array of dates, along with the registration dates, when manual mode is selected * * @access public * @return array */ function find_recurrence_manual_dates($params = array()) { //echo_f('p',$params); extract($params); $recurrence_dates = array(); if (count($recurrence_manual_dates) == 0) { return $recurrence_dates; } //Make sure there are no repeat dates $recurrence_manual_dates = array_unique($recurrence_manual_dates); $recurrence_manual_end_dates = array_unique($recurrence_manual_end_dates); $start_date = date("Y-m-d", strtotime($recurrence_manual_dates[0])); //just in case it comes in in another format /* * Since we already have the first date, for each one of the manually entered dates, we will find the * difference in days, and if the user wants to increment the registration dates, we will do so * using the date difference. * */ foreach ($recurrence_manual_dates as $k => $v) { if ($v != '') { $date_difference = get_difference($start_date, $v, 3); $recurrence_dates[$v]['recurrence_id'] = $recurrence_id; $recurrence_dates[$v]['start_date'] = $v; $recurrence_dates[$v]['event_end_date'] = $recurrence_manual_end_dates[$k] != '' ? $recurrence_manual_end_dates[$k] : $v; if ($recurrence_regis_date_increment == 'N') { $recurrence_dates[$v]['registration_start'] = date("Y-m-d", strtotime("+{$date_difference} day", strtotime($registration_start))); $recurrence_dates[$v]['registration_end'] = date("Y-m-d", strtotime("+{$date_difference} day", strtotime($registration_end))); } else { $recurrence_dates[$v]['registration_start'] = date("Y-m-d", strtotime($registration_start)); $recurrence_dates[$v]['registration_end'] = date("Y-m-d", strtotime($registration_end)); } if ($recurrence_visibility != '') { $recurrence_dates[$v]['visible_on'] = date("Y-m-d", strtotime("-{$recurrence_visibility} day", strtotime($recurrence_dates[$v]['registration_start']))); } else { $recurrence_dates[$v]['visible_on'] = date("Y-m-d"); } } } //remove the first key since that day will be added/modified before the add_event_to_db or update_event recursion if (isset($adding_to_db)) { //unset( $recurrence_dates[$start_date] ); } return $recurrence_dates; }
if ($status == "online") { echo '<span style="color:green">online</span>!'; } elseif ($status == "online (full)") { echo '<span style="color:orange">online (full)</span>!'; } elseif ($status == "online (timeout)") { echo '<span style="color:darkorange">online (timeout)</span>!'; } else { echo '<span style="color:red">offline</span>!'; } if ($i == 0 && $onlinecounter) { echo $userstatus; } echo '</br></br> It\'s been ' . $status . ' for: '; get_difference($lastonline); echo '</br> Last checked: '; get_difference($lastcheck); echo '</br> These numbers are up to date as of '; echo $now2->format('Y-m-d H:i:s'); echo ' in GMT+2 '; if (date('I')) { echo 'DST'; } echo '</br> </br>'; } echo ' <span style="display:none">10</span> </div> </br> </br> </br>
function timeout_check($hostaddress) { include "config.php"; for ($i = 0; $i <= count($servers) - 1; $i++) { if ($servers[$i]['serveraddress'] == $hostaddress) { $filename = $absolute_cache_path . "servertime" . $servers[$i]['id'] . ".txt"; $myfile = fopen($filename, "r"); $fileread = fread($myfile, filesize($filename)); fclose($myfile); $lastseenonline = date_create_from_format('Y-m-d H:i:s', $fileread); } } $since_on_diff = get_difference($lastseenonline, $timeout_format); if (!isset($since_on_diff)) { echo "not set"; return true; } var_dump($since_on_diff); var_dump($timeout_amount); var_dump(get_slot_state("f")); if (intval($since_on_diff) >= $timeout_amount && get_slot_state("f") == "same") { echo "off"; return false; } else { echo "on"; return true; } }