Skip to content

Commit

Permalink
Merge branch 'master' of github.com:p-blomberg/wellpapp-web
Browse files Browse the repository at this point in the history
  • Loading branch information
p-blomberg committed Jul 1, 2011
2 parents 0c7d454 + ccde14b commit 8428578
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
4 changes: 4 additions & 0 deletions classes/wellpappConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ class wellpappConnection {
private $do_debug;
private $host;
private $port;
public $image_prefix;
public $thumb_prefix;

private function connect() {
$this->sock=socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
Expand Down Expand Up @@ -31,6 +33,8 @@ public function __construct($db_alias, $debug) {

$this->host=$host;
$this->port=$port;
$this->image_prefix = $image_prefix;
$this->thumb_prefix = $thumb_prefix;

$this->connect();
}
Expand Down
4 changes: 2 additions & 2 deletions content/main/tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
$posts=$tag->posts();
foreach($posts as $post) {
echo "<input type=\"checkbox\" name=\"".$post->md5."\" />";
echo "<a href=\"/image/".$post->md5."\">";
echo "<img src=\"/images/".$post->md5.'.'.$post->ext."\" title=\"";
echo "<a href=\"". $wpc->image_prefix . $post->md5 .".". $post->ext ."\">";
echo "<img src=\"" . $wpc->thumb_prefix . $post->md5 ."\" title=\"";
foreach($post->tags as $t) {
echo $t->name.' ';
}
Expand Down
2 changes: 2 additions & 0 deletions db_settings/db_settings.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php
$host="127.0.0.1";
$port=2225;
$thumb_prefix="/thumbs/200/";
$image_prefix="/images/";
?>
12 changes: 6 additions & 6 deletions public/.htaccess
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
RewriteEngine On

### MAPPAR I PUBLIC SOM SKA GÅ ATT KOMMA ÅT

RewriteCond %{REQUEST_URI} !/gfx
RewriteCond %{REQUEST_URI} !/images
RewriteCond %{REQUEST_URI} !/thumbs
RewriteCond %{REQUEST_URI} !/scripts
RewriteCond %{REQUEST_URI} !/special
RewriteCond %{REQUEST_URI} !/documents
Expand All @@ -17,14 +20,11 @@ RewriteCond %{REQUEST_URI} !/favicon.ico

### ÄNDRA INGET NEDANFÖR DENNA RAD

RewriteRule (.*) index.php/$1

RewriteRule ^thumbs/(\d+)/([0-9a-f])([0-9a-f]{2})([0-9a-f]{29})$ /images/thumbs/$1/$2/$3/$2$3$4 [T=image/jpeg]
RewriteRule ^images/([0-9a-f])([0-9a-f]{2})([0-9a-f]{29})\.([a-z]{3,4})$ /images/thumbs/200/$1/$2/$1$2$3 [T=image/$4]
RewriteRule (.*) index.php/$1 [L]

RewriteRule ^thumbs/(\d+)/([0-9a-f])([0-9a-f]{2})([0-9a-f]{29})$ /thumbs/$1/$2/$3/$2$3$4 [L,T=image/jpeg]
RewriteRule ^images/([0-9a-f])([0-9a-f]{2})([0-9a-f]{29})\.([a-z]{3,4})$ /images/$1/$2/$1$2$3 [L,T=image/$4]


RewriteEngine On
php_flag magic_quotes_gpc Off

AddDefaultCharset utf-8
Expand Down

0 comments on commit 8428578

Please sign in to comment.