Няма описание

Daniel 04298d4498 Smol updates преди 2 години
EuroScope.ttf 04298d4498 Smol updates преди 2 години
FRAShuttle.jpg.php 298f6e6759 Creating GIT Repo преди 3 години
README.md 303b8bc5ea formatting преди 3 години
Schedule.php 04298d4498 Smol updates преди 2 години
Tuesday.jpg.php 04298d4498 Smol updates преди 2 години
UbuntuMono-Bold.ttf 04298d4498 Smol updates преди 2 години
UbuntuMono-Regular.ttf 298f6e6759 Creating GIT Repo преди 3 години
Woche.jpg.php 298f6e6759 Creating GIT Repo преди 3 години
Woche2.jpg.php 298f6e6759 Creating GIT Repo преди 3 години
config.php 04298d4498 Smol updates преди 2 години
darkmode.php 298f6e6759 Creating GIT Repo преди 3 години
example.jpg 01f00a5aa7 Adding example image преди 3 години
test.jpg.php 298f6e6759 Creating GIT Repo преди 3 години

README.md

VATSIM PHP Scheduler, using VATSIM GERMANY API.

It is recommended to set up a separate PHP file for each overview you would like to create. Alternatively one file can be created that outputs images to files using a cronjob. If multiple overviews use the same stations, optional stations or wanted stations, a central config file might be useful.

Example

A new Overview is created by making a new instance of the Schedule class:

$schedule = new Schedule($displaydates, $stations, $optstations, $wantedstations, $darkmode);
  • $displaydates is an Array that should be created with one of the helper functions:
    • Schedule::EveryXDaysFromStartdate (String startdate, int x, int numberofdays = 1) - Returns an array of DateTime objects. For regularly recurring events. Define a startdate and an interval in days for the event. numberofdays defines how many upcoming days will be returned.
    • EveryXWeeksFromStartdate (String startdate, int x, int numberofdays = 1) - Returns an array of DateTime objects. For regularly recurring events. Define a startdate and an interval in weeks for the event. numberofdays defines how many upcoming days will be returned. This is just an alias for EveryXDaysFromStardate with the input for x being x*7.
    • EveryWeekday (String weekday, int numberofdays) - Returns a list of datetime objects. This can be used for weekly events. Define a day of the week (such as "Wednesday") and the number of days to be displayed.
    • WholeWeek (int shift = 0) - Returns a list of 7 datetime objects for consecutive days. Will start with today + shift days.
  • $stations - an array of the stations that are to be displayed (including optional ones!). The String -- can be used to display a visual seperator.
  • $optstations - an array of the stations that are only to be displayed when there is a booking for that station. Defaults to [].
  • $wantedstations - A 2-dimensional array of stations and dates that should show "Wanted!" instead of "Open" when no booking is made. Defaults to []. A helper function to create this array is provided:
    • Schedule::processWantedDays(array stations, array dates, ...): In pairs of stations and dates each, provide as many pairs as needed. Stations should just be a plain array of stations, dates should once again be an array of DateTime objects, ideally using the helper functions described above.
  • $darkmode - Whether to display a dark or light background. Defaults to false. The attached darkmode.php provides a way to set a cookie for the darkmode which can be used to feed this value.

The image will be creted calling the createImage method.

    $image = $schedule->createImage();
    imagejpg($image);