n

nuzzaci External Links; a Wordpress plugin

9

Background, similar to wikipedia.org, I have a small icon next to all links that will take you away from this site. Up until now I’ve been using a javascript function that I wrote and posted back in December 2006 to find all external links and add the icon. It’s quite a flaky and… ugly script, so I though it would be a good idea to revisit the issue and give it another go.

Thoughts, first I though I would just use the brilliant jQuery javascript library and turn my 10+ lines into 4. This might be a method many would recommend and suggest, but similar to when I approached the “Flickr images are a bit to wide” issue with the nuzzaci Width Watchers plugin, I thought — why not do it server side?

Solution, So, let me present the nuzzaci External Links wordpress plugin. It fairly straight forward.

This plugin will look through your posts before they get displayed and either modify the existing class attribute or create a class attribute with the value external to all links that don’t link within the current domain name. It will ignore all links without http:// and all links where the node is an image. This plugin doesn’t touch the database.

View the script here, and download it here
(the 4 line javascript solution using jQuery can be found here).

Instructions, Download the file, upload it to your plugin folder, log on to your admin section and activate it. Before you see any visual difference on the external links you’ll need to define how you want the class ‘external’ to look like. Here’s an example how you get all external links to look like wikipedia’s external links.

I’m using wordpress 2.0.5, but don’t see why this plugin shouldn’t work on all versions.

Version History

  • v 0.1, Launch.

nuzzaci Width Watcher; a Wordpress plugin

20

Background, Mr Cookie at made-in-england.org asked me if I knew of a way to change the size of the images published to his blog via Flickr. It’s not a case of Mr Cookie being lazy or not capable of resizing images — he’s on holiday and are sending photos directly from his phone to his Flickr account, that then in return post the photo to his blog.

When setting up your blog on Flickr you can select from three sizes; 500, 240 and 100 pixel wide. Most people, like Mr Cookie, find that 500 pixels is a bit to wide. A 500 pixel wide post area forces the lines to run long and extends the recommended 66 characters / 10 words per line (unless, of cause, if you set a really large font-size). 240 pixels and 100 pixels are normally a bit too small if it is a main post image.

Thoughts, The quick fix on Mr Cookie’s blog was a CSS workaround; added a max-width to all the images within the a post — .postclass img{max-width:460px}. But IE 6 and older browsers don’t support max-width.

My next thought was to write a javascript function. But I’m no big fan of the onload flickering behaviour. A webpage need to be fully loaded before any javascript kicks in, so everything done with javascript that changes the look of the site will be noticeable for the trained eye. An example on this is my external link script. Even if there may be ways around the flickering onload behavior, it didn’t feel like the right job for Mr javascript.

Solution, So, let me present the nuzzaci Width Watcher wordpress plugin. It fairly straight forward.

This plugin will look through your posts before they get displayed and make sure that no images are wider than a desired maximum width (specify desired width in the nuzzaciWidthWatcher.php file). If an image is too wide, the plugin will add a height and width attribute to the image so that it will be displayed with the desired width while still keeping the correct ratio. It will ignore all images that already have a width or height attribute and/or if the size is less than the set maximum width. This plugin doesn’t touch the original image or the database.

View the script here, and download it here.

Instructions, Download the file, edit the max width variable, upload it to your plugin folder, log on to your admin section and activate it.

I’m using wordpress 2.0.5 and I have tried it on v2.2, but don’t see why this one shouldn’t work on all versions.

Version History

  • v 0.5, Launch.
  • v 0.6, Fixed an issue regarding potrait images.

a Tiger

0

tiger.jpgIf you are using Wordpress, I suggest you download the WP Tiger Administration by Steve Smith. It’s a plugin that makes the boring and butt ugly admin system of Wordpress look nice. Just like the free clipart used in this post.

Links for 2006-09-10

0

A comment on a comment on comments

1

I have received some comments on not having comments enabled on my blog. The reason is that I have read that a lot of people suffer from a high maintenance due to spam. I actually managed to get spam comments on here before the blog was even launched… they do find there way around.

I’m doing an update on the blog soon (version 2)… but I do listen to my audience so I have now turned comments on. Let’s see how it all works out.

Have fun ;)

structure, frustration and personal disappointed (and confusion)(simultaneously)

0

Im getting a bit… confused and a bit disappointed at myself. As it turns out most of the posts I do here are just ‘link list’ from my daily catch (of surfing), and posted through my little tool that gets them from del.icio.us. A very easy process. If I didn’t have these tools (del.icio.us and my posting tool), I would most probably not post as many links, and more post would be “non-link-related” (actually not more “normal” post, but less posts will be just link nonsense).

So, should I separate the links from the “main” journal entries? Are the links more interesting then my normal posts? For you? For me? What’s her name?

Sure a “side note” or “link roll” feature would be one solution, but then everything just gets cluttered and distracted, and probably more “issues” would arise from this.

For now I will let it be. But maybe in a near future I will either separate the links from the main content or just stop posting them here (or offer three different views (with links, just links, everything))… damn… start to sound like my brother (sorry bro, had to ;) (but thank god though that I don’t like or want to connect my blog with all my bluetooth devices and simultaneously sync them with all my computers that then trough an online application check every hour if I have coffee in the fridge, and then send a text message to my phone)(sorry again (wow bracket nest( . )( . ))(just had to)

anyway, for those who cares:

we have moved to .co.uk

0

Just letting everyone know that I just moved my journal to the root of the server. So we now live directly under www.nuzzaci.co.uk instead of www.nuzzaci.co.uk/journal/

I know it’s a bad thing changing the permanent links etc, but until now the journal haven’t been official. Now it is and here it’s gonna stay.

update
The permanent links might change again. This is since wordpress seem to be very sensitive when it determents if the post is a single post or not (this is so that the comments get displayed, and this is why the comments aren’t displayed at the moment).

At the moment my permanent links structure is:
/year/month/day/hour:minute:second

I wouldn’t mind take the seconds out, since I unlikely will post two post’s the same minute. But if I don’t have the second’s the comments will not work.

My decision on not having the post-title in the permanent link, and only having the time, also seem to have fuck up when you ‘url’ surf (like go directly to /year/month/ to have a look at all post posted that month) and have a archive page.
If you have an archive page, and people ‘url’ surf - they get redirected to the archive page and to what they requested.

One month of ‘blogging’

1

It’s been a month since I started this journal. One month and this is my 34′th post. That’s not to bad, I have an average over one post per day (yeah, most of them are just link list’s, I know. But it still something)!

So how have it been?
Good and bad.

Well, the blog tool I’m using is Wordpress. Saved as draft on the admin tool is a post titled ‘wordpress frustration’…

Wordpress is a good blogging tool. It’s easy but… everything feels like a hack or patch. Everything feels and is more complicated then it has to be (and least for me). And it’s slow! Before I have reached where I want with it I have probably put down more time tuning it then it would take building my own system.

A tips, from me to you:

If you are about to give wordpress a go, and have a bit of web techy knowledge - don’t try to change the default theme to do what you want it to do - just delete everything and create your know.

Before I installed wordpress I actually was in the making of my own blog platform/system. But I reach a point when I thought: Let’s start writing instead of building - so I did.

Question:

Then why did I go with wordpress then? There are other tools out there!

Answer:

Well most of them aren’t better (for my needs. at least.).

I have installed textpattern, not played with it yet though. Have heard a lot of good things about it and people who have the same feelings as me towards wordpress have found textpattern spot on. Seems brilliant. So it might just be the cure.

Related links