Add URL property to events.
This commit is contained in:
parent
8519c00a57
commit
328a2a31e6
|
@ -17,4 +17,6 @@ abstract class Event {
|
||||||
|
|
||||||
public abstract function getStop(); /* : DateTimeImmutable */
|
public abstract function getStop(); /* : DateTimeImmutable */
|
||||||
|
|
||||||
|
public abstract function getURL(); /* : string */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,8 @@ class AnimekveldEvent extends Event {
|
||||||
return "Liang Zhu";
|
return "Liang Zhu";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getURL() /* : string */ {
|
||||||
|
return '/anime/';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,8 @@ class BrettspillEvent extends Event {
|
||||||
return "PVV";
|
return "PVV";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getURL() /* : string */ {
|
||||||
|
return '/brettspill/';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,8 @@ class NerdepitsaEvent extends Event {
|
||||||
return "Anders Christensen";
|
return "Anders Christensen";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getURL() /* : string */ {
|
||||||
|
return '/nerdepitsa/';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
require '../src/_autoload.php';
|
|
||||||
date_default_timezone_set('Europe/Oslo');
|
date_default_timezone_set('Europe/Oslo');
|
||||||
require __DIR__ . '/../sql_config.php';
|
|
||||||
setlocale(LC_ALL, 'no_NO');
|
setlocale(LC_ALL, 'no_NO');
|
||||||
|
require __DIR__ . '/../src/_autoload.php';
|
||||||
|
require __DIR__ . '/../sql_config.php';
|
||||||
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
|
||||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
$agenda = new \pvv\side\Agenda([
|
$agenda = new \pvv\side\Agenda([
|
||||||
|
@ -59,8 +59,8 @@ $agenda = new \pvv\side\Agenda([
|
||||||
<ul>
|
<ul>
|
||||||
<?php foreach($events as $event) { $counter2++ ?>
|
<?php foreach($events as $event) { $counter2++ ?>
|
||||||
<li>
|
<li>
|
||||||
<a><?= $event->getName(); ?></a>
|
<a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a>
|
||||||
<a class="icon subscribe" href="">+</a>
|
<?php /* <a class="icon subscribe">+</a> */ ?>
|
||||||
<?php if ($period) {
|
<?php if ($period) {
|
||||||
if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) {
|
if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) {
|
||||||
echo '<span class="time">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
|
echo '<span class="time">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
|
||||||
|
|
Loading…
Reference in New Issue