diff --git a/2019/event.php b/2019/event.php index febfa33..03f8da2 100644 --- a/2019/event.php +++ b/2019/event.php @@ -1,354 +1,308 @@ . require 'load.php'; $conference = FullConference::factoryFromUID( CURRENT_CONFERENCE_UID ) ->queryRow(); -$conference or die_with_404(); +if( !$conference ) { + die_with_404(); +} $event = FullEvent::factoryByConferenceAndUID( $conference->getConferenceID(), @ $_GET['uid'] )->queryRow(); if( !$event ) { die_with_404(); } -FORCE_PERMALINK and $event->forceEventPermalink(); +if( FORCE_PERMALINK ) { + $event->forceEventPermalink(); +} $args = [ + 'conference' => $conference, 'title' => sprintf( __("%s: %s"), $event->getChapterName(), $event->getEventTitle() ), 'url' => $event->getEventURL() ]; if( $event->hasEventImage() ) { $args['og'] = [ - 'image' => $event->getEventImage() + 'image' => $event->getEventImage( true ), ]; } -// Adding subscribers -$subscribed = null; -if( isset( $_POST['subscription_email'] ) && $event->areEventSubscriptionsAvailable() ) { - $email = $_POST['subscription_email']; - - if( filter_var($email, FILTER_VALIDATE_EMAIL) ) { - $event->addSubscription($email); +template( 'header', $args ); +?> - $args['alert'] = __("Grazie per esserti iscritto."); - $args['alert.type'] = Messagebox::INFO; - $subscribed = true; - } else { - $args['alert'] = __("E-mail non valida."); - $args['alert.type'] = Messagebox::ERROR; - $subscribed = false; - } -} +
+

getEventTitle() ) ?>

-Header::spawn( null, $args ); -?> isEventEditable() ): ?>

getFullEventEditURL(), - __("Modifica evento") . icon('edit', 'left') + __("Modifica") . icon('edit', 'left') ) ?>

+
+
-
+
-
+
<?php
 						echo esc_attr( $event->getEventTitle() )
 					?>
-
+
getTrackName() ?>
getTrackLabel() ?>
getRoomName() ?>
@ getLocationGeoOSM(), - $conference->getLocationName(), + esc_html( $conference->getLocationName() ), $conference->getLocationAddress(), null, 'target="_blank"' ) ?>
- getLocationAddress() ?> + getLocationAddress() ) ?>
getEventHumanStart() ?>
getEventStart('d/m/Y'), $event->getEventStart('H:i') ) ?>
getEventCalURL(), __( "Scarica promemoria calendario" ) ) ?>
+
hasEventAbstract() ): ?> -
-
-

- getEventAbstractHTML( ['p' => 'flow-text'] ) ?> -
+
+
+

+ getEventAbstractHTML( ['p' => 'flow-text'] ) ?> +
+
hasEventDescription() ): ?> -
-
-

- getEventDescriptionHTML( ['p' => 'flow-text'] ) ?> -
+
+

+ getEventDescriptionHTML( ['p' => 'flow-text'] ) ?> +
- - areEventSubscriptionsAvailable() ): ?> -
-
- -

- -
-
-
-
-

-

-
-
- - -
-
- -
-
-
-
-
-
- -
- - - hasEventNote() ): ?> -
-
-

- getEventNoteHTML( ['p' => 'flow-text'] ) ?> -
+
+

+ getEventNoteHTML( ['p' => 'flow-text'] ) ?> +
factorySharebleByEvent() ->queryGenerator(); ?> valid() ): ?> -
-
+

-
+
isSharableDownloadable() ): ?>

getSharablePath(), icon('attachment', 'left') . $sharable->getSharableTitle(['prop' => true]), null, null, 'target="_blank"' ), $sharable->getSharableLicense()->getLink() ) ?>

isSharableVideo() ): ?>

getSharablePath(), icon('share', 'left') . $sharable->getSharableTitle( ['prop' => true] ), null, null, 'target="_blank"' ), $sharable->getSharableLicense()->getLink() ) ?>

-
+
-
-
+

factoryUserByEvent() ->queryGenerator(); ?> valid() ): ?>
-
+
-
+ -
+
getUserURL(), "

{$user->getUserFullname()}

", sprintf( __("Profilo di %s"), $user->getUserFullname() ), 'valign' ) ?>

-
+
factoryPreviousFullEvent() ->select('event_uid', 'event_title', 'chapter_uid', 'conference_uid', 'event_start') ->limit(1) ->queryRow(); $next = $event->factoryNextFullEvent() ->select('event_uid', 'event_title', 'chapter_uid', 'conference_uid', 'event_start') ->limit(1) ->queryRow(); ?> -
-
+
-
+

getEventURL( ROOT ), $previous->getEventTitle() ) ?>

-
+

getEventURL( ROOT ), $next->getEventTitle() ) ?>

-
+
- . /* * This is the boz-php configuration file */ define('CURRENT_CONFERENCE_UID', '2019'); // Boz-PHP: start require '../load.php'; define('CURRENT_CONFERENCE_ROOT', ROOT . _ . CURRENT_CONFERENCE_UID); define('CURRENT_CONFERENCE_URL', URL . _ . CURRENT_CONFERENCE_UID); define('CURRENT_CONFERENCE_ABSPATH', ABSPATH . __ . ROOT . __ . CURRENT_CONFERENCE_UID); // Autoload classes spl_autoload_register( function( $c ) { $path = CURRENT_CONFERENCE_ABSPATH . "/include/class-$c.php"; if( is_file( $path ) ) { require $path; } } ); define('STATIC_PATH', CURRENT_CONFERENCE_ROOT . _ . 'static'); define('STATIC_URL', CURRENT_CONFERENCE_URL . _ . 'static'); define('STATIC_ABSPATH', CURRENT_CONFERENCE_ABSPATH . __ . 'static'); define('SITE_NAME', __("Linux Day Torino 2019") ); define('SITE_NAME_SHORT', __("LDTO2019") ); define('SITE_DESCRIPTION', __("Manifestazione annuale sul software libero ed i sistemi operativi GNU/Linux.") ); -register_js('leaflet.init', STATIC_PATH . '/leaflet-init.js'); + +register_js( 'leaflet.init', STATIC_PATH . '/leaflet-init.js' ); + +define( 'DEFAULT_IMAGE', ROOT . '/2016/static/gnu-linux-on-black.png' ); + require 'include/functions.php'; diff --git a/2019/user.php b/2019/user.php index 4764bea..1f09284 100644 --- a/2019/user.php +++ b/2019/user.php @@ -1,284 +1,290 @@ . require 'load.php'; $conference = FullConference::factoryFromUID( CURRENT_CONFERENCE_UID ) ->queryRow(); -$conference or die_with_404(); +if( !$conference ) { + die_with_404(); +} $user = User::factoryByUID( $_GET['uid'] ) ->queryRow(); -$user or die_with_404(); +if( !$user ) { + die_with_404(); +} -FORCE_PERMALINK && $user->forceUserPermalink(); +if( FORCE_PERMALINK ) { + $user->forceUserPermalink(); +} enqueue_js('jquery'); template( 'header', [ 'conference' => $conference, 'title' => $user->getUserFullname(), 'url' => $user->getUserURL(), 'og' => [ 'image' => $user->getUserImage(), 'type' => 'profile', 'profile:first_name' => $user->user_name, 'profile:last_name' => $user->user_surname ] ] ); ?>

getUserFullName() ) ?>

hasPermissionToEditUser() ): ?>

getUserUID()}", __("Modifica") . icon('edit', 'left') ) ?>

has( User::WEBSITE ) ): ?> <?php
 								echo esc_attr( $user->getUserFullname() )
 							?> has( User::WEBSITE ) ): ?>
user_site ): ?>

user_site, __("Sito personale") . icon('inbox', 'right'), null, 'btn waves-effect purple darken-2', 'target="_blank"' ) ?>

factoryUserSkills() ->queryGenerator(); ?> valid() ): ?>

getSkillCode() ) ?>
hasUserLovelicense() ): ?>
getUserLovelicense() ?>

%s."), $license->getLink() ) ?>

hasUserBio() ): ?>

getUserBioHTML( ['p' => 'flow-text'] ) ?>

whereConference( $conference ) ->whereUser( $user ) ->joinTrackChapterRoom() ->queryGenerator(); ?> valid() ): ?>
getEventURL(), sprintf( "%s", esc_html( $title = $event->getEventTitle() ) ), sprintf( __("Vedi %s"), $title ) ) ?> getChapterName() ) ?> getTrackName() ) ?> getLocationName() ) ?>
getRoomName() ) ?>
%s (il %s)"), $event->getEventStart("H:i"), $event->getEventStart("d/m/Y") ) ?>
getEventHumanStart() ?>

joinLocation() ->whereConferenceNot( $conference ) ->whereUser( $user ) ->orderBy( Event::START, 'DESC' ) ->queryGenerator(); ?> valid() ): ?>

getEventTitle() ) ?> getConferenceTitle() ) ?> getLocationName() ) ?>
%s (il %s)"), $event->getEventStart("H:i"), $event->getEventStart("d/m/Y") ) ?>
getEventHumanStart() ?>
isUserSocial() ): ?>

has( User::RSS ) and UserSocialBox::spawn( $user, "RSS", $user->get( User::RSS ), 'home.png' ); $user->has( User::FACEBOOK ) and UserSocialBox::spawn( $user, "Facebook", $user->getUserFacebruck(), 'facebook_logo.png' ); $user->has( User::GOOGLE_PLUS ) and UserSocialBox::spawn( $user, "Google+", $user->getUserGuggolpluz(), 'google.png' ); $user->has( User::TWITTER ) and UserSocialBox::spawn( $user, "Twitter", $user->getUserTuitt(), 'twitter.png' ); $user->has( User::LINKEDIN ) and UserSocialBox::spawn( $user, "Linkedin", $user->getUserLinkeddon(), 'linkedin.png' ); $user->has( User::GITHUB ) and UserSocialBox::spawn( $user, "Github", $user->getUserGithubbo(), 'github.png' ); ?>