From 44c584615cb55117c33f89ffd9ebeb942e26e088 Mon Sep 17 00:00:00 2001 From: Gabriel Dunne Date: Sun, 17 Apr 2011 19:39:36 -0700 Subject: [PATCH] Added delete --- .htaccess | 5 ++--- get.php | 46 +++++++++++++++++++++++++++++++--------------- head.html | 5 +++-- index.php | 20 +++++++++----------- put.php | 2 -- style.css | 37 +++++++++++++++++++++++++++++++++---- 6 files changed, 78 insertions(+), 37 deletions(-) diff --git a/.htaccess b/.htaccess index d5fd0d3..c8fdc6b 100644 --- a/.htaccess +++ b/.htaccess @@ -2,6 +2,5 @@ Options +FollowSymLinks RewriteEngine On # redirect every other request to the index -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule . index.php [L] \ No newline at end of file +RewriteRule /*\.(css|php|js|gif|png|jpe?g)$ - [NC,L] +RewriteRule ^(.*)$ index.php?_url=$1 [QSA,L] diff --git a/get.php b/get.php index 01578d7..ca8434b 100644 --- a/get.php +++ b/get.php @@ -13,7 +13,7 @@ if ($params['user']) { $user = get_users($dbh, array('user' => $params['user'] )); if ($user) { - $q = $dbh->prepare(" SELECT * FROM clumps JOIN users ON users.id = clumps.user_id WHERE user_id = ? ORDER BY date DESC "); + $q = $dbh->prepare(" SELECT *, clumps.id as clump_id FROM clumps JOIN users ON users.id = clumps.user_id WHERE user_id = ? ORDER BY date DESC "); $q->execute( array( $user['id'] )); } else { @@ -22,7 +22,7 @@ } else { - $q = $dbh->prepare("SELECT * FROM clumps JOIN users ON users.id = clumps.user_id ORDER BY date DESC"); + $q = $dbh->prepare("SELECT *, clumps.id as clump_id FROM clumps JOIN users ON users.id = clumps.user_id ORDER BY date DESC"); $q->execute(); } } @@ -34,17 +34,33 @@ include 'head.html'; - echo '