Yes that is right everyone. Go to classes now!
I've just spend the last few hours playing with Classes in php; and wow what a difference.
I've just coded myself a mysql database class. This class connects to the database plus processes queries. The processing queries section is really useful for two reasons:
1) Cuts back on code as I do not need to retype anything. If I wanted to count how many rows there are in a table the old code would look like this:
$query = "SELECT count(*) FROM news";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo $row['count'];
The new one is simply:
echo $database->numofrows("SELECT count(*) FROM news");
2) I can now change over to another database system if needed. All I do is replace my mysql class with another class. No other code change is needed.
If you're running Wordpress you're lucky enough to have programmers who know what they're doing. WP already uses classes.
So who here has found the wonders of classes?
This is what I said at the beginning of the month
[quote]This would be the first month ever that outgoing traffic has equaled in coming traffic. Scary stuff! 2GB is a massive jump since last month (about double).[/quote]
Again bandwidth has increased. This months totals have just hit 3GB upload (while still only 2GB down).
Impressive :)
Also this morning I did an upgrade of apache (yes this was done last week too, but there is a new version out). Now we're at 2.0.52.
Over the last week I have seen a large increase in random users signing up to my forums. They are random bots who are tracking down sites and sending an automated signup. The problem with my forums is that they are powered by phpbb, which is one of the most common scripts out there. This means that it is more prone to such an attack.
Matt over at photomatt.net has started receiving large amounts of spam through his own contact script! (one that he wrote himself).
This increase in spam through online forms is a worry and can be somewhat harder to stop. From now on we’re going to be seeing a lot more annoying image generators where you must enter in the random number before you can continue. I must admit I really dislike them, but it seems to be the only way to stop such an attack.
This is just going to make the internet a more annoying tool to use. Unfortunately everything is going online; Soon we’ll be getting spam on our phones (http://www.joahua.com/blog/2004/09/26/freetel-are-evil).
Some of you will remember my old website. It was my first "real" news script and all that stuff. Anyway I've just inputted all the old content in this site. Anything from news id 72 and less is from my old site (this includes all of July and half of Aug).
Check it out!
http://blog.dalegroup.net/archive/
Okay, So you've just read this large post on some blog site and you're about to reply. But wait, there are comments from other people too! Now should what these people have written effect your response?
You've pretty much made up your mind about what you're going to say before hand.
But what if what you're about to say has already been said? Should you be silenced!? Comments are good for feedback on a topic, but are they there for discussion? I don't know.
Should my comments link go to the first comment or straight to the comment post field? Should people read the other comments first?
A good example is here: http://mezzoblue.com/ The comments are very muchly separated from the post. You must click to read the comments. Good or Bad?
I got pissed off with the message on their website yesterday (http://blog.dalegroup.net/archive/blog/newsid/137) so I sent them an email. I've just got a reply
[quote]Michael
Your email has been passed on to the appropriate department.
Helen[/quote]
Good! Fix the damn site! ;) I'll let you know if I receive another response. I've also submitted my uni preferences (although in *shudder* IE).
Time to catch up on some blogging ;) There are a few things I want to talk about; it is a far bit so I’ll see how we go.
This blog covers the following:
[b]Do IT Admin Staff get too much crap?
IPv6.
Dynamic Websites
Website Formatting and Presentation.
You NEED Netscape or Internet Explorer.
New "read more" system.
Filter system.[/b]
First off.
[b]Do IT Admin Staff get too much crap?[/b]
I know at SACS that almost everyone pays out the IT staff but is it called for? Maybe it is just because we’re jealous that they’re in power and we’re not? Over the past few years the computer systems HAVE improved a lot. The network rarely goes down anymore and most computers don’t crash (some are slow, but what are you going to do?). Back in the “good old days” we had Win9x systems with some PCguard software installed on them. They were so slow it wasn’t funny and the amount of times you couldn’t log on was countless.
But this goes for all IT staff. They’re the ones in control of something that is used and relied on everyday. People feel powerless if the network is down and have to blame someone. Many older people don’t understand what is going on; they can only just use the computer. So when complications come up they feel stranded.
It is a bit like the internet. If your ADSL connection goes down you’re powerless to fix it and therefore get annoyed.
Do you think IT staff get too much crap?
Next!
[b]IPv6[/b]
The new way of handling layer 3 protocols. More octets and therefore more addresses available for everyone. I have a link to a Slashdot article talking about Apache acting as a proxy between IPv4 and IPv6 but there seems to be a large issue with Telstra. I am connected to the internet, just nothing is going anywhere. I’ll post it once everything is back.
I’m very much looking forward to IPv6, just because I want a static IP address. I’ve heard once IPv6 is used (going to be a long way off people) everyone will be assigned a subnet to use. How cool! IP address here, IP address there. Cool. Looking forward to that.
Ah I found the two links in my bookmarks:
http://ipv6gate.sixxs.net/
http://linux.yyz.us/ipv6/proxy.html
[b]Dynamic Websites[/b]
I know most people (friends etc) are now using some form of Dynamic Website but I thought I’d just say how cool they really are. I’m not sure if people realize but every time your website is visited the page is generated (or recreated). If it is done properly most of your content (if not all) should be stored in a database of some form. This means that you can completely change the way your site works without loosing any content. This is how it should be. A good database design also helps.
CSS is funky because you can change the layout of everything quickly and easily and you don’t need to have a dynamic site for that. Dynamic is good people! It makes your site last longer. Upgrades are easier. And you don’t need to spend hours changing every link on your frame filled table based site just because you changed the directory structure. Cool!
[b]Website Formatting and Presentation[/b]
The layout and design of a website is one of the most important aspects of the site. When a user visits your site they don’t really care how the information got there, they just care about the fact that it IS there and what it looks like. Your php/asp/ssi (or what ever dynamic language you code in) could be quite ugly, but the end user is none the wiser.
What people do care about is how your website looks. Formatting is very important. Remember this people! No one likes a hard to use website. Make sure it works in every browser/os too. Following standards will help this but remember:
David McKinnon wrote
[quote]
This may sound like heresy in this list, but the goal of using Web standards is not to get your site to validate. (Wait, put down that pitchfork!) The way I see it people, is that it's all about people.
The goal is to make it better for people. Better for viewers, who don't get things looking like krud because they choose the 'wrong' browser or platform. Better for people with special needs. Better for people who build and maintain the site and better for the people who will redesign the site when it comes to that.[/quote]
[b]You NEED Netscape or Internet Explorer[/b]
ARGHHH. I was just about to submit my uni preferences to http://www.uac.edu.au when I got the following error:
“This browser is not supported by the Apply-By-Web system! Click on “OK” to download the latest version of Microsoft Internet Explorer.
ARGHHHH NOO!!! Firefox is better than IE in every single way. It supports standards, it renders websites correctly and isn’t full of security issues!!!! ARGHHH
Don’t use your gay browser string detection crap on me!!!! PFFT.
Some more reading here: http://www.spreadfirefox.com/?q=node/view/1389
[b]New read more system[/b]
My old system would cut off posts after a certain position. Say after the 250 character you would need to click “read more”. It was hard coded and crap (sometimes it would kill urls because it cut them in half). So I was thinking of a way to do this. I could set a length for each news item and store it in the database but that was dodgy and would take too much effort (I’m lazy here people). So I needed a terminating thing or something. A string that you entered in to cut the post.
So I implemented a system that works very well! I was all happy UNTIL! ARGHH I decided to check how Wordpress did it; and guess what!? THE SAME WAY!!! So since Wordpress used a certain string I decided to copy it in the aim for some kind of compatibility. Bah.
[b]Filter system[/b]
I’ve worked on my text filtering system and it now should be working better. I SHOULD be able to type anything into the news item (so like the MS Word quotation) and it shouldn’t break validation. So we’ll see.
[b]EDIT[/b]: YESSSS!! It validates. W00t.
Okay that is all for now. Hope you enjoyed it ;)
EDIT2: That post killed my RSS feed. But it has been fixed so everything should be good now :)
It is about time I followed everyone else on this. Contact forms are good! Spam is bad. So therefore I've removed my email address from every page. If you wish to contact me simply click on the Contact link (or use your funky email client).
http://blog.dalegroup.net/contact/