Compare commits
45 Commits
37745e8ae9
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b0ae121363 | ||
|
|
8c22515397 | ||
|
|
30bfd34ee3 | ||
|
|
d46dc081ef | ||
|
|
acc2260745 | ||
|
|
11e1a3ea54 | ||
|
|
643efdb404 | ||
|
|
e3564b524f | ||
|
|
7da73b92a9 | ||
|
|
d0190a7b35 | ||
|
|
2b5a905a2d | ||
|
|
e4d91c2af5 | ||
|
|
4f2c134b67 | ||
|
|
de39b84975 | ||
|
|
06b2bd704b | ||
|
|
f5b39618f6 | ||
|
|
12c498a125 | ||
|
|
c8fd7e8a51 | ||
|
|
144d0844e8 | ||
|
|
7a0f727c86 | ||
| b64defe7fc | |||
|
|
6333ff6433 | ||
| f28e1609ae | |||
|
|
99720de0ca | ||
| ee8d50cf6c | |||
|
|
ae0e83def6 | ||
|
|
68ae6f9161 | ||
| 47a7590bf5 | |||
|
|
863381a226 | ||
| 4bd72b1349 | |||
|
|
94eddea78b | ||
| 6abe7ba61a | |||
|
|
7f1688ee89 | ||
|
|
34f5cfca73 | ||
|
|
676569256e | ||
|
|
5cd69739e5 | ||
|
|
b24fdc8e41 | ||
|
|
e12fcf8ad7 | ||
|
|
5b4b0011ea | ||
|
|
5e3604da33 | ||
|
|
aec6690c9e | ||
|
|
3e7490531d | ||
|
|
c7243f31a0 | ||
|
|
2e1f496eea | ||
|
|
92c66e4ed9 |
0
Dockerfile
Normal file → Executable file
0
Dockerfile.dev
Normal file → Executable file
0
Gruntfile.js
vendored
Normal file → Executable file
0
app/Console/Kernel.php
Normal file → Executable file
0
app/Exceptions/Handler.php
Normal file → Executable file
0
app/Helpers/FormatterHelper.php
Normal file → Executable file
0
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file → Executable file
0
app/Http/Controllers/Auth/LoginController.php
Normal file → Executable file
0
app/Http/Controllers/Auth/RegisterController.php
Normal file → Executable file
0
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file → Executable file
2
app/Http/Controllers/CalendarController.php
Normal file → Executable file
@@ -17,7 +17,7 @@ class CalendarController extends Controller
|
||||
|
||||
public function overview(Request $request)
|
||||
{
|
||||
$apiResult = $this->API('agenda/overzicht');
|
||||
$apiResult = $this->API('agenda/overzicht?aantal=100');
|
||||
$calendar = [];
|
||||
foreach($apiResult->events as $calendarItem)
|
||||
{
|
||||
|
||||
73
app/Http/Controllers/Controller.php
Normal file → Executable file
@@ -19,17 +19,17 @@ class Controller extends BaseController
|
||||
|
||||
private function getDataFromFileAndConvert($file, $path, $class, $maxItems = 0)
|
||||
{
|
||||
$data = json_decode(Storage::disk('local')->get($file));
|
||||
$data = json_decode(Storage::get($file));
|
||||
foreach ($path as $subobject) {
|
||||
$data = $data->$subobject;
|
||||
}
|
||||
$data = $data->$subobject ?? [];
|
||||
}
|
||||
$items = [];
|
||||
foreach ($data as $item_data) {
|
||||
$items[] = new $class($item_data);
|
||||
if ($maxItems && count($items) == $maxItems) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
@@ -47,7 +47,7 @@ class Controller extends BaseController
|
||||
$view->with('data', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem'));
|
||||
});
|
||||
View::composer('widgets.nustraks', function ($view) {
|
||||
$data = json_decode(Storage::disk('local')->get('nu_straks.json'))->schedule;
|
||||
$data = json_decode(Storage::get('nu_straks.json'))->schedule;
|
||||
$programs = [];
|
||||
foreach ($data as $item_data) {
|
||||
$programs[] = $program = new \Model\Program($item_data->program);
|
||||
@@ -57,7 +57,7 @@ class Controller extends BaseController
|
||||
|
||||
// Need a bit of slack here, otherwise the current program may show up
|
||||
$now = new \DateTimeImmutable('2 minutes ago');
|
||||
$data = json_decode(Storage::disk('local')->get('zojuist.json'))->schedule;
|
||||
$data = json_decode(Storage::get('zojuist.json'))->schedule;
|
||||
$i = 0;
|
||||
foreach (array_reverse($data) as $item_data) {
|
||||
$recent = $program = new \Model\Program($item_data->program);
|
||||
@@ -72,8 +72,10 @@ class Controller extends BaseController
|
||||
$view->with('data', $programs);
|
||||
});
|
||||
View::composer('widgets.laatstepodcasts', function ($view) {
|
||||
$view->with('data',
|
||||
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast'));
|
||||
$view->with(
|
||||
'data',
|
||||
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')
|
||||
);
|
||||
});
|
||||
View::composer('widgets.regioagenda', function ($view) {
|
||||
$view->with('data', $this->getDataFromFileAndConvert('regioagenda.json', [], '\Model\CalendarEvent'));
|
||||
@@ -84,8 +86,13 @@ class Controller extends BaseController
|
||||
View::composer('widgets.menu', function ($view) {
|
||||
$view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'))
|
||||
->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem', 3))
|
||||
->with('podcasts',
|
||||
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast'));
|
||||
->with(
|
||||
'podcasts',
|
||||
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')
|
||||
);
|
||||
});
|
||||
View::composer('widgets.menu', function($view) {
|
||||
$view->with('items', json_decode(Storage::get('static/menu.json')));
|
||||
});
|
||||
|
||||
View::share('disableBanners', env('DISABLE_BANNERS', false));
|
||||
@@ -97,14 +104,16 @@ class Controller extends BaseController
|
||||
return;
|
||||
}
|
||||
|
||||
app('db')->insert('INSERT INTO `pagestats`(`type`, `item_id`, `visitor_ip`, `session`, `referer`) VALUES(:type, :id, :ip, :session, :referer)',
|
||||
app('db')->insert(
|
||||
'INSERT INTO `pagestats`(`type`, `item_id`, `visitor_ip`, `session`, `referer`) VALUES(:type, :id, :ip, :session, :referer)',
|
||||
[
|
||||
'type' => $type,
|
||||
'id' => $id,
|
||||
'ip' => $request->server('REMOTE_ADDR'),
|
||||
'session' => md5(Session::getId()),
|
||||
'referer' => $request->server('HTTP_REFERRER')
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
protected function API($url)
|
||||
@@ -113,15 +122,16 @@ class Controller extends BaseController
|
||||
'ssl' => [
|
||||
"verify_peer" => false,
|
||||
"verify_peer_name" => false,
|
||||
],
|
||||
'http' => [
|
||||
'method' => 'GET',
|
||||
],
|
||||
'http' => [
|
||||
'method' => 'GET',
|
||||
'header' => 'X-Api-Key: ' . sha1(request()->server('REMOTE_ADDR')) . "\r\n"
|
||||
. 'X-User-Agent: ' . request()->server('HTTP_USER_AGENT') . "\r\n"
|
||||
]
|
||||
. 'X-User-Agent: ' . request()->server('HTTP_USER_AGENT') . "\r\n"
|
||||
]
|
||||
];
|
||||
|
||||
return json_decode(file_get_contents($this->API_URL . $url, false, stream_context_create($arrContextOptions)));
|
||||
//\dump($http_response_header);
|
||||
$result = @file_get_contents($this->API_URL . $url, false, stream_context_create($arrContextOptions));
|
||||
return $result ? json_decode($result) : null;
|
||||
}
|
||||
|
||||
protected function checkAPI($url)
|
||||
@@ -142,6 +152,7 @@ class Controller extends BaseController
|
||||
return is_object($obj) ? new \DateTime($obj->date, new \DateTimeZone($obj->timezone)) : \Carbon\Carbon::parse($obj)->setTimezone(date_default_timezone_get());
|
||||
}
|
||||
|
||||
/*
|
||||
public function __call($method, $arguments)
|
||||
{
|
||||
if (substr($method, 0, 5) == 'view_') {
|
||||
@@ -151,13 +162,14 @@ class Controller extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
return abort(404);
|
||||
return abort(404);
|
||||
}
|
||||
*/
|
||||
|
||||
public function getSidebareData()
|
||||
{
|
||||
$populair = [];
|
||||
$apiResult = $this->API('nieuws/populair?aantal=5');
|
||||
$apiResult = $this->API('nieuws/populair?aantal=5');
|
||||
foreach ($apiResult->news as $_newsItem) {
|
||||
$populair[] = new \Model\NewsItem($_newsItem);
|
||||
}
|
||||
@@ -170,4 +182,23 @@ class Controller extends BaseController
|
||||
|
||||
return ['newsItems' => $newsItems, 'populair' => $populair];
|
||||
}
|
||||
|
||||
public function static_page($slug)
|
||||
{
|
||||
if (view()->exists($slug)) {
|
||||
return view($slug);
|
||||
}
|
||||
|
||||
$page = $this->API('statisch/' . $slug);
|
||||
if ($page == null) {
|
||||
return abort(404);
|
||||
}
|
||||
|
||||
$page->published = Controller::JsonToDateTime($page->published);
|
||||
if ($page->edited) {
|
||||
$page->edited = Controller::JsonToDateTime($page->edited);
|
||||
}
|
||||
|
||||
return view('static', compact('page'));
|
||||
}
|
||||
}
|
||||
|
||||
0
app/Http/Controllers/HomeController.php
Normal file → Executable file
0
app/Http/Controllers/ImagesController.php
Normal file → Executable file
0
app/Http/Controllers/JobsController.php
Normal file → Executable file
0
app/Http/Controllers/KerkdienstController.php
Normal file → Executable file
28
app/Http/Controllers/NewsController.php
Normal file → Executable file
@@ -17,27 +17,30 @@ class NewsController extends Controller
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
parent::registerView($request, 'nieuws', $id);
|
||||
$apiResult = $this->API('nieuws/bericht/' . $id);
|
||||
$preview = "";
|
||||
if(request()->get('preview', null) != null) {
|
||||
$preview = "?preview=" . request()->get('preview');
|
||||
}
|
||||
$apiResult = $this->API('nieuws/bericht/' . $id . $preview);
|
||||
$newsItem = new \Model\NewsItem($apiResult->news);
|
||||
|
||||
switch ($apiResult->version) {
|
||||
case 1:
|
||||
if (!$newsItem->content) return redirect('//nhnieuws.nl/gooi');
|
||||
return view('newsitem', ['news' => $newsItem, 'metadata' => $newsItem->metadata]);
|
||||
break;
|
||||
if (!$newsItem->content) return redirect('//nhnieuws.nl/gooi');
|
||||
|
||||
case 2:
|
||||
case 2:
|
||||
if(isset($apiResult->source->article)) {
|
||||
$source = $apiResult->source->article;
|
||||
$newsItem->published = self::TimestampToDateTime($source->created);
|
||||
$newsItem->edited = self::TimestampToDateTime($source->updated);
|
||||
$newsItem->author = $source->author;
|
||||
$newsItem->images = null; // Images will be embedded
|
||||
$newsItem->video = null; // Videos will be embedded
|
||||
$newsItem->content = $source->blocks;
|
||||
|
||||
|
||||
|
||||
return view('newsitem', array_merge($this->getSidebareData(), ['news' => $newsItem, 'metadata' => $newsItem->metadata, 'searchURL' => 'nieuws/zoeken']));
|
||||
$newsItem->content = $source->blocks;
|
||||
} elseif(isset($apiResult->source->blocks)) {
|
||||
$newsItem->content = $apiResult->source->blocks;
|
||||
}
|
||||
return view('newsitem', array_merge($this->getSidebareData(), ['type' => $apiResult->type, 'news' => $newsItem, 'metadata' => $newsItem->metadata, 'searchURL' => 'nieuws/zoeken']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,9 +141,12 @@ class NewsController extends Controller
|
||||
$total = 5;
|
||||
}
|
||||
$page = (int)$request->get('pagina', 1);
|
||||
if ($url == 'overzicht' && $request->get('dateStart', null) && $request->get('dateEnd', null)) {
|
||||
$url = 'datum/' . $request->get('dateStart', null) . '/' . $request->get('dateEnd', null);
|
||||
}
|
||||
$apiResult = $this->API('nieuws/' . $url . '?pagina=' . (int)max(1, $page) . ($total ? '&aantal=' . $total : ''));
|
||||
$news = [];
|
||||
foreach ($apiResult->news as $newsItem) {
|
||||
foreach ($apiResult->news ?? [] as $newsItem) {
|
||||
$news[] = new \Model\NewsItem($newsItem);
|
||||
}
|
||||
|
||||
|
||||
0
app/Http/Controllers/PodcastController.php
Normal file → Executable file
5
app/Http/Controllers/RadioController.php
Normal file → Executable file
@@ -49,7 +49,10 @@ class RadioController extends Controller
|
||||
|
||||
public function program($id)
|
||||
{
|
||||
$apiResult = $this->API('programma/details/' . (int)$id);
|
||||
$apiResult = $this->API('programma/details/' . (int)$id);
|
||||
if($apiResult == null) {
|
||||
return abort(404);
|
||||
}
|
||||
return view('radioprogram', ['program' => new \Model\Program($apiResult)]);
|
||||
}
|
||||
|
||||
|
||||
0
app/Http/Controllers/SpecialController.php
Normal file → Executable file
0
app/Http/Controllers/StreamController.php
Normal file → Executable file
0
app/Http/Kernel.php
Normal file → Executable file
0
app/Http/Middleware/EncryptCookies.php
Normal file → Executable file
0
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file → Executable file
0
app/Http/Middleware/TrimStrings.php
Normal file → Executable file
0
app/Http/Middleware/VerifyCsrfToken.php
Normal file → Executable file
0
app/Models/Blog.php
Normal file → Executable file
0
app/Models/CalendarEvent.php
Normal file → Executable file
0
app/Models/JobOpening.php
Normal file → Executable file
0
app/Models/Kerkdienst.php
Normal file → Executable file
0
app/Models/MetaData.php
Normal file → Executable file
0
app/Models/Model.php
Normal file → Executable file
0
app/Models/NewsImage.php
Normal file → Executable file
0
app/Models/NewsItem.php
Normal file → Executable file
0
app/Models/NewsSource.php
Normal file → Executable file
0
app/Models/Podcast.php
Normal file → Executable file
0
app/Models/Program.php
Normal file → Executable file
0
app/Models/ProgramHost.php
Normal file → Executable file
0
app/Models/Track.php
Normal file → Executable file
0
app/Providers/AppServiceProvider.php
Normal file → Executable file
0
app/Providers/AuthServiceProvider.php
Normal file → Executable file
0
app/Providers/BroadcastServiceProvider.php
Normal file → Executable file
0
app/Providers/EventServiceProvider.php
Normal file → Executable file
0
app/Providers/RouteServiceProvider.php
Normal file → Executable file
0
app/User.php
Normal file → Executable file
0
bootstrap/app.php
Normal file → Executable file
0
bootstrap/autoload.php
Normal file → Executable file
0
bootstrap/cache/.gitignore
vendored
Normal file → Executable file
0
composer.json
Normal file → Executable file
0
composer.lock
generated
Normal file → Executable file
0
config/app.php
Normal file → Executable file
0
config/auth.php
Normal file → Executable file
0
config/broadcasting.php
Normal file → Executable file
0
config/cache.php
Normal file → Executable file
0
config/database.php
Normal file → Executable file
12
config/filesystems.php
Normal file → Executable file
@@ -48,12 +48,12 @@ return [
|
||||
'root' => storage_path('app'),
|
||||
],
|
||||
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'public',
|
||||
],
|
||||
//'public' => [
|
||||
// 'driver' => 'local',
|
||||
// 'root' => storage_path('app/public'),
|
||||
// 'url' => env('APP_URL').'/storage',
|
||||
// 'visibility' => 'public',
|
||||
//],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
|
||||
0
config/mail.php
Normal file → Executable file
0
config/queue.php
Normal file → Executable file
0
config/services.php
Normal file → Executable file
0
config/session.php
Normal file → Executable file
0
config/view.php
Normal file → Executable file
0
database/.gitignore
vendored
Normal file → Executable file
0
database/factories/ModelFactory.php
Normal file → Executable file
0
database/migrations/2014_10_12_000000_create_users_table.php
Normal file → Executable file
0
database/migrations/2014_10_12_100000_create_password_resets_table.php
Normal file → Executable file
0
database/migrations/2024_02_27_000000_create_pagestats_table.php
Normal file → Executable file
0
database/seeds/DatabaseSeeder.php
Normal file → Executable file
0
docker-compose.dev.yml
Normal file → Executable file
0
docker-compose.yml
Normal file → Executable file
0
docker/apache.conf
Normal file → Executable file
0
docker/apache.dev.conf
Normal file → Executable file
0
download_mediaplayer_plugins.php
Normal file → Executable file
0
env.example
Normal file → Executable file
0
package-lock.json
generated
Normal file → Executable file
0
package.json
Normal file → Executable file
0
phpunit.xml
Normal file → Executable file
0
public/.htaccess
Normal file → Executable file
0
public/android-chrome-192x192.png
Normal file → Executable file
|
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
0
public/android-chrome-512x512.png
Normal file → Executable file
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 183 KiB |
0
public/apple-touch-icon.png
Normal file → Executable file
|
Before Width: | Height: | Size: 39 KiB After Width: | Height: | Size: 39 KiB |
0
public/css/airplay.png
Normal file → Executable file
|
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 606 B |
0
public/css/airplay.svg
Normal file → Executable file
|
Before Width: | Height: | Size: 417 B After Width: | Height: | Size: 417 B |
0
public/css/app.css
vendored
Normal file → Executable file
0
public/css/app.css.map
Normal file → Executable file
0
public/css/bootstrap-grid.css
vendored
Normal file → Executable file
0
public/css/bootstrap-grid.css.map
Normal file → Executable file
0
public/css/bootstrap-grid.min.css
vendored
Normal file → Executable file
0
public/css/bootstrap-grid.min.css.map
Normal file → Executable file
0
public/css/chromecast.png
Normal file → Executable file
|
Before Width: | Height: | Size: 951 B After Width: | Height: | Size: 951 B |
0
public/css/chromecast.svg
Normal file → Executable file
|
Before Width: | Height: | Size: 637 B After Width: | Height: | Size: 637 B |
0
public/css/components/posts.css.map
Normal file → Executable file
0
public/css/components/pretty_photo.css.map
Normal file → Executable file
0
public/css/images/ui-bg_flat_0_aaaaaa_40x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
0
public/css/images/ui-bg_flat_0_eeeeee_40x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 274 B After Width: | Height: | Size: 274 B |
0
public/css/images/ui-bg_flat_55_ffffff_40x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
0
public/css/images/ui-bg_flat_75_ffffff_40x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 271 B After Width: | Height: | Size: 271 B |
0
public/css/images/ui-bg_glass_65_ffffff_1x400.png
Normal file → Executable file
|
Before Width: | Height: | Size: 272 B After Width: | Height: | Size: 272 B |
0
public/css/images/ui-bg_highlight-soft_100_f6f6f6_1x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 384 B After Width: | Height: | Size: 384 B |
0
public/css/images/ui-bg_highlight-soft_25_0073ea_1x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 387 B After Width: | Height: | Size: 387 B |
0
public/css/images/ui-bg_highlight-soft_50_dddddd_1x100.png
Normal file → Executable file
|
Before Width: | Height: | Size: 407 B After Width: | Height: | Size: 407 B |