33 Commits

Author SHA1 Message Date
NH Gooi
b0ae121363 Fix images starting with / or not 2025-11-20 13:52:46 +01:00
NH Gooi
8c22515397 Merge remote-tracking branch 'dev/dev' 2025-11-20 13:47:40 +01:00
NH Gooi
30bfd34ee3 Support for image block in own article 2025-11-19 22:09:49 +01:00
NH Gooi
d46dc081ef Remove tvgids -> statisch 2025-07-17 21:42:12 +02:00
NH Gooi
acc2260745 Menu styling tweak 2025-07-17 15:57:39 +02:00
NH Gooi
11e1a3ea54 Menu active links 2025-07-17 15:40:31 +02:00
NH Gooi
643efdb404 Menustructuur via intranet te beheren 2025-07-17 14:01:44 +02:00
NH Gooi
e3564b524f Statische pagina's naar CMS (nu werkend) 2025-07-16 21:24:15 +02:00
NH Gooi
7da73b92a9 Revert static pagina's via API want het was stuk 2025-07-16 17:10:24 +02:00
NH Gooi
d0190a7b35 Merge remote-tracking branch 'dev/dev' 2025-07-15 22:02:53 +02:00
NH Gooi
2b5a905a2d Merge remote-tracking branch 'origin/dev' into dev 2025-07-15 22:02:02 +02:00
NH Gooi
e4d91c2af5 Embed block width / height as specified 2025-07-15 22:01:08 +02:00
NH Gooi
4f2c134b67 Merge remote-tracking branch 'origin/main' into dev 2025-07-15 21:55:52 +02:00
NH Gooi
de39b84975 Merge branch 'dev' 2025-07-15 15:50:51 +02:00
NH Gooi
06b2bd704b Add static page view 2025-07-15 15:49:40 +02:00
NH Gooi
f5b39618f6 Merge remote-tracking branch 'origin/dev' 2025-07-15 15:47:51 +02:00
NH Gooi
12c498a125 Contact via intranet 2025-07-15 15:46:05 +02:00
NH Gooi
c8fd7e8a51 Statische pagina's via intranet 2025-07-15 15:45:09 +02:00
NH Gooi
144d0844e8 Agenda ordering en aantal items 2025-07-15 12:17:59 +02:00
NH Gooi
7a0f727c86 Embed datawrapper toegevoegd 2025-07-10 23:15:04 +02:00
b64defe7fc Merge pull request 'Added description how to use it.' (#17) from feature-news-date-filter into dev
Reviewed-on: #17
2025-07-07 15:29:40 +02:00
Jorit Tijsen
6333ff6433 Added description how to use it. 2025-07-07 15:29:36 +02:00
f28e1609ae Merge pull request 'Use Monday as the first day of the week.' (#16) from feature-news-date-filter into dev
Reviewed-on: #16
2025-07-07 14:50:04 +02:00
Jorit Tijsen
99720de0ca Use Monday as the first day of the week. 2025-07-07 14:47:42 +02:00
ee8d50cf6c Merge pull request 'feature-news-date-filter' (#15) from feature-news-date-filter into dev
Reviewed-on: #15
2025-06-30 17:37:54 +02:00
Jorit Tijsen
ae0e83def6 Merge branch 'feature-news-date-filter' of https://git.nhgooi.nl/NH_Gooi/nhgooi.nl into feature-news-date-filter 2025-06-30 17:37:21 +02:00
Jorit Tijsen
68ae6f9161 Fix: "Attempt to read property \"news\" on null" error 2025-06-30 17:36:04 +02:00
47a7590bf5 Merge pull request 'Fix: "Attempt to read property \"news\" on null" error' (#14) from feature-news-date-filter into dev
Reviewed-on: #14
2025-06-30 17:33:39 +02:00
Jorit Tijsen
863381a226 Fix: "Attempt to read property \"news\" on null" error 2025-06-30 17:33:22 +02:00
4bd72b1349 Merge pull request 'Add loading text + no items found text' (#13) from feature-news-date-filter into dev
Reviewed-on: #13
2025-06-30 17:30:32 +02:00
Jorit Tijsen
94eddea78b Add loading text + no items found text
Remove logging
2025-06-30 17:29:58 +02:00
6abe7ba61a Merge pull request 'feature-news-date-filter' (#12) from feature-news-date-filter into dev
Reviewed-on: #12
2025-06-30 17:03:25 +02:00
Jorit Tijsen
7f1688ee89 Feature: Added new News date filter to the news page 2025-06-30 16:40:44 +02:00
7534 changed files with 423 additions and 561 deletions

0
Dockerfile Normal file → Executable file
View File

0
Dockerfile.dev Normal file → Executable file
View File

0
Gruntfile.js vendored Normal file → Executable file
View File

0
app/Console/Kernel.php Normal file → Executable file
View File

0
app/Exceptions/Handler.php Normal file → Executable file
View File

0
app/Helpers/FormatterHelper.php Normal file → Executable file
View File

0
app/Http/Controllers/Auth/ForgotPasswordController.php Normal file → Executable file
View File

0
app/Http/Controllers/Auth/LoginController.php Normal file → Executable file
View File

0
app/Http/Controllers/Auth/RegisterController.php Normal file → Executable file
View File

0
app/Http/Controllers/Auth/ResetPasswordController.php Normal file → Executable file
View File

2
app/Http/Controllers/CalendarController.php Normal file → Executable file
View File

@@ -17,7 +17,7 @@ class CalendarController extends Controller
public function overview(Request $request) public function overview(Request $request)
{ {
$apiResult = $this->API('agenda/overzicht'); $apiResult = $this->API('agenda/overzicht?aantal=100');
$calendar = []; $calendar = [];
foreach($apiResult->events as $calendarItem) foreach($apiResult->events as $calendarItem)
{ {

74
app/Http/Controllers/Controller.php Normal file → Executable file
View File

@@ -19,17 +19,17 @@ class Controller extends BaseController
private function getDataFromFileAndConvert($file, $path, $class, $maxItems = 0) 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) { foreach ($path as $subobject) {
$data = $data->$subobject; $data = $data->$subobject ?? [];
} }
$items = []; $items = [];
foreach ($data as $item_data) { foreach ($data as $item_data) {
$items[] = new $class($item_data); $items[] = new $class($item_data);
if ($maxItems && count($items) == $maxItems) { if ($maxItems && count($items) == $maxItems) {
break; break;
} }
} }
return $items; return $items;
} }
@@ -47,7 +47,7 @@ class Controller extends BaseController
$view->with('data', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem')); $view->with('data', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem'));
}); });
View::composer('widgets.nustraks', function ($view) { 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 = []; $programs = [];
foreach ($data as $item_data) { foreach ($data as $item_data) {
$programs[] = $program = new \Model\Program($item_data->program); $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 // Need a bit of slack here, otherwise the current program may show up
$now = new \DateTimeImmutable('2 minutes ago'); $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; $i = 0;
foreach (array_reverse($data) as $item_data) { foreach (array_reverse($data) as $item_data) {
$recent = $program = new \Model\Program($item_data->program); $recent = $program = new \Model\Program($item_data->program);
@@ -72,8 +72,10 @@ class Controller extends BaseController
$view->with('data', $programs); $view->with('data', $programs);
}); });
View::composer('widgets.laatstepodcasts', function ($view) { View::composer('widgets.laatstepodcasts', function ($view) {
$view->with('data', $view->with(
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')); 'data',
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')
);
}); });
View::composer('widgets.regioagenda', function ($view) { View::composer('widgets.regioagenda', function ($view) {
$view->with('data', $this->getDataFromFileAndConvert('regioagenda.json', [], '\Model\CalendarEvent')); $view->with('data', $this->getDataFromFileAndConvert('regioagenda.json', [], '\Model\CalendarEvent'));
@@ -84,8 +86,13 @@ class Controller extends BaseController
View::composer('widgets.menu', function ($view) { View::composer('widgets.menu', function ($view) {
$view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem')) $view->with('news', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'))
->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem', 3)) ->with('popular', $this->getDataFromFileAndConvert('populair_nieuws.json', ['news'], '\Model\NewsItem', 3))
->with('podcasts', ->with(
$this->getDataFromFileAndConvert('laatste_podcasts.json', ['podcasts'], '\Model\Podcast')); '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)); View::share('disableBanners', env('DISABLE_BANNERS', false));
@@ -97,14 +104,16 @@ class Controller extends BaseController
return; 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, 'type' => $type,
'id' => $id, 'id' => $id,
'ip' => $request->server('REMOTE_ADDR'), 'ip' => $request->server('REMOTE_ADDR'),
'session' => md5(Session::getId()), 'session' => md5(Session::getId()),
'referer' => $request->server('HTTP_REFERRER') 'referer' => $request->server('HTTP_REFERRER')
]); ]
);
} }
protected function API($url) protected function API($url)
@@ -113,16 +122,16 @@ class Controller extends BaseController
'ssl' => [ 'ssl' => [
"verify_peer" => false, "verify_peer" => false,
"verify_peer_name" => false, "verify_peer_name" => false,
], ],
'http' => [ 'http' => [
'method' => 'GET', 'method' => 'GET',
'header' => 'X-Api-Key: ' . sha1(request()->server('REMOTE_ADDR')) . "\r\n" '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"
] ]
]; ];
//\dump($http_response_header); //\dump($http_response_header);
$result = @file_get_contents($this->API_URL . $url, false, stream_context_create($arrContextOptions)); $result = @file_get_contents($this->API_URL . $url, false, stream_context_create($arrContextOptions));
return $result ? json_decode($result) : null; return $result ? json_decode($result) : null;
} }
protected function checkAPI($url) protected function checkAPI($url)
@@ -143,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()); 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) public function __call($method, $arguments)
{ {
if (substr($method, 0, 5) == 'view_') { if (substr($method, 0, 5) == 'view_') {
@@ -152,13 +162,14 @@ class Controller extends BaseController
} }
} }
return abort(404); return abort(404);
} }
*/
public function getSidebareData() public function getSidebareData()
{ {
$populair = []; $populair = [];
$apiResult = $this->API('nieuws/populair?aantal=5'); $apiResult = $this->API('nieuws/populair?aantal=5');
foreach ($apiResult->news as $_newsItem) { foreach ($apiResult->news as $_newsItem) {
$populair[] = new \Model\NewsItem($_newsItem); $populair[] = new \Model\NewsItem($_newsItem);
} }
@@ -171,4 +182,23 @@ class Controller extends BaseController
return ['newsItems' => $newsItems, 'populair' => $populair]; 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
View File

0
app/Http/Controllers/ImagesController.php Normal file → Executable file
View File

0
app/Http/Controllers/JobsController.php Normal file → Executable file
View File

0
app/Http/Controllers/KerkdienstController.php Normal file → Executable file
View File

30
app/Http/Controllers/NewsController.php Normal file → Executable file
View File

@@ -16,11 +16,11 @@ class NewsController extends Controller
public function show(Request $request, $id) public function show(Request $request, $id)
{ {
parent::registerView($request, 'nieuws', $id); parent::registerView($request, 'nieuws', $id);
$preview = ""; $preview = "";
if(request()->get('preview', null) != null) { if(request()->get('preview', null) != null) {
$preview = "?preview=" . request()->get('preview'); $preview = "?preview=" . request()->get('preview');
} }
$apiResult = $this->API('nieuws/bericht/' . $id . $preview); $apiResult = $this->API('nieuws/bericht/' . $id . $preview);
$newsItem = new \Model\NewsItem($apiResult->news); $newsItem = new \Model\NewsItem($apiResult->news);
@@ -29,21 +29,18 @@ class NewsController extends Controller
if (!$newsItem->content) return redirect('//nhnieuws.nl/gooi'); if (!$newsItem->content) return redirect('//nhnieuws.nl/gooi');
case 2: case 2:
if(isset($apiResult->source->article)) { if(isset($apiResult->source->article)) {
$source = $apiResult->source->article; $source = $apiResult->source->article;
$newsItem->published = self::TimestampToDateTime($source->created); $newsItem->published = self::TimestampToDateTime($source->created);
$newsItem->edited = self::TimestampToDateTime($source->updated); $newsItem->edited = self::TimestampToDateTime($source->updated);
$newsItem->author = $source->author; $newsItem->author = $source->author;
$newsItem->images = null; // Images will be embedded $newsItem->images = null; // Images will be embedded
$newsItem->video = null; // Videos will be embedded $newsItem->video = null; // Videos will be embedded
$newsItem->content = $source->blocks; $newsItem->content = $source->blocks;
} elseif(isset($apiResult->source->blocks)) { } elseif(isset($apiResult->source->blocks)) {
$newsItem->content = $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']));
return view('newsitem', array_merge($this->getSidebareData(), ['type' => $apiResult->type, 'news' => $newsItem, 'metadata' => $newsItem->metadata, 'searchURL' => 'nieuws/zoeken']));
} }
} }
@@ -144,9 +141,12 @@ class NewsController extends Controller
$total = 5; $total = 5;
} }
$page = (int)$request->get('pagina', 1); $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 : '')); $apiResult = $this->API('nieuws/' . $url . '?pagina=' . (int)max(1, $page) . ($total ? '&aantal=' . $total : ''));
$news = []; $news = [];
foreach ($apiResult->news as $newsItem) { foreach ($apiResult->news ?? [] as $newsItem) {
$news[] = new \Model\NewsItem($newsItem); $news[] = new \Model\NewsItem($newsItem);
} }

0
app/Http/Controllers/PodcastController.php Normal file → Executable file
View File

0
app/Http/Controllers/RadioController.php Normal file → Executable file
View File

0
app/Http/Controllers/SpecialController.php Normal file → Executable file
View File

0
app/Http/Controllers/StreamController.php Normal file → Executable file
View File

0
app/Http/Kernel.php Normal file → Executable file
View File

0
app/Http/Middleware/EncryptCookies.php Normal file → Executable file
View File

0
app/Http/Middleware/RedirectIfAuthenticated.php Normal file → Executable file
View File

0
app/Http/Middleware/TrimStrings.php Normal file → Executable file
View File

0
app/Http/Middleware/VerifyCsrfToken.php Normal file → Executable file
View File

0
app/Models/Blog.php Normal file → Executable file
View File

0
app/Models/CalendarEvent.php Normal file → Executable file
View File

0
app/Models/JobOpening.php Normal file → Executable file
View File

0
app/Models/Kerkdienst.php Normal file → Executable file
View File

0
app/Models/MetaData.php Normal file → Executable file
View File

0
app/Models/Model.php Normal file → Executable file
View File

0
app/Models/NewsImage.php Normal file → Executable file
View File

0
app/Models/NewsItem.php Normal file → Executable file
View File

0
app/Models/NewsSource.php Normal file → Executable file
View File

0
app/Models/Podcast.php Normal file → Executable file
View File

0
app/Models/Program.php Normal file → Executable file
View File

0
app/Models/ProgramHost.php Normal file → Executable file
View File

0
app/Models/Track.php Normal file → Executable file
View File

0
app/Providers/AppServiceProvider.php Normal file → Executable file
View File

0
app/Providers/AuthServiceProvider.php Normal file → Executable file
View File

0
app/Providers/BroadcastServiceProvider.php Normal file → Executable file
View File

0
app/Providers/EventServiceProvider.php Normal file → Executable file
View File

0
app/Providers/RouteServiceProvider.php Normal file → Executable file
View File

0
app/User.php Normal file → Executable file
View File

0
bootstrap/app.php Normal file → Executable file
View File

0
bootstrap/autoload.php Normal file → Executable file
View File

0
bootstrap/cache/.gitignore vendored Normal file → Executable file
View File

0
composer.json Normal file → Executable file
View File

0
composer.lock generated Normal file → Executable file
View File

0
config/app.php Normal file → Executable file
View File

0
config/auth.php Normal file → Executable file
View File

0
config/broadcasting.php Normal file → Executable file
View File

0
config/cache.php Normal file → Executable file
View File

0
config/database.php Normal file → Executable file
View File

12
config/filesystems.php Normal file → Executable file
View File

@@ -48,12 +48,12 @@ return [
'root' => storage_path('app'), 'root' => storage_path('app'),
], ],
'public' => [ //'public' => [
'driver' => 'local', // 'driver' => 'local',
'root' => storage_path('app/public'), // 'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage', // 'url' => env('APP_URL').'/storage',
'visibility' => 'public', // 'visibility' => 'public',
], //],
's3' => [ 's3' => [
'driver' => 's3', 'driver' => 's3',

0
config/mail.php Normal file → Executable file
View File

0
config/queue.php Normal file → Executable file
View File

0
config/services.php Normal file → Executable file
View File

0
config/session.php Normal file → Executable file
View File

0
config/view.php Normal file → Executable file
View File

0
database/.gitignore vendored Normal file → Executable file
View File

0
database/factories/ModelFactory.php Normal file → Executable file
View File

View File

View File

View File

0
database/seeds/DatabaseSeeder.php Normal file → Executable file
View File

0
docker-compose.dev.yml Normal file → Executable file
View File

0
docker-compose.yml Normal file → Executable file
View File

0
docker/apache.conf Normal file → Executable file
View File

0
docker/apache.dev.conf Normal file → Executable file
View File

0
download_mediaplayer_plugins.php Normal file → Executable file
View File

0
env.example Normal file → Executable file
View File

0
package-lock.json generated Normal file → Executable file
View File

0
package.json Normal file → Executable file
View File

0
phpunit.xml Normal file → Executable file
View File

0
public/.htaccess Normal file → Executable file
View File

0
public/android-chrome-192x192.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

0
public/android-chrome-512x512.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 183 KiB

After

Width:  |  Height:  |  Size: 183 KiB

0
public/apple-touch-icon.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

0
public/css/airplay.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 606 B

After

Width:  |  Height:  |  Size: 606 B

0
public/css/airplay.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 417 B

After

Width:  |  Height:  |  Size: 417 B

0
public/css/app.css vendored Normal file → Executable file
View File

0
public/css/app.css.map Normal file → Executable file
View File

0
public/css/bootstrap-grid.css vendored Normal file → Executable file
View File

0
public/css/bootstrap-grid.css.map Normal file → Executable file
View File

0
public/css/bootstrap-grid.min.css vendored Normal file → Executable file
View File

0
public/css/bootstrap-grid.min.css.map Normal file → Executable file
View File

0
public/css/chromecast.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 951 B

After

Width:  |  Height:  |  Size: 951 B

0
public/css/chromecast.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

0
public/css/components/posts.css.map Normal file → Executable file
View File

0
public/css/components/pretty_photo.css.map Normal file → Executable file
View File

0
public/css/images/ui-bg_flat_0_aaaaaa_40x100.png Normal file → Executable file
View 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
View 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
View 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
View 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
View File

Before

Width:  |  Height:  |  Size: 272 B

After

Width:  |  Height:  |  Size: 272 B

View File

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 384 B

View File

Before

Width:  |  Height:  |  Size: 387 B

After

Width:  |  Height:  |  Size: 387 B

View File

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 407 B

Some files were not shown because too many files have changed in this diff Show More