168 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
NH Gooi
34f5cfca73 Peter Schavemaker -> Marco Willemse als chef redactie 2025-06-10 15:14:57 +02:00
NH Gooi
676569256e Fix dubbele header redacite 2025-06-06 14:46:09 +02:00
NH Gooi
5cd69739e5 Inhoud aanpassingen redactie 2025-06-06 14:19:34 +02:00
NH Gooi
b24fdc8e41 Chef redactie -> Peter 2025-05-19 18:44:51 +02:00
NH Gooi
e12fcf8ad7 Oproep agendaitems toegevoegd 2025-05-07 08:33:36 +02:00
NH Gooi
5b4b0011ea Add header block type to block_story 2025-04-01 10:04:47 +02:00
NH Gooi
5e3604da33 Preview functionality for unpublished articles 2025-03-29 21:29:13 +01:00
NH Gooi
aec6690c9e Controller::API() returns null on error, so we can return 404 instead of 500. 2025-03-19 22:18:22 +01:00
NH Gooi
3e7490531d Merge remote-tracking branch 'origin/dev' 2025-03-18 21:54:01 +01:00
NH Gooi
c7243f31a0 Render articles directly from block source instead of prerendered text 2025-03-18 21:53:01 +01:00
NH Gooi
2e1f496eea Render articles directly from block source instead of prerendered text 2025-03-18 21:51:18 +01:00
NH Gooi
92c66e4ed9 Adverteren-pagina aangepasT 2025-02-04 21:18:13 +01:00
NH Gooi
37745e8ae9 Margin toegevoegd op div.text in post, want intranet editor maakt geen p tags 2025-01-04 17:51:04 +01:00
NH Gooi
eb9813c239 Contactinfo aangepast 2024-12-21 11:31:11 +01:00
NH Gooi
9dc9b30afa Regionieuws lengte - 4 samples per seconde 2024-12-16 20:40:43 +01:00
NH Gooi
761cec4257 Laad 'meer fragmenten' in de juiste container 2024-12-16 20:27:47 +01:00
NH Gooi
0e2148956f Regionieuws waveform gefixt 2024-12-07 18:37:57 +01:00
1863ff766f Merge pull request 'Correcties voor banner placement' (#10) from dev into main
Reviewed-on: #10
2024-12-06 17:45:27 +01:00
96748c0c01 fix: center sidebar banner on mobile 2024-12-06 14:58:16 +01:00
c16a2db01d fix: set correct margin on banner 2024-12-06 14:54:51 +01:00
df4d48a327 fix: remove extra margin above banner 2024-12-06 14:49:26 +01:00
187fc7b273 fix: small styling fixes for sidebar banner 2024-12-06 14:46:28 +01:00
06e7741d3b fix: less space above homepage banner 2024-12-06 14:15:18 +01:00
262aec618b fix: build was not run properly 2024-12-06 14:05:30 +01:00
98a9cd2c53 fix: center banners on mobile 2024-12-06 14:02:56 +01:00
21ca729958 fix: placement of mobile banner 2024-12-06 13:49:31 +01:00
367527098d Merge pull request 'Add mobile header banner' (#9) from dev into main
Reviewed-on: #9
2024-12-04 11:15:40 +01:00
a86f8e56a1 fix: show banner full-width on mobile 2024-12-04 10:42:30 +01:00
c1ddaa15c6 fix: only show mobile banner on mobile 2024-12-04 10:27:15 +01:00
39f1ee4823 feat: add mobile banner to header 2024-12-04 08:07:46 +01:00
71a5d3a690 fix: add mobile banner 2024-12-02 12:09:22 +01:00
NH Gooi
6db6de8e49 Artiest en titel omgedraaid in nustraks 2024-11-28 21:45:17 +01:00
NH Gooi
e06ce1507b Revive URL en ID via .env 2024-11-28 21:09:07 +01:00
3ef630c7cc fix: correct margin for homepage banner 2024-11-25 20:57:49 +01:00
2ba81f8550 fix: add leaderboard on homepage 2024-11-25 20:52:33 +01:00
f3fa2c109a fix: add margin to header banner 2024-11-25 20:49:31 +01:00
52df85716b fix: move new styling into scss files 2024-11-25 20:47:18 +01:00
22292e10ed fix: add banner styling 2024-11-25 20:03:11 +01:00
9428e1d2ee fix: move ad prefix to banner system 2024-11-25 19:44:07 +01:00
1c587684f3 fix: enable banners by default 2024-11-25 19:30:18 +01:00
918255be1c feat: update banners with new system 2024-11-25 19:28:35 +01:00
NH Gooi
35a5aa636f Merge branch 'main' into dev 2024-11-12 14:17:24 +01:00
NH Gooi
e2551b1dab Podcast toegevoegd, NH Gooi -> NHGooi 2024-11-12 14:16:01 +01:00
NH Gooi
552c638571 Agenda items kon niet doorklikken 2024-10-20 18:02:20 +02:00
NH Gooi
a930fb7216 Merge remote-tracking branch 'origin/main' into dev 2024-10-03 19:33:29 +02:00
NH Gooi
58ea5c0c85 iframe blocktype toegevoegd [#00033] 2024-10-03 19:32:44 +02:00
NH Gooi
8616cb3d56 Relatieve links gefixt in Lees Ook blok 2024-10-03 19:22:25 +02:00
NH Gooi
dbca7e2bc5 Composer autoload opnieuw gegenereerd 2024-09-29 19:10:40 +02:00
NH Gooi
437e6243e7 Merge branch 'feature/api-to-repo' into dev 2024-09-29 19:06:46 +02:00
NH Gooi
9698f9b103 Model classes van API repo naar deze repo verplaatst 2024-09-29 19:05:03 +02:00
NH Gooi
6008d3175b Merge remote-tracking branch 'origin/main' into dev 2024-09-25 21:19:15 +02:00
NH Gooi
8d1e79f1b7 API eindpunt iets aangepast 2024-09-25 21:18:36 +02:00
NH Gooi
ab7246e123 Merge remote-tracking branch 'origin/main' into dev 2024-09-25 17:32:04 +02:00
NH Gooi
d9627a54c4 Player styling verplaatst naar style.css 2024-09-25 17:32:00 +02:00
NH Gooi
6c732f90e8 Wavesurfer voor audio file player 2024-09-25 17:30:15 +02:00
NH Gooi
1dadbc62af WaveSurfer player voor podcasts, voor live WIP 2024-09-24 17:29:57 +02:00
NH Gooi
7f07a28b98 On air indicator in programmering 2024-09-23 22:02:53 +02:00
NH Gooi
cff9948dda Now playing aangepast tijdens live programma 2024-09-21 13:56:45 +02:00
NH Gooi
059b1ed47a Merge remote-tracking branch 'origin/dev' 2024-09-19 12:24:22 +02:00
NH Gooi
0699269fb2 Verwijder blogs want die gaven een fout 2024-09-19 12:17:33 +02:00
NH Gooi
a3e8b05008 Fix duplicate route 2024-09-12 15:48:21 +02:00
NH Gooi
389e5c6523 Fix duplicate route 2024-09-12 15:47:20 +02:00
ba06608ee0 Merge pull request 'release/live to main' (#7) from release/live into main
Reviewed-on: #7
2024-09-12 15:08:56 +02:00
8da0481296 Merge pull request 'release/dev to release/live' (#6) from release/dev into release/live
Reviewed-on: #6
2024-09-12 15:06:33 +02:00
885ce2b2cc Merge pull request 'Pull new-api into release/dev' (#5) from new-api into release/dev
Reviewed-on: #5
2024-09-12 15:04:09 +02:00
NH Gooi
6d91e1d3ca Uitgelicht podcast [#00028] 2024-09-12 14:06:28 +02:00
NH Gooi
5ebf7f20be API ondersteunt /stream en /download 2024-09-12 13:45:41 +02:00
NH Gooi
cc1eba5959 Luister popout gefixt 2024-09-10 20:54:56 +02:00
NH Gooi
3b55a1cf42 Spelling 2024-09-10 20:48:42 +02:00
NH Gooi
f4444d44e3 Lettertype en overflow fragment gefixt 2024-09-07 10:50:40 +02:00
NH Gooi
35713d2974 Parse ...Z date strings to local time correctly 2024-09-06 10:41:21 +02:00
NH Gooi
6044a670d7 Merge remote-tracking branch 'origin/release/live' into new-api 2024-07-04 14:49:44 +02:00
NH Gooi
173d9dcaf6 Favicon vervangen 2024-07-04 14:48:57 +02:00
NH Gooi
a7d1347319 Merge remote-tracking branch 'origin/release/live' into new-api 2024-07-02 21:11:07 +02:00
NH Gooi
92769463cd 500 error opgelost, dubbel Nieuws item uit menu gehaald 2024-07-02 21:09:54 +02:00
NH Gooi
47eb0952d4 Merge remote-tracking branch 'origin/release/live' into new-api 2024-07-02 17:25:40 +02:00
NH Gooi
e7bae27951 Podcasts en fragment gemist gescheiden 2024-07-02 17:23:50 +02:00
NH Gooi
50d6a97fce Regioagenda naar streekagenda hernoemd 2024-07-02 17:23:38 +02:00
NH Gooi
9d96efc022 Merge remote-tracking branch 'origin/release/live' into new-api 2024-07-02 15:33:38 +02:00
NH Gooi
539dd88d42 Content wijzigingen voor Petra en Leon plus een kleine CSS fix op toolbar 2024-07-02 15:32:48 +02:00
NH Gooi
d9c933b79a Merge branch 'release/live' into new-api 2024-07-02 15:04:47 +02:00
NH Gooi
84355b1121 Link naar TV aangepast 2024-07-02 14:34:29 +02:00
NH Gooi
70d25c3cea Podcast toegevoegd aan menu 2024-07-02 12:23:21 +02:00
NH Gooi
b628404977 Wijzigingen inhoud op verzoek Leon 2024-07-02 08:46:28 +02:00
NH Gooi
e1823a1322 Add file version to css to avoid agressive caching on Chrome 2024-07-02 08:33:48 +02:00
9364ebecad Merge pull request 'post-go-live' (#3) from post-go-live into release/live
Reviewed-on: #3
2024-07-01 11:48:45 +02:00
NH Gooi
16808e6280 Merge branch 'release/dev' into release/live 2024-07-01 11:43:13 +02:00
NH Gooi
e194e93784 Cookiestatement en privacyverklaring toegevoegd 2024-06-28 15:53:17 +02:00
NH Gooi
e551e55158 Lees ook... alleen laten zien als het naar loakle artikelen verwijst 2024-06-23 23:46:51 +02:00
NH Gooi
2799b1843f Podcasts en lees meer... toegevoegd aan nieuwsartikelen 2024-06-23 23:18:38 +02:00
NH Gooi
52f38b4c00 Inline podcastplayer toegevoegd 2024-06-22 22:58:22 +02:00
NH Gooi
e2f114a7a8 Podcast player embedded obv links in tekst 2024-06-22 22:47:20 +02:00
NH Gooi
cc58f5931c API key toegevoegd voor statistieken 2024-06-20 23:30:13 +02:00
NH Gooi
23d88ac143 Fix API call 2024-06-20 22:10:11 +02:00
NH Gooi
56adc60788 Merge branch 'release/dev' into new-api 2024-06-20 11:28:38 +02:00
NH Gooi
72da998965 TV Programmering toegevoegd 2024-06-20 11:25:43 +02:00
NH Gooi
2db970e8c6 Nieuwe API aanpassingen 2024-06-18 22:04:46 +02:00
NH Gooi
80256669b1 Wijzigingen voor nieuwe API 2024-06-17 23:11:07 +02:00
NH Gooi
738107515c Wijzigingen voor nieuwe API 2024-06-15 22:45:53 +02:00
NH Gooi
e96198bc3d Document aangepast voor Leon 2024-06-02 21:15:16 +02:00
NH Gooi
c5b9e88ad3 TV programmering toegevoegd aan TV menu 2024-05-28 15:32:25 +02:00
Jorit Tijsen
7c05b92703 Show only icons if search is opened 2024-05-17 15:25:40 +02:00
Jorit Tijsen
9ae62ab798 Fix: change background of selected menu item corner for grey background 2024-05-15 14:05:05 +02:00
Jorit Tijsen
d495cdde37 Move class grey_background to parent class 2024-05-14 15:05:39 +02:00
Jorit Tijsen
644d4f9b12 Remove "Deel op Facebook" 2024-05-14 13:47:18 +02:00
Jorit Tijsen
5948154ae1 Merge branch 'release/dev' of https://git.nhgooi.nl/NH_Gooi/nhgooi.nl into release/dev 2024-05-14 13:44:38 +02:00
Jorit Tijsen
d75ab273ff Changed primary menu order
Increase size logo and slogan
Align menu item in bar better
Fix: grey background in menu
2024-05-14 13:44:11 +02:00
NH Gooi
909126c05a Link naar nieuwe podcast toegevoegd 2024-05-13 21:21:17 +02:00
Jorit Tijsen
077fb0236f Change favicon 2024-05-08 15:36:53 +02:00
Jorit Tijsen
ecfbb47f1e Disable banner by env file
Favicon aanpassen
Logo aanpassen + subtitel toevoegd
Tab ‘Nieuws’ uit het menu gehaalt
Menu item ‘Gemist’ in menu plaaten
App uit menu balk
Adverteren toevoegen aan blauwe balk
Wat draait in sidebar NH Gooi Radio Live
Footer tekst
NAW toevoegen aan contact pagina
Op contactpagina: Chef redactie
Delen bericht
2024-05-06 15:08:19 +02:00
Jorit Tijsen
e06ecf297f Fix: calendar image 2024-05-06 13:33:03 +02:00
Jorit Tijsen
684cba6085 Add docker dev 2024-05-06 13:32:23 +02:00
NH Gooi
e0c11c50f5 Update docker files to build correctly in fresh container 2024-04-25 16:26:24 +02:00
34ca1486bd Merge pull request 'Merge release/dev to release/live' (#1) from release/dev into release/live
Reviewed-on: #1
2024-04-25 15:49:00 +02:00
Jorit Tijsen
6220a405a3 Added dummy data to calendar events
Styled calendar pages
2024-04-24 16:57:02 +02:00
Jorit Tijsen
239bff06ce Retry calculate add size if is not working 2024-04-19 15:46:16 +02:00
Jorit Tijsen
8fcd34759f Change sidebar box width to auto 2024-04-19 15:36:14 +02:00
Jorit Tijsen
4db20ca296 Calculate adds sizes
Trim white-spaces for share buttons
Increase header with 1 pixel
2024-04-19 15:25:00 +02:00
Jorit Tijsen
e7459cf026 Added header ad 2024-04-09 11:41:31 +02:00
Jorit Tijsen
26f9a71061 Auto adjust the ads height 2024-04-09 10:31:12 +02:00
Jorit Tijsen
9370b21d84 Small mobile header icons fix 2024-04-09 10:19:22 +02:00
Jorit Tijsen
be485c7300 Add ad version 0.2 2024-04-09 10:15:56 +02:00
Jorit Tijsen
c81ba184b3 Add ad version 0.1 2024-04-08 17:19:26 +02:00
Jorit Tijsen
58e291d0d3 Change adverteren text 2024-04-08 16:31:59 +02:00
Jorit Tijsen
f4ba89a6eb Fix menu on news page 2024-04-08 10:06:55 +02:00
Jorit Tijsen
9c80727a03 Small fixes 2024-04-05 16:07:59 +02:00
Jorit Tijsen
4aa1fef3ad New mobile header
Add job pages
More news button on home page links to news page
Small mobile fixes for new page and other pages
2024-04-03 16:38:10 +02:00
Jorit Tijsen
249f7a7d4c Add favicon
Change logo
Add luister and kijk icons
Tip de streekredactie points to whatsapp 088-8505651
Add s to Podcast
Removed waterschapsverkiezingen from menu
Podcast autoplay disabled
Remove Gooische Courant and NH Nieuws
Changed NH Gooi to Over NH Gooi
Added padding and border-radios to homepage posts
Changed header 12px to 14px
Add now and next programs to homepage
Add new button to programs
Changed contact text
Add fallback image to program guide
Make items height equally in program guide
2024-04-02 17:42:39 +02:00
Jorit Tijsen
cdd394a8d4 Full width feature posts 2024-03-22 16:10:57 +01:00
Jorit Tijsen
6041398e10 Style the job pages
Style the image page
Small fixes
2024-03-22 15:44:34 +01:00
Jorit Tijsen
1d94e7da7f Add some variables to the scss files
Use the period API call for the program schema
2024-03-20 17:54:10 +01:00
Jorit Tijsen
25b3d41bf1 Add scroll to top function
Add share buttons to news item
Add logo to footer
2024-03-20 15:13:59 +01:00
Jorit Tijsen
180c5d01be Fix news title item on mobile 2024-03-20 12:53:28 +01:00
Jorit Tijsen
46a39588de Add minified css style 2024-03-20 12:46:19 +01:00
Jorit Tijsen
fd2b17689c Remove last menu item bottom line 2024-03-20 12:42:52 +01:00
7538 changed files with 4779 additions and 2260 deletions

39
.env.example Normal file
View File

@@ -0,0 +1,39 @@
APP_NAME="NH Gooi"
APP_ENV=production
APP_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
APP_DEBUG=false
APP_LOG_LEVEL=error
APP_URL=https://dev.nhgooi.nl
IMAGE_BASE_URL=https://dev.nhgooi.nl
API_URL=https://api.nhgooi.nl/
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=in-v3.mailjet.com
MAIL_PORT=25
MAIL_USERNAME=mailjet_username
MAIL_PASSWORD=mailjet_password
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
DB_CONNECTION=mysql
DB_HOST=nhgooi.nl
DB_PORT=3306
DB_DATABASE=dbname
DB_USERNAME=6fmstats
DB_PASSWORD=dbpass
CACHE_DRIVER=file
QUEUE_DRIVER=sync

10
Dockerfile Normal file → Executable file
View File

@@ -27,12 +27,12 @@ COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
ADD docker/apache.conf /etc/apache2/sites-enabled/000-default.conf ADD docker/apache.conf /etc/apache2/sites-enabled/000-default.conf
WORKDIR /var/www/html WORKDIR /var/www/html
COPY . /var/www/html # COPY . /var/www/html
RUN mkdir -p storage/framework/{sessions,views,cache,cache/data} && \ RUN mkdir -p storage/framework/{sessions,views,cache,cache/data} && \
chown -R www-data:www-data storage/framework && \ chown -R www-data:www-data storage/framework && \
chmod -R 775 storage chmod -R 775 storage
# RUN php artisan cache:clear && \ RUN php artisan cache:clear && \
# php artisan config:clear && \ php artisan config:clear && \
# php artisan view:clear php artisan view:clear

38
Dockerfile.dev Executable file
View File

@@ -0,0 +1,38 @@
FROM php:8.1-apache
RUN apt-get update \
&& apt-get -y install \
g++ \
libcurl4-gnutls-dev \
libxml2-dev \
libxslt-dev \
libzip-dev \
zlib1g-dev \
msmtp \
unzip \
git \
ssl-cert \
locales \
--no-install-recommends \
&& docker-php-ext-install pdo pdo_mysql mysqli xsl xml zip opcache \
&& a2enmod rewrite ssl proxy proxy_http headers \
&& apt-get purge -y g++ \
&& apt-get autoremove -y \
&& rm -r /var/lib/apt/lists/*
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Update the default apache site with the config we created.
ADD docker/apache.dev.conf /etc/apache2/sites-enabled/000-default.conf
WORKDIR /var/www/html
COPY . /var/www/html
RUN mkdir -p storage/framework/{sessions,views,cache,cache/data} && \
chown -R www-data:www-data storage/framework && \
chmod -R 775 storage
# RUN php artisan cache:clear && \
# php artisan config:clear && \
# php artisan view:clear

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

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

@@ -10,20 +10,20 @@ class CalendarController extends Controller
{ {
parent::registerView($request, 'agenda', $id); parent::registerView($request, 'agenda', $id);
$apiResult = $this->API('agenda/item/' . (int)$id); $apiResult = $this->API('agenda/item/' . (int)$id);
$calendarEvent = new \Model\CalendarEvent($apiResult); $calendarEvent = new \Model\CalendarEvent($apiResult->news);
return view('calendarevent', ['event' => $calendarEvent, 'metadata' => $calendarEvent->metadata]); return view('calendarevent', array_merge($this->getSidebareData(), ['event' => $calendarEvent, 'metadata' => $calendarEvent->metadata]));
} }
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 as $calendarItem) foreach($apiResult->events as $calendarItem)
{ {
$calendar[] = new \Model\CalendarEvent($calendarItem); $calendar[] = new \Model\CalendarEvent($calendarItem);
} }
return view('calendarlist', ['events' => $calendar]); return view('calendarlist', array_merge($this->getSidebareData(), ['events' => $calendar]));
} }
} }

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

@@ -19,9 +19,9 @@ 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) {
@@ -39,39 +39,30 @@ class Controller extends BaseController
View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/')); View::share('apiUrl', $this->API_URL = env('API_URL', 'http://api.6fm.nl/'));
View::share('imgBase', env('IMAGE_BASE_URL', '/')); View::share('imgBase', env('IMAGE_BASE_URL', '/'));
$blogs = $this->getDataFromFileAndConvert('blogs.json', [], '\Model\Blog', 1);
$activeBlog = count($blogs) && $blogs[0]->is_active ? $blogs[0] : null;
View::share('activeBlog', $activeBlog);
//View::share('onAir', file_get_contents(url('onair'))); //View::share('onAir', file_get_contents(url('onair')));
View::composer('widgets.laatstenieuws', function ($view) { View::composer('widgets.laatstenieuws', function ($view) {
$view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem')); $view->with('data', $this->getDataFromFileAndConvert('laatste_nieuws.json', ['news'], '\Model\NewsItem'));
}); });
View::composer('widgets.populairnieuws', function ($view) { View::composer('widgets.populairnieuws', function ($view) {
$view->with('data', $this->getDataFromFileAndConvert('populair_nieuws.json', [], '\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);
$program->start = new \DateTimeImmutable($item_data->start->date, $program->start = self::JsonToDateTime($item_data->start);
new \DateTimeZone($item_data->start->timezone)); $program->end = self::JsonToDateTime($item_data->end);
$program->end = new \DateTimeImmutable($item_data->end->date,
new \DateTimeZone($item_data->end->timezone));
} }
// 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);
$recent->start = new \DateTimeImmutable($item_data->start->date, $recent->start = self::JsonToDateTime($item_data->start);
new \DateTimeZone($item_data->start->timezone)); $recent->end = self::JsonToDateTime($item_data->end);
$recent->end = new \DateTimeImmutable($item_data->end->date,
new \DateTimeZone($item_data->end->timezone));
if (($recent->end < $now) && (!$recent->nonstop) && (!$recent->rerun)) { if (($recent->end < $now) && (!$recent->nonstop) && (!$recent->rerun)) {
$view->with('recent', $recent); $view->with('recent', $recent);
break; break;
@@ -81,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'));
@@ -92,10 +85,17 @@ 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', [], '\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));
} }
protected function registerView(Request $request, $type, $id) protected function registerView(Request $request, $type, $id)
@@ -104,31 +104,34 @@ 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)
{ {
// if (strpos($url, 'nieuws/overzicht') !== false) {
// return json_decode(file_get_contents(__DIR__ . '/../../../storage/app/laatste_nieuws.json'));
// }
// return [];
$arrContextOptions = [ $arrContextOptions = [
'ssl' => [ 'ssl' => [
"verify_peer" => false, "verify_peer" => false,
"verify_peer_name" => false, "verify_peer_name" => false,
], ],
'http' => [
'method' => 'GET',
'header' => 'X-Api-Key: ' . sha1(request()->server('REMOTE_ADDR')) . "\r\n"
. 'X-User-Agent: ' . request()->server('HTTP_USER_AGENT') . "\r\n"
]
]; ];
//\dump($http_response_header);
return json_decode(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;
} }
protected function checkAPI($url) protected function checkAPI($url)
@@ -146,9 +149,10 @@ class Controller extends BaseController
protected static function JsonToDateTime($obj) protected static function JsonToDateTime($obj)
{ {
return new \DateTime($obj->date, new \DateTimeZone($obj->timezone)); 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_') {
@@ -158,14 +162,15 @@ 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 as $_newsItem) { foreach ($apiResult->news as $_newsItem) {
$populair[] = new \Model\NewsItem($_newsItem); $populair[] = new \Model\NewsItem($_newsItem);
} }
@@ -177,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'));
}
} }

16
app/Http/Controllers/HomeController.php Normal file → Executable file
View File

@@ -14,21 +14,17 @@ class HomeController extends Controller
$news = []; $news = [];
foreach ($apiResult->news as $newsItem) { foreach ($apiResult->news as $newsItem) {
$news[] = new \Model\NewsItem($newsItem); $news[] = new \Model\NewsItem($newsItem);
} }
$populair = []; $populair = [];
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=5'); $apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=5');
foreach ($apiResult as $newsItem) { foreach ($apiResult->news as $newsItem) {
$populair[] = new \Model\NewsItem($newsItem); $populair[] = new \Model\NewsItem($newsItem);
} }
$podcasts = []; $apiResult = $this->API('podcast/overzicht?aantal=15');
$apiResult = $this->API('podcast/overzicht?aantal=3'); $index = array_rand($apiResult->podcasts);
$podcast = new \Model\Podcast($apiResult->podcasts[0]); $podcast = new \Model\Podcast($apiResult->podcasts[$index]);
foreach ($apiResult->podcasts as $_podcast) { return view('home', ['populair' => $populair, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
$podcasts[] = new \Model\Podcast($_podcast);
}
return view('home', ['populair' => $populair, 'podcasts' => $podcasts, 'podcast' => $podcast, 'title' => 'Home', 'news' => $news, 'searchURL' => 'nieuws/zoeken']);
} }
} }

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

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

@@ -6,19 +6,19 @@ use Illuminate\Http\Request;
use \Model\JobOpening; use \Model\JobOpening;
class JobsController extends Controller class JobsController extends Controller
{ {
private static function TimestampToDateTime($timestamp) { private static function TimestampToDateTime($timestamp) {
$result = new \DateTime; $result = new \DateTime;
$result->setTimestamp($timestamp); $result->setTimestamp($timestamp);
return $result; return $result;
} }
public function show(Request $request, $id) public function show(Request $request, $id)
{ {
parent::registerView($request, 'nieuws', $id); parent::registerView($request, 'nieuws', $id);
$apiResult = $this->API('vacatures/details/' . $id); $apiResult = $this->API('vacatures/details/' . $id);
$jobsItem = new \Model\JobOpening($apiResult->item); $jobsItem = new \Model\JobOpening($apiResult->item);
return view('jobsitem', ['job' => $jobsItem, 'metadata' => $jobsItem->metadata]); return view('jobsitem', array_merge($this->getSidebareData(), ['job' => $jobsItem, 'metadata' => $jobsItem->metadata]));
} }
public function overview(Request $request) public function overview(Request $request)
@@ -29,17 +29,17 @@ class JobsController extends Controller
private function listJobs(Request $request, $url, $title = null) private function listJobs(Request $request, $url, $title = null)
{ {
$page = (int)$request->get('pagina', 1); $page = (int)$request->get('pagina', 1);
$apiResult = $this->API('vacatures/' . $url . '?pagina=' . (int)max(1, $page)); #$apiResult = $this->API('vacatures/' . $url . '?pagina=' . (int)max(1, $page));
$jobs = []; $jobs = [];
foreach($apiResult->jobs as $jobsItem) #foreach($apiResult->jobs as $jobsItem)
{ #{
$jobs[] = new \Model\JobOpening($jobsItem); # $jobs[] = new \Model\JobOpening($jobsItem);
} #}
return view('jobslist', ['title' => $title, 'jobs' => $jobs]); return view('jobslist', array_merge($this->getSidebareData(), ['title' => $title, 'jobs' => $jobs]));
//return view($request->ajax() ? 'partial/jobslist_small' : ($title == null ? 'home' : 'jobslist'), ['title' => $title, 'jobs' => $jobs, 'searchURL' => 'vacatures/zoeken']); //return view($request->ajax() ? 'partial/jobslist_small' : ($title == null ? 'home' : 'jobslist'), ['title' => $title, 'jobs' => $jobs, 'searchURL' => 'vacatures/zoeken']);
} }
public function bijeenkomst() { public function bijeenkomst() {
return view('kennismakingsbijeenkomst', ['a' => 2]); return view('kennismakingsbijeenkomst', ['a' => 2]);
} }

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

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

@@ -17,27 +17,30 @@ 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);
$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); $newsItem = new \Model\NewsItem($apiResult->news);
switch ($apiResult->version) { switch ($apiResult->version) {
case 1: case 1:
if (!$newsItem->content) return redirect('//nhnieuws.nl/gooi'); if (!$newsItem->content) return redirect('//nhnieuws.nl/gooi');
return view('newsitem', ['news' => $newsItem, 'metadata' => $newsItem->metadata]);
break;
case 2: case 2:
$source = $apiResult->source; if(isset($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)) {
$newsItem->content = $apiResult->source->blocks;
}
return view('newsitem', array_merge($this->getSidebareData(), ['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']));
} }
} }
@@ -65,21 +68,26 @@ class NewsController extends Controller
$id = $request->get('id', ''); $id = $request->get('id', '');
$populair = []; $populair = [];
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=5'); $apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $page) . '&aantal=5');
foreach ($apiResult as $_newsItem) { foreach ($apiResult->news as $_newsItem) {
$populair[] = new \Model\NewsItem($_newsItem); $populair[] = new \Model\NewsItem($_newsItem);
} }
return view('partial/newslist_small', ['id' => $id, 'news' => $populair]); return view('partial/newslist_small', ['id' => $id, 'news' => $populair]);
} }
public function taglist(Request $request, $tag)
{
return $this->listNews($request, 'tag/' . $tag, ucfirst($tag));
}
public function regionlist(Request $request, $region) public function regionlist(Request $request, $region)
{ {
return $this->listNews($request, 'regio/' . $region, ucfirst($region)); return $this->listNews($request, 'tag/' . $region, ucfirst($region));
} }
public function themelist(Request $request, $theme) public function themelist(Request $request, $theme)
{ {
return $this->listNews($request, 'thema/' . $theme, ucfirst($theme)); return $this->listNews($request, 'tag/' . $theme, ucfirst($theme));
} }
public function search(Request $request, $query) public function search(Request $request, $query)
@@ -129,10 +137,16 @@ class NewsController extends Controller
private function listNews(Request $request, $url, $title = null, $id = 'items', $total = null) private function listNews(Request $request, $url, $title = null, $id = 'items', $total = null)
{ {
if ($request->ajax()) {
$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);
} }
@@ -142,7 +156,7 @@ class NewsController extends Controller
} }
$apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1, $apiResult = $this->API('nieuws/populair?pagina=' . (int)max(1,
$page) . ($total ? '&aantal=' . $total : '')); $page) . ($total ? '&aantal=' . $total : ''));
foreach ($apiResult as $newsItem) { foreach ($apiResult->news as $newsItem) {
$populair[] = new \Model\NewsItem($newsItem); $populair[] = new \Model\NewsItem($newsItem);
} }
@@ -169,7 +183,7 @@ class NewsController extends Controller
{ {
$apiResult = $this->API('nieuws/populair'); $apiResult = $this->API('nieuws/populair');
$news = []; $news = [];
foreach ($apiResult as $newsItem) { foreach ($apiResult->news as $newsItem) {
$news[] = new \Model\NewsItem($newsItem); $news[] = new \Model\NewsItem($newsItem);
} }
@@ -178,11 +192,15 @@ class NewsController extends Controller
public function regionieuws() public function regionieuws()
{ {
$data = $this->API('nieuws/regionieuws.json');
return view('listen', [ return view('listen', [
'source' => $this->API_URL . 'nieuws/regionieuws', 'source' => $this->API_URL . 'nieuws/regionieuws.mp3',
'title' => 'Regionieuws', 'title' => 'Regionieuws',
'content' => 'het laatste nieuws uit de regio', 'content' => 'het laatste nieuws uit de regio',
'isStream' => false, 'isStream' => false,
'canDownload' => true]); 'canDownload' => true,
'lengte' => $data->length * 0.25,
'waveform' => $data
]);
} }
} }

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

@@ -29,14 +29,23 @@ class PodcastController extends Controller
$podcasts[] = new \Model\Podcast($podcast); $podcasts[] = new \Model\Podcast($podcast);
} }
return view($request->ajax() ? 'partial.podcastitems' : 'podcastseries', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken'])); return view($request->ajax() ? 'partial.podcastitems' : 'podcastseries', array_merge($viewData, ['podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => true]));
} }
public function podcast(Request $request, $id) public function podcast(Request $request, $id)
{ {
parent::registerView($request, 'podcast', $id); parent::registerView($request, 'podcast', $id);
$apiResult = $this->API('podcast/details/' . (int)$id); $apiResult = $this->API('podcast/details/' . (int)$id);
$podcast = new \Model\Podcast($apiResult); $podcast = new \Model\Podcast($apiResult);
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata]); $podcasts = [];
if($podcast->program) {
$apiResult = $this->API('podcast/programma/' . (int)$podcast->program->id . '?pagina=1&aantal=5');
$podcasts = [];
foreach($apiResult->podcasts as $p)
{
$podcasts[] = new \Model\Podcast($p);
}
}
return view('podcastitem', ['podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'isPodcast' => true]);
} }
} }

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

@@ -9,9 +9,9 @@ class RadioController extends Controller
{ {
public function schedule(Request $request, $date = '') public function schedule(Request $request, $date = '')
{ {
$apiResult = $this->API('programma/schema/week/0'); $start = $date ? (new \DateTime($date))->format('Y-m-d') : (new \DateTime("-2 day"))->format('Y-m-d');
$start = self::JsonToDateTime($apiResult->startdate); $end = $date ? (new \DateTime($date))->modify('+1 day')->format('Y-m-d') : (new \DateTime("+3 day"))->format('Y-m-d');
$end = self::JsonToDateTime($apiResult->enddate); $apiResult = $this->API('programma/schema/periode/' . $start . '/' . $end);
$schedule = []; $schedule = [];
foreach($apiResult->schedule as $program) foreach($apiResult->schedule as $program)
{ {
@@ -49,14 +49,17 @@ class RadioController extends Controller
public function program($id) 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)]); return view('radioprogram', ['program' => new \Model\Program($apiResult)]);
} }
public function podcast(Request $request, $id, $title = '') public function podcast(Request $request, $id, $title = '')
{ {
if($this->checkAPI('podcast/details/' . (int)$id) != "200"){ if($this->checkAPI('podcast/details/' . (int)$id) != "200"){
return view('podcastitem', array_merge($this->getSidebareData(), ['title' => $title, 'podcast' => null, 'metadata' => null, 'related' => [], 'searchURL' => 'gemist/zoeken'])); return view('podcastitem', array_merge($this->getSidebareData(), ['title' => $title, 'podcast' => null, 'metadata' => null, 'related' => [], 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]));
} }
parent::registerView($request, 'podcast', $id); parent::registerView($request, 'podcast', $id);
@@ -71,7 +74,7 @@ class RadioController extends Controller
$podcasts[] = new \Model\Podcast($_podcast); $podcasts[] = new \Model\Podcast($_podcast);
} }
return view($request->ajax() ? 'partial/podcastitems' : 'podcastitem', ['title' => $title, 'podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken']); return view($request->ajax() ? 'partial/podcastitems' : 'podcastitem', ['title' => $title, 'podcast' => $podcast, 'metadata' => $podcast->metadata, 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]);
} }
public function podcasts(Request $request, $programma = null) public function podcasts(Request $request, $programma = null)
@@ -95,7 +98,7 @@ class RadioController extends Controller
{ {
$programs = []; $programs = [];
$now = new \DateTimeImmutable('2 minutes ago'); $now = new \DateTimeImmutable('2 minutes ago');
$page = (int)$request->get('pagina', 1); $page = (int)$request->get('pagina', 1);
$apiResult = $this->API('programma/schema/recent?pagina=' . (int)max(1, $page) . '&aantal=12'); $apiResult = $this->API('programma/schema/recent?pagina=' . (int)max(1, $page) . '&aantal=12');
foreach($apiResult->schedule as $item) { foreach($apiResult->schedule as $item) {
if(!$item->program->nonstop && !$item->program->rerun) { if(!$item->program->nonstop && !$item->program->rerun) {
@@ -107,7 +110,7 @@ class RadioController extends Controller
} }
} }
return view($request->ajax() ? 'partial/programitems' : 'programlist', ['programs' => array_reverse($programs)]); return view($request->ajax() ? 'partial/programitems' : 'programlist', ['programs' => array_reverse($programs), 'isPodcast' => false]);
} }
private function getPodcastList(Request $request, $action, $viewData = []) private function getPodcastList(Request $request, $action, $viewData = [])
@@ -120,7 +123,7 @@ class RadioController extends Controller
$podcasts[] = new \Model\Podcast($podcast); $podcasts[] = new \Model\Podcast($podcast);
} }
return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken'])); return view($request->ajax() ? 'partial/podcastitems' : 'podcastlist', array_merge($viewData, ['id' => 'items-podcasts', 'podcasts' => $podcasts, 'searchURL' => 'gemist/zoeken', 'isPodcast' => false]));
} }
} }

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

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

@@ -14,6 +14,8 @@ class StreamController extends Controller
return view('listen', [ return view('listen', [
'source' => self::$STREAM_URL . 'mp3live', 'source' => self::$STREAM_URL . 'mp3live',
'title' => 'Luister live', 'title' => 'Luister live',
'lengte' => 0,
'waveform' => null,
'content' => 'de live-uitzending van NH Gooi.', 'content' => 'de live-uitzending van NH Gooi.',
'isStream' => true ]); 'isStream' => true ]);
} }
@@ -30,6 +32,17 @@ class StreamController extends Controller
return view('watch', ['title' => 'Kijk NH Gooi Tv Studio', 'stream' => 'https://studiocam.nhgooi.nl/studiocam/live/index.m3u8']); return view('watch', ['title' => 'Kijk NH Gooi Tv Studio', 'stream' => 'https://studiocam.nhgooi.nl/studiocam/live/index.m3u8']);
} }
public function inline(Request $request, $id)
{
$apiResult = $this->API('podcast/details/' . (int)$id);
$podcast = new \Model\Podcast($apiResult);
if(sha1($id . ':' . date('Y-m-d')) != $request->get('auth')) {
// return view('widgets/podcastplayer', ['podcast' => null]);
}
return view('widgets/podcastplayer', ['podcast' => $podcast]);
}
public function podcast(Request $request, $id) public function podcast(Request $request, $id)
{ {
$apiResult = $this->API('podcast/details/' . (int)$id); $apiResult = $this->API('podcast/details/' . (int)$id);
@@ -39,16 +52,23 @@ class StreamController extends Controller
} }
return view('listen', [ return view('listen', [
'source' => $this->API_URL . 'podcast/download' . $apiResult->url . '?auth=' . $podcast->auth, 'source' => $this->API_URL . 'podcast/stream/' . $apiResult->url,
'title' => $podcast->title, 'title' => $podcast->title,
'content' => $podcast->title, 'content' => $podcast->title,
'lengte' => $podcast->duration / 1000,
'waveform' => $podcast->waveform,
'isStream' => false, 'isStream' => false,
'canDownload' => true ]); 'canDownload' => $this->API_URL . 'podcast/download/' . $apiResult->url ]);
} }
public function program(Request $request, $year, $month, $day, $hour, $duration, $offset = 0) { public function program(Request $request, $year, $month, $day, $hour, $duration, $offset = 0) {
$date = (new \DateTimeImmutable())->setDate($year, $month, $day)->setTime($hour, 0, 0); $date = (new \DateTimeImmutable())->setDate($year, $month, $day)->setTime($hour, 0, 0);
$current = $date->add(\DateInterval::createFromDateString($offset . ' hours')); $current = $date->add(\DateInterval::createFromDateString($offset . ' hours'));
$programma = $this->API("programma/details/" . $current->Format("Y/m/d/H"));
if(!$programma->is_beschikbaar) {
return view('listen', ['notAvailable' => true]);
}
$hours = []; $hours = [];
for($i = 0; $i < $duration; $i++) { for($i = 0; $i < $duration; $i++) {
@@ -58,10 +78,12 @@ class StreamController extends Controller
} }
return view('listen', [ return view('listen', [
'source' => $this->API_URL . 'programma/download/' . $current->format('Y/m/d/H') . '/1', 'source' => $this->API_URL . 'programma/stream/' . $current->format('Y/m/d/H'),
'tabs' => $hours, 'tabs' => $hours,
'title' => 'Uitzending terugluisteren', 'title' => 'Uitzending terugluisteren',
'content' => 'de uitzending van ' . $current->format('d-m-Y, H') . ':00 uur', 'lengte' => $programma->waveform->length,
'waveform' => $programma->waveform,
'content' => $programma->programma->name . ' van ' . $current->format('d-m-Y, H') . ':00 uur',
'isStream' => false, 'isStream' => false,
'canDownload' => false ]); 'canDownload' => false ]);
} }
@@ -77,10 +99,10 @@ class StreamController extends Controller
public function kerkdienst(Request $request) { public function kerkdienst(Request $request) {
return view('listen', [ return view('listen', [
'source' => $this->API_URL . 'kerkdienst/download', 'source' => $this->API_URL . 'kerkdienst/stream',
'title' => 'Kerkdienst gemist', 'title' => 'Kerkdienst gemist',
'content' => 'de kerkdienst van afgelopen zondag', 'content' => 'de kerkdienst van afgelopen zondag',
'isStream' => false, 'isStream' => false,
'canDownload' => true ]); 'canDownload' => $this->API_URL . 'kerkdienst/download' ]);
} }
} }

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

23
app/Models/Blog.php Executable file
View File

@@ -0,0 +1,23 @@
<?php
namespace Model;
class Blog extends Model {
public $id;
public $title;
public $description;
public $news_category;
public $start_date;
public $end_date;
public $is_active;
public $url;
public function __construct($data, $images = null, $podcast = null) {
parent::__construct($data);
parent::ConvertToDateTime($this->start_date);
parent::ConvertToDateTime($this->end_date);
$this->url = "/blog/{$this->id}/" . parent::url_slug($this->title);
}
}

67
app/Models/CalendarEvent.php Executable file
View File

@@ -0,0 +1,67 @@
<?php
namespace Model;
class CalendarEvent extends Model {
public $id;
public $title;
public $region;
public $content;
public $starts;
public $ends;
public $images;
public $podcast;
public $video;
public $keywords;
public $url;
public $metadata;
public $tags;
public function __construct($data, $images = null, $podcast = null) {
parent::__construct($data);
parent::ConvertToDateTime($this->starts);
parent::ConvertToDateTime($this->ends);
$this->keywords = null;
if(isset($data->keywords)) {
if(is_array($data->keywords)) {
$this->keywords = $data->keywords;
} else if(trim($data->keywords)) {
$this->keywords = explode(' ', $data->keywords);
}
}
if($podcast)
{
$this->podcast = new \Model\Podcast($podcast);
} else if(isset($data->podcast) && $data->podcast) {
$this->podcast = new \Model\Podcast($data->podcast);
}
$images = ($images != null) ? $images
: (isset($data->images) ? $data->images : null);
if($images) {
$this->images = [];
foreach($images as $image) {
$this->images[] = new NewsImage($image, '/img/news/');
}
}
$this->url = "/agenda/{$this->id}/" . parent::url_slug($this->title);
$this->metadata = (new MetaData())
->set('title', $this->title)
->set('description', strip_tags($this->excerpt()))
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
;
}
public function excerpt() {
$hasImages = isset($this->images) && count($this->images) > 0;
$maxLength = $hasImages ? 200 : 500;
return '<p class="news-excerpt ' . ($hasImages ? 'short' : 'long') . '">' .
substr($this->content, 0, $maxLength) .
(strlen($this->content) > $maxLength ? '...' : '') .
'</p>';
}
}

61
app/Models/JobOpening.php Executable file
View File

@@ -0,0 +1,61 @@
<?php
namespace Model;
class JobOpening extends Model {
public $id;
public $title;
public $content;
public $starts;
public $ends;
public $images;
public $url;
public function __construct($data, $images = null, $podcast = null) {
parent::__construct($data);
parent::ConvertToDateTime($this->starts);
parent::ConvertToDateTime($this->ends);
$this->keywords = null;
if(isset($data->keywords)) {
if(is_array($data->keywords)) {
$this->keywords = $data->keywords;
} else if(trim($data->keywords)) {
$this->keywords = explode(' ', $data->keywords);
}
}
if($podcast)
{
$this->podcast = new \Model\Podcast($podcast);
} else if(isset($data->podcast) && $data->podcast) {
$this->podcast = new \Model\Podcast($data->podcast);
}
$images = ($images != null) ? $images
: (isset($data->images) ? $data->images : null);
if($images) {
$this->images = [];
foreach($images as $image) {
$this->images[] = new NewsImage($image, '/img/news/');
}
}
$this->url = "/vacatures/{$this->id}/" . parent::url_slug($this->title);
$this->metadata = (new MetaData())
->set('title', $this->title)
->set('description', strip_tags($this->excerpt()))
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
;
}
public function excerpt() {
$hasImages = count($this->images) > 0;
$maxLength = $hasImages ? 200 : 500;
return '<p class="news-excerpt ' . ($hasImages ? 'short' : 'long') . '">' .
substr($this->content, 0, $maxLength) .
(strlen($this->content) > $maxLength ? '...' : '') .
'</p>';
}
}

26
app/Models/Kerkdienst.php Executable file
View File

@@ -0,0 +1,26 @@
<?php
namespace Model;
class KerkdienstInstance extends Model {
public $name;
public $start;
public function __construct($data) {
parent::__construct($data);
parent::ConvertToDateTime($this->start);
}
}
class Kerkdienst extends Model {
public $isRunning;
public $previous;
public $next;
public function __construct($data) {
// parent::__construct($data);
$this->isRunning = $data->isRunning;
$this->previous = new KerkdienstInstance($data->previous);
$this->next = new KerkdienstInstance($data->next);
}
}

35
app/Models/MetaData.php Executable file
View File

@@ -0,0 +1,35 @@
<?php
namespace Model;
class MetaData {
private $data = ['type' => 'article', 'locale' => 'nl-nl'];
public function set($prop, $val) {
if($val) {
$this->data[$prop] = $val;
}
return $this;
}
public function append($prop, $val) {
if(array_key_exists($prop, $this->data)) {
$this->data[$prop] .= $val;
}
return $this;
}
public function prepend($prop, $val) {
if(array_key_exists($prop, $this->data)) {
$this->data[$prop] = $val . $this->data[$prop];
}
return $this;
}
public function metaTags() {
foreach($this->data as $prop => $val) {
if($val) {
echo "<meta property=\"og:$prop\" content=\"" . htmlentities($val) . "\" />\n";
}
}
}
}

64
app/Models/Model.php Executable file
View File

@@ -0,0 +1,64 @@
<?php
namespace Model;
class Model {
protected function ConvertToDateTime(&$field) {
if($field) {
// PHP7 JSON-encodes to {date: "", "timezone_type": ..., "timezone": "UTC" }
// In that case $field will be an object
if(is_object($field)) {
$field = ($field->timezone)
? new \DateTimeImmutable($field->date, new \DateTimeZone($field->timezone))
: (new \DateTimeImmutable($field->date));
} else {
// If $field is not an object, assume it's a plain, valid, string
$field = new \DateTime($field);
}
if($field === false || $field->getTimestamp() <= 0) {
// If field had data but is invalid DateTime or is 0000-00-00 00:00, set it to null.
$field = null;
} else {
// If valid, return local timezone
$field->setTimezone(new \DateTimeZone("Europe/Amsterdam"));
}
}
}
public function __construct($data) {
$class = get_class($this);
foreach($data as $key => $val) {
if(property_exists($class, $key)) {
$this->$key = is_string($val) ? stripslashes($val) : $val;
}
}
}
public function url_slug($text) {
// Alles naar kleine letter
$text = strtolower($text);
// Vervang accent-tekens door niet-geaccentueerde versies
// $text = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $text);
$search = explode(",","ç,æ,œ,á,é,í,ó,ú,à,è,ì,ò,ù,ä,ë,ï,ö,ü,ÿ,â,ê,î,ô,û,å,e,i,ø,u");
$replace = explode(",","c,ae,oe,a,e,i,o,u,a,e,i,o,u,a,e,i,o,u,y,a,e,i,o,u,a,e,i,o,u");
$text = str_replace($search, $replace, $text);
// Verwijder alle woorden van 3 letters, behalve BEL (BEL-combinatie etc)
if(strlen($text) > 3) {
$text = preg_replace('/\b(?!bel|fm|nh)([a-z]{1,3})\b/u', '', $text);
}
// Vervang alles dat niet een woord-karakter is (letter, cijfer), een streepje of spatie
if(strlen($text) > 3) {
$text = preg_replace('/[^\w_\-\s]/', '', $text);
}
// Reeksen van één of meer spaties / streepjes vervangen door een enkel streepje
$text = preg_replace('/[\-\s]+/', '-', $text);
// Verwijder alle witruimte / streepjes aan begin en eind
return trim(strtolower($text), '-');
}
}

20
app/Models/NewsImage.php Executable file
View File

@@ -0,0 +1,20 @@
<?php
namespace Model;
class NewsImage extends Model {
public $id;
public $title;
public $author;
public $url;
public function __construct($data, $urlPrefix = '/') {
parent::__construct($data);
// Deserialisatie van JSON heeft url in data,
// lezen uit database heeft file en (als het goed is) urlPrefix
if(isset($data->file)) {
$this->url = $urlPrefix . $data->file;
}
}
}

118
app/Models/NewsItem.php Executable file
View File

@@ -0,0 +1,118 @@
<?php
namespace Model;
require_once "NewsImage.php";
require_once "NewsSource.php";
require_once "MetaData.php";
class NewsItem extends Model {
public $id;
public $title;
public $author;
public $content;
public $published;
public $edited;
public $keywords;
public $source;
public $category;
public $theme;
public $region;
public $tags;
public $podcast;
public $images;
public $video;
public $url;
public $metadata;
public function __construct($data, $images = null, $podcast = null) {
parent::__construct($data);
parent::ConvertToDateTime($this->published);
parent::ConvertToDateTime($this->edited);
if($this->edited && ($this->edited->getTimestamp() - $this->published->getTimestamp() < 1800 /* == 30 minutes */)) {
// If last edit was within grace period, consider it unedited (note: currently RES always saves edited == published on creation)
$this->edited = null;
}
$this->source = null;
if(isset($data->source))
{
if(is_object($data->source))
{
$this->source = new \Model\NewsSource($data->source->title, $data->source->url, $data->source->show);
} else if($data->source) {
$this->source = new \Model\NewsSource($data->source, $data->source_url, $data->showsource);
}
}
if($podcast) {
$this->podcast = new \Model\Podcast($podcast);
} else if(isset($data->podcast) && $data->podcast) {
$this->podcast = new \Model\Podcast($data->podcast);
}
$this->keywords = null;
if(isset($data->keywords)) {
if(is_array($data->keywords) || is_object($data->keywords)) {
$this->keywords = $data->keywords;
} else if(trim($data->keywords)) {
$this->keywords = explode(' ', $data->keywords);
}
}
if(isset($data->region)) {
if(is_object($data->region)) {
$this->region = new \Model\NewsRegion($data->region->title, $data->region->slug);
} else {
$this->region = new \Model\NewsRegion($data->region, $data->region_slug);
}
}
if(isset($data->theme)) {
if(is_object($data->theme)) {
$this->theme = new \Model\NewsRegion($data->theme->title, $data->theme->slug);
} else {
$this->theme = new \Model\NewsRegion($data->theme, $data->theme_slug);
}
}
if(isset($data->tags)) {
foreach($data->tags as $tag) {
$this->theme = new \Model\NewsRegion($tag->titel, $tag->slug);
}
}
$images = ($images != null) ? $images
: (isset($data->images) ? $data->images : null);
if($images) {
$this->images = [];
foreach($images as $image) {
$this->images[] = new NewsImage($image, '/img/news/');
}
}
$this->url = "/nieuws/{$this->id}/" . parent::url_slug($this->title);
$this->metadata = (new MetaData())
->set('title', $this->title)
->set('description', strip_tags($this->excerpt()))
->set('image', isset($this->images) && count($this->images) ? $this->images[0]->url : null )
->set('video', isset($this->video) ? $this->video : null)
->set('audio', isset($this->podcast) ? $this->podcast->url : null)
->set('article:published_time', $this->published->format('r'))
->set('article:modified_time', $this->edited ? $this->edited->format('r') : null)
;
}
public function excerpt() {
$hasImages = isset($this->images) && count($this->images) > 0;
$maxLength = $hasImages ? 200 : 500;
return '<p class="news-excerpt ' . ($hasImages ? 'short' : 'long') . '">' .
substr($this->content, 0, $maxLength) .
(strlen($this->content) > $maxLength ? '...' : '') .
'</p>';
}
}

25
app/Models/NewsSource.php Executable file
View File

@@ -0,0 +1,25 @@
<?php
namespace Model;
class NewsRegion {
public $title;
public $slug;
public function __construct($title, $slug = null) {
$this->title = $title;
$this->slug = $slug ? $slug : strtolower(str_replace(' ', '', $title));
}
}
class NewsSource {
public $title;
public $url;
public $show;
public function __construct($title, $url, $show) {
$this->title = $title;
$this->url = $url;
$this->show = $show;
}
}

94
app/Models/Podcast.php Executable file
View File

@@ -0,0 +1,94 @@
<?php
namespace Model;
require_once "NewsImage.php";
class Podcast extends Model {
public $id;
public $title;
public $content;
protected $soundfilename;
public $created;
public $program;
public $url;
public $auth;
public $download;
public $duration;
public $image;
public $metadata;
public $waveform;
private $key;
public function __construct($data) {
parent::__construct($data);
parent::ConvertToDateTime($this->created);
$this->url = '/' . $this->id . '/' . parent::url_slug($this->title) . '.mp3';
if($this->soundfilename) {
// Only generate when not constructing from a JSON object
$this->key = sha1($this->id . ':' . date('Y-m-d') . ':' . $this->soundfilename);
$this->auth = $this->key;
}
if(isset($data->program)) {
$this->program = null;
if(is_object($data->program)) {
$this->program = new \Model\Program($data->program);
} elseif($data->program) {
$this->program = new \Model\Program(['id' => $data->program, 'name' => $data->program_name, 'description' => $data->program_description]);
}
}
if(isset($data->imagefile)) {
$imagedata = new \stdClass();
$imagedata->id = $this->id;
$imagedata->file = $data->imagefile;
$imagedata->title = $data->imagecaption;
$this->image = new NewsImage($imagedata, '/img/podcast/');
}
if(isset($data->metadata, $data->metadata->waveform)){
$this->waveform = $data->metadata->waveform;
}
$this->metadata = (new MetaData())
->set('title', $this->title)
->set('description', strip_tags($this->excerpt()))
->set('image', isset($this->image) ? $this->image->url : null )
->set('audio', $this->url)
;
}
public function titleWithoutProgram() {
if(!$this->program) { return $this->title; }
return trim(str_replace($this->program->name, '', $this->title), "- \t\n\r\0\x0B");
}
public function isValidAuth($key) {
return ($key == $this->key);
}
public function getSoundfile() {
return '/var/audio/podcast/' . $this->soundfilename;
}
public function formatDuration() {
$seconds = $this->duration / 1000;
$milliseconds = $this->duration % 1000;
$hours = ($seconds > 3600) ? floor($seconds / 3600) : 0;
$seconds %= 3600;
return str_pad($hours, 2, '0', STR_PAD_LEFT)
. gmdate(':i:s', $seconds)
;//. ($milliseconds ? ".$milliseconds" : '') ;
}
public function excerpt() {
$maxLength = 500;
return '<p class="news-excerpt long">' .
substr($this->content, 0, $maxLength) .
(strlen($this->content) > $maxLength ? '...' : '') .
'</p>';
}
}

55
app/Models/Program.php Executable file
View File

@@ -0,0 +1,55 @@
<?php
namespace Model;
class Program extends Model {
public $id;
public $name;
public $tagline;
public $description;
public $email;
public $nonstop;
public $rerun;
public $priority;
public $image;
public $hosts;
public $recent;
public $next;
public function __construct($data) {
parent::__construct($data);
if(isset($data->suffix) && $data->suffix) {
$this->name .= ' ' . $data->suffix;
}
if($this->recent && $this->recent) {
foreach($this->recent as &$recent) {
parent::ConvertToDateTime($recent->starts);
parent::ConvertToDateTime($recent->ends);
}
}
if($this->next && $this->next) {
foreach($this->next as &$next) {
parent::ConvertToDateTime($next->starts);
parent::ConvertToDateTime($next->ends);
}
}
if(isset($data->email) && ($mailComma = strpos($data->email, ',')) !== false) {
$this->email = substr($data->email, 0, $mailComma);
}
if(isset($data->state)) {
$this->nonstop = $data->state == 0;
$this->rerun = $data->state == 3;
}
$this->url = "/{$this->id}/" . parent::url_slug($this->name);
}
public function isSpecial() {
return ($this->priority < 2);
}
}

10
app/Models/ProgramHost.php Executable file
View File

@@ -0,0 +1,10 @@
<?php
namespace Model;
class ProgramHost extends Model {
public $id;
public $name;
public $email;
}

47
app/Models/Track.php Executable file
View File

@@ -0,0 +1,47 @@
<?php
namespace Model;
class Track extends Model {
public $start;
public $itemCode;
public $title;
public $artist;
public $duration;
public $ends;
public $isLayout;
public function __construct($data) {
parent::__construct($data);
parent::ConvertToDateTime($this->start);
parent::ConvertToDateTime($this->ends);
$isLayout = $this->isLayout();
}
private static $IDENTS = ['UURSLUITER' => 'Nieuws', 'NIEUWSOPEN ' => 'Nieuws', 'ANWB' => 'Verkeersinformatie', 'REGIO' => 'Regionieuws', 'CB' => 'Reclame'];
public function isLayout() {
foreach(self::$IDENTS as $ident => $display) {
if(substr($this->itemCode, 0, strlen($ident)) == $ident || substr($this->title, 0, strlen($ident)) == $ident) {
$this->title = $display;
$this->artist = "";
$this->itemCode = '_' . $this->itemCode;
return false;
}
}
if(strlen($this->itemCode) > 0 && ($this->itemCode[0] == 'V')) {
return true;
}
return false;
}
public function ends($ends = null) {
$this->ends = $ends;
}
public function secondsRemaining() {
return ($this->ends) ? ($this->ends->getTimestamp() - time()) : -1;
}
}

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

2
composer.json Normal file → Executable file
View File

@@ -27,7 +27,7 @@
"Database\\Factories\\": "database/factories/", "Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/", "Database\\Seeders\\": "database/seeders/",
"Helpers\\": "app/Helpers", "Helpers\\": "app/Helpers",
"Model\\": "/srv/api/common/classes" "Model\\": "app/Models"
} }
}, },
"autoload-dev": { "autoload-dev": {

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

24
docker-compose.dev.yml Executable file
View File

@@ -0,0 +1,24 @@
version: '3.8'
services:
web:
build:
context: ./
dockerfile: Dockerfile.dev
ports:
- 8080:80
- 8443:443
volumes:
- .:/var/www/html
- ./srv:/srv
db:
image: mysql:5.5
ports:
- "3306:3306"
expose:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: development-password
MYSQL_DATABASE: forge
MYSQL_USER: forge
MYSQL_PASSWORD: secret

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

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

@@ -6,9 +6,9 @@ ServerTokens Prod
<VirtualHost *:80> <VirtualHost *:80>
ServerName localhost ServerName localhost
ServerAdmin support@websight.nl ServerAdmin support@websight.nl
DocumentRoot /var/www/html/public DocumentRoot /var/www/html
<Directory /var/www/html/public/> <Directory /var/www/html/>
Options -Indexes +FollowSymLinks +MultiViews Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All AllowOverride All
Order deny,allow Order deny,allow
@@ -23,7 +23,7 @@ ServerTokens Prod
<VirtualHost *:443> <VirtualHost *:443>
ServerName localhost ServerName localhost
ServerAdmin support@websight.nl ServerAdmin support@websight.nl
DocumentRoot /var/www/html/public DocumentRoot /var/www/html
SSLEngine on SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
@@ -32,7 +32,7 @@ ServerTokens Prod
SSLProtocol All -SSLv2 -SSLv3 SSLProtocol All -SSLv2 -SSLv3
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
<Directory /var/www/html/public/> <Directory /var/www/html/>
Options -Indexes +FollowSymLinks +MultiViews Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All AllowOverride All
Order deny,allow Order deny,allow

46
docker/apache.dev.conf Executable file
View File

@@ -0,0 +1,46 @@
Header set X-Content-Type-Options: "nosniff"
Header set X-Frame-Options: "sameorigin"
ServerTokens Prod
<VirtualHost *:80>
ServerName localhost
ServerAdmin support@websight.nl
DocumentRoot /var/www/html
<Directory /var/www/html/>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/log/apache2/vhost-error.log
CustomLog /var/log/apache2/vhost-access.log combined
</VirtualHost>
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName localhost
ServerAdmin support@websight.nl
DocumentRoot /var/www/html
SSLEngine on
SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
SSLCompression off
SSLProtocol All -SSLv2 -SSLv3
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
<Directory /var/www/html/>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order deny,allow
Allow from all
</Directory>
ErrorLog /var/log/apache2/ssl-vhost-error.log
CustomLog /var/log/apache2/ssl-vhost-access.log combined
</VirtualHost>
</IfModule>

0
download_mediaplayer_plugins.php Normal file → Executable file
View File

39
env.example Executable file
View File

@@ -0,0 +1,39 @@
APP_NAME="NH Gooi"
APP_ENV=production
APP_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
APP_DEBUG=false
APP_LOG_LEVEL=error
APP_URL=https://dev.nhgooi.nl
IMAGE_BASE_URL=https://dev.nhgooi.nl
API_URL=https://api.nhgooi.nl/
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
MAIL_DRIVER=smtp
MAIL_HOST=in-v3.mailjet.com
MAIL_PORT=25
MAIL_USERNAME=mailjet_username
MAIL_PASSWORD=mailjet_password
MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
DB_CONNECTION=mysql
DB_HOST=nhgooi.nl
DB_PORT=3306
DB_DATABASE=dbname
DB_USERNAME=6fmstats
DB_PASSWORD=dbpass
CACHE_DRIVER=file
QUEUE_DRIVER=sync

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

3
package.json Normal file → Executable file
View File

@@ -1,7 +1,10 @@
{ {
"private": true, "private": true,
"scripts": { "scripts": {
"sass": "sass resources/assets/sass:public/css",
"sass-watch": "sass --watch resources/assets/sass:public/css", "sass-watch": "sass --watch resources/assets/sass:public/css",
"sass-minify": "sass resources/assets/sass/style.scss:public/css/style.min.css --style compressed",
"sass-minify-watch": "sass --watch resources/assets/sass/style.scss:public/css/style.min.css --style compressed",
"js-watch": "grunt watch" "js-watch": "grunt watch"
}, },
"devDependencies": { "devDependencies": {

View File

@@ -1 +0,0 @@
<?php phpinfo();

0
phpunit.xml Normal file → Executable file
View File

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

BIN
public/android-chrome-192x192.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
public/android-chrome-512x512.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

BIN
public/apple-touch-icon.png Executable file

Binary file not shown.

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

View File

@@ -1,35 +0,0 @@
div.pp_default .pp_content_container .pp_left,
div.pp_default .pp_content_container .pp_right,
div.pp_default .pp_top .pp_left,
div.pp_default .pp_top .pp_middle,
div.pp_default .pp_top .pp_right,
div.pp_default .pp_bottom .pp_left,
div.pp_default .pp_bottom .pp_middle,
div.pp_default .pp_bottom .pp_right {
background: none;
padding: 0;
}
div.pp_default .pp_content, div.light_rounded .pp_content {
padding: 10px;
}
div.pp_default .pp_description {
font-family: Nunito, serif;
font-size: 12px;
font-style: italic;
line-height: 3.17;
color: #585858;
}
div.pp_default .pp_close {
margin-top: 8px;
background: url("/images/icons/other/close.png") 0 0 no-repeat;
}
div.pp_default .pp_close:hover {
opacity: 1;
background-position: 0 -30px;
}
/*# sourceMappingURL=pretty_photo.css.map */

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

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