Dale's Weblog

looking back it was easy.
Saturday 13 March

Images

Posted by dale on Sat, 28 Aug 2004 20:26:49 EST

From the start of creating this site, I’ve said to myself that I wouldn’t put images on this site. I want quick loading times. But this won’t stop me from linking to them and well there is this one image that I wanted to show people. A very cute dog.

Now I wanted it so that style was the same as the site. So with a bit of help from mod_rewrite and some php code it can be done! Nice 8)

The first link:
http://blog.dalegroup.net/archive/blog/images/maxdog.jpg

I like the urls :)

This posted was edited: Sat, 28 Aug 2004 20:53:03 EST
Below are the comments for this news item

Excellent to see that styles remain consistent… one criticism relating to interfaces, though.

Your "Back to blog" link is statically linked back to your blog index page, which presents usability issues if you've got multiple links to images in the one post (and that post is displayed in abbreviated form on the front page, i.e. full version can only be viewed at the permalink).

I'd suggest you implement a system whereby that link goes to the HTTP referer page – NOT using JavaScript, because that's crap, but by using the PHP reserved variable 'HTTP_REFERER' (in conjunction with the $_SERVER reserved variables list).

Obviously, if there was no referring page, you'd link direct back to blog.dalegroup.net (so if people are thrown a link in an IM message, or an email or something), but generally, that should work quite nicely on its own.

The only OTHER thing I have to say is what about non-JPG images? You might not think you'll use them, but is a URL which ends in .jpg really that much worse? Besides, it's fairly obvious to all who visit that they're not just seeing a normal JPG image, and are instead being served fancy HTML, so the cool factor is preserved (and, let's face it, that's about half of what mod_rewrite is all about!).

My $AU0.03

1: Comment by Josh - Sat, 28 Aug 2004 20:43:51 EST


Point 1) Agreed, I also want to do this for the change style thing. So I shall do that now

Point 2) I was thinking of using a database system to work out the file extension but I think it might just be easier this way ;)

2: Comment by dale - Sat, 28 Aug 2004 20:49:39 EST


Okay both those things have been done. Styles and images will return back to the page you came from.

Image thing does all images now.

3: Comment by dale - Sat, 28 Aug 2004 21:00:09 EST


BBCode:

urls become clickable

[b]place text in bold[/b]

[i]place text in italics[/i]

[quote]place text in a quote[/quote]

Comments? Please note that all HTML tags are removed from your post.

The URI to TrackBack this entry is: http://www.dalegroup.net//early05/archive/blog/newsid/trackback/96

Comments

Message:

Name (optional):

Email (not shown):

WWW (optional):






Copyright © Michael Dale 2004. Page generated in 0.0048 seconds FreeBSD Powered
Background on style 5 is used from squidfingers How are we going? 3 queries