1
0
Fork 0

Correct URL paths for images and style sheets.

This commit is contained in:
Andrew Tomaka 2011-11-04 22:01:21 -04:00
parent 34062abda0
commit f975dd4f1e
3 changed files with 13 additions and 7 deletions

6
.htaccess Normal file
View File

@ -0,0 +1,6 @@
RewriteEngine on
RewriteRule ^([0-9]+)$ /$1/ [R]
RewriteRule ^([0-9]+)/$ /view.php?id=$1
#RewriteRule ^random.*$ /view.php?id=-1
#RewriteRule ^gallery/?([0-9]*)$ /gallery.php?p=$1
#RewriteRule ^latest.*$ /view.php?id=-2

View File

@ -3,8 +3,8 @@
<head>
<title>No Chicks Allowed: Image Repository</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" media="all" href="css/html5reset-1.6.1.css" />
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
<link rel="stylesheet" type="text/css" media="all" href="/css/html5reset-1.6.1.css" />
<link rel="stylesheet" type="text/css" media="all" href="/css/style.css" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

View File

@ -1,7 +1,7 @@
<?php
$conf = json_decode(file_get_contents('database.conf'));
$id = isset($_GET['image']) ? $_GET['image'] : '';
$id = isset($_GET['id']) ? $_GET['id'] : '';
if($id == '' ) {
// redirect to gallery; do with .htaccess?
@ -22,10 +22,10 @@ if($id == '' ) {
// load tags
$image = $result->fetch_object();
$imageOutput = '<img src="uploads/' . $id . '.' . $image->extension . '" class="image" />';
$imageOutput = '<img src="/uploads/' . $id . '.' . $image->extension . '" class="image" />';
$message = 'Uploaded on: ' . $image->created;
$message .= '<br/>Original name: ' . $image->original;
$message .= '<br/>View Raw: <a href="uploads/' . $id . '.' . $image->extension . '">'. $id . '.' . $image->extension . '</a>';
$message .= '<br/>View Raw: <a href="/uploads/' . $id . '.' . $image->extension . '">'. $id . '.' . $image->extension . '</a>';
}
}
}
@ -35,8 +35,8 @@ if($id == '' ) {
<head>
<title>No Chicks Allowed: Image Repository</title>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" media="all" href="css/html5reset-1.6.1.css" />
<link rel="stylesheet" type="text/css" media="all" href="css/style.css" />
<link rel="stylesheet" type="text/css" media="all" href="/css/html5reset-1.6.1.css" />
<link rel="stylesheet" type="text/css" media="all" href="/css/style.css" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>