From the category archives:

Instructions

WIP

by taoski on January 31, 2006

Just been farting around with my template again over at my TaoTest blog. After seeing the cute and excellent site design over at OrderedList I decided to take mine to a "low tech, single post" level.

In order to do this effectively I would have to limit the size of the inital view of the latest posting to a few lines and then introduce a "Read More" item at the bottom for people to load the full thing up.

I did a search for Blogger Hacks and found this posting by Nerdier than thou! on how to create such a thing.

The only issue I can see with this is that you have to insert some CSS code into your post to get it to work correctly - which I don't want to do. I just want to make a posting and have the first portion of it displayed automatically.

So… Off to JavaScript land I went and came up with something that actually works!

Here's the code bit i stuck in my template:

<mainorarchivepage>

<script type="text/javascript">

var str_length=400;

str = '<$BlogItemBody$>';
last_dot = str.indexOf('.',str_length);
document.write(str.substring(0,last_dot + 1));
</script>

<br><a href="<$BlogItemPermalinkURL$>">Read more!</a>
</mainorarchivepage>

<itempage>
<$BlogItemBody$>
</itempage>

The blog post is written into the variable str and then the post is scanned for the next full stop after the number of characters specified in the str_length variable. To show more content, increase the value of str_length.

The post is then re-written using the document.write command as far as that full stop character to allow for proper sentences to be displayed rather than being cut off in mid flow.

The JavaScript is between the <mainorarchivepage> tags to allow it to be shown on the front page.

A normal <$BlogItemBody$> tag is shown between the <itempage> tags to allow it to be displayed in full when you click the "Read More!" link.

This is still a Work In Progress - so please don't take it as gospel - but I think it works ok. Not sure how it will work with pictures though.

Rather than messing with CSS code, I was thinking of putting some keywords into the text such as !start! and !end! to signify the start and end of the posting you want to be displayed before the "Read More!" link. That should be pretty easy for JavaScript to sense and strip them out, and alot easier than going into the HTML code when posting.

{ 0 comments }

Hells Blue Teeth

by taoski on December 8, 2005

Since I got hold of my Motorola V600 phone I have been trying to use Bluetooth to upload stuff to it. I bought a Blue-USB Bluetooth adapter from eBay and have paired the phone, using the crappy Bluesoleil software to my PC, but can only download pics from the phone - not upload ringtones or anything else.

After reading the tutorial over at Jonsguides for getting any USB Bluetooth Adapter to work with XP using the Widcomm software, I went in search of the required files that had been deleted (as requested by Widcomm) and found them!

All done via this search string on the mighty Tyoogle.

I have'nt tried this yet, but will tonight.
Enjoy!

Update: Installed the drivers and patches to my laptop. Followed the complete instructions here as Jon's is missing a bit. Tested, works brilliantly! Now, off to find a copy of Crazy Frog.mp3!

{ 1 comment }