kieranbarnes Independent PHP, WordPress & CubeCart Programmer

Redirect a www prefixed site to a non-www prefix

Posted on July 10, 2007

Posted by Kieran

I like clean URLs.

Nicer Pagination with ADOdb

Posted on July 7, 2007

Posted by Kieran

Or should that be Nicr? To follow in an annoying theme.

Olavo Alexandrino wrote a nice well rounded class for record set pagination in ADOdb. If you've ever used ADOdb's version, you will know it is not very good, to say the least.

Although Olavo did a fantastic job on the logic, the presentation left a little to be desired from my perspective.
I am providing my modifed version for download below, it provides a few logic updates and better presentation.

Idiot Proof Lightbox

Posted on July 7, 2007

Posted by Kieran

I've just made some modifications to my Gallery code which is part of i9000's small site CMS software.
It adds some client side logic to make sure the images Lightbox 2 creates fit the users screen perfectly. Previous to this some customers were complaining that the images they uploaded were too big for their visitor's screen.

This allows us to present the largest possible image to the user without scrolling around the page.

Tagged as: Continue reading

Poor mans currency conversion

Posted on July 3, 2007

Posted by Kieran

I recently completed a project that required currency conversion. I was limited what I could get out through the corporate firewall, so I came up with this.
It connects to Yahoo! with curl and reads a CSV string into memory.

Tagged as: Continue reading

Read a file into an array

Posted on July 3, 2007

Posted by Kieran

Here's something that puddled me for a while...

$filename = 'file.txt';
$file_handle = fopen($filename, 'r');
$data = '';
while(!feof($file_handle)){
$data .= fgets($file_handle, 1024);
}

Filed under: PHP No Comments

Converting XLS to CSV. Simple, eh? Well, sorta.

Posted on July 3, 2007

Posted by Kieran

I hate problems that can be solved really easily. (With a totally different set of tools). I needed to open Excel (XLS) files in PHP. Simple enough you think, IF you are using Windows.

IF I was using Windows, I would have a bunch of options open to me, I could use PHP's COM & .NET functions. Or PHP's ODBC functions. Or a selection of classess from PHP Classes.

NTLM Authentication (Active Directory) on Apache (Linux)

Posted on July 3, 2007

Posted by Kieran

Here is a quick guide to enabling NTLM authentication for Apache 2.
I generally use Ubuntu, so I am a heavy apt-get'er, but I prefer to build my apache from source.

Apache2 mod_deflate

Posted on July 3, 2007

Posted by Kieran

The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.

Lazy man's description, your pages load quicker.

Card Reader Annoyances

Posted on July 3, 2007

Posted by Kieran

My new Dell computer came with one of those 1,600 in 1 internal memory card readers. The 1,600 drives in 'My Computer' really irritated me.

OK, so I exaggerated slightly. But the extra 3 drives did irritate me. My cameras use SD cards so I can safely disable the ones I don't use.

Tagged as: , Continue reading

Apache, JungleDisk and Port 80

Posted on July 3, 2007

Posted by Kieran

I was tearing what little hair I have trying to solve a very strange bug on Windows with Apache 2 & JungleDisk.
(Yes I use Amazon's Simple Storage Service for all my backups).

I was getting the following errors in Event Log, for what appeared to be no reason.

The Apache service named reported the following error:
>>> (OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 .

The Apache service named reported the following error:
>>> Unable to open logs

Page 34 of 35« First...1020...3132333435