diff --git a/README.md b/README.md index 075c0da..6c5e624 100644 --- a/README.md +++ b/README.md @@ -1,205 +1,75 @@ -# Linux Day Torino's website -![Linux Day Torino](https://raw.githubusercontent.com/0iras0r/ld2016/master/2016/static/linuxday-64.png) +# suckless-conference -Content Management System for the __Linux Day Torino__ event, but just from 2016 to 2019 (and beyond we hope!). +Framework based on `suckless-php` to provide some classes useful to build content management systems for conferences. -The [Linux Day](https://www.linuxday.it/) is a yearly Italian event were Italian cities organize free conferences for everyone, talking about GNU/Linux, Free software, open source, and we meet amazing new friends. - -The [Linux Day Torino](https://linuxdaytorino.org/) is just our local implementation, and this project is the related website. +Note that we are still doing some internal refactors. Don't be shy. Just ask. ## Introduction This project allow the centralization of various informations during a set of conferences, while allowing completly different themes for each conference. -This project is designed using GNU/Linux, Apache/nginx, PHP, MySQL/MariaDB and the [suckless-php](https://github.com/valerio-bozzolan/suckless-php) framework. +This project is designed using GNU/Linux, Apache/nginx, PHP, MySQL/MariaDB and the [suckless-php](https://gitpull.it/tag/suckless-php/) framework. We use PHP. Because _PHP does not suck_. PHP it's the best hypertext preprocessor available. It's well-tested; well-known; well-documented; multi-platform; easy to be deployed; powerful; actively developed since 20 years and if you know how to code, it's also drammatically fast and secure. Note that, thanks to PHP, this website has no third party dependency. I mean we use just a stupid framework made by us (10 files). __No Laravel__. No therabytes of NodeJS dependencies. No silly crap. Just this website. So, before talking bad about PHP, shut up. You are a troll. Think about your crapware-hipster-NodeJS/whateverbetter project full of shitty dependencies you do not know how to maintain, kiddo. PHP loves you. Do not be bad with it. :^) -## Quick start Hacking - -To start hacking on this project we suggest the installation of `vagrant` to reproduce our production environment quickly. You should know how to install this package from your favourite GNU/Linux distribution. Then, just run: - - vagrant up - -Then simply follow the instructions from your terminal. - -## Keep project up-to-date - -Too keep the project updated, just run: - - git pull - vagrant provision - -## Quick start on Arch Linux (or anything other than Debian GNU/Linux) - -The virtual machine does not work with VirtualBox. It is also incompatible with Vagrant rsync synced folders. You have to install libvirt, any packages required for NFS and firewalld because libvirt requires a firewall for no apparent reason and the firewall *has* to be firewalld. Which by default blocks libvirt machines from accessing NFS. - -You need a few packages and a Vagrant plugin: - -```bash -pacman -S nfs-utils libvirt firewalld -vagrant plugin install vagrant-libvirt -``` - -Then, to start the VM: - -```bash -systemctl start libvirtd firewalld nfs-server rpcbind -firewall-cmd --zone=libvirt --add-service=nfs -firewall-cmd --zone=libvirt --add-service=mountd -firewall-cmd --zone=libvirt --add-service=rpc-bind -vagrant up --provider=libvirt -``` - -The `firewall-cmd` commands can be made permanent with `--permanent`. - -## Bare-metal installation - -If you don't want to use Vagrant, you can just install Apache or nginx and a MySQL server and run this project as you know. - -In this case follow the installation instructions for Debian GNU/Linux and adapt it to your needs. - -### Bare-metal installation (Debian GNU/Linux) - -On a Debian GNU/Linux `stable` system (actually tested on `stretch`) install a webserver (Apache or nginx, is your choice) and a MysQL database server and some other additional packages: - - apt install apache2 mariadb-server php php-mysql libapache2-mod-php libjs-jquery libjs-leaflet libmarkdown-php - a2enmod rewrite - service apache2 reload - -Place the project files somewhere, available to your webserver: - - cd /var/www/linuxday - git clone [https://... this repo] - -Copy the example [Apache configuration file](documentation/apache/htaccess.conf) and save it as `.htaccess` (e.g. `/var/www/linuxday/.htaccess`). Or if you want nginx obviously we have an [nginx configuration example](documentation/nginx/locations.conf). - -Remember to change the `DocumentRoot` of your Apache configuration file to respect your pathname (e.g. `/var/www/linuxday`). - -Create an empty database with a dedicated user. Then copy the [load-example.php](load-example.php) in a new file called `load.php` and type there your database credentials. Populate your database with the [database-schema.sql](documentation/database/database-schema.sql). - -Place [suckless-php](https://github.com/valerio-bozzolan/suckless-php) somewhere. It is our laser-cannon framework. It consists in just ~23 files. -You can put it in the `includes` directory of the project: - - # apt-get install git - cd includes - git clone https://github.com/valerio-bozzolan/suckless-php - -Now everything should work. - -### Hardening your bare-metal installation - -The website can be kept in read-only for the webserver user, and nothing more. E.g.: - - chown root:www-data -R /var/www/linuxday - chmod o= -R /var/www/linuxday - -You may also want to declare the PHP `open_basedir` directive to the value of `/var/www/linuxday:/usr/share/php` and nothing more to restrict the access to just these files. - -Also you can disable all the unused system calls like `exec()` etc. - -### Installation in a custom subdirectory - -If you want to serve the website from a subdirectory, you can. Just change your `.htaccess` file to fit your needs. Example: - - # RewriteBase / - RewriteBase /linuxday - -In this case also change the related project `ROOT` from your `load.php` file: - - # define( 'ROOT', '' ); - define( 'ROOT', '/linuxday' ); - -## Database import - -To just reset your database to the latest version, just run: - - git pull - vagrant provision - -Or just import the [database-schema.sql](documentation/database/database-schema.sql). - -## Database export - -When you want to export and commit the database, just run: - - vagrant ssh - /vagrant/Vagrant/pull-database.sh - exit - - git status - # ... - ### API The website exposes some REST-ful APIs. The one called _tagliatella_ generates a valid XML document containing all the talks/events (in a format that someone call Pentabarf, but it's not the Pentabarf - really, this stupid format has not even an official name). The _tagliatella_ API gives an HTTP Status Code 500 and some other uncaught exceptions if an error raises. The one called _tropical_ generates a valid `iCal` document to import an Event or a Conference in your favourite calendar client. ## Internationalization The website interface (plus some parts of the content) is internationalized thanks to GNU Gettext. GNU Gettext is both a software and a standard. This is not the place to learn GNU Gettext, but this is how you can use it. ### Translate a string You can edit the `.po` file with Poedit to translate some strings to a language: * [English](l10n/en_US.utf8/LC_MESSAGES/linuxday.po) To apply your changes: vagrant provision Or: vagrant ssh cd /vagrant ./l10n/localize.php . ./l10n/localize.php . exit Note that if you change the database contents you may also need this command before the above one: vagrant ssh cd /vagrant ./l10n/mieti.php > ./l10n/trebbia.php That's all. ### Translate in a new language Copy the [GNU Gettext template](l10n/linuxday.pot) in a new pathname similar to the English one, and also rename it to the `.po` extension. Then in the [load-post.php](includes/load-post.php) file you can add another `register_language()` line. -## Backend - -To access to the backend follow the instructions on your terminal when running: - - vagrant provision - -Or create an User with: - - ./cli/add-user.php --uid=root --role=admin --pwd=secret - -The login page is actually situated in `2016/login.php`. - ## License -(c) 2015 Linux Day contributors, 2016-2019 [Valerio Bozzolan](https://boz.reyboz.it/), [Ludovico Pavesi](https://github.com/lvps), [Rosario Antoci](https://linuxdaytorino.org/2019/user/oirasor), Linux Day contributors +(c) 2015 Linux Day contributors, 2016-2020 [Valerio Bozzolan](https://boz.reyboz.it/), [Ludovico Pavesi](https://github.com/lvps), [Rosario Antoci](https://linuxdaytorino.org/2019/user/oirasor), Linux Day contributors This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the [GNU Affero General Public License](LICENSE.md) for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Thank you for forking this project! Contributions are welcome! If you do any non-minor contribution you are welcome to put your name in the copyright header of your touched file. diff --git a/Vagrant/apache.conf b/Vagrant/apache.conf deleted file mode 100644 index 7ff5c9b..0000000 --- a/Vagrant/apache.conf +++ /dev/null @@ -1,20 +0,0 @@ - - ServerName ldto - ServerAlias localhost 127.0.0.1 - DocumentRoot /vagrant - DirectoryIndex index.php index.html - LogLevel info - - php_admin_flag display_errors 1 - php_admin_flag display_startup_errors 1 - php_admin_flag html_errors 1 - php_admin_value error_reporting -1 - - - # allow a non-standard webserver pathname - Require all granted - - # allow to load the .htaccess file - AllowOverride All - - diff --git a/Vagrant/bootstrap.sh b/Vagrant/bootstrap.sh deleted file mode 100755 index 60e800f..0000000 --- a/Vagrant/bootstrap.sh +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/sh -# Vagrant provision: bootstrap - -# Exit immediately if a command exits with a non-zero status -set -e - -PORT_APACHE=8070 -PORT_NGINX=8071 -DOMAIN=localhost -WELCOME_APACHE=http://"$DOMAIN":"$PORT_APACHE" -WELCOME_NGINX=http://"$DOMAIN":"$PORT_NGINX" -PROJECT=/vagrant -WWW="$PROJECT" -DB_NAME=ldto -DB_PREFIX=ldto_ -SUCKLESS_PHP="$PROJECT"/includes/suckless-php -SUCKLESS_PHP_REPO=https://github.com/valerio-bozzolan/suckless-php.git - -# Very scaring -DB_USER=ldto -DB_PASS=ldto - -# prevent interaction during phpmyadmin installation -echo "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections -echo "phpmyadmin phpmyadmin/app-password-confirm password $DB_PASS" | debconf-set-selections -echo "phpmyadmin phpmyadmin/mysql/admin-pass password $DB_PASS" | debconf-set-selections -echo "phpmyadmin phpmyadmin/mysql/app-pass password $DB_PASS" | debconf-set-selections -echo "phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2" | debconf-set-selections - -# avoid warnings in apt -export DEBIAN_FRONTEND=noninteractive - -apt-get update -apt-get install --yes mariadb-server \ - php \ - php-mysql \ - php-mbstring \ - php-xml \ - apache2 \ - libapache2-mod-php \ - gettext \ - libmarkdown-php \ - libjs-jquery \ - libjs-leaflet \ - git \ - phpmyadmin - -echo "stop apache" -systemctl stop apache2 - -if [ ! -e "$SUCKLESS_PHP" ]; then - git clone "$SUCKLESS_PHP_REPO" "$SUCKLESS_PHP" -else - git -C "$SUCKLESS_PHP" pull -fi - -echo "create a file with database credentials" -cat > "$WWW/load.php" < "$FILE" - -# stripping e-mail addresses -sed "s/'[a-z\.\-]*@[a-z\.\-]*'/NULL/g" -i "$FILE" - -# stripping passwords (now are SHA1 salted) -sed "s/'[a-f0-9]\{40\}'/NULL/g" -i "$FILE" diff --git a/Vagrantfile b/Vagrantfile deleted file mode 100644 index f6b33b1..0000000 --- a/Vagrantfile +++ /dev/null @@ -1,18 +0,0 @@ -Vagrant.configure("2") do |config| - config.vm.box = "debian/stretch64" - - # 80 internal: apache exposed as 8070 - config.vm.network "forwarded_port", guest: 80, host: 8070 - - # 8008 internal: nginx exposed as 8071 - config.vm.network "forwarded_port", guest: 8008, host: 8071 - - config.vm.provision "shell", path: "Vagrant/bootstrap.sh" - - # https://wiki.debian.org/Vagrant#Errors_on_NFS_mount - config.vm.synced_folder ".", "/vagrant", nfs_version: "3" - - # Vagrant merda! - # https://stackoverflow.com/a/42397127 - config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" -end diff --git a/api/tagliatella.php b/api/tagliatella.php deleted file mode 100755 index df61c17..0000000 --- a/api/tagliatella.php +++ /dev/null @@ -1,216 +0,0 @@ -. - -require __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'load.php'; - -// In case something goes wrong... -http_response_code( 500 ); - -$uid = isset( $_GET[ 'conference' ] ) - ? $_GET[ 'conference' ] - : CURRENT_CONFERENCE_UID; - -$conference_row = FullConference::factoryFromUID( $uid ) - ->queryRow(); - -if( ! $conference_row ) { - throw new LogicException( sprintf( - "Conference with uid '%s' does not exists!", - esc_html( $uid ) - ) ); -} - -$xml = new DOMDocument( '1.0', 'UTF-8' ); -$schedule = $xml->createElement( 'schedule' ); -$schedule = $xml->appendChild( $schedule ); -$conference = $xml->createElement( 'conference' ); -$conference = $schedule->appendChild( $conference ); - -$conference_fields = [ - 'title' => $conference_row->getConferenceTitle(), - 'subtitle' => $conference_row->getConferenceSubtitle(), - 'acronym' => $conference_row->get( Conference::ACRONYM ), - 'days' => $conference_row->get( Conference::DAYS ), - 'persons_url' => $conference_row->get( Conference::PERSONS_URL ), - 'events_url' => $conference_row->get( Conference::EVENTS_URL ), -]; - -foreach( $conference_fields as $xml_field => $db_field ) { - add_child( $xml, $conference, $xml_field, $db_field ); -} - -add_child( $xml, $conference, 'start', $conference_row->getConferenceStart( 'Y-m-d H:i:s' ) ); -add_child( $xml, $conference, 'end', $conference_row->getConferenceEnd( 'Y-m-d H:i:s' ) ); -add_child( $xml, $conference, 'city', $conference_row->getLocationAddress() ); -add_child( $xml, $conference, 'venue', $conference_row->getLocationNoteHTML() ); - -// Yes, these are hardcoded. asd -add_child( $xml, $conference, 'day_change', '09:00:00' ); -add_child( $xml, $conference, 'timeslot_duration', '00:30:00' ); - -$events = FullEvent::factoryByConference( $conference_row->getConferenceID() ) - ->orderBy( Event::START ) - ->orderBy( Room::ID_ ) - ->queryGenerator(); - -// Room names indexed by room_ID -$room_names = []; - -$events_by_date_then_room = []; -foreach( $events as $event ) { - - $day = $event->getEventStart( 'Y-m-d' ); - - // Add various levels to the array, if they don't already exists - if( ! isset( $events_by_date_then_room[ $day ] ) ) { - $events_by_date_then_room[ $day ] = []; - } - - $room = $event->getRoomID(); - - if( ! isset( $events_by_date_then_room[ $day ][ $room ] ) ) { - $events_by_date_then_room[ $day ][ $room ] = []; - } - - $room_names[ $room ] = $event->getRoomName(); - - // And finally, add the event itself - $events_by_date_then_room[ $day ][$room ][] = $event; -} - -// These are database event fields whose content can be taken straight from the database. -// Others need a little more work to convert to the correct format. -$keys = [ - 'subtitle' => Event::SUBTITLE, - 'language' => Event::LANGUAGE, -]; - -$day_index = 1; -$events_by_id = []; -foreach( $events_by_date_then_room as $day_date => $rooms ) { - $dayxml = add_child( $xml, $schedule, 'day', NULL ); - $dayxml->setAttribute( 'index', $day_index ); - $dayxml->setAttribute( 'date', $day_date ); - - foreach( $rooms as $room_ID => $events ) { - $roomxml = add_child( $xml, $dayxml, 'room', NULL ); - - // 9 agosto 2016 22:30 Ludovico says that this does not exist. OK. - // 9 agosto 2016 22:31 Ludovico says that this exists. OK. - $roomxml->setAttribute( 'name', $room_names[ $room_ID ] ); - - foreach( $events as $event ) { - $event_ID = $event->getEventID(); - - $eventxml = add_child( $xml, $roomxml, 'event', NULL ); - $eventxml->setAttribute( 'id', $event_ID ); - - $events_by_id[ $event_ID ] = $eventxml; - - // this stops PHPStorm from complaining, but most of these elements are really just strings... - /** @var $event DateTime[] */ - // Same exact format, two different parameters since 'start' is a DateTime and 'duration' a DateInterval. Why, PHP, WHY? - add_child( $xml, $eventxml, 'title', $event->getEventTitle() ); - add_child( $xml, $eventxml, 'slug', $event->getEventUID() ); - add_child( $xml, $eventxml, 'start', $event->getEventStart( 'H:i' ) ); - add_child( $xml, $eventxml, 'duration', $event->getEventDuration( '%H:%I' ) ); - add_child( $xml, $eventxml, 'room', $event->getRoomName() ); - add_child( $xml, $eventxml, 'track', $event->getTrackName() ); - add_child( $xml, $eventxml, 'type', $event->getChapterName() ); - - $description = null; - if( $event->hasEventDescription() ) { - $description = $event->getEventDescriptionHTML(); - } - add_child( $xml, $eventxml, 'description', $description ); - - $abstract = null; - if( $event->hasEventAbstract() ) { - $abstract = $event->getEventAbstractHTML(); - } - add_child( $xml, $eventxml, 'abstract', $abstract ); - - // Add event fields that don't need any further processing - foreach( $keys as $xml_key => $db_key ) { - add_child( $xml, $eventxml, $xml_key, $event->get( $db_key ) ); - } - } - } - - $day_index++; -} - -$people = EventUser::factory() - ->select( [ - Event::ID_, - User::ID_, - User::UID, - User::NAME, - User::SURNAME - ] ) - ->from( [ - Event::T, - User::T, - ] ) - ->whereInt( Conference::ID , $conference_row->getConferenceID() ) - ->equals( EventUser::EVENT_, Event::ID_ ) - ->equals( EventUser::USER_, User ::ID_ ) - ->orderBy( Event::ID ) - ->queryGenerator(); - -$lastid = NULL; -$lastpersons = NULL; -foreach( $people as $row ) { - // This works only because rows are sorted by events - $event_ID = $row->getEventID(); - - if( $lastid !== $event_ID ) { - $event = $event_ID; - $lastid = $event; - - $personsxml = $xml->createElement( 'persons' ); - $personsxml = $events_by_id[ $event ]->appendChild( $personsxml ); - $lastpersons = $personsxml; - } - - $personxml = add_child( $xml, $lastpersons, 'person', $row->getUserFullname() ); - $personxml->setAttribute( 'id', $row->getUserID() ); - $personxml->setAttribute( 'slug', $row->getUserUID() ); -} - -http_response_code( 200 ); -header( 'Content-type: text/xml; charset=' . CHARSET ); -echo $xml->saveXML(); - -// ---------------------------------------------------------------------------- - -/** - * Add child to an element and return it - * - * @param $xml DOMDocument - * @param $parent DOMNode - * @param $tagname string - * @param $content string - * @return DOMElement - */ -function add_child( & $xml, $parent, $tagname, $content ) { - $child = $xml->createElement( $tagname ); - if( null !== $content && '' !== $content ) { - $child->nodeValue = $content; - } - return $parent->appendChild( $child ); -} diff --git a/api/tropical.php b/api/tropical.php deleted file mode 100644 index 384fb8b..0000000 --- a/api/tropical.php +++ /dev/null @@ -1,194 +0,0 @@ -. - -/* - * This is the Linux Day Torino Tropical (trop-iCal) API - * - * It print a (hopefully) valid iCal file of a Linux Day Torino event. - */ - -// load the framework -require __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'load.php'; - -// die if missing Conference UIR -if( empty( $_GET['conference'] ) ) { - http_response_code( 404 ); - die( "Missing 'conference' argument" ); -} - -$event = null; -$conference = FullConference::factoryFromUID( $_GET['conference'] ) - ->queryRow(); - -// die if missing Conference -if( !$conference ) { - http_response_code( 404 ); - die( "Conference not found" ); -} - -// die if missing Event UID -if( isset( $_GET['event'] ) ) { - $event = FullEvent::factoryFromConferenceAndEventUID( $conference, $_GET['event'] ) - ->queryRow(); - - if( !$event ) { - http_response_code( 404 ); - die( "Event not found" ); - } -} - -$event_url = null; -if( $event ) { - $event_ID = $event->getEventID(); - $event_title = $event->getEventTitle(); - $event_start = $event->getEventStart(); - $event_end = $event->getEventEnd(); - $event_desc = $event->getEventDescription(); - if( $event->hasEventPermalink() ) { - $event_url = $event->getEventURL( true ); - } -} else { - $event_ID = $conference->getConferenceID(); - $event_title = $conference->getConferenceTitle(); - $event_url = $conference->getConferenceURL(); - $event_start = $conference->getConferenceStart(); - $event_end = $conference->getConferenceEnd(); - $event_desc = $conference->getConferenceDescription(); -} - -$event_uid = $conference->getConferenceUID(); -if( $event ) { - $event_uid .= '-' . $event->getEventUID(); -} - -if( $event ) { - $event_stable_guid = $conference->getConferenceUID() . '-' . $event_ID . '@linuxdaytorino.org'; -} else { - $event_stable_guid = $conference->getConferenceUID() . '@linuxdaytorino.org'; -} - -$event_location = null; // TODO: get this one (e.g. "Room A" or "Via Fasulla 123, Springfield") -$event_geo_lat = null; -$event_geo_lng = null; -if( $conference->locationHasGeo() ) { - $event_geo_lat = $conference->getLocationGeoLat(); - $event_geo_lng = $conference->getLocationGeoLng(); -} - -if( empty( $_GET['debug'] ) ) { - header( 'Content-Type: text/calendar' ); - header( sprintf( 'Content-Disposition: attachment; filename=%s.ics', $event_uid ) ); -} else { - header( 'Content-Type: text/plain' ); -} - -echo get_ical( - $event_stable_guid, - $event_title, - $event_start, - $event_end, - $event_url, - $event_desc, - $event_location, - $event_geo_lat, - $event_geo_lng -); - -function timestamp_to_ical( $timestamp ) { - return date( 'Ymd\THis\Z', $timestamp ); -} - - -/** - * Get an event (or conference as a single event) in iCal format. - * - * @param string $id Unique ID for this event - * @param string $title Event title - * @param int $start Start time (UNIX timestamp) - * @param int $end End time (UNIX timestamp) - * @param string $url Event URL - * @param string $description Longer description of the event - * @param string $location Name of event location, e.g. "Room A" - * @param float $geo_lat Latitude of the location - * @param float $geo_lon Longitude of the location - * - * @return string the event in iCal format - */ -function get_ical( $id, $title, $start, $end, $url = null, $description = null, $location = null, $geo_lat = null, $geo_lng = null ) { - $dtstart = timestamp_to_ical( $start->getTimestamp() ); - $dtend = timestamp_to_ical( $end->getTimestamp() ); - $dtstamp = timestamp_to_ical( time() ); - $id = htmlspecialchars( $id ); - $title = htmlspecialchars( $title ); - if( !$description ) { - $opt_description = ''; - } else { - $description = str_replace( "\n", " ", $description ); - $description = strip_tags( $description ); - $description = htmlspecialchars( $description ); - $opt_description = "DESCRIPTION:$description"; - } - if( !$url ) { - $opt_url = ''; - } else { - $opt_url = 'URL;VALUE=URI:' . htmlspecialchars( $url ); - } - if( !$geo_lat || !$geo_lng ) { - $opt_geo = ''; - } else { - $opt_geo = "GEO:$geo_lat;$geo_lng"; - } - if( !$location ) { - $opt_location = ''; - } else { - $location = htmlspecialchars( $location ); - $opt_location = "LOCATION:$location"; - } - - $ics = []; - $ics[] = 'BEGIN:VCALENDAR'; - $ics[] = 'VERSION:2.0'; - $ics[] = 'PRODID:-//ldto/asd//NONSGML v1.0//EN'; - $ics[] = 'CALSCALE:GREGORIAN'; - $ics[] = 'BEGIN:VEVENT'; - $ics[] = "UID:$id"; - $ics[] = "SUMMARY:$title"; - - if( $opt_description ) { - $ics[] = $opt_description; - } - - if( $opt_url ) { - $ics[] = $opt_url; - } - - if( $opt_location ) { - $ics[] = $opt_location; - } - - if( $opt_geo ) { - $ics[] = $opt_geo; - } - - $ics[] = "DTSTART:$dtstart"; - $ics[] = "DTEND:$dtend"; - $ics[] = "DTSTAMP:$dtstamp"; - $ics[] = 'END:VEVENT'; - $ics[] = 'END:VCALENDAR'; - - return implode( "\r\n", $ics ); -} diff --git a/index.php b/index.php deleted file mode 100644 index 8314fa4..0000000 --- a/index.php +++ /dev/null @@ -1,21 +0,0 @@ -. - -require 'load.php'; - -// redirect to latest conference with a 303 See Other redirect -http_redirect( _ . LATEST_CONFERENCE_UID, 303 ); diff --git a/load-example.php b/load-example.php deleted file mode 100644 index baa9676..0000000 --- a/load-example.php +++ /dev/null @@ -1,56 +0,0 @@ -. - -// Database info -$database = 'insert-here-database-name'; -$username = 'insert-here-database-username'; -$password = 'insert-here-database-password'; -$location = 'localhost'; -$charset = 'utf8mb4'; - -// Database table prefix (if any) -// E.g. 'asd_' -// Keep in mind that "tagliatella" doesn't support this, so it's probably better to leave an empty string here. -$prefix = ''; - -// See also include/class-Talk.php for track\area names! - -// Enable extra verbose framework errors -define('DEBUG', true); - -// Absolute pathname to the folder of the project -// NO TRAILING SLASH -define('ABSPATH', __DIR__ ); - -// Request URI pathname of the complete website -// NO TRAILING SLASH -// E.g. '/linux-day' -define('ROOT', ''); - -// used for events -define('DB_TIMEZONE', 'Europe/Rome'); - -// contact informations -define('CONTACT_EMAIL', 'asd@asd.asd' ); -define('CONTACT_PHONE', '555-55-55-55' ); -define('CONTACT_PHONE_PREFIX', '+39' ); - -// which file should be loaded after boz-php -define('REQUIRE_LOAD_POST', ABSPATH . '/includes/load-post.php' ); - -// load suckless-php -require 'includes/suckless-php/load.php';