Archive for September, 2006

Topic Listing

Here’s an early preview of the topic listing in a board, it’s not finished, I have to do the sticky threads, and most like will add in some announcement feature, that will come later once I have most of it done.
http://www.pixeldepth.net/images/Peter/pDBB/topics.gif

All the data is dummy data, so none of it are real topics / posts, I haven’t got that far yet, though I did start the post class which will extend the board class.

I really could do with some sticky, stick locked icons, need to be free to use though.

Saturday, September 30th, 2006 Programming, pDBB 2 Comments

Championships + pDBB

I should have really been playing in the Suffolk Badminton County Championships earlier today, but 1. I didn’t send my entry form, and 2. I’m not ready :P. If everything goes well next year, then I will definitely be entering. Right now, my fitness is not where I would like it to be able to compete in something at that level, but hopefully next year i’ll be there and winning it ;).

Haven’t done a lot this week, done some bits and bobs for clients, just tweaking existing products, and getting them ready for install.

Over the last few days, I worked on my forum, haven’t done a lot to it, just finished the code tweaking to cache queries and update them when needed. Today I worked on the board class, basically this class does everything from showing sub boards to showing posts, so this will take some time. At the moment i’m busy writing the get topics function, am trying to keep the queries down to a minium. I would have liked to use 1 query, but it was getting a little too big, sometimes it’s best to split queries up, so this is what I will do.

Right now, i’m sitting here browsing forums to see what’s interesting, which isn’t much. I’m pretty bored, there is nothing good to watch out of the 100+ channels that SKY offer, waste of money most of the time.

How many of you have some sort of digital TV? Do you think it’s worth the money?

Friday, September 29th, 2006 General, Programming, pDBB 2 Comments

Coding Books

Today I decided I would buy an SQL book, there wasn’t a lot to select from at the bookstore, but I really needed one to brush up on SQL and learn a few of the other things i’ve never used before. I have a few books i’ve brought, 4 Javascript books, 1 PHP book, and now this SQL book.

The 3 of the Javascript books I never look at now, as 2 of them just cover the basic stuff, and the 3rd covers Dynamic HTML, has some cool examples in it though, but nothing need to use. My 4th Javascript book is my favourite, and I would be lost without it. It’s basically a complete reference which includes HTML, CSS, Javascript (including DOM). It’s probably the best book ever, and I only hope there will be a new edition, though I haven’t found any information, so if anyone knows, let me know. The book is called “Dynamic HTML, The Definitive Reference, by Danny Goodman (2nd Edition)”.

My PHP book just covers the basics, sometimes I will have a quick look through it if I have forgot something, sometimes I have to look up something in my books when I have forgot a simple property or method :p. For example, when connecting to a database, I can never remember how to do it, as it’s not something you do all the time, usually you just copy and paste the code, so you don’t remember it :p.

What coding books to you have on your shelf, and which are your favourite ones?

Tuesday, September 26th, 2006 Programming 6 Comments

4 & 6

Caching the queries is working well, for guests the index page is down to 4 queries, and for members it is at 6 queries. This will go up by 1 when I do the last 5 posts in the info centre, but it’s looking good. My target was around 11 queries, but now that some are being cached (bots, categories, settings, groups) as the data in them doesn’t change unless it is via the admin control area.

I have to tweak the code in the admin area now to update the cache, but that’s pretty simple to do.

Monday, September 25th, 2006 Programming, pDBB 8 Comments

SQL Query Cache

Today I fixed a few pDBB bugs, mainly in the users online function, for some reason IE didn’t like the way the cookies were being set, because recently I change the cookie function to support the http only flag. That’s fixed now.

I also cleaned up the queries for the categories and boards, at the moment it uses 2 queries, 1 for categories and 1 for boards. But I have added a new feature into the main class to cache query results. So now index page will only query the database if the category cache doesn’t exist. I have also done this for the settings, and will do it for the permissions (groups), so I should be able to keep the index page query count that have to query the database between 6 and 10. I shall be able to query other results on other parts of the forum as well, but the main one I was worried about was the index page, as that uses index.php, the most used file.

Possible things that I could do is cache other queries like updating topic views every so many hours. I will most likely implement some options in the control panel to allow the use to enable / disable it.

Right now the query count is at 7, this will drop to 6 once I cache the group permissions. I could cache the boards as well, only update the cache when the last post is greater than the cache file modify time. Hmmm, will think about that one.

But yeah, i’m happy. Once I get the group permissions done, I will be very happy, as most of the time over the last couple of days has been spent optimizing and changing loads of code.

Sunday, September 24th, 2006 Programming, pDBB No Comments

pDBB; What a boring day it has been

I spent all day on pDBB, but it hasn’t been a fun exciting day.

It started off early this morning, I started Apache & MySQL, and entered the URL for pDBB to begin coding another feature, but I decided to whack in counter in the MySQL driver to see how many queries were being used on the index.php page. My GOD, I was furious, I couldn’t believe the total query count. I decided to do some debuging to see what queries were being done, and most of them came from the listing of the categories / boards and the info center, mainly the users online section.

About an hour had passed, thinking what a n00b I was, so I decided to rewrite the entire users online function which wasn’t fun, as I had to create a new MySQL table to include members, guests, and bots so they were all in one place, and alter other files that was related to the users online section. I managed to get that to 1 query, cool. But there were a few others that were using too many queries, so I spent quite a few hours going through the whole code.

I’m nearly there, I have to redo the category / board function, I should be able to get that to 2 queries. 1 for the categories, 1 for boards + total topics + total posts + last post information.

So, not fun, pretty stupid of me though, I really should have thought things through before writing those parts, but least I have learnt some news things from reading the MySQL manual, I really need to get a MySQL book, something I have wanted for a while now.

Friday, September 22nd, 2006 Programming, pDBB 2 Comments

pDBB Update & http only cookies

Been working on pDBB quite a bit now, even though I really should be doing other stuff :p.

Yesterday I done the displaying of categories, boards and sub boards. With pDBB, I decided to only allow boards to go 2 levels deep, I think a sub board inside a sub board is too much really, but allowed it just incase people needed it. Along with that, I got the redirection boards done as well, you know what I mean? You click on the board title which is really a link to somewhere else and it records the hits.

A long with those things, I added support for http only cookies which works in Internet Explorer fine, but obviously Firefox doesn’t support it yet, so I will use some Javascript like IPB 2.2 does (recently released, some nice features added), and just obfuscate the code. In Firefox, you need to prevent people from accessing document.cookie, the way to prevent that is to set the property to null by using defineGetter. All we do is make the function return null, so when you call document.cookie, you will get “null” in Firefox. Another problem is though, if an XSS attack was possible, then the attacker can just delete it…

[js]delete HTMLDocument.prototype.cookie[/js]

…then you have access to the cookie property again.

One solution is to replace any occurrences of “HTMLDocument.prototype” in the document, which I believe IPB 2.2 does. But this isn’t fool proof, because if the attacker was able to pass through a script using the script tags, then the Javascript which replaces “HTMLDocument.prototype” would be too late due to it being called with the onload event. Things like urls and maybe images would be safe, because urls need user action on them to be able to execute the XSS code (onclick event for example). Images on the other hand can run Javascript through the src property or via events. To run Javascript without a user action, you could use the onload or onerror event for the image (onerror if the image url is fake).

Now there is a problem, how do you access other cookies? For cookies not tagged http only, you could create an object to store these so you have access to the information, this would need to be done before you do the prototyping. You will still be able to set cookies in the document, you just wouldn’t be able to read them using document.cookie.

Hopefully this method will cut down on XSS attacks that steal user credentials.

Thursday, September 21st, 2006 JavaScript, Programming, pDBB 2 Comments

Busy Weekend

It’s been quite a busy weekend for me even though I wasn’t doing much work for clients. Saturday afternoon and most of Sunday was spent tweaking and adding new features to the pixelDepth software (http://pixeldepth.net). I wrote a new module to handle affiliates. It’s got off to a slow start, I would have thought more people would have joined to advertise, either way, i’m happy with the feature.

Today spent quite a bit of time doing nothing :p. Well, not exactly true, I did help out with Ron’s (http://ronsguide.com) new forum software he is building. I’m helping him beta test it to squash as many bugs as possible before it goes public. Overall it’s look very nice, hopefully the forum will do well.

This evening I done some work on pDBB, which is my forum i’m working on. For those that haven’t seen what it looks like at the moment, just look at these screen shots. Note though, the skin is what I came up with, it will obviously look better than that once it is done.

http://www.pixeldepth.net/images/Peter/pDBB/infocenter.gif

http://www.pixeldepth.net/images/Peter/pDBB/forum_settings.gif

http://www.pixeldepth.net/images/Peter/pDBB/register.gif

http://www.pixeldepth.net/images/Peter/pDBB/login.gif

http://www.pixeldepth.net/images/Peter/pDBB/forum_settings2.gif

http://www.pixeldepth.net/images/Peter/pDBB/confirm_settings.gif

A few things may have changed since I took those screen shots, but they give you an idea.

At the moment i’m working on the admin side of things before the public side, once the admin stuff is done, things should move along much quicker.

Monday, September 18th, 2006 Programming, pDBB 1 Comment

Another client

Am just applying the finishing touches to the CSAO client, the website is looking very nice indeed, am quite happy with it.

In a few weeks I have another client, I get to create a shopping cart, so an SSL cert. is needed. Have done a lot of reading up about SSL, as i’ve never used / installed it before, the client will have to pay for the SSL cert. but there prices aren’t too bad really, James gave me a few links to some websites that offer cheap deals. With this project, I would like to do something fancy with the shopping cart, not sure what yet, but something dynamic.

Apart from working i’ve been trying to get a project going. We have a small development group, but things are happening very slowly, i’m just not sure if a few of them are motivated enough, hopefully they will prove me wrong. We really need a graphic designer to design us a temp. template to work with until we can get a proper template done, if anyone is interested, just let me know.

Zelda is on hold for the moment, last few weeks I have enjoyed playing around with Javascript again, most of my day consists of just PHP programming, so it’s nice to get away from it.

I’m trying to think of new things for pixelDepth, the forum is basically dead, so I will probably end up removing that at the end of the month unless things pickup.

Friday, September 15th, 2006 Programming No Comments

Javascript Zelda Game Update

Haven’t done much on it today, been busy, but what I did get done was the rupee counter, music on / off switch, and the hearts. So when you pickup a rupee, the counter will increment, and when you pickup a heart, it is added. I have to remove the items that are picked up from the maps completely, otherwise you could just keep going from one map to the other repicking them up. The way I will do that is to create an object to store what has been picked up, so when a map is loaded, it checks to see if the item has already been picked up…

if(!game.item_map[game.current_map].item["t_" + y + "_" + x].picked_up){

Something along those lines, pretty simple.

Sunday, September 10th, 2006 JavaScript, Programming No Comments

What Am I Doing?

Search

 

Categories