Published on
October 17, 2008 in
Website.
The new community website design is just about complete. I’ve moved along onto more troubling things as finishing the CMS.
It’s really interesting when you do something right… things seem to… work! The best idea we’ve had was to properly design a CMS and make it modular. I can’t even begin to explain how its helped the process. Instead of having shit loads of code in a single file, I’m able to break them apart and organize the functions.
The way it works is pretty simple too. First you create your CMS’s main class, and when the page is called it creates an instance of it… lets say $CMS.
The CMS loads all its modules into an array, $CMS->Modules[]. From there you can have stuff like $CMS->Modules[News] or $CMS->Modules[Files] or anything. Each one of the keys are an instance of a class created from the modules.
Then when we’re writing the front page, we can just add a line of code somewhere in the HTML like $CMS->Modules[News]->DisplayNews(). Everything is handled in the module code and doesn’t need to clutter up the HTML of the front page. WHRY is this so helpful? Simple answer is simple: If we need to move any HTML around, or tweak the way the front page looks, we don’t have 120 lines of PHP code jammed in the ass of it all.
Progress is good, but I think I have to take a break for a while and start moving the files over to the new webhost because the old webhost is starting ot take a shit.
An important factor we’ve focused on when managing GATM has been keeping the website and game server on different platforms. The main purpose for this has been simple: performance.
We keep the website on a shared hosting account and the game servers on our dedicated server. Believe it or not, websites are resource hogs… especially high traffic ones. Every time someone loads up a page from your site, all the content including images needs to be accessed and sent over to the user. And that’s not even mentioning MySQL. If you have something running a database (i.e. a blog or forums) not only does the previously mentioned stuff happen, but then the MySQL server has to perform a query (or maybe even 10 queries, depending on what you’re doing).
So start taking that into account every time you hit refresh on a forum page, or quickly browse through pages of a post. There’s a lot of shit going on behind the scenes. And we wouldn’t want all that affecting the experience of those in our servers.
Now that you understand why we keep them separated, there’s one other issue. How do you communicate between the two? This is a major part of our task because people like seeing the integration of game server and website/forum. For the stability of the games, we keep the game data local to the server. WHRY? Simple answer is simple: you never want the game server dependent on ANYTHING. If the data is stored on the website and the website takes a shit… what happens? Yup… the game server takes a shit too, and you have a possibility of lost data.
Overcoming this obstacle isn’t all that hard, but the solution can’t bring down resources on the game server as I spoke about earlier. I’ll explain how we do this later.
Published on
October 14, 2008 in
Website.
Recently I’ve been trying to better my HTML style. One of the main things I’ve been focusing on is using divs instead of tables. WHRY? Because if you know how to use them, they are much more powerful.
Protip: divs are useless without CSS. So learn that first. If you don’t already know CSS and you’re still designing sites without it… leave website design alone and spend your free time knitting sweaters. And by “knitting” I mean “kicking“… and by “sweaters” I mean “midgets“.
When you’re laying out a site, you can setup a div class for lets say.. um… a logo. Then you can set an absolute position of said div inside the CSS class. What does this do? Well it gives you full control over the position of the image… even positions in negative numbers. Which means you can have images overlapping containers and other cool shit like that. It really helps to make your website look tricked out.
The other cool shit about divs is you can have them act like tables, and yet you don’t need to have them nested all fucked up like tables need to be. Oh and they seem to be more XHTML friendly. Seems like most websites that aim for meeting standards use divs over tables.
Another interesting thing is using CSS to skin standard HTML blocks. You can do anything from defining your own “strong” tag, or completely overriding the standard look of an “hr” tag.
So far the new site design is coming along great. It didn’t turn out to be a complete redesign, but its enough to be a big change and bring back the attitude the community misses.
Published on
October 13, 2008 in
Website.
*** Preface: For those who want to further read about what a CMS is click here
A content management system (CMS) is a computer application used to create, edit, manage, and publish content in a consistently organized fashion
So the last website design I cooked up was pretty neat, but I’m remaking it (see my previous post to understand why). The other thing I’m focusing on is the script that drives the site. Last time it was a rudimentary PHP script that just spit out content. This time I’ve taken a step back and decided to do it RIGHT.
I’m going to write it myself from the ground up. Its easy enough to go with some prepackaged script some nerds put together, but then I’ll end up hacking the shit out of it to make it do what I want… so whats the point in using it in the first place? The other reason to write this myself is because the website interacts with the game server so much; I want to make sure I have as much control over this as possible.
Here’s some cool things I’ve learned that you should all use at one point or another in a PHP script:
- Classes. Use classes or you’re and idiot. Object orientated programming is your friend.
- ob_start… look this function up and harness its power.
- Just like any application, make your web applications modular. God kicks a puppy in the face every time you don’t.
- Comment your code. Even if you’re the only person that’s ever going to look at it, it helps you debug and sometimes even reminds you what the fuck you were thinking.
I don’t think I’ll make a template system. I’ll just make a hybrid index.php that renders the basic site layout and calls functions to display content. I’ve tossed around the idea of making templates, but I think its a waste of time for what my needs are.
I’m still working on the new site design… I’m getting closer. One step closer I guess, but now I’m off to play some Xbox 360.
Published on
October 12, 2008 in
Website.
…is designing the website!!
Everyone has a time in their life when they realize they want to redesign their website. Oh you haven’t? Well fuck you and the horse you rode in on.
I have a creative side… I really do. But sometimes I feel like I get ‘designers cock‘. No not ‘block‘ because that would just be silly. The community has gone through many changes; dating back to PGM days, we’ve had many different styles. When GATM came around, the theme was very anti-political and rebellious. It was very rich and had tons of graphics and tried to express a mood… but it lacked functionality!
So I get this idear! LETS GO WEB 2.0! AWESOME DUDES! Yeah, so that worked out great. Now we have a totally functional site…
*long annoying pause*
…but it lacks any passion at all!
So I need to find a happy medium between the two. Passionate and functional. Completely new design? Who the hell knows anymore.
Published on
October 12, 2008 in
Website.
God. I don’t think anyone understands the complexity of moving webhosts… especially if you actually have a lot of content on your existing site. I currently host like 5 different domains; what a pain in the ass this is going to be. Most webhosts provide a free service to move it all for you, but the thought of having someone rummaging around in my site files is a little unnerving. Pain in the ass or not, I want to do it myself… plus this gives me a chance to clean up a bit.
I started off by moving my primary domain (foszor.com) and getting that all setup. I updated the DNS last night and today it had already fully propagated. I totally spaced setting up my email information at first… I wonder how much email I missed out on. Who cares, I don’t feel like buying viagra anyways.
With all these issues, why did I change hosts?. Simple answer: my previous provider sucked the largest of dicks. The cPanel was wacky, the support was… well decent at best, but the best support is support you don’t need to use (meaning the site just works the way it should work). Most importantly, everyone (yes including me) had page load time issues. Sometimes it was just really slow, or failed to connect, or loaded the text and images took forever.
I don’t how some companies survive with poor management like that.
Edit:
Shit I’ve already had a few moments where the page wouldn’t load… hopefully it was on my end or maybe because I recently changed the DNS. *crosses fingers*