diff --git a/README.md b/README.md index bcc03c3..d6fd6c5 100644 --- a/README.md +++ b/README.md @@ -130,22 +130,3 @@ Clarion ни предоставя JSON интерфейс с всичките н * openfest_home_page() - връща дали е главната страница, поради един проблем, създаден от polylang, заради който is_front_page() не работеше. * of_get_lang(), е_() - wrapper-и около polylang, ако липсва plugin-а. * pn_get_attachment_id_from_url - отмъкната функция, която намира id на attachment от url, трябва при зареждането на снимките на лекторите. - -## Създаване на сайт за ново издание на събитието - -Клонира се последният сайт с помощта на NS Cloner plugin-а от главния админ панел на сайта. За slug на сайта е редно да се използва годината на предстоящото събитие, тъй като това ще бъде "ключ" за графичните елементи (виж по-долу). - -Статусът на всички публикации се слага на "Чернова", за да не се виждат в сайта, но да могат при нужда да се използват за шаблони. - -В **Languages -> Strings translations** трябва да се обнови информация като име и описание на събитието, дати и местоположение на залата. - -За да излезе новият сайт на началната страница, maniax трябва да направи някаква магия в базата, тъй като redirect плъгинът е счупен. - -### Обновяване на визията - -Всяка година се променя визията на сайта. Ако няма намеса в layout-а, е достатъчно да бъдат добавени следните картинки (със съответната година в името): -* `banner-back-2020.jpg` - фон за шапката на сайта -* `banner-bg-2020.png` - надпис на български в/у горния с името на събитието, дати и място -* `banner-en-2020.png` - като горния надпис, но на английски -* `logo-2020.png` - лого на събитието -* `navbg-2020.png` - фон за менюто в най-горната част на сайта. Обикновено е градиент от бяло към основния цвят. \ No newline at end of file diff --git a/css/styles.css b/css/styles.css index c975897..4b28288 100644 --- a/css/styles.css +++ b/css/styles.css @@ -321,18 +321,13 @@ nav .logo { position: absolute; top: 0; left: 0; - z-index: 99 !important; } nav .selected { font-weight: bold; } @media all and (max-width: 840px) { nav .logo { - display: block; - position: relative; - width: 110px; - height: 94px; - margin: 0 auto 15px; + display: none; } nav .logo img { display: block; @@ -406,6 +401,7 @@ nav .selected { padding: 0 0 0 1em; } .grid .col3 { + width: 33%; float: left; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; @@ -602,49 +598,10 @@ footer .content li a { display: inline-block; margin: 0 0 2em 0; } -.sponsors-item .tac a { - display: inline-block; - width: 15em; - height: 9em; - line-height: 9em; - margin-bottom: 0.5em; -} -.sponsors-item .tac a img { - width: auto; - height: auto; - max-width: calc(15em - 0.6em); /* width - (left+right padding) */ - max-height: calc(9em - 0.6em); - padding: 0.3em; - vertical-align: middle; -} -.sponsors-item .tac p { - text-align: justify; -} -.sponsors-frontpage { - text-align: center; -} -.sponsors-frontpage h3, -.sponsors-frontpage .content { - text-align: left; -} .sponsors-frontpage a { display: inline-block; - padding: 0; - margin: 0.3em; - width: calc(15em - 0.6em - 2px); /* width - (left+right margin) - (left+right border) */ - height: calc(9em - 0.6em - 2px); - line-height: calc(9em - 0.6em - 2px); - border: solid 1px #DBDBDB; - text-align: center; -} -.sponsors-frontpage a img { - width: auto; - height: auto; - max-width: calc(15em - 1.2em - 2px); /* width - (left+right margin&padding) - (left+right border) */ - max-height: calc(9em - 1.2em - 2px); - padding: 0.3em; - vertical-align: middle; + padding: 0 2.2em 1em 0; } .sponsors-frontpage p a { display: inline; @@ -742,10 +699,10 @@ a.button:hover { opacity: 0.8; } .program table { width: 99%; } -/* + .program h2 { } -*/ + .program table, .program td, .program tr, .program th { border: 0; } @@ -863,11 +820,10 @@ a.button:hover { opacity: 0.8; } .schedule-social { background: #a6b4de; } -/* .schedule-14 { background: #; } -*/ + /* Advanced technical track 2015 */ .schedule-advanced-technical { background: #DF9959; @@ -975,14 +931,3 @@ footer.entry-footer { height: 100%; border: 0; } -@media all and (max-width: 600px) { - p.info + p { - height: auto; - } -} -section.subtitle_content { - background: #f0f0f0; - padding: 10px; - text-align: justify; - font-weight: bold; -} diff --git a/entry-meta.php b/entry-meta.php index 10ae186..10e9b05 100644 --- a/entry-meta.php +++ b/entry-meta.php @@ -1,2 +1,5 @@
+ + | +
diff --git a/favicon.ico b/favicon.ico index 499d616..c637267 100644 Binary files a/favicon.ico and b/favicon.ico differ diff --git a/footer.php b/footer.php index 6b40e07..f5ba25d 100644 --- a/footer.php +++ b/footer.php @@ -14,17 +14,12 @@ 'footer-schedule', 'items_wrap' => '%3$s
' )); ?>

-

'footer-others', 'items_wrap' => '%3$s
' )); ?>

-

diff --git a/front-page.php b/front-page.php index 18a31a9..6277113 100644 --- a/front-page.php +++ b/front-page.php @@ -6,11 +6,252 @@ } -

'.e_('about_event').''; + // set this to 0 if there is something not working with the stream player code + // (people will still have the Streaming page with all the links to the streams) + if (0) { ?> + + +
+

Streaming |

+

+

+

+ +

+

+ RTMP | HLS +

+

+

+
+ +
+ +
diff --git a/functions.php b/functions.php index ab9b7fb..086f5d3 100644 --- a/functions.php +++ b/functions.php @@ -1,47 +1,12 @@ path, '/'); -} - -// OpenGraph image for FB/Twitter -function og_image( $tags ) { - $blog_slug = get_blog_slug(); - - $imagePath = __DIR__ . '/img/fb_preview_' . $blog_slug . '.jpg'; - - if (file_exists($imagePath)) { - $imageUrl = esc_url('https://www.openfest.org/wp-content/themes/initfest/img/' . basename($imagePath)); - list($width, $height) = getimagesize($imagePath); - - $tags['og:image'] = $imageUrl; - $tags['og:image:width'] = $width; - $tags['og:image:height'] = $height; - $tags['twitter:image'] = $imageUrl; - } - - return $tags; -} -add_filter( 'jetpack_open_graph_tags', 'og_image' ); register_nav_menus( array( 'main-menu' => __( 'Main Menu', 'initfest' ), - 'subnav-menu' => __( 'Sub Navigation', 'initfest'), - 'stream-menu' => __('Stream Menu', 'initfest'), + 'subnav-menu' => __( 'Sub Navigation', 'initfest'), 'footer-openfest' => __('OpenFest', 'initfest'), 'footer-openfest' => __('OpenFest', 'initfest'), 'footer-schedule' => __('Schedule', 'initfest'), @@ -70,12 +35,12 @@ function sh_latest_posts($atts){ 'cat' => $ncat, 'label' => __('News', 'initfest') ); - + $result = '

'.$atts['label'].' | '.__('see all', 'initfest').'

'; - - + + $news_args = array( 'category_name' => 'news,news-bg', 'numberposts' => 6, 'lang' => of_get_lang() ); - $news = new WP_Query( $news_args ); + $news = new WP_Query( $news_args ); ob_start(); if ( $news->have_posts() ) : @@ -84,11 +49,12 @@ function sh_latest_posts($atts){ ?>

+

|

-
'; endwhile; @@ -97,9 +63,9 @@ function sh_latest_posts($atts){ $result .= ob_get_contents(); $result .='
'; ob_end_clean(); - + return $result; - + } @@ -107,9 +73,9 @@ function sh_latest_posts($atts){ function sponsors_shortcode() { $result= '

'.pll__('Спонсори').'

'; - + $sponsors_args = array( 'post_type' => 'sponsors', 'orderby' => 'rand', 'nopaging' => 'true'); - $sponsors = new WP_Query( $sponsors_args ); + $sponsors = new WP_Query( $sponsors_args ); ob_start(); @@ -142,9 +108,9 @@ function sponsors_shortcode() { function partners_shortcode() { $result= '

'.pll__('Партньори').'

'; - + $sponsors_args = array( 'post_type' => 'sponsors', 'orderby' => 'rand', 'nopaging' => 'true' ); - $sponsors = new WP_Query( $sponsors_args ); + $sponsors = new WP_Query( $sponsors_args ); ob_start(); @@ -174,12 +140,12 @@ function partners_shortcode() { } -# Create shortcode for transport methods +# Create shortcode for transport methods function transport_shortcode() { $result= '

'.pll__('Място').': '.pll__('VENUE_LOCATION').'

'; $transport_args = array( 'post_type' => 'transportation' ); - $transport = new WP_Query( $transport_args ); + $transport = new WP_Query( $transport_args ); ob_start(); @@ -188,13 +154,13 @@ function transport_shortcode() { ?>

-
get_var( $wpdb->prepare( "SELECT wposts.ID FROM $wpdb->posts wposts, $wpdb->postmeta wpostmeta WHERE wposts.ID = wpostmeta.post_id AND wpostmeta.meta_key = '_wp_attached_file' AND wpostmeta.meta_value = '%s' AND wposts.post_type = 'attachment'", $attachment_url ) ); - + } - + return $attachment_id; } add_action( 'init', 'transportation_posttype' ); @@ -381,24 +347,4 @@ if (function_exists("pll_register_string")) { pll_register_string('high_quality','HIGH_QUALITY'); pll_register_string('all_streams','ALL_STREAMS'); pll_register_string('tba','TBA'); - pll_register_string('feedback','Submit feedback'); - pll_register_string('about_event','about_event'); -} - -add_filter( 'wp_title', 'wpdocs_hack_wp_title_for_home' ); - -/** - * Customize the title for the home page, if one is not set. - * - * @param string $title The original title. - * @return string The title to use. - */ -function wpdocs_hack_wp_title_for_home( $title ) -{ - if ( empty( $title ) && ( is_home() || is_front_page() ) ) { - $title = get_bloginfo('name') . ' | ' . get_bloginfo( 'description' ); - } else { - $title = $title . get_bloginfo( 'tagline' ); - } - return $title; } diff --git a/header.php b/header.php index 6c25726..685831c 100644 --- a/header.php +++ b/header.php @@ -1,7 +1,7 @@ > - + @@ -13,62 +13,29 @@ - - - <?php wp_title( ' | ', true, 'right' ) ?> + + + <?php is_front_page() ? (bloginfo('name').e_(' | ').e_('Да споделим свободата')) : wp_title( ' | ', true, 'right' ); ?> - + '; - } else { - echo "
'; - #echo ''; - } else if ($blog_slug == "2021") { - //echo ''; - //if (of_get_lang() == "en") { - // echo ''; - //} else { - // echo ''; - //} - - echo ''; - - - } else if ($blog_slug == '2023') { - echo ''; - - } else { - echo ''; - } + echo ''; } ?> diff --git a/html/about.html b/html/about.html index 6b4f82f..e9992c0 100644 --- a/html/about.html +++ b/html/about.html @@ -1,7 +1,7 @@ - + @@ -13,12 +13,12 @@ - + OpenFest - + @@ -95,7 +95,7 @@ OpenFest e единствената по рода си в България ко С автобус:
Автобус №413, името на спирката е СТЦ Интерпред. Автобусът тръгва от Централна гара.
Разписание и маршрут.



-
augenpflege von clinique
+
View Larger Map
@@ -144,4 +144,4 @@ OpenFest e единствената по рода си в България ко - \ No newline at end of file + diff --git a/html/index.html b/html/index.html index f2a3b40..5eff1ca 100644 --- a/html/index.html +++ b/html/index.html @@ -1,7 +1,7 @@ - + @@ -13,12 +13,12 @@ - + OpenFest - + @@ -115,7 +115,7 @@ С автобус:
Автобус №413, името на спирката е СТЦ Интерпред. Автобусът тръгва от Централна гара.
Разписание и маршрут.



-
augenpflege von clinique
+
View Larger Map - \ No newline at end of file + diff --git a/html/speakers.html b/html/speakers.html index 49e6df8..766b3d0 100644 --- a/html/speakers.html +++ b/html/speakers.html @@ -1,7 +1,7 @@ - + @@ -13,12 +13,12 @@ - + OpenFest - + @@ -57,23 +57,23 @@

Васил Колев

- Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието. + Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.
-
+

Васил Колев

- Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието. + Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.
-
+
@@ -84,7 +84,7 @@ -
+

@@ -111,7 +111,7 @@ С автобус:
Автобус №413, името на спирката е СТЦ Интерпред. Автобусът тръгва от Централна гара.
Разписание и маршрут.



-
augenpflege von clinique
+
View Larger Map @@ -160,4 +160,4 @@ - \ No newline at end of file + diff --git a/html/team.html b/html/team.html index 87d09cc..3cd3d37 100644 --- a/html/team.html +++ b/html/team.html @@ -1,7 +1,7 @@ - + @@ -13,12 +13,12 @@ - + OpenFest - + @@ -112,23 +112,23 @@

Васил Колев

- Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието. + Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.
-
+

Васил Колев

- Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието. + Васил Колев е третият ветеран в екипа. Всяка година на неговите плещи лежат безпроблемното функциониране на мрежата и видео записването на събитието.
-
+
@@ -139,7 +139,7 @@ -
+

@@ -166,7 +166,7 @@ С автобус:
Автобус №413, името на спирката е СТЦ Интерпред. Автобусът тръгва от Централна гара.
Разписание и маршрут.



-
augenpflege von clinique
+
View Larger Map @@ -219,4 +219,4 @@ - \ No newline at end of file + diff --git a/img/banner-back-2019.jpg b/img/banner-back-2019.jpg deleted file mode 100644 index 8b25398..0000000 Binary files a/img/banner-back-2019.jpg and /dev/null differ diff --git a/img/banner-back-2020.jpg b/img/banner-back-2020.jpg deleted file mode 100644 index 680b00d..0000000 Binary files a/img/banner-back-2020.jpg and /dev/null differ diff --git a/img/banner-back-2021.jpg b/img/banner-back-2021.jpg deleted file mode 100644 index 917f716..0000000 Binary files a/img/banner-back-2021.jpg and /dev/null differ diff --git a/img/banner-back-2021.svg b/img/banner-back-2021.svg deleted file mode 100644 index a7b5131..0000000 --- a/img/banner-back-2021.svg +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/img/banner-back-2022.jpg b/img/banner-back-2022.jpg deleted file mode 100644 index 0b5c489..0000000 Binary files a/img/banner-back-2022.jpg and /dev/null differ diff --git a/img/banner-back-2022.png b/img/banner-back-2022.png deleted file mode 100644 index a6c6dc9..0000000 Binary files a/img/banner-back-2022.png and /dev/null differ diff --git a/img/banner-back-2023.png b/img/banner-back-2023.png deleted file mode 100644 index 866fa1f..0000000 Binary files a/img/banner-back-2023.png and /dev/null differ diff --git a/img/banner-bg-2019.png b/img/banner-bg-2019.png deleted file mode 100644 index 1d1fd3f..0000000 Binary files a/img/banner-bg-2019.png and /dev/null differ diff --git a/img/banner-bg-2020.png b/img/banner-bg-2020.png deleted file mode 100644 index 9895bd7..0000000 Binary files a/img/banner-bg-2020.png and /dev/null differ diff --git a/img/banner-bg-2021.png b/img/banner-bg-2021.png deleted file mode 100644 index 2ce0959..0000000 Binary files a/img/banner-bg-2021.png and /dev/null differ diff --git a/img/banner-bg-2021.svg b/img/banner-bg-2021.svg deleted file mode 100644 index 0f2f73b..0000000 --- a/img/banner-bg-2021.svg +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/img/banner-bg-2022.png b/img/banner-bg-2022.png deleted file mode 100644 index 8dc8bea..0000000 Binary files a/img/banner-bg-2022.png and /dev/null differ diff --git a/img/banner-bg-2023.png b/img/banner-bg-2023.png deleted file mode 100644 index 997c265..0000000 Binary files a/img/banner-bg-2023.png and /dev/null differ diff --git a/img/banner-en-2019.png b/img/banner-en-2019.png deleted file mode 100644 index dd74634..0000000 Binary files a/img/banner-en-2019.png and /dev/null differ diff --git a/img/banner-en-2020.png b/img/banner-en-2020.png deleted file mode 100644 index ff23e4f..0000000 Binary files a/img/banner-en-2020.png and /dev/null differ diff --git a/img/banner-en-2021.png b/img/banner-en-2021.png deleted file mode 100644 index 253c1bd..0000000 Binary files a/img/banner-en-2021.png and /dev/null differ diff --git a/img/banner-en-2022.png b/img/banner-en-2022.png deleted file mode 100644 index f71a168..0000000 Binary files a/img/banner-en-2022.png and /dev/null differ diff --git a/img/fb_preview_2020.jpg b/img/fb_preview_2020.jpg deleted file mode 100644 index 9b6a52a..0000000 Binary files a/img/fb_preview_2020.jpg and /dev/null differ diff --git a/img/fb_preview_2021.jpg b/img/fb_preview_2021.jpg deleted file mode 100644 index 21734d4..0000000 Binary files a/img/fb_preview_2021.jpg and /dev/null differ diff --git a/img/fb_preview_2022.jpg b/img/fb_preview_2022.jpg deleted file mode 100644 index ad78f20..0000000 Binary files a/img/fb_preview_2022.jpg and /dev/null differ diff --git a/img/fb_preview_2023.jpg b/img/fb_preview_2023.jpg deleted file mode 100644 index 1f8b430..0000000 Binary files a/img/fb_preview_2023.jpg and /dev/null differ diff --git a/img/logo-2019.png b/img/logo-2019.png deleted file mode 100644 index 7cabd3b..0000000 Binary files a/img/logo-2019.png and /dev/null differ diff --git a/img/logo-2020.png b/img/logo-2020.png deleted file mode 100644 index 2923d06..0000000 Binary files a/img/logo-2020.png and /dev/null differ diff --git a/img/logo-2021.png b/img/logo-2021.png deleted file mode 100644 index 4b832f4..0000000 Binary files a/img/logo-2021.png and /dev/null differ diff --git a/img/logo-2022.png b/img/logo-2022.png deleted file mode 100644 index 1a87e41..0000000 Binary files a/img/logo-2022.png and /dev/null differ diff --git a/img/logo-2023.png b/img/logo-2023.png deleted file mode 100644 index b994965..0000000 Binary files a/img/logo-2023.png and /dev/null differ diff --git a/img/navbg-2019.png b/img/navbg-2019.png deleted file mode 100644 index 2d34161..0000000 Binary files a/img/navbg-2019.png and /dev/null differ diff --git a/img/navbg-2020.png b/img/navbg-2020.png deleted file mode 100644 index 9cde805..0000000 Binary files a/img/navbg-2020.png and /dev/null differ diff --git a/img/navbg-2021.png b/img/navbg-2021.png deleted file mode 100644 index 9702673..0000000 Binary files a/img/navbg-2021.png and /dev/null differ diff --git a/img/navbg.jpg b/img/navbg.jpg index 6ed770c..733d93d 100644 Binary files a/img/navbg.jpg and b/img/navbg.jpg differ diff --git a/index.php b/index.php index 94d2496..154a6a7 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,7 @@
+
diff --git a/page-schedule.php b/page-schedule.php index c9f5bed..58fdc1c 100644 --- a/page-schedule.php +++ b/page-schedule.php @@ -9,16 +9,14 @@ require("schedule-config.php");
'; } ?>

- iCalendar

'; echo $content['schedule']; ?> @@ -42,7 +40,7 @@ if (!empty($content)) { ?> "; get_sidebar(); }; diff --git a/page-streaming.php b/page-streaming.php index 8949c8a..c159dc2 100644 --- a/page-streaming.php +++ b/page-streaming.php @@ -1,27 +1,24 @@ 'stream-menu', 'container_class' => 'content subnav cf' ) ); +//wp_nav_menu( array( 'theme_location' => 'footer-schedule', 'container_class' => 'content subnav cf' ) ); ?> -
- +

-
-
+ + [4], 'hidden_language_tracks' => [], ]; - + $config = [ 2014 => [ 'conferenceId' => 1, @@ -48,46 +48,8 @@ function getSchedConfig($year = 2017) { ], 'hidden_language_tracks' => [42], ], - 2019 => [ - 'conferenceId' => 6, - 'eventTypes' => [ - 'lecture' => 12, - 'workshop' => 11, - ], - 'hidden_language_tracks' => [50], - ], - 2020 => [ - 'conferenceId' => 7, - 'eventTypes' => [ - 'lecture' => 14, - ], - 'hidden_language_tracks' => [59], - ], - 2021 => [ - 'conferenceId' => 8, - 'eventTypes' => [ - 'lecture' => 16, - 'workshop' => 15, - ], - 'hidden_language_tracks' => [66], - ], - 2022 => [ - 'conferenceId' => 9, - 'eventTypes' => [ - 'lecture' => 18, - 'workshop' => 17, - ], - 'hidden_language_tracks' => [73], - ], - 2023 => [ - 'conferenceId' => 10, - 'eventTypes' => [ - 'lecture' => 20, - 'workshop' => 19, - ], - 'hidden_language_tracks' => [78], - ], - ]; + ]; + return array_merge($globalConfig, $config[$year]); } diff --git a/schedule/parse.php b/schedule/parse.php index 076567e..7ada9d4 100644 --- a/schedule/parse.php +++ b/schedule/parse.php @@ -1,19 +1,5 @@ ='); - -if ($strftimeDeprecated) { - require 'php-8.1-strftime.php'; -} - -$strftime = function (...$args) { - global $strftimeDeprecated; - - return $strftimeDeprecated ? PHP81_BC\strftime(...$args) : \strftime(...$args); -}; - function parseData($config, $data) { - global $strftime; - $languages = array( 'en' => array( 'name' => 'English', @@ -24,8 +10,8 @@ function parseData($config, $data) { 'locale' => 'bg_BG.UTF8' ) ); - - if ($data === false) return false; + + if ($data === false) return false; // We need to set these so we actually parse properly the dates. WP fucks up both. date_default_timezone_set('Europe/Sofia'); @@ -35,7 +21,7 @@ function parseData($config, $data) { $data['slots'] = array_filter($data['slots'], function($slot) { return isset($slot['starts_at'], $slot['ends_at'], $slot['hall_id'], $slot['event_id']); }); - + // Collect the slots for each hall, sort them in order of starting $slots = []; $timestamps = []; @@ -48,7 +34,7 @@ function parseData($config, $data) { foreach ($data['halls'] as $hall_id => $hall) { $slots[$hall_id] = []; - + foreach ($data['slots'] as $slot_id => $slot) { if ($slot['hall_id'] !== $hall_id) { continue; @@ -59,11 +45,11 @@ function parseData($config, $data) { if ($etype !== $filtered_type_id && !is_null($filtered_type_id)) { continue; } - + if (!in_array($slot['starts_at'], $timestamps)) { $timestamps[] = $slot['starts_at']; } - + if (!in_array($slot['ends_at'], $timestamps)) { $timestamps[] = $slot['ends_at']; } @@ -73,38 +59,39 @@ function parseData($config, $data) { ksort($slots[$hall_id]); if (empty($slots[$hall_id])) unset($slots[$hall_id]); } - + sort($timestamps); - + // Find all microslots (the smallest time unit) $microslots = []; $lastTs = 0; $first = true; - + foreach ($timestamps as $ts) { if ($first) { $lastTs = $ts; $first = false; continue; } - + if (date('d.m', $lastTs) !== date('d.m', $ts)) { $lastTs = $ts; continue; } - + $microslots[] = [$lastTs, $ts]; $lastTs = $ts; } + // Fill in the event ID for each time slot in each hall $events = []; foreach ($data['halls'] as $hall_id => $hall) { $hall_data = []; - + foreach ($microslots as $timestamps) { $found = false; - + foreach ($data['slots'] as $slot_id => $slot) { if ( $slot['hall_id'] === $hall_id && @@ -117,7 +104,7 @@ function parseData($config, $data) { continue; } } - + $found = true; $hall_data[] = [ 'event_id' => $slot['event_id'], @@ -127,18 +114,20 @@ function parseData($config, $data) { break; } } - + if (!$found) { $hall_data[] = null; } } - - $events[$hall_id] = $hall_data; + + $events[] = $hall_data; } + // Remove halls with no events after filtering - foreach ($events as $i => $event) { + $count = count($events); + for ($i = 0; $i < $count; ++$i) { $hasEvents = false; - foreach ($event as $event_info) { + foreach ($events[$i] as $event_info) { if (!is_null($event_info)) { $hasEvents = true; break; @@ -154,28 +143,29 @@ function parseData($config, $data) { $events = array_map(null, ...$events); // Filter empty slots - foreach($events as $i => $event) { - $hall_count = count($event); + $count = count($events); + for ($i = 0; $i < $count; ++$i) { + $hall_count = count($events[$i]); $hasEvents = false; - + for ($j = 0; $j < $hall_count; ++$j) { - if (!is_null($event[$j]) && $event[$j]['edge']) { + if (!is_null($events[$i][$j]) && $events[$i][$j]['edge']) { $hasEvents = true; continue 2; } } - + if (!$hasEvents) { unset($events[$i]); } } - + // Merge events longer than one slot $prevEventId = []; $prevEventSlot = []; $prevSlotIndex = 0; $first = true; - + foreach ($events as $slot_index => &$events_data) { if ($first) { $prevEventId = array_map(function($event_info) { @@ -186,137 +176,113 @@ function parseData($config, $data) { $first = false; continue; } - + foreach ($events_data as $hall_index => &$event_info) { if (is_null($event_info)) { $prevEventId[$hall_index] = null; $prevEventSlot[$hall_index] = null; continue; } - + if ($event_info['event_id'] !== $prevEventId[$hall_index]) { $prevEventId[$hall_index] = $event_info['event_id']; $prevEventSlot[$hall_index] = null; continue; } - - // We have a long event + + // We have a long event if (is_null($prevEventSlot[$hall_index])) { $prevEventSlot[$hall_index] = $prevSlotIndex; } - - $masterSlotIndex = $prevEventSlot[$hall_index]; - - // check if the events spans on the next day - if (date('d.m', $microslots[$slot_index][0]) !== date('d.m', $microslots[$masterSlotIndex][1])) { - // not sure why this is needed, but it fixes things - $prevEventSlot[$hall_index] = null; - continue; - } - - $master_slot = &$events[$masterSlotIndex][$hall_index]; - + + $master_slot = &$events[$prevEventSlot[$hall_index]][$hall_index]; + if (!array_key_exists('rowspan', $master_slot)) { $master_slot['rowspan'] = 2; } else { ++$master_slot['rowspan']; } - + unset($master_slot); - + $event_info = false; } - + unset($event_info); - + $prevSlotIndex = $slot_index; } - + unset($events_data); - + // Build the HTML $schedule_body = ''; $lastTs = 0; $fulltalks = ''; $hall_ids = []; - $now = time(); - - $known_events = array(); - + foreach ($events as $slot_index => $events_data) { $columns = []; - + if (date('d.m', $microslots[$slot_index][0]) !== date('d.m', $lastTs)) { - $schedule_body .= '' . $strftime('%d %B - %A', $microslots[$slot_index][0]) . ''; + $schedule_body .= '' . strftime('%d %B - %A', $microslots[$slot_index][0]) . ''; } - + $lastTs = $microslots[$slot_index][0]; $lastEventId = 0; $colspan = 1; - + foreach ($events_data as $event_info) { if ($event_info === false) { continue; } - - if (is_null($event_info) || is_null($event_info['event_id'])) { + + if (is_null($event_info['event_id'])) { $columns[] = ' '; continue; } - + if (!in_array($event_info['hall_id'], $hall_ids)) { $hall_ids[] = $event_info['hall_id']; } - + $eid = &$event_info['event_id']; $event = &$data['events'][$eid]; -# var_dump($microslots[$slot_index]); $title = mb_substr($event['title'], 0, $config['cut_len']) . (mb_strlen($event['title']) > $config['cut_len'] ? '...' : ''); $speakers = ''; - + if (count($event['participant_user_ids']) > 0) { $spk = []; foreach ($event['participant_user_ids'] as $uid) { - if (in_array($uid, $config['hidden_speakers']) || empty($data['speakers'][$uid])) { + if (in_array($uid, $config['hidden_speakers']) || empty($data['speakers'][$uid])) { continue; } - $speaker = $data['speakers'][$uid]; - $name = $speaker['first_name'] . ' ' . $speaker['last_name']; - $organisation = empty($speaker['organisation']) ? '' : - ('
/⁠' . $speaker['organisation'] . '⁠/'); - $spk[] = '' . $name . '' . $organisation; + $name = $data['speakers'][$uid]['first_name'] . ' ' . $data['speakers'][$uid]['last_name']; + $spk[] = '' . $name . ''; } - + $speakers = implode (', ', $spk); } - - if ($microslots[$slot_index][0] < $now) { - // talk has already started. Provide feedback links - $fullfb = '

'.pll__('Submit feedback').'

'; - $progfb = '

'.pll__('Submit feedback').'

'; - } else { - $fullfb = ""; - $progfb = ""; - } + $content = '' . htmlspecialchars($title) . '
' . $speakers; - if (!isset($known_events[$eid])) { - //if (!in_array($data['events'][$event_info['event_id']]['track_id'], $config['hidden_language_tracks']) && !isset($known_events[$eid])) { - $fulltalks .= '
'; + // these are done by $eid, as otherwise we get some talks more than once (for example the lunch) + // TODO: fix this, it's broken + if (!in_array($data['events'][$event_info['event_id']]['track_id'], $config['hidden_language_tracks'])) { + $fulltalks .= '
'; + // We don't want '()' when we don't have a speaker name $fulltalk_spkr = strlen($speakers) > 0 ? (' (' . $speakers . ')') : ''; - $fulltalks .= '

' . htmlentities($event['title']) . ' ' . $fulltalk_spkr . '

'; - $fulltalks .= '

' . htmlentities($event['abstract']) . '

'; - $fulltalks .= $fullfb; + $fulltalks .= '

' . $event['title'] . ' ' . $fulltalk_spkr . '

'; + $fulltalks .= '

' . $event['abstract'] . '

'; + $fulltalks .= '

Submit feedback

'; $fulltalks .= '
'; - $known_events[$eid] = $eid; } - if ($eid === $lastEventId) { array_pop($columns); ++$colspan; @@ -326,64 +292,61 @@ function parseData($config, $data) { } $rowspan = array_key_exists('rowspan', $event_info) ? (' rowspan="' . $event_info['rowspan'] . '"') : ''; - + // CSS $cssClasses = []; - + if (!in_array($event['track_id'], $config['hidden_language_tracks'])) { $cssClasses[] = 'schedule-' . $event['language']; } - + $cssClass = $data['tracks'][$event['track_id']]['css_class']; - + if (strlen($cssClass) > 0) { $cssClasses[] = $cssClass; } - + $cssClasses = count($cssClasses) > 0 ? (' class="' . implode(' ', $cssClasses) . '"') : ''; // Render cell - $columns[] = ' 1 ? ' colspan="' . $colspan . '"' : $rowspan) . $cssClasses . '>' . $content . $progfb . ''; - + $columns[] = ' 1 ? ' colspan="' . $colspan . '"' : $rowspan) . $cssClasses . '>' . $content . ''; + $lastEventId = $eid; unset($eid, $event); } - + $schedule_body .= ''; - $schedule_body .= date('H:i', $microslots[$slot_index][0]) . ' - ' . date('H:i', $microslots[$slot_index][1]); + $schedule_body .= strftime('%H:%M', $microslots[$slot_index][0]) . ' - ' . strftime('%H:%M', $microslots[$slot_index][1]); $schedule_body .= ''; $schedule_body .= implode('', $columns); $schedule_body .= ''; } - + $schedule = ''; - + foreach ($data['halls'] as $hall_id => $hall) { if (!in_array($hall_id, $hall_ids)) { continue; } - + $schedule .= ''; } - + $schedule .= ''; $schedule .= $schedule_body; $schedule .= '
' . $hall[$config['lang']] . '
'; - + // Create the legend $legend = ''; - foreach($data['tracks'] as $track_id => $track) { - if ( in_array($track_id, $config['hidden_language_tracks'])) { - continue; - } + foreach($data['tracks'] as $track) { $legend .= '' . $track['name'][$config['lang']] . ''; } foreach ($languages as $code => $lang) { $legend .= '' . $lang['name'] . ''; } - + // Speaker list $gspk = '
'; $fspk = ''; @@ -411,18 +374,18 @@ function parseData($config, $data) { $gspk .= '
'; $fspk .= '
'; - $fspk .= '' . $name . ''; + $fspk .= '' . $name . ''; $fspk .= '

' . $name . '

'; $fspk .= '
'; - + foreach ($types as $type => $param) { if (!empty($speaker[$type])) { $fspk .= ''; } } - + $fspk .= '
'; - $fspk .= '

' . htmlentities($speaker['biography']) . '

'; + $fspk .= '

' . $speaker['biography'] . '

'; $fspk .= '
'; } diff --git a/schedule/php-8.1-strftime.php b/schedule/php-8.1-strftime.php deleted file mode 100644 index d092030..0000000 --- a/schedule/php-8.1-strftime.php +++ /dev/null @@ -1,217 +0,0 @@ - - */ -function strftime (string $format, $timestamp = null, ?string $locale = null) : string { - if (!($timestamp instanceof DateTimeInterface)) { - $timestamp = is_int($timestamp) ? '@' . $timestamp : (string) $timestamp; - - try { - $timestamp = new DateTime($timestamp); - } catch (Exception $e) { - throw new InvalidArgumentException('$timestamp argument is neither a valid UNIX timestamp, a valid date-time string or a DateTime object.', 0, $e); - } - } - - $timestamp->setTimezone(new DateTimeZone(date_default_timezone_get())); - - if (empty($locale)) { - // get current locale - $locale = setlocale(LC_TIME, '0'); - } - // remove trailing part not supported by ext-intl locale - $locale = preg_replace('/[^\w-].*$/', '', $locale); - - $intl_formats = [ - '%a' => 'EEE', // An abbreviated textual representation of the day Sun through Sat - '%A' => 'EEEE', // A full textual representation of the day Sunday through Saturday - '%b' => 'MMM', // Abbreviated month name, based on the locale Jan through Dec - '%B' => 'MMMM', // Full month name, based on the locale January through December - '%h' => 'MMM', // Abbreviated month name, based on the locale (an alias of %b) Jan through Dec - ]; - - $intl_formatter = function (DateTimeInterface $timestamp, string $format) use ($intl_formats, $locale) { - $tz = $timestamp->getTimezone(); - $date_type = IntlDateFormatter::FULL; - $time_type = IntlDateFormatter::FULL; - $pattern = ''; - - switch ($format) { - // %c = Preferred date and time stamp based on locale - // Example: Tue Feb 5 00:45:10 2009 for February 5, 2009 at 12:45:10 AM - case '%c': - $date_type = IntlDateFormatter::LONG; - $time_type = IntlDateFormatter::SHORT; - break; - - // %x = Preferred date representation based on locale, without the time - // Example: 02/05/09 for February 5, 2009 - case '%x': - $date_type = IntlDateFormatter::SHORT; - $time_type = IntlDateFormatter::NONE; - break; - - // Localized time format - case '%X': - $date_type = IntlDateFormatter::NONE; - $time_type = IntlDateFormatter::MEDIUM; - break; - - default: - $pattern = $intl_formats[$format]; - } - - // In October 1582, the Gregorian calendar replaced the Julian in much of Europe, and - // the 4th October was followed by the 15th October. - // ICU (including IntlDateFormattter) interprets and formats dates based on this cutover. - // Posix (including strftime) and timelib (including DateTimeImmutable) instead use - // a "proleptic Gregorian calendar" - they pretend the Gregorian calendar has existed forever. - // This leads to the same instants in time, as expressed in Unix time, having different representations - // in formatted strings. - // To adjust for this, a custom calendar can be supplied with a cutover date arbitrarily far in the past. - $calendar = IntlGregorianCalendar::createInstance(); - $calendar->setGregorianChange(PHP_INT_MIN); - - return (new IntlDateFormatter($locale, $date_type, $time_type, $tz, $calendar, $pattern))->format($timestamp); - }; - - // Same order as https://www.php.net/manual/en/function.strftime.php - $translation_table = [ - // Day - '%a' => $intl_formatter, - '%A' => $intl_formatter, - '%d' => 'd', - '%e' => function ($timestamp) { - return sprintf('% 2u', $timestamp->format('j')); - }, - '%j' => function ($timestamp) { - // Day number in year, 001 to 366 - return sprintf('%03d', $timestamp->format('z')+1); - }, - '%u' => 'N', - '%w' => 'w', - - // Week - '%U' => function ($timestamp) { - // Number of weeks between date and first Sunday of year - $day = new DateTime(sprintf('%d-01 Sunday', $timestamp->format('Y'))); - return sprintf('%02u', 1 + ($timestamp->format('z') - $day->format('z')) / 7); - }, - '%V' => 'W', - '%W' => function ($timestamp) { - // Number of weeks between date and first Monday of year - $day = new DateTime(sprintf('%d-01 Monday', $timestamp->format('Y'))); - return sprintf('%02u', 1 + ($timestamp->format('z') - $day->format('z')) / 7); - }, - - // Month - '%b' => $intl_formatter, - '%B' => $intl_formatter, - '%h' => $intl_formatter, - '%m' => 'm', - - // Year - '%C' => function ($timestamp) { - // Century (-1): 19 for 20th century - return floor($timestamp->format('Y') / 100); - }, - '%g' => function ($timestamp) { - return substr($timestamp->format('o'), -2); - }, - '%G' => 'o', - '%y' => 'y', - '%Y' => 'Y', - - // Time - '%H' => 'H', - '%k' => function ($timestamp) { - return sprintf('% 2u', $timestamp->format('G')); - }, - '%I' => 'h', - '%l' => function ($timestamp) { - return sprintf('% 2u', $timestamp->format('g')); - }, - '%M' => 'i', - '%p' => 'A', // AM PM (this is reversed on purpose!) - '%P' => 'a', // am pm - '%r' => 'h:i:s A', // %I:%M:%S %p - '%R' => 'H:i', // %H:%M - '%S' => 's', - '%T' => 'H:i:s', // %H:%M:%S - '%X' => $intl_formatter, // Preferred time representation based on locale, without the date - - // Timezone - '%z' => 'O', - '%Z' => 'T', - - // Time and Date Stamps - '%c' => $intl_formatter, - '%D' => 'm/d/Y', - '%F' => 'Y-m-d', - '%s' => 'U', - '%x' => $intl_formatter, - ]; - - $out = preg_replace_callback('/(?format($replace); - } else { - $result = $replace($timestamp, $pattern); - } - - switch ($prefix) { - case '_': - // replace leading zeros with spaces but keep last char if also zero - return preg_replace('/\G0(?=.)/', ' ', $result); - case '#': - case '-': - // remove leading zeros but keep last char if also zero - return preg_replace('/^0+(?=.)/', '', $result); - } - - return $result; - }, $format); - - $out = str_replace('%%', '%', $out); - return $out; -}