Archives for June 2009
You are currently browsing 6 articles posted June 2009.
The Site Looks Weird in FF3
Published Tuesday 30th of June 2009
I've been doing more bug-fixing lately, and one I did recently introduced several new ones in FF3 but not in Chrome, Opera, Safari or FF3.5.
What I did was I added a "Continue Reading"-link at the bottom of the article on the home-page. In order to style it without using a class I used the :last-of-type pseudo-class:
#article > p:last-of-type = $icon;As you can see I'm using a type of CSS-constants (new version in the works btw), and because many other selectors should be icons as well they're all merged by the constants-parser so in the end i end up with something like this:
#article > p:last-of-type,
#article > dl:last-child dt,
#quick-about > p:last-child {
/* Icon styling */
}What seems to happen is that when Firefox chokes on one of the selectors it ignores (or improperly parses) the entire block.
Since 3.5 is out I expect it to start taking over so I thought I'd leave this bug as it is.
Sorry for any inconvenience!
Be the first to post a comment
Bug Fixin'
Published Wednesday 24th of June 2009
My evening was kind of free today and I felt like coding so I took the time to sort out some annoying bugs I've been having with aFramework v3, and hence AndreasLagerkvist.com as well.

Here's a list of the updates:
- I've solved the case of the missing RSS-feed.
- I had a bug where line-breaks weren't allowed in comments - pretty bad, but fixed now.
- Removed previous-link from first page recent-comments.
- Now sorting the plugins by name.
- Now the date of a comment links to the comment, the author's name links to his/hers website.
- Fixed broken pagination for search-results.
+ some more, even less interesting fixes.
Stay tuned for real articles :)
Be the first to post a comment
Now Using the Universal IE6 Stylesheet
Published Thursday 18th of June 2009
When looking through the stats for my various sites I noticed that some people are actually still viewing them in IE6. Today I decided to get rid of all my IE6 and IE7-problems forever.
I recently read about Andy Clarke's Universal Internet Explorer 6 CSS and decided it was about time I implemented something like this in aFramework.
Join 3 others and post a comment
Super Simple Ajax (Without a Framework)
Published Friday 12th of June 2009
If you're looking for the bare minimum when it comes to doing cross-browser GET or POST XHR then this might be the script for you.
I know there's hundreds (probably thousands) of these scripts out there already but even the most lightweight ones I could find seemed kind of bloated.
Example
// GET latest-comments.php and update the #latest-comments element
superSimpleAjax({url: 'latest-comments.php'}, 'latest-comments');
// GET article with ID 12 and alert its contents
superSimpleAjax({
url: 'get-article.php',
data: 'id=12',
callback: function (data) {
alert(data);
}
});
// POST a comment to post-comment.php
superSimpleAjax({
method: 'POST',
url: 'post-comment.php',
data: 'author=John Doe&email=johndoe@johndoe.com&content=Hi, my name is John Doe',
callback: function (data) {
alert('Thanks for your comment!');
}
});Grab the code from Google Code. It's about 1k uncompressed.
Enjoy!
Be the first to post a comment
7 Nifty htaccess Tips
Published Monday 8th of June 2009
If you use Apache you've probably heard of a file called .htaccess. It can be extremely useful for a number of different things. Here are some htaccess-tricks I've been using myself.
# A little mod rewritin
<IfModule mod_rewrite.c>
# Start ModRewrite
RewriteEngine On
RewriteBase / # Root-dir for your site
# Prevent access for visitors without user-agent string (prevents some spam)
RewriteCond %{HTTP_USER_AGENT} = ""
RewriteRule .* - [F,L]
# Prevent www-access (you should change the yourdomain-bit)
RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com$ [NC]
RewriteRule ^(.*)$ http://yourdomain\.com/$1 [R=301,L]
# Force a trailing slash for dirs
RewriteRule !\..{2,4}$ - [C]
RewriteCond %{REQUEST_URI} !^.*/$
RewriteRule ^(.+)$ $1/ [R=301,L]
# These are useful for running everything but real files through index.php (the way many CMSes and blogs work)
# Redirect /index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php
RewriteRule ^index.php/?(.*)$ $1 [R=301,L]
# Run everything else but real files through index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1?%{QUERY_STRING} [L]
</IfModule>
# These are for performance and they increase
# speed a lot! (try yslow wiv and wivout)
# Configure ETags
FileETag MTime Size
# Enable expirations
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 3 days"
</IfModule>
# Gzip HTML, CSS and JS
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/x-javascript text/plain text/xml
</IfModule>Hope it wasn't all old news to you!
Be the first to post a comment
New Domain, Design, Front-end and Back-end
Published Monday 1st of June 2009
Por fin! A brand new design on a brand new domain running on a brand new back-end!

It took a little longer than I expected but I've finally "finished" AndreasLagerkvist.com.
Join 3 others and post a comment
