September 21, 2003

Lots of coding but not much time to update :p Unfortunately, the coding has mostly been for my consultancy stuff and so I’ve not been working on Blog as much as I would like. First, there was C# stuff to be done since one of my old clients had a problem with an ASP.NET component that I’d done for him to access CSV data as you would a database file – at least as far as reading the data went. Microsoft seems to have their own ideas about how to do CSV files and there is no standardization at all (go figure :p) and so files created in Excel would not work with my CSVReader component. So I had to go in and add a patch to make it get along with CSV files created from Excel.

Then there is the PHP project I’m doing for Martin. I’d already done phase one of the project which was a web interface to create a graphical representation of a sign on the fly using given text, fonts, colours etc. For phase two, Martin wanted to be able to allow the user to upload an image, specify the positioning and optionally, be even able to resize the image and then add the text on top of it. I’d done the original code a specific way since there was no file upload involved. However, when I got to phase two, I realized that I couldn’t do things the way I’d done originally – where I’d gotten all the form input and then used JavaScript to put it all together and call a PHP script to generate the image on the fly and display it on the same screen. For this, I couldn’t do it that way since there was the uploaded image file to consider. So I had to go back and rewrite things from scratch and I had to allow for temporary image files to be created on the server, saved and used between each reload of the interface. This took some doing and I don’t really like it that much since this creates a lot of files on the server. However, I’ve added a cleanup routine which clears up all these temporary files at a given time interval and so it’s not that bad either.

This particular project is keeping me fairly busy since in addition to all of the above, I also had to figure out how to create an e-mail in PHP with attachments. The way I normally work with a programming language is by picking up what I need as I go along. So I had never done e-mails with attachments in PHP before this and I discovered that the PHP documentation was kind of sketchy about how to do things since it simply pointed me to a different website which actually had lots of explanations about MIME types but the final example code was extremely convoluted and complicated and I didn’t want all of that :p So, I simply sat down and broke down the code and got only the bits I needed and came up with something which actually seems to work after some tweaking :p

Of course, there is another bit of PHP code that I’ve been working on in the midst of all of this – the comments system that my wife uses on one of her sites :) Yes, it looks like the same as the comments system which is used here .. but it’s not :p I used the original code but modified it so that the comments would be saved to a mySQL database instead of being saved into text files. In addition, I added the ability for multiple users to be hosted on the same comments system and the ability for each of those users to have multiple blogs with comments. In fact, a full blown, remote server commenting system :) The system itself is a bit buggy (as you’ll notice from all the test comments on my wife’s blog if you were to go there :p) but I’m slowly getting the kinks out of the system and getting it on the road to being a useable system.

So what of Blog you ask? Well, I’ve got the HTML editing stuff working and I need to find some time to sit down and test that the publishing of entries and uploading of images works fine too. Once I get that done, I can release the first beta. However, there is so much going on with other code (plus lots of shenanigans at work … about which I might rant one of these days on SM :p) that it might take a little while. So bear with me :)

Be Sociable, Share!
Tags: General
Posted by Fahim at 11:28 am   Comments (1)