Human Age Smarty Modifier

The Smarty Modifier “Human Age” works well under Blogsome, I’ll ask the admins to install it. It’s used like:

1     {capture name=pdate}{the_time d="U"}{/capture}
2     {capture name=cdate}{comment_date d="U"}{/capture}
3     {assign var=since value=$smarty.capture.pdate|human_age:$smarty.capture.cdate:true:2}

Then, where you want the data to go: {$since} after the fact. Note: this is not installed on the main Blogsome server yet. However, you can already use: {human_time_diff from=$smarty.capture.pdate to=$smarty.capture.cdate} after having captured the dates. It isn’t quite as nice as the other version, as it only displays minutes/hours/days, but it will do for now.

JavaScript Snippet: Get Trackback URL

Here’s a nice little bit of JavaScript that grabs the Trackback URI of the current post. I’m not quite sure how to use it yet. It would be nice to be able to automatically add this to the BlogThis link, but there’s no way to do so, since cross-site scripting is disabled.

1     document.body.innerHTML.split("trackback:ping=\"")[1].split("\"")[0];

The other thing that might be cool is to copy this to the clipboard, but I’m a bit loath to do things like that which are “invisible” to a user.

Turning off Google Ads

Michael, over at Binary Bonsai, has written about how he turns off Google Ads (or any other type of text) for readers who have commented. No Ads for Regulars at Binary Bonsai Here’s how to do the same thing at Blogsome, using Smarty Tags. Just before your Ad Block: {if $comment_author == ""} And then after, use: {/if} Then, readers who have commented on your blog won’t see your Advertisement(s). This only seems to work on a Post page. For some reason the cookie isn’t checked on other pages. I’m still looking into this.

PNG file sizes

I didn’t realise that PNG file sizes could vary so much. I was taking a screenshot using Windows, and initially, saving it in Paint, and then using Microsoft Office Image Manager to convert it to a PNG. Then I discovered the machine I was on had Fireworks, so I pasted directly into that, and saved as a PNG. The Fireworks PNG was around 3-5 times as large as the other one. I would have pegged it as being the other way around. I actually came across a program I had downloaded the other day that is a one-trick pony – it compresses PNG images. This made a similar difference in sizes.

Changing Interests

It’s amazing how much and how quickly one can change their attitude towards things. Take the following comment (by me), posted on the Blogsome Forums on Sun Aug 07, 2005 10:28 am.

I try and avoid JavaScript where possible , and cannot tell you if that is valid code or not. What I would suggest is that that code does not belong in the StyleSheet – put it in the Main page template, and see how that goes.

I have become a full convert to the greatness that is JavaScript. Since that point in time I’ve developed quite a library of functions that control various features on this blog, from disallowing Spam comments, to making checkboxes appear as lovely images instead of the ugly normal checkbox. Perhaps my favourite component is my floating window. I’ve mentioned it briefly, but it basically allows for <div> tags to float over the top of other items on the page. They can also remain fixed while the page scrolls, yet be moved to another position, and stay on that point, relative to the window. (This is broken under IE, and others that do not support position="fixed"). I think the irony is that I was very opposed to JavaScript, but had to use it as there was no other way to really control stuff under Blogsome. But, as chance would have it, I discovered just how powerful a language it really is, and now most of my coding is done in JavaScript, with the remainer being PHP Smarty Tags. I can’t remember the last time I wrote a python script. In all honesty, I’d love to be able to supplant all of my JavaScript with python, but I don’t think that will happen. Browsers will always support JavaScript, and XMLHttpRequest() really is pretty cool, but I don’t think they’ll start inlcuding python any time soon.

Scholaris FrameworkID Error

When I try to Assess student work using Scholaris, I come across the following error:

Class: Assessment Function: GetAssessmentVerbages(ByVal FrameworkID As String, ByVal SchoolID As String) As DataTable

* * *

Current function cannot be executed due to the following reason: *FrameworkID is empty Please take a screen shot of this error message and send it to support@solutionsit.com.au

* * *

It then doesn’t display the student work that was submitted, and I can’t mark it, or return it to the student. I get several other functions giving the same error, two on the way in, and three on the way out. Very annoying, as it means I can’t complete the full cycle of assessment using this tool, which means I’ve hit the limits of it’s usefulness for now.