From 9d77827195a8057746842bfa307d550d04ed02f9 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Thu, 24 Nov 2011 20:41:53 -0800 Subject: [PATCH] added a permalink and use clean urls this needs .htaccess. Already added clean urls for tags and single pic, but at the moment only page is working. --- .htaccess_template | 24 ++++++++++++++++++++++++ README | 14 ++++++++++---- index.php | 10 +++++++--- style.css | 8 ++++++++ 4 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 .htaccess_template diff --git a/.htaccess_template b/.htaccess_template new file mode 100644 index 0000000..203ba4c --- /dev/null +++ b/.htaccess_template @@ -0,0 +1,24 @@ + +RewriteEngine on + +RewriteBase / + + +# make the url nice and clean; the comments shows an url that should be matched + +# web_base/tag/me+berlin/pic/id +RewriteRule tag/([-_a-zA-Z0-9+]*)/pic/([0-9]*) index.php?tag=$1&pic=$2 [L] + +# web_base/tag/tag1+tag2/page/4 +RewriteRule tag/([-_a-zA-Z0-9+]*)/page/([0-9]*) index.php?tag=$1&page=$2 [L] + +# web_base/tag/tag1+tag2 +RewriteRule tag/([-_a-zA-Z0-9+]*) index.php?tag=$1 [L] + +# web_base/pic/17 +RewriteRule pic/([0-9]*) index.php?pic=$1 [L] + +# web_base/page/4 +RewriteRule page/([0-9]*) index.php?page=$1 [L] + + diff --git a/README b/README index cfbf541..146cd71 100644 --- a/README +++ b/README @@ -1,7 +1,8 @@ This are some simple php files and bash scripts to display your F-spot -photos including information from the data-base on a webpage. +photos including information from the data-base on a webpage. To get +up and running follow these steps: -You can exclude/include certain tags incase you want for example on +1) You can exclude/include certain tags incase you want for example on show pictures on the web that were tagged "Public". To use the scripts copy config.ini_template to config.ini, edit it and @@ -10,7 +11,9 @@ then run for example f-spot-db-reduce.sh --include='Public' This will create a new smaller database that only contains information -about pictures with the Public tag. Next run +about pictures with the Public tag. + +2) Next run ./create_thumbnails.sh @@ -20,7 +23,10 @@ will need to run it several times. This is done, so that you limit the time this tasks run, so that it doesn't get shut down on for example rented web-space where execcive CPU uses is an issue. -Ones this is done you can visit index.php and everything should be working. +3) install .htaccess + +edit the "RewriteBase" in the .htaccess_template file and rename it to .htaccess. +Onces this is done you can visit index.php and everything should be working. Feel free to fork, send in patches, make suggestions. diff --git a/index.php b/index.php index 44be53b..5f04543 100644 --- a/index.php +++ b/index.php @@ -17,9 +17,9 @@ else ?> <?php echo htmlspecialchars($title) ?> - - - + + + @@ -29,6 +29,8 @@ else + +