Archive for September, 2005

Free recruitment sites are up

Saturday, September 24th, 2005

We´ve got a load of progects on the go and one of the main ones is the Find Local Jobs part of Find Locally. While we´re building up towards our launch in a few months, we´re doing a free version in some job areas such as Accounting Staff. These sites are based around the same code as Find with the invoicing systems disabled so it didn´t take long to check the code and get it up and running.

 
The only difference was the template used on the sites. Although they are all different in terms of colour schemes and images, they all use the same layout so by using the $_ENV["SERVER_NAME"] variable I could easily apply a different style sheet and image name to the template.
 
The best bit though was the tabs at the top of the page. Instead of having to do it the old fashioned way with tables to and images to create the tabs, this is all done through very cool css and then implemented as a simple div and ul. A simple id="current" in the li tag switches it from being a background tab to the current one. Nice!

GA-K8NXP-SLI Windows Install

Friday, September 23rd, 2005

This should hopefully help someone avoid the nightmare that I had getting windows onto this motherboard. SATA is ace but getting XP to boot and see the disks is a ball-ache, so here´s how you do it with this motherboard.


  • Go into the BIOS and "Load Optimised Defaults"

  • Set the First Boot Device as CDROM

  • Go into the SATA setup thing

  • Choose "Create RAID Set"

  • Choose "JBOD (Single)" for one drive or the raid setup you want

  • Set the drive size and then exit
  • Go to another PC and put in the motherboard driver cd

  • Go to the "BootDrv" folder and double click on "MENU"

  • Choose option "I"

  • Start the new PC with Windows CD in

  • Press F6 to load additional drivers when it asks

  • When it asks for the additional drivers shove the floppy you just created in and load the XP drivers
  • Continue and all should be OK

This worked for me but if it doesn´t for you then email someone else. I´m a web developer, not an IT support technician and this PC I´m doing now isn´t even for me! God, I hate this stuff…

First vBulletin forum is up

Friday, September 23rd, 2005

After days of messing around I´ve finally got our first vBulleting powered forum up and running. The NHS Forum needed a bit of tweaking to get it running so I had to start messing around with the code before we could launch it.

 
The main reason was that we wanted it to be for NHS staff only. This was "easy" to do since they all have an email address with the .nhs TLD, so if I could get the registration process to make sure that they signed up and activated their account using a .nhs email address they were definately NHS staff. The other thing was to get some additional information during the registration process (such as the specialty they work in, and region of the country) and remove some of the other fields I didn´t want (such as time zone).
 
The first thing I did was load up the register.php file hoping that it might be a simple case of editing this. How wrong I was. After a couple of hours of messing around and looking through all the files and the database I managed to get a good understanding of how it all worked and found some features in the admin panel that I could use to cut some corners. I´ll put a breif account of what I did here in case anyone else is trying to do something similar.
 
The PHP files that make up vBulletin are mainly functions that access various areas of the database to construct a given page. In the case of the registration page they do various things such as error checking on the form, inserting the deatils into the database and displaying the next page in the registration. For a given page the database contains the template information in one table so altering this was just a case of finding the right entry in the table and editing it to do what I wanted.

 
This meant that I could remove areas of the registration form that I didn´t want just by editing this entry. The next step was to add field where I wanted them. Since I didn´t fancy going through all the files to find out where I would need to add my code or alter sql queries I headed for t´interweb to see if there was an easier way. This is where the Custom User Fields comes in. This lets you specify additional user fields that can be enforced during the registration process and can be edited in the admin panel so that you don´t have to go messing around with code. This made it very easy to get the redistration form just the way I wanted it.
 
The last bit was to make sure email address was a .nhs one. I found the function that verifies the email addresses and just edited this to throw up an error if the last part of the address wasn´t right. With the other varification vBulletin does as standard and the confirmation email to activate the account, it now does everything I need it to.
 
I finished it off by finding the "posts" template and editing this to include my custom user fields and then it was all done. We´ll be launching next week so I´ll see how it goes and get to grips with all the moderation stuff.

FTP and PHP between 1and1 servers

Wednesday, September 21st, 2005

We have a series of job advertising websites as part of the Find Locally group of sites which, for the time being we have decided to offer as a free service under another set of a dozen or so domains (IT Positions etc).

 
This was supposed to be a simple project since the code is already written for the Find domains so I just needed to set up the templates for the new sites and then check all the scripts to make sure everything was OK and make a few minor changes.
 
One of these changes was the way the site will store CVs and documents the jobs advertisers upload which are stored in a hidden directory and then fed out to the user through a session protected downoad script. All this was working fine but since a user could stumble accross a job advert on either a Find site or one of the new sites, I needed to make sure both the advertisers files and the user´s CVs were available to both sites. This wasn´t a problem either as it was just a case of FTP-ing from one to the other and vice-versa when someone uploaded a file. Or so I thought…
 
After two hours of subtly re-writing the FTP script, checking all the settings, SSH-ing into both servers to see if I could do the FTP upload manually (which worked, dammit!) and checking with other scripts that I´ve used this technique on (which worked, dammit), I was getting very, very wound up (I might have broken a keyboard).
 
By the time I´d done all this though it had got to the stage where I could either stay for the long haul or call it a night, so I decided to go home and forget about it. I didn´t do this of course, but instead spent the entire bus journey thinking of ways I could do it without using PHP´s FTP functions. That´s when I thought about doing the file transfer over HTTP.

 
I´ve often used PHP´s file function to trigger a script to run on another domain (e.g. PDF invoice creation) which causes the PHP script to run on the second domain without affecting whats going on at the first domain. Since I knew where the files where to be stored on both domains I figured that I could just use an "file" call to the domain without the document from the domain with the document. The domain without the document could then use fopen and then fwrite to it with the contents of something like this:

 
fwrite($fp, implode(file(´http://´.$firstDomain.´/´.$pathToFiles.´/´.$file)));
 
which would pull the file across HTTP as if it was any other download byany web client and then save it to an identical file. The variables used are passed through GET as part of the "file" call and after testing the whole thing… it worked without a problem!!! I never really liked FTP anyway…

Image Verification and Comment Spam

Wednesday, September 14th, 2005

This blog and a few others that people I know use are run off php scripts that I wrote. Instead of an all-singing all-dancing set of scritps I´ve generally just added bits to it when it´s been needed.

 
The latest problem we´ve had is comment spam. I haven´t bothered to track down who it was but the content was always MIME code (the stuff emails are made up of) which doesn´t really make sense since most comment spam is used to boost a sites serps. I have finally got around to sorting it out though.
 
Now all the post´s comment forms have one of those images where you have to enter the string of characters into the box to enter a comment. It´s all done by through php which randomly generates a string of characters, creates an image with the string in it, outputs the image to the browser and then destroys it. It also stores the string in a session variable and then when someone submits a comment it checks that what they´ve entered to see if it matches what is stored in the session. If not it outputs an error message. Job done.
 
Now lets see how long it is until some bored script kiddie reads this and tries to hack it!

Just testing - Ignore this

Friday, September 9th, 2005

I´m testing the "add post" script - thats all

Downloading a bit slow

Monday, September 5th, 2005

Someone asked me over the weekend why their downloads are always a lot slower than the speed of their internet connection. They are on a 2 meg adsl connection but said that they could only download at a maximum of 256KB/s (ish). Thing is, this is absolutely correct.

 
The speed of the adsl connection is given in Kb/s (Kilo Bits per Second) and the speed that Windoze reports the download going at is in KB/s (Kilo Bytes per Second). Since most people don´t even notice the capital B, let alone know what it means, so here goes. There are 8 bits in a byte so to find out how fast you should be able to download just divide your connection speed by 8. Either that or search for a large file on microsoft´s site (they always download as fast as possible on most connections) and download a bit to see how fast it is.

Panasonic TDA30 Maintenance Software Download

Thursday, September 1st, 2005

I was a bit bored this afternoon and wanted to have a play around with our phone system but don´t have the software for it anywhere so I hit the interweb looking for it.
 
I found a tek forum (can´t remember which one) where another guy was trying to find the same thing. Unfortunately the rest of the people on there were vendors and were getting way too arsey about the fact he wanted the software without being a certified Panasonic whatever. Luckily somebody put a link at the bottom with a link to Panasonic´s UK site that has the Panasonic TDA30 software for download for free.