All posts by Ryan Cullen

Blogger Javascript Hack

This weekend I came up with a script that would allow you to have the post title in your HaloScan window and also have the Next and Previous post links on the Item Pages.

IF YOUR CODE HAS STOPPED WORKING, IT’S BECAUSE I’VE MOVED A FILE, PLEASE MODIFY YOUR TEMPLATE AS PER STEP 4

Now it’s a bit tricky, and a bit messy, but here’s how to do it.
Note, you will need a remote file hosting system!

Step 1.
In the Blogger settings, on the Formatting page make a note of every setting.
Then change Show to 999 Posts, and Timestamp Format to a date output setting (I choose Sunday, January 02, 2005).
Hit Save Settings, but do not Republish your blog.

Step 2.
In the Template page, copy your template in to a text editor like Notepad, and save it. The replace the whole template with

var blogger = new Array;
<blogger>blogger[‘<$BlogItemNumber$>’] = Array(“<$BlogItemTitle$>”, “<$BlogItemPermalinkURL$>”, “<$BlogItemDateTime$>”);
</blogger>

Then hit Preview.
In the Preview window, view the page source, select all the text and copy it in to a text editor. You will need to remove everything above:

var blogger = new Array;

and also

</body>
</html>

from the bottom.
Save it as post_data.js and upload it to your file space.

Step 3.
Restore all your settings.

Step 4.
In your blogger template add the following lines between the head tags

<script type=”text/javascript” src=
“http://WWW.YOURWEBSITE.COM/post_data.js”> </script>
<script type=”text/javascript” src=
“https://blog.artesea.co.uk/js/previous_next_post.js”> </script>

With WWW.YOURWEBSITE.COM the location where you uploaded the post_data.js file.

Then you can add the following lines, where best suited (although they must be between the <Blogger> tags).

<ItemPage>
<script type=”text/javascript”>
var BlogItemNumber = ‘<$BlogItemNumber$>’;
var previousArray = previousPost(blogger, BlogItemNumber);
if(previousArray[0] == ”) document.write(‘&lt;&lt; Previous | ‘);
else document.write(‘<a href=”‘ + previousArray[1] + ‘” title=”‘ + previousArray[0] + ‘ (‘ + previousArray[2] + ‘)”>&lt;&lt; Previous</a> | ‘);
</script>
<a href=”<$BlogURL$>” title=”Home”>Home</a>
<script type=”text/javascript”>
var nextArray = nextPost(blogger, BlogItemNumber);
if(nextArray [0] == ”) document.write(‘ | Next &gt;&gt;’);
else document.write(‘ | <a href=”‘ + nextArray[1] + ‘” title=”‘ + nextArray[0] + ‘ (‘ + nextArray[2] + ‘)”>Next &gt;&gt;</a> ‘);
</script>
</ItemPage>

You’ll then need to save your template, and republish the whole blog.

Step 5.
If you use HaloScan, and are a Premium Member you can add these two lines of code to your HTML Template.
Between the HEAD tags add:

<script type=”text/javascript” src=”http://WWW.YOURWEBSITE.COM/post_data.js”> </script>

And where you want the title of the post to appear add:

<script type=”text/javascript”>document.write(‘<br /><a href=”‘ + blogger[‘{HSPageID}’][1] + ‘”>’ + blogger[‘{HSPageID}’][0] + ‘</a>’); </script>

Hopefully it should all work after these steps, if you have any problems, leave a comment. The only problem is that you’ll need to generate the javascript code after every post, and that you’re limited to only 999 posts.

Hitchhiking to Peterborough

Today, driving back from Hemel to Lincoln, me and Heather decided to go via Peterborough to do a spot of shopping.

On route at Hatfield, just before the A1(M) a hitchhiker was asking for a lift to Peterborough, so I stopped and picked him up.

Now I’ve been hitchhiking before, and have always promised myself to pick up anyone going my way. I’ve only seen people a few times, and they’ve always been going the opposite direction.

Luckily for myself, Heather and the hitchhiker, none of us were axe murders, and we all managed to get to our destinations safely.

Students sign up for weekly grant

With the news that more 16 and 17 year olds are being bribed to go to school, occurs on the same day my statement from the Student Loans Company (SLC) came through.

Now what I find shocking, is that although in the last tax year (April 2003 – March 2004) I paid off £550, I was charged £250 in interest. Now of course I understand that the loan is index linked, and the interest rate was 2.5% (or something similar), the problem I do have is that the £550 taken from me, by the Inland Revenue, never accrued interest whilst they were holding it for me, to give to the SLC.

So I’m asking those MPs that read my blog, is this really fair?

The Sun Says

In today’s Sun editorial, they ask this question

The question all the doubters must answer is this: Have you got a better way of fighting terrorists?

So my answer to the Sun must be this: More Policemen

Also in the main story, the only reason they give for having ID cards is

A: Ministers say the cards will help fight terrorism, illegal immigration and identity fraud

Exactly how they don’t say.

Whilst I on at the Sun, all of the letters seem to believe that Blunkett resigned due to “family issues”, that he was the best Home Sectary yet, and that he should still be in the cabinet, yet I’m pretty sure the resignation was to do with the fast tracking of a visa.

Tobacco advert rules introduced

Whilst I’m pro ban of smoking in the work place, and hate the smell of tobacco, does anyone else really believe this will work?

In the days before tobacco advertising was banned in the media, did children really get what the adverts were about?

All I can see happening now at point of sale, is a whole lot of 200 cartons stacked up where the small adverts used to be.