Datei:Zeitreisen in Star Trek.svg/quellcode: Unterschied zwischen den Versionen

aus Memory Alpha, der freien deutschen Star-Trek-Datenbank
Spring zu: Navigation, suche
imported>Shisma
(neu angelegt)
 
imported>Shisma
Zeile 1: Zeile 1:
 
<pre><nowiki><?php
 
<pre><nowiki><?php
 +
 +
// Dieser Code steht unter einer CC-BY-Lizenz
 +
// Shisma: http://de.memory-alpha.org/wiki/Benutzer:Shisma
  
 
// hier kann man inhalte eintragen
 
// hier kann man inhalte eintragen

Version vom 2. April 2011, 14:21 Uhr

<?php

// Dieser Code steht unter einer CC-BY-Lizenz 
// Shisma: http://de.memory-alpha.org/wiki/Benutzer:Shisma

// hier kann man inhalte eintragen

$GLOBALS['time_travels'] = array();
$GLOBALS['timelines'] = array();

global $time_travels;
global $timelines;

$time_travels = array(
    'TOS|1×21/1' => array(
        'start' => 2267,
        'end' => 1969,
        'traveler_type' => 'starship',
        'traveler_desc' => 'The USS Enterprise NCC-1701',
        'desc' => 'Morgen ist Gestern'
    ),
    'TOS|1×21/2' => array(
        'start' => 1969,
        'end' => 2267,
        'traveler_type' => 'starship',
        'traveler_desc' => 'The USS Enterprise NCC-1701',
        'desc' => 'Morgen ist Gestern'
    ),
    'TOS|1×28/1' => array(
        'start' => 2267,
        'end' => 1930,
        'traveler_type' => 'people',
        'traveler_desc' => 'Captain James T. Kirk, Dr. Leonard McCoy, Commander Spock',
        'desc' => 'Griff in die Geschichte'
    ),
    'TOS|1×28/2' => array(
        'start' => 1930,
        'end' => 2267,
        'traveler_type' => 'people',
        'traveler_desc' => 'Captain James T. Kirk, Dr. Leonard McCoy, Commander Spock',
        'desc' => 'Griff in die Geschichte'
    ),
    'TOS|2×26/1' => array(
        'start' => 2268,
        'end' => 1968,
        'traveler_type' => 'starship',
        'traveler_desc' => 'The USS Enterprise NCC-1701',
        'desc' => 'Ein Planet, genannt Erde'
    ),
    'TOS|2×26/2' => array(
        'start' => 1968,
        'end' => 2268,
        'traveler_type' => 'starship',
        'traveler_desc' => 'The USS Enterprise NCC-1701',
        'desc' => 'Ein Planet, genannt Erde'
    ),
    'TOS|2×26/2' => array(
        'start' => 1968,
        'end' => 2268,
        'traveler_type' => 'starship',
        'traveler_desc' => 'The USS Enterprise NCC-1701',
        'desc' => 'Ein Planet, genannt Erde'
    ),
    'm4/1' => array(
        'start' => 2286,
        'end' => 1986,
        'traveler_type' => 'starship',
        'desc' => 'Star Trek IV: Zurück in die Gegenwart'
    ),
    'm4/2' => array(
        'start' => 1986,
        'end' => 2286,
        'traveler_type' => 'starship',
        'desc' => 'Star Trek IV: Zurück in die Gegenwart'
    ),
    'm8/1' => array(
        'start' => 2373,
        'end' => 2063,
        'traveler_type' => 'starship',
        'traveler_desc' => 'A Borg Sphere and the USS Enterprise NCC-1701-E',
        'desc' => 'Star Trek: Der erste Kontakt'
    ),
    'm8/2' => array(
        'start' => 2063,
        'end' => 2373,
        'traveler_type' => 'starship',
        'back_to_the' => 'future',
        'traveler_desc' => 'The USS Enterprise NCC-1701-E',
        'desc' => 'Star Trek: Der erste Kontakt'
    ),
    'm7' => array(
        'start' => 2293,
        'end' => 2371,
        'traveler_desc' => 'James Tiberius Kirk',
        'traveler_type' => 'people',
        'desc' => 'Star Trek: Treffen der Generationen'
    ),
    'm11/1' => array(
        'start' => 2387,
        'end' => 2233,
        'traveler_type' => 'starship',
        'desc' => 'Star Trek'
    ),
    'm11/2' => array(
        'start' => 2387,
        'end' => 2258,
        'end_timeline' => 'new_timeline',
        'traveler_type' => 'starship',
        'traveler_desc' => 'Spock',
        'desc' => 'Star Trek'
    ),
    'TNG|3×15/1' => array(
        'start' => 2344,
        'end' => 2366,
        'traveler_desc' => 'The USS Enterprise NCC-1701-C',
        'traveler_type' => 'starship',
        'end_timeline' => 'longer_klingon_war',
        'desc' => 'Die alte Enterprise'
    ),
    'TNG|3×16/1' => array(
        'start' => 2366,
        'end' => 2344,
        'back_to_the' => 'past',
        'start_timeline' => 'longer_klingon_war',
        'traveler_desc' => 'The USS Enterprise NCC-1701-C',
        'traveler_type' => 'starship',
        'desc' => 'Die alte Enterprise'
    ),
    'TNG|5×26/1' => array(
        'start' => 2368,
        'end' => 1893,
        'traveler_type' => 'people',
        'desc' => 'Gefahr aus dem 19. Jahrhundert, Teil I'
    ),
    'TNG|5×26/2' => array(
        'start' => 1893,
        'end' => 2368,
        'back_to_the' => 'future',
        'traveler_type' => 'people',
        'desc' => 'Gefahr aus dem 19. Jahrhundert, Teil I'
    ),
    'TNG|7×21/1' => array(
        'start' => 2410,
        'end' => 2370,
        'start_approx' => TRUE,
        'traveler_type' => 'people',
        'traveler_desc' => 'Alexander Rozhenko',
        'desc' => 'Ritus des Aufsteigens'
    ),
    'DS9|3×11/1' => array(
        'start' => 2371,
        'end' => 2024,
        'traveler_type' => 'people',
        'traveler_desc' => 'Benjamin Lafayette Sisko, Julian Bashir, Jadzia Dax. Later Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil I'
    ),
    'DS9|3×11/2' => array(
        'start' => 2371,
        'end' => 2371,
        'end_timeline' => 'no_bell_riots',
        'traveler_type' => 'starship',
        'traveler_desc' => 'Benjamin Lafayette Sisko, Julian Bashir, Jadzia Dax. Later Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil I'
    ),
    'DS9|3×12/1' => array(
        'start' => 2371,
        'end' => 1930,
        'start_timeline' => 'no_bell_riots',
        'traveler_type' => 'people',
        'traveler_desc' => 'Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil II'
    ),
    'DS9|3×12/2' => array(
        'start' => 1930,
        'end' => 2371,
        'back_to_the' => 'future',
        'end_timeline' => 'no_bell_riots',
        'traveler_type' => 'people',
        'traveler_desc' => 'Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil II'
    ),
    'DS9|3×12/3' => array(
        'start' => 2371,
        'end' => 1967,
        'start_timeline' => 'no_bell_riots',
        'traveler_type' => 'people',
        'traveler_desc' => 'Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil II'
    ),
    'DS9|3×12/4' => array(
        'start' => 1967,
        'end' => 2371,
        'end_timeline' => 'no_bell_riots',
        'back_to_the' => 'future',
        'traveler_type' => 'people',
        'traveler_desc' => 'Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil II'
    ),
    'DS9|3×12/5' => array(
        'start' => 2371,
        'end' => 2048,
        'start_timeline' => 'no_bell_riots',
        'end_timeline' => 'no_bell_riots',
        'traveler_type' => 'people',
        'traveler_desc' => 'Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil II'
    ),
    'DS9|3×12/6' => array(
        'start' => 2048,
        'end' => 2371,
        'end_timeline' => 'no_bell_riots',
        'start_timeline' => 'no_bell_riots',
        'traveler_type' => 'people',
        'back_to_the' => 'future',
        'traveler_desc' => 'Kira Narys and Miles Edward O\'Brian',
        'desc' => 'Gefangen in der Vergangenheit, Teil II'
    ),
    'DS9|4×07/1' => array(
        'start' => 2372,
        'end' => 2048,
        'traveler_type' => 'starship',
        'desc' => 'Kleine, grüne Männchen'
    ),
    'DS9|4×07/2' => array(
        'start' => 1947,
        'end' => 2372,
        'back_to_the' => 'future',
        'traveler_type' => 'starship',
        'desc' => 'Kleine, grüne Männchen'
    ),
    'DS9|5×06/1' => array(
        'start' => 2373,
        'end' => 2268,
        'traveler_type' => 'starship',
        'desc' => 'Immer die Last mit den Tribbles'
    ),
    'DS9|5×06/2' => array(
        'start' => 2268,
        'end' => 2373,
        'traveler_type' => 'starship',
        'desc' => 'Immer die Last mit den Tribbles',
        'back_to_the' => 'future',
    ),
    'VOY|3×08' => array(
        'start' => 2373,
        'end' => 1996,
        'traveler_type' => 'starship',
        'desc' => 'Vor dem Ende der Zukunft, Teil I'
    ),
    'VOY|3×09' => array(
        'start' => 1996,
        'end' => 2373,
        'back_to_the' => 'future',
        'traveler_type' => 'starship',
        'desc' => 'Vor dem Ende der Zukunft, Teil I'
    ),
    'ENT|3×01/1' => array(
        'start' => 2750,
        'start_approx' => TRUE,
        'end' => 2151,
        'traveler_type' => 'signal',
        'desc' => 'Future Guy communicate with the Suliban'
    ),
    'ENT|3×01/2' => array(
        'start' => 2151,
        'end_approx' => TRUE,
        'end' => 2750,
        'traveler_type' => 'signal',
        'desc' => 'Future Guy communicate with the Suliban'
    ),
    'ENT|3×11/1' => array(
        'start' => 2153,
        'end' => 2004,
        'traveler_type' => 'people',
        'desc' => 'Carpenter Street'
    ),
    'ENT|3×11/2' => array(
        'start' => 2004,
        'end' => 2153,
        'back_to_the' => 'future',
        'traveler_type' => 'people',
        'desc' => 'Carpenter Street'
    ),
    'ENT|3×21/1' => array(
        'start' => 2154,
        'end' => 2037,
        'traveler_type' => 'starship',
        'desc' => 'E²'
    ),
    'ENT|3×24/1' => array(
        'start' => 2154,
        'end' => 1944,
        'end_timeline' => 'nazis_conquer_usa',
        'traveler_type' => 'starship',
        'desc' => 'Stunde Null'
    ),
    'ENT|3×24/2' => array(
        'start' => 1944,
        'start_timeline' => 'nazis_conquer_usa',
        'end' => 2154,
        'back_to_the' => 'future',
        'traveler_type' => 'starship',
        'desc' => 'Stunde Null'
    ),
    'ENT|3×08' => array(
        'start' => 2165,
        'start_timeline' => 'nazis_conquer_usa',
        'end' => 2153,
        'start_timeline' => 'xindi_destroy_earth',
        'traveler_type' => 'consciousness',
        'desc' => 'Stunde Null'
    ),
    'VOY|7×25' => array(
        'start' => 2404,
        'end' => 2378,
        'traveler_type' => 'starship',
        'desc' => 'Endspiel, Teil I',
    ),
    'VOY|5×06' => array(
        'start' => 2390,
        'end' => 2375,
        'traveler_type' => 'signal',
        'desc' => 'Temporale Paradoxie'
    ),
    'TNG|5×09/1' => array(
        'start' => 2859,
        'start_approx' => TRUE,
        'end' => 2150,
        'end_approx' => TRUE,
        'traveler_type' => 'timeship',
        'taveler_desc' => 'Berlinghoff Rasmussen',
        'desc' => 'Der zeitreisende Historiker'
    ),
    'TNG|5×09/2' => array(
        'start' => 2150,
        'start_approx' => TRUE,
        'end' => 2368,
        'traveler_type' => 'timeship',
        'taveler_desc' => 'Berlinghoff Rasmussen',
        'desc' => 'Der zeitreisende Historiker'
    ),
    'TNG|3×19/1' => array(
        'start' => 2650,
        'start_approx' => TRUE,
        'end' => 2150,
        'end_approx' => TRUE,
        'traveler_type' => 'people',
        'taveler_desc' => '	Kal Dano',
        'desc' => 'Picard macht Urlaub'
    ),
    'TNG|3×19/2' => array(
        'start' => 2650,
        'start_approx' => TRUE,
        'end' => 2367,
        'traveler_type' => 'people',
        'taveler_desc' => '	Ajur und Boratus',
        'desc' => 'Picard macht Urlaub'
    ),
    'TNG|5×18' => array(
        'start' => 2278,
        'end' => 2368,
        'traveler_type' => 'starship',
        'taveler_desc' => 'USS Bozeman NCC-1941',
        'desc' => 'Déjà Vu'
    ),
    'TNG|6×15/1' => array(
        'start' => 2369,
        'end' => 2327,
        'traveler_type' => 'consciousness',
        'taveler_desc' => 'Jean Luc Picard',
        'desc' => 'Willkommen im Leben nach dem Tode'
    ),
    'TNG|6×15/2' => array(
        'start' => 2327,
        'end' => 2369,
        'traveler_type' => 'consciousness',
        'end_timeline' => 'picard_is_a_loser',
        'taveler_desc' => 'Jean Luc Picard',
        'back_to_the' => 'future',
        'desc' => 'Willkommen im Leben nach dem Tode'
    ),
    'TNG|6×15/3' => array(
        'start' => 2369,
        'end' => 2327,
        'start_timeline' => 'picard_is_a_loser',
        'traveler_type' => 'consciousness',
        'start_timeline' => 'picard_is_a_loser',
        'taveler_desc' => 'Jean Luc Picard',
        'desc' => 'Willkommen im Leben nach dem Tode'
    ),
    'TNG|6×15/4' => array(
        'start' => 2327,
        'end' => 2369,
        'traveler_type' => 'consciousness',
        'back_to_the' => 'future',
        'taveler_desc' => 'Jean Luc Picard',
        'desc' => 'Willkommen im Leben nach dem Tode'
    ),
    'DS9|4×03/1' => array(
        'start' => 2372,
        'end' => 2373,
        'traveler_type' => 'people',
        'taveler_desc' => 'Benjamin Lafajette Sisko',
        'desc' => 'Der Besuch'
    ),
    'DS9|4×03/2' => array(
        'start' => 2373,
        'end' => 2389,
        'start_timeline' => 'main_timeline',
        'end_timeline' => 'early_lost_sisco',
        'traveler_type' => 'people',
        'taveler_desc' => 'Benjamin Lafajette Sisko',
        'desc' => 'Der Besuch'
    ),
    'DS9|4×03/3' => array(
        'start' => 2389,
        'end' => 2408,
        'start_timeline' => 'early_lost_sisco',
        'end_timeline' => 'early_lost_sisco',
        'traveler_type' => 'people',
        'taveler_desc' => 'Benjamin Lafajette Sisko',
        'desc' => 'Der Besuch'
    ),
    'DS9|4×03/4' => array(
        'start' => 2408,
        'end' => 2422,
        'start_timeline' => 'early_lost_sisco',
        'end_timeline' => 'early_lost_sisco',
        'traveler_type' => 'people',
        'taveler_desc' => 'Benjamin Lafajette Sisko',
        'desc' => 'Der Besuch'
    ),
    'DS9|4×03/5' => array(
        'start' => 2422,
        'end' => 2450,
        'start_timeline' => 'early_lost_sisco',
        'end_timeline' => 'early_lost_sisco',
        'traveler_type' => 'people',
        'taveler_desc' => 'Benjamin Lafajette Sisko',
        'desc' => 'Der Besuch'
    ),
    'DS9|4×03/6' => array(
        'start' => 2422,
        'end' => 2450,
        'start_timeline' => 'early_lost_sisco',
        'end_timeline' => 'early_lost_sisco',
        'traveler_type' => 'people',
        'taveler_desc' => 'Benjamin Lafajette Sisko',
        'desc' => 'Der Besuch'
    ),
    'DS9|4×03/7' => array(
        'start' => 2450,
        'end' => 2372,
        'start_timeline' => 'early_lost_sisco',
        'end_timeline' => 'main_timeline',
        'traveler_type' => 'people',
        'back_to_the' => 'past',
        'taveler_desc' => 'Benjamin Lafajette Sisko',
        'desc' => 'Der Besuch'
    ),
    'DS9|4×17/1' => array(
        'start' => 2170,
        'end' => 2372,
        'approx_start' => TRUE,
        'traveler_type' => 'starship',
        'taveler_desc' => 'Akorem Laan in his Light Ship',
        'desc' => 'Die Übernahme'
    ),
    'DS9|4×17/2' => array(
        'start' => 2372,
        'end' => 2170,
        'approx_start' => TRUE,
        'traveler_type' => 'starship',
        'back_to_the' => 'past',
        'taveler_desc' => 'Akorem Laan in his Light Ship',
        'desc' => 'Die Übernahme'
    ),
    'DS9|4×17/2' => array(
        'start' => 2372,
        'end' => 2170,
        'approx_start' => TRUE,
        'traveler_type' => 'starship',
        'back_to_the' => 'past',
        'taveler_desc' => 'Akorem Laan in his Light Ship',
        'desc' => 'Die Übernahme'
    ),
    'DS9|5×22' => array(
        'start' => 2373,
        'end' => 2130,
        'approx_start' => TRUE,
        'traveler_type' => 'starship',
        'taveler_desc' => 'USS Defiant',
        'desc' => 'Kinder der Zeit'
    ),
    'DS9|6×17/1' => array(
        'start' => 2374,
        'end' => 2346,
        'traveler_type' => 'people',
        'taveler_desc' => 'Kira Nerys',
        'desc' => 'Tiefes Unrecht'
    ),
    'DS9|6×17/2' => array(
        'start' => 2346,
        'end' => 2374,
        'back_to_the' => 'future',
        'traveler_type' => 'people',
        'taveler_desc' => 'Kira Nerys',
        'desc' => 'Tiefes Unrecht'
    ),
    'DS9|6×24/1' => array(
        'start' => 2374,
        'end' => 2050,
        'traveler_type' => 'people',
        'taveler_desc' => 'Molly O\'Brien',
        'desc' => 'Das Zeitportal'
    ),
    'DS9|6×24/2' => array(
        'start' => 2060,
        'end' => 2374,
        'start_timeline' => 'mollys_ten_years_alone',
        'traveler_type' => 'people',
        'back_to_the' => 'future',
        'taveler_desc' => '10 years older Molly O\'Brien',
        'desc' => 'Das Zeitportal'
    ),
    'DS9|6×24/3' => array(
        'start' => 2374,
        'end' => 2060,
        'traveler_type' => 'people',
        'back_to_the' => 'past',
        'taveler_desc' => '10 years older Molly O\'Brien',
        'desc' => 'Das Zeitportal'
    ),
    'DS9|6×24/4' => array(
        'start' => 2060,
        'end' => 2374,
        'traveler_type' => 'people',
        'back_to_the' => 'future',
        'taveler_desc' => 'Molly O\'Brien',
        'desc' => 'Das Zeitportal'
    ),
    'DS9|6×25/1' => array(
        'start' => 2371,
        'end' => 2374,
        'traveler_type' => 'signal',
        'taveler_desc' => 'Lisa Cusak\'s distress call',
        'desc' => 'Der Klang ihrer Stimme'
    ),
    'DS9|6×25/2' => array(
        'start' => 2374,
        'end' => 2371,
        'traveler_type' => 'signal',
        'taveler_desc' => 'Answers on Lisa Cusak\'s distress call',
        'desc' => 'Der Klang ihrer Stimme'
    ),
);

$timelines = array(
    'main_timeline' => array(
        'timelayer' => 0,
    ),
    'nazis_conquer_usa' => array(
        'point_of_divergence' => 1916,
        'first_timetravel_event' => 1944,
        'vanishing_point' => 1944,
        'timelayer' => 1,
    ),
    'no_bell_riots' => array(
        'point_of_divergence' => 2024,
        'first_timetravel_event' => 2048,
        'timelayer' => 2,
        'vanishing_point' => 2371
    ),
    'picard_is_a_loser' => array(
        'point_of_divergence' => 2327,
        'first_timetravel_event' => 2369,
        'vanishing_point' => 2369,
        'timelayer' => -3,
    ),
    'new_timeline' => array(
        'point_of_divergence' => 2233,
        'first_timetravel_event' => 2258,
        'timelayer' => -2,
    ),
    'xindi_destroy_earth' => array(
        'point_of_divergence' => 2154,
        'first_timetravel_event' => 2165,
        'timelayer' => 1,
        'vanishing_point' => 2165,
    ),
    'longer_klingon_war' => array(
        'point_of_divergence' => 2344,
        'first_timetravel_event' => 2366,
        'timelayer' => -1,
    ),
    'early_lost_sisco' => array(
        'point_of_divergence' => 2372,
        'first_timetravel_event' => 2389,
        'timelayer' => 1,
    ),
    'borg_earth' => array(
        'point_of_divergence' => 2063,
        'first_timetravel_event' => 2100,
        'timelayer' => -1,
        'vanishing_point' => 2100,
    ),
    'mollys_ten_years_alone' => array(
        'point_of_divergence' => 2050,
        'point_of_divergence_approx' => TRUE,
        'first_timetravel_event' => 2060,
        'first_timetravel_event_approx' => TRUE,
        'timelayer' => 1,
        'vanishing_point' => 2060,
    ),
);

// STYLE

$GLOBALS['zoom'] = 5;
$GLOBALS['stage_width'] = 660;
$GLOBALS['main_timeline_offset'] = $GLOBALS['stage_width'] / 2;
$GLOBALS['time_layer_distance'] = 70;
$GLOBALS['min_range'] = 1880;
$GLOBALS['max_range'] = 2460;
$GLOBALS['ruler_offset_x'] = $GLOBALS['main_timeline_offset'] + 5;

function get_styling() {
  
  $timeline_color = '#3A5766';

  return '<defs>
    <style>

    #ruler line{stroke:white;}

    .timeline{stroke-width:5;stroke:' . $timeline_color . ';fill:none}
    .timeline.vanishing{stroke:url(#timeline_end_gradient)}

    .time_travel{stroke:white;stroke-width:2; fill:none}
    .time_travel.back_to_the_future{opacity:.6}

    .time_travel.taveler_type_timeship{stroke:white}
    .time_travel.taveler_type_starship{stroke:#66BBFF}
    .time_travel.taveler_type_people{stroke:#0269B3}
    .time_travel.taveler_type_signal{stroke:white}
    .time_travel.taveler_type_consciousness{stroke:white; stroke-width:1}
    </style>
<linearGradient id="timeline_end_gradient" gradientUnits="objectBoundingBox" x1="0%" y1="0%" x2="0" y2="100%">
<stop offset="0%" style="stop-color:' . $timeline_color . ';stop-opacity:1"/>
<stop offset="100%" style="stop-color:' . $timeline_color . ';stop-opacity:0"/>
</linearGradient>
</defs>
';
}

// Programm-Foo

function draw_ruler() {
  global $ruler_offset_x;
  global $min_range;
  global $max_range;
  global $zoom;

  $output = '<g id="ruler" style="opacity:.2">';

  $output .= '<line x1="' . $ruler_offset_x . '"  x2="' . $ruler_offset_x . '" y1="0" y2="' . (($max_range - $min_range) * $zoom) . '" />';

  for ($i = $min_range; $i < $max_range; $i++) {
    if ($i % 10) {
      $width = 5;
    } else {
      $width = 10;
      $output .= '<text x="' . ($ruler_offset_x + 15) . '" y="' . (($i - $min_range) * $zoom) . '" style="fill:#fff;font-family:sans-serif">' . $i . '</text>';
    }
    $output .= '<line x1="' . ($ruler_offset_x) . '"  x2="' . ($ruler_offset_x + $width) . '" y1="' . (($i - $min_range) * $zoom) . '" y2="' . (($i - $min_range) * $zoom) . '" />';
  }
  $output .= '</g>';

  return $output;
}

function draw_timeline($timeline) {
  if (!$timeline['timelayer']) {
    $timeline['timelayer'] = 0;
  }
  global $zoom;
  global $main_timeline_offset;
  global $time_layer_distance;
  global $min_range;
  global $max_range;

  if (!$timeline['point_of_divergence']) {
    return '<path class="timeline" d="M' . $main_timeline_offset . ',0 L' . $main_timeline_offset . ', ' . ($max_range * $zoom) . '" />';
  }

  $start_y = (($timeline['point_of_divergence'] - $min_range) * $zoom);
  $start_x = $main_timeline_offset + $start_timelayer;

  $end_y = (($timeline['first_timetravel_event'] - $min_range) * $zoom);
  $end_x = get_timelayer_offset($timeline['timelayer']);

  $range = $end_y - $start_y;

  $c1_y = ((($range / 3)) + $start_y);
  $c2_y = ((($range / 3)) + $start_y);

  if ($timeline['vanishing_point']) {
    $curve_end_y = ($timeline['vanishing_point'] - $min_range) * $zoom;

    $timeline_end = '<path d="M' . $end_x . ', ' . $curve_end_y . ' L' . ($end_x + 1) . ',' . ( $curve_end_y + 200) . '" class="timeline vanishing" />';
  } else {
    $curve_end_y = $max_range * $zoom;
    $timeline_end = '';
  }

  $output = '<path d="M' . $start_x . ',' . $start_y . 'C' . $start_x . ' ,' . $c1_y . ',' . $end_x . ', ' . $c2_y . ',' . $end_x . ',' . $end_y . ' L' . $end_x . ', ' . $curve_end_y . '" class="timeline" />';


  return $output . $timeline_end;
}

function draw_time_travel($travel) {
  if (!$travel['start_timeline']) {
    $travel['start_timeline'] = 'main_timeline';
  }
  if (!$travel['end_timeline']) {
    $travel['end_timeline'] = 'main_timeline';
  }

  global $main_timeline_offset;
  global $min_range;
  global $zoom;
  global $timelines;

  $width = ($travel['start'] - $travel['end']) * 1.5;

  $start_x = get_timelayer_offset($timelines[$travel['start_timeline']]['timelayer']);
  $start_y = (($travel['start'] - $min_range) * $zoom);

  $end_x = get_timelayer_offset($timelines[$travel['end_timeline']]['timelayer']);
  $end_y = (($travel['end'] - $min_range) * $zoom);

  $middle_x = $main_timeline_offset - $width;
  $middle_y = (($end_y - $start_y) / 2) + $start_y;

  if ($travel['back_to_the']) {
    $addclass = 'back_to_the_future';
  } else {
    $addclass = '';
  }

  return '<path class="time_travel taveler_type_' . $travel['traveler_type'] . ' ' . $addclass . '" d="M' . $start_x . ',' . $start_y . ' S ' . $middle_x . ' ' . $middle_y . ' ' . $end_x . ',' . $end_y . '" />';
}

function get_timelayer_offset($timelayer) {
  global $main_timeline_offset;
  global $time_layer_distance;
  return $main_timeline_offset + ($timelayer * $time_layer_distance);
}

// und hier gehts los

global $zoom;
global $main_timeline_offset;
global $time_layer_distance;
global $min_range;
global $max_range;
global $ruler_offset_x;

header("Content-Type: image/svg+xml");
echo '<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">';

echo '<svg xmlns="http://www.w3.org/2000/svg" height="' . (($max_range - $min_range) * $zoom) . '" width="1000" style="background-color:black" >';

echo get_styling();

echo draw_ruler();

foreach ($time_travels as $travel) {
  echo draw_time_travel($travel);
}

foreach ($timelines as $timeline) {
  echo draw_timeline($timeline);
}

echo '</svg>';

Diese Datei wird auf keiner Seite verwendet.