diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 8203a102..00000000 --- a/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -# Ignore .htaccess (copy ht.access and create your own) -.htaccess - -# Ignoring composer.phar (because we don't want to push it to Github) -composer.phar - -# Ignoring composer.lock (just because) -composer.lock - -# Ignoring vendor dir (because files are installed using composer) -vendor \ No newline at end of file diff --git a/.htaccess b/.htaccess index 4d53c4aa..952ded2a 100755 --- a/.htaccess +++ b/.htaccess @@ -1,11 +1,12 @@ -# Mod rewrite -RewriteEngine On +Options +FollowSymLinks +RewriteEngine on RewriteBase / +RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] +RewriteRule ^(.*)$ http://%1/$1 [R=301,L] + +RewriteCond %{REQUEST_URI} !(/$|\.) +RewriteRule (.*) %{REQUEST_URI}/ [R=301,L] -# Route all requests to index.php unless real file or folder RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] - -# Disallow directory listing -Options -Indexes \ No newline at end of file +RewriteRule /(.*)$ /$1 [L] \ No newline at end of file diff --git a/README.md b/README.md index b8c7d467..b97cef91 100755 --- a/README.md +++ b/README.md @@ -8,28 +8,3 @@ Zöff is built around the youtube search and video API, and enables the creation The project is currently under development and runs on http://zoff.no - -Install notes -============= - -Composer --------- - -This projects uses composer. Install composer by typing: - - curl -sS https://getcomposer.org/installer | php - -After that, fetch project dependencies: - - php composer.phar update - -.htaccess ---------- - -We also use .htaccess to prettify the urls. To keep it easy to develop elsewhere, we have a stock ht.access file. Copy this and call it .htaccess. If you develop in a directory that is not the base in your webserver change - - RewriteBase / - -To - - RewriteBase /your-sub-directory \ No newline at end of file diff --git a/base.php b/base.php deleted file mode 100755 index 82727f90..00000000 --- a/base.php +++ /dev/null @@ -1,9 +0,0 @@ - + + + + +
+
+ + Zöff +
+ +
+
+
-// Require the autoloader -require 'base.php'; -require ZOFF_BASE_PATH . '/vendor/autoload.php'; +
+
+ + Settings + Skip +
+
+
+
-// New instance of smarty -$template = new Smarty(); +
+
+
+
+
+ -// Set smarty options -$template->left_delimiter = '[[+'; -$template->right_delimiter = ']]'; - -// Check if we are in a room or not -if (!isset($_GET['q'])) { - // Not in a room, fetch active rooms - - $dir = scandir(ZOFF_BASE_PATH . '/lists'); - $channels = []; - $time = 60 * 60 * 24 * 3; - - foreach ($dir as $files) { - if (strpos($files, '.json') !== false) { - if (time() - filemtime(ZOFF_BASE_PATH . '/lists/' . $files) < $time) { - $channels[] = ucfirst(str_replace('.json', '', $files)); - } - } - } - - // Build string for search - $search_string = ''; - foreach ($channels as $channel) { - $search_string .= '