Skip to content

Blog

WPGet 0.7 preview – Ajax comments

It’s completely devoid of any styles and probably very unstable and buggy, but here’s a quick preview of what the new Ajax comments feature will act like in WPGet 0.7.

See the preview

Any comments, suggestions, things I’ve forgotten and of course, pre-emptive bug reports are more than welcome. Note – 0.7 is still a long way away (depending on the level of development time it gets, which may vary), there’s lots of new features still to do and some stuff I’m going to change to make the code leaner and easier for me to manage and other people to read.

The current code isn’t available as it’s really messy, incomplete, buggy and subject to major changes until the release. If someone really really wants it despite all that, though, I might be convinced to hand it out…

WPGet – a question to all users

I’m working on the new inline Ajaxified comments thing in the next WPGet release (where you click the comments link, and theoretically a little box will pop up and show you the latest comments on that post). I have a question to ask as to how best achieve a solution to a problem I’m facing. If you don’t want to delve into the technical reasons behind this, skip a couple of paragraphs and rejoin. I really do need the users input here as to what the best way of fixing it is, so please please please tell me what I should do.

I’ve run into an interesting problem. In order to do this cool Ajax stuff, I need to pass some special information in the URL so that WPGet springs into action and delivers the Ajax content you requested (pulling out comments out for each and every post would be far too database intensive).

However, WPGet is included by another page, which means that the user doesn’t access the wpget.php file directly, all of that is be handled by the master script. That makes it a pain to get that special information passed in the URL, as I can’t control the master script invoking WPGet and change how it works.

Basically, if I cut the technical drivel, which of these solutions to this problem is better?

  1. At install time, you have to paste two bits of PHP into your file – one snippet of code at the top to handle Ajax stuff (this is the new bit) and one where you want the posts to appear as normal. This would only affect people wanting the Ajax functionality.
  2. Only one snippet to copy and paste, but we ask the users at install time which directory wpget.php will be located relative to the script calling it (index.php for example). In most cases, it’s the current directory (index.php and wpget.php in the same folder), so novices will leave it at that and there’s no problem. For people wanting to put it in /includes or whatever, they would have to remember to state this during the setup process.

    Technical talk – in this solution, when Ajaxing, we’d request the wpget.php script directly in the URL, along with our arguments, so therefore we need to know where it is relative to $_SERVER[‘PHP_SELF’]

Now, there’s clearly arguments for and against both and I don’t want to complicate the installation process too much. These measures probably won’t affect users not wanting the Ajax comments functionality, but I really want to keep installation simple.

I am relying on you to tell me which solution is best, as I’m not really sure. Particularly Lee, as you suggested this feature, what do you think is best?

Alternatively, I’m if (likely) being incredibly stupid, someone please tell me how to get the current file’s web-accessible filename from within PHP (not the filename of the file that calls wpget.php, but the wpget.php file itself).

MacWorld is from now on called AppleConsumerElectronicsWorld

I’m pretty disappointed about no news of Leopard and for the first time in a long time, no iLife/iWork updates at the Macworld 2007 San Fransisco keynote.

It was all iPhone, Apple TV and all that. Yeah, pretty cool – but not what I was really looking for. Apple may have just as well gone to CES, because there was literally no Mac stuff in the whole keynote (I didn’t watch it, but I was following the MacRumours live feed). And I wanted a 10.5 date…

I am pretty disappointed that we still only have the oh-so-slightly vague ‘Spring’ as Leopard’s release date. Oh well…

WordPress 2.0.6 upgrade

Just upgraded to WordPress 2.0.6, and all seems to have gone well!

As ever, it was as simple as merging the new files over the old ones and running the upgrade script! Well, and applying my custom error message hack (if anything goes wrong you see a friendlier message than the default), but that’s my hack and not part of WordPress.

If anyone does notice any problems though, let me know somehow.

PHP class for making HTML tabs – coming soon

Oh – forgot to mention this.

Reasonably soon, I will be releasing a new bit of code to the world. It was born out of some useful stuff from the Livelocity project – and it’s a PHP class that will automate the creation of tabs in a web page.

When I say tabs, I mean – the kind of tabs you would have inside a dialogue box in a desktop app to have lots of stuff in one window, whilst keeping everything organised. There’s currently no HTML widget which provides a tabbed interface out of the box, so you have to build the tabs yourself, with CSS, JavaScript and HTML.

This is where my code will come in – it’s some really easy to use PHP where you can simply call it and it will generate all the HTML, CSS and JavaScript needed to make a nice tabbed window (with Ajax capabilites and fallback for users without JavaScript).

I’m sorry if this makes no sense – it’s too late and I’ve been coding for too long. There’s a bit of cleaning up work to do on the code, so I’ll try and get it to you as soon as we’ve got the Livelocity Beta out the door and I have a bit of free time.

It’s likely (but not yet completely decided) that this will be released under a BSD-style licence (aka “take it and do what you want, but give me credit”).

(Subtle?) site updates and some miscellany

Since it’s now 2007, I’ve made a couple of changes to the main site and my homepage. I’ve updated a lot of information, changed some wording here and there to make it a bit more coherent and relevant.

Unfortunately for you, the worst change is you now have to look at a picture of me on the homepage. 😛

Also, I just want to reiterate – the blog content (everything in the /blog folder) is licensed under the Creative Commons BY-NC-ND 2.0 UK licence. That means you can republish my stuff under certain conditions. Click through on that link to see what you’re allowed and not allowed to do (it’s reasonably permissive). If you want to use any of my blog content in a way that doesn’t fall under this licence, I’d appreciate it if you’d get in contact. In most cases I’ll let you do what you want without charge, so it’s definitely worth asking!

All the content on the main site (i.e. everything not in the /blog folder) is not affected by this licence and you’re not generally allowed to republish it. In fact, most of it would be pretty useless on another site. If, however, you want to use this anywhere (apart from fair use and all that), then contact me and we’ll work something out. Content made available under the /files folder might be subject to other licences, like the GPL, LGPL or the BSD Licence, so check that too.

Sorry to have to put you through that, but I need to just keep everyone informed as to what the situation is.

Anyway, Happy New Year everybody!

Quick disclaimer – I am not a lawyer. I have to say this.

Happy New Year

On a slightly more upbeat note than my last post, here’s another blog-wide celebration for tomorrow – when all the numbers tick over and it’s 2007.

So, Happy New Year everyone!

More PHP OOP tutorials will be coming in the next few weeks when I have time to do them.

Never trust ‘sponsored’ studies

From InformationWeek:

Running Windows Vista’s new Aero graphical interface doesn’t impact PC performance, a study sponsored by Microsoft claims.

According to speed measurements of more than 60 common business chores, which were conducted by North Carolina-based Principled Technologies for Microsoft, using the Aero interface “had little or no negative effect on Windows Vista’s performance.”

Rule number one is never believe the results of any study ‘sponsored’ by any company/organisation with any interest whatsoever in the results. Even not-for-profits like Mozilla. Only independent studies. Bias sucks.

Don’t believe this. Or any other ‘sponsored’ study.

Productivity is using virtual desktops

I love virtual desktops. They rule – they come as standard in virtually every Linux setup and you can get third party programs for other operating systems too. Combine that with the eye candy of Compiz and you have productivity and beauty in a crisp sugar shell. Sorry about the Smarties reference.

Anyway, this is my setup for coding. When I’m happily hacking away (like I have been for the past, oh – four days non stop?) I like to have my virtual desktops like this. By the way, clicking on the screenshots will not allow you to spy on me – they will not get any bigger. Don’t even try. Sorry about the blur too. Needs must, I’m afraid.

» Read the rest of this post…

I’m back

Wow, that was a long time away from blogging (not). Forgive me if I’m brief – I’ve been typing almost all day, mostly PHP code. My eyes are almost bleeding after getting a nice solution to a nasty problem. I love finding solutions to problems, it’s awesome.

Development is coming along nicely, taking up almost all of my time. Thanks to the 25th of December, I now actually have the ability to purchase a MacBook now – but I’m not going to yet, because I am waiting very patiently for Leopard. In the long run, waiting will be a better thing to do. Believe me, it will.

Anyway, I think it’s photo time, don’t you?

» Read the rest of this post…