Well, let's look at what the file is doing and you can see if it's what you are expecting it to do.
It connects to a MySQL server and gets all records in the table named sessions. Then it loads the first record from that table into an array called $row. It gets the ip and session fileds from that array and puts them into variables called $ip and $session.
Then, if your IP is the IP from that record and its status is 1, it shows "yourloc.gif". If your IP isn't the same as the IP from that record, but its status is 1, it shows "connected.gif". Otherwise, if your IP isn't the same as the one from the record, and the status isn't 1, it shows "notavail.gif".
Edit: cleared some stuff up.