$_year = intval(gus(1)); $_month = validate_month(gus(2)); gus_die(3); if ($_month) { if (!validate_date($_year, $_month)) { $events = (new \Databases\Events())->sqlRead("SELECT MAX(date_start) AS date FROM events INNER JOIN events_images ON events.id = events_images.event_id"); if ($events_row = $events[0] ?? null) { $_year = intval(substr($events_row['date'], 0, 4)); $_month = intval(substr($events_row['date'], 5, 2)); } else { $_year = date('Y'); $_month = date('n'); } header('Location: ' . DOMAIN . LANGUAGE . 'photos/' . $_year . '/' . str_month($_month) . '/'); die; } } else { if (!validate_date($_year, 1)) { $events = (new \Databases\Events())->sqlRead("SELECT MAX(date_start) AS date FROM events INNER JOIN events_images ON events.id = events_images.event_id"); if ($events_row = $events[0] ?? null) { $_year = intval(substr($events_row['date'], 0, 4)); } else { $_year = date('Y'); } header('Location: ' . DOMAIN . LANGUAGE . 'photos/' . $_year . '/'); die; } } if ($_month) { list($previous_year, $previous_month) = change_date('previous_month', $_year, $_month); list($next_year, $next_month) = change_date('next_month', $_year, $_month); } else { list($previous_year) = change_date('previous_year', $_year, 1); list($next_year) = change_date('next_year', $_year, 1); } include('../include/parts/' . $theme . '_header.php'); $event_type = (new \DatabasesQueries\EventsTypes())->GetEventTypesArray(); echo box_outside_top(lang('Event Photos', 'Photos D\'événements', ''), '[ ' . lang('Newest Comments For All Events', 'Nouveaux commentaires pour tous les événements', '') . ' ]'); echo box_inside_top(); if ($_month) { echo '
| '; if ($_month) { echo '<< ' . utf8_ucwords(str_month($_month)) . ' ' . $_year . ' >>'; } else { echo '<< ' . $_year . ' >>'; } echo ' | '; if ($_month) { echo date_selection('photos', $_year, $_month, "SELECT DISTINCT (YEAR(date_start)) AS year FROM events INNER JOIN events_images ON events.id = events_images.event_id ORDER BY year DESC"); } else { echo date_selection_year('photos', $_year, "SELECT DISTINCT (YEAR(date_start)) AS year FROM events INNER JOIN events_images ON events.id = events_images.event_id ORDER BY year DESC"); } echo ' |
| '; $eventsYearsPieces = []; $eventsYears = (new \Databases\Events())->sqlRead("SELECT DISTINCT (YEAR(date_start)) AS year FROM events INNER JOIN events_images ON events.id = events_images.event_id ORDER BY year DESC"); foreach ($eventsYears as $eventsYearsRow) { if ($_year == $eventsYearsRow['year']) { $eventsYearsPieces[] = $eventsYearsRow['year']; } else { $eventsYearsPieces[] = '' . $eventsYearsRow['year'] . ''; } } echo implode(' ', $eventsYearsPieces); echo ' |
| ';
echo box_image_top('margin: 0px 5px 0px 0px;');
echo ' | ';
echo '';
echo box_image_top('margin: 0px 5px 0px 0px;');
echo ' | ';
echo '';
echo box_image_top('margin: 0px 5px 0px 0px;');
echo ' | ';
echo '';
echo '' . safe_output($events_row['name']) . ' ' . safe_output($events_row['country']) . ($events_row['region'] ? ', ' . safe_output($events_row['region']) : '') . ($events_row['city'] ? ', ' . safe_output($events_row['city']) : '') . ' ' . substr($events_row['date_start'], 0, 10) . ' ' . $events_images_count_row . ' ' . lang('photos') . ', ' . number_format($events_images_views_count_row['views'], 0) . ' ' . lang('views'); echo ' | ';
echo '|
| '; echo 'Legend: '; echo '' . lang('Raves', 'Raves', '') . ', '; echo '' . lang('Afterhours', 'Clubs de fin de nuit', '') . ', '; echo '' . lang('Clubs', 'Clubs', '') . ', '; echo '' . lang('Concerts', 'Concerts', '') . ', '; echo '' . lang('Other', 'Autre', '') . '.'; echo ' |
| '; if ($_month) { echo '<< ' . utf8_ucwords(str_month($_month)) . ' ' . $_year . ' >>'; } else { echo '<< ' . $_year . ' >>'; } echo ' | '; if ($_month) { echo date_selection('photos', $_year, $_month, "SELECT DISTINCT (YEAR(date_start)) AS year FROM events INNER JOIN events_images ON events.id = events_images.event_id ORDER BY year DESC"); } else { echo date_selection_year('photos', $_year, "SELECT DISTINCT (YEAR(date_start)) AS year FROM events INNER JOIN events_images ON events.id = events_images.event_id ORDER BY year DESC"); } echo ' |
| ';
echo box_image_top('margin: 0px 5px 0px 0px;');
echo ' | ';
echo '';
echo box_image_top('margin: 0px 5px 0px 0px;');
echo ' | ';
echo '';
echo box_image_top('margin: 0px 5px 0px 0px;');
echo ' | ';
echo '';
echo '' . $events_row['name'] . ' ' . $events_row['country'] . ($events_row['region'] ? ', ' . $events_row['region'] : '') . ($events_row['city'] ? ', ' . $events_row['city'] : '') . ' ' . substr($events_row['date_start'], 0, 10) . ' ' . $events_images_count_row . ' ' . lang('photos') . ', ' . number_format($events_images_views_count_row['views'], 0) . ' ' . lang('views'); echo ' | ';
echo '|