Posts Tagged ‘website’

Building a Guild Site

datePosted 4:19 PM, August 14th, 2011 by MarkleB

Apparently I haven’t got the hang of having a baby and finding time for projects.

One project I did find the time to do recently was create a guild page for the upcoming Star Wars: The Old Republic MMORPG. It’s almost unnecessary, though. Even pre-launch, the game offers default guild pages for members of the site, and includes forums (public and private), Message of the Day, Mission Statement, and Roster Management. It looks like the roster management functionality will actually have interaction with the game to actually manage your membership from outside the game. Also, in allowing you to create your guild early, the developers will try to reserve the name of your guild when the game launches, if you have four pre-order members in the guild early enough.

Our guild is Korriban Council. Whether or not we get to keep the name is up in the air, since there was an earlier guild with the same idea. That didn’t stop me from dropping $10 to register the domain name, though. (Because, of course, I have an illness. And every time a remotely good idea for a website name pops into my head, I register it compulsively. Witness this site.) So far it’s co-workers and my sister.

[Thank you for joining me for a moment in Tangent Corner, the part of my article which really has absolutely nothing to do with the rest of whatever it is that I’m talking about. Today’s topic: Why Sith? There are a few reasons. Chief among them, Jedi are a bunch of whiners. Or is it Jedis? I know the plural is written down in a book or on the Wookiepedia or off the top of every Comic Con attendee’s head. Whatever. The point is, they’re a bunch of whiners. The Jedi, not the awesome Comic Con attendees. “But I was going into Toshi Station to pick up some power converters!” “She’s forgotten me completely!” Whiny little whelps. My guess is that while not everybody who chooses to play a Jedi will be a whiny force-jockey (to be fair, a lot of cool people have been waiting years to play a Jedi in this game), every whiny force-jockey will choose to play a Jedi. On the flip side, jerks are going to be more likely to play Sith, all gankers are jerks, so most gankers are going to be Sith side. It’s just logical that if you want to avoid getting ganked, grab a red light saber.]

Anyway, back to the guild page. I didn’t want to just plug in some data at an existing guild-portals-R-us site and call it a day. I like having control over things (Sith, remember?), I like having things unique, and I like figuring out thinks I didn’t already know. Site building is always a learning experience, because I’m rather awful at it. (Again, witness this site.) I’d built a partial guild page for someone else before, but they wanted it based on a forums-centric CMS that made managing non-forum content nearly impossible. It took forever to get changes in, so it had very few features.

To start with this time, I chose my favorite Content Management System: Drupal. With enough work, Drupal can be anything you want it to be. With a few structure customization modules it’s even fairly easy.

Let’s be honest about Drupal though: Out of the box, its ugly. Not just its default themes (which are kind of nice, really, just a tad plain), but its built-in modules are feature-sparse. People often complain on their forums about how crappy the forums in Drupal are. Invariably, some nimrod responds with, “The forums you’re using now are the core Drupal forums!” This leaves everybody so dumbfounded that someone would be PROUD of this that the complainers go away and never come back. Probably switch to Joomla! along the way. (Which is also a nice CMS, but the really great modules are generally not free … but you do tend to get what you pay for.)

So I had to heavily modify Drupal to get it to be my guild site. Here are the things I’ve added to it and how I did it.

Custom Theme:
I started with the Zen theme and modified the CSS. In one case (polls) I had to go a bit further. I modified the .php for poll bars to include an extra div element, so I could use an image as a background overlay. Most of the theming I did used functions that are only available in current-generation-web-browsers-which-are-not-Microsoft-Windows-Internet-Explorer. Honestly why people use IE is beyond me, not that many do. Currently about 5% of my traffic comes from IE browsers. But even that beats the pants off of Apple Mac or i OSes. I evidently have nothing to offer hipsters, thank goodness. Anyhow, if you look at the site on IE 6, IE 7, IE 8, or IE 9, the site displays in four different ways, none of them right. If you look at the site on Firefox, Opera, Chrome, Safari, or even a NookColor, they all display the same.

Anyway, I suck at theming (once again, witness this site) but I at least managed to stick with it this time.

I toyed with the idea of having a third-party forum and just tying user accounts to it, but I really hate when I’m on a site and the forums have no awareness of the site, and the site has no awareness of the forums.

I loaded up the Advanced Forums module. It was more “Advanced” in Drupal 6 than it is now (because of other modules like the Author Panel and such) but it’s head-and-shoulders above the seemingly random list of articles that they call posts in core Drupal.

I haven’t 100% completed theming the forums, but they’re good enough for a start.

Roster/Member list/User profiles:
Okay, so this isn’t as cool as the official SWTOR roster, since it won’t actually have in-game impact (though I’d love if they released some kind of API to allow me to do that), but it’s nice enough.

I used the Views module to create a list of current members on the board (minus the Admin account), gave a default icon Heheheh ... and called it a day.

When clicking on the users it shows their name, picture, the most recent forum topics they started, and the most recent comments they’ve made. I created each piece of the profile separately with Views, then tied the multiple Views together with the Panels module. Nobody told me I needed Panels, so let me help you: If you have a Drupal site, you need Panels. Just get it, you’ll find a use for it later.

Screenshot Gallery:
Since the game hasn’t started yet, this is currently empty, but it works and it works well.

I created a Content Type called Screenshot using core Drupal 7 functionality, because CCK (Custom Content Kit) is the ONE thing they’ve actually finally moved to Core Drupal. It’s like an article or a blog post, but all it lets you do is upload a picture with a one line description. You can’t even give it a title, because I used the Automatic Nodetitles module to automatically give it the title of the user who uploaded it and the date/time they did so. The images are then resized downward to a maximum size of 1600×1200 because yes, some people game on insanely sized multi-screen displays.

Then I have a View set up that checks for all the posts of type Screenshot, displays thumbnails of them in a grid, and puts a nice title underneath them.

Very simple to set up, but it works nicely. (I had previously built an Entire-Gallery-As-A-Single-Node pseudo-module that I may re-introduce into this site later, but for now I really like having just a Screenshots gallery.)

Voice Chat:
Oh, this one was cool. The Voice Chat isn’t really built into the site. The site just displays the current status of our TeamSpeak3 server.

I had actually built this to work with Ventrilo, but all the work I’d put into that was thrown down the drains when I realized that Ventrilo will only let you host 8 people simultaneously unless you rent space on someone else’s server. You can’t license it for more and run it on your own server. Since the point of having a voice server is to coordinate during raids, and you’re going to need more than 8 slots, we had to move over to TeamSpeak3.

The bright side is that I had to do a lot more work to get Ventrilo to work than TeamSpeak3. TeamSpeak3 has a query tool built into it, while Ventrilo requires a second program to be installed. Also, I had to do the PHP from scratch with Ventrilo, and with TeamSpeak3 I found TSStatus. This saved me at least a day of figuring out all the hooks myself.

I did have to modify it a bit. I couldn’t figure out why it had been programmed to build links with javascript, so I re-wrote them to simple PHP. If anybody’s curious in doing the same, here are the changed lines in tsstatus.php:
$link = "ts3server://$this->_host:".$this->_serverDatas["virtualserver_port"]."?password=********&channel=".htmlentities($channel["channel_name"])."&nickname=$this->uname";

$out .= '<div class="tsstatusServerName"><a href="ts3server://' . $this->_host . ':' . ($this->_serverDatas['virtualserver_port']) . '?password=********&nickname='.$this->uname.'"><img src="' . $this->imagePath . '16x16_server_green.png" />' . $this->_serverDatas["virtualserver_name"] . "</a></div>\n";

I put the HTML that was generated from the tsstatusgen.php file directly into a block in Drupal, and added two lines, “global $user;” and “$tsstatus->uname = $user->name;” and then added “public $uname;” to the tsstatus.php file so that when a logged-in user clicks on the links, it automatically logs them in using their board name as their TeamSpeak3 name.

Still to be added:
I’d like to handle applications for the guild through a web form. I’ll probably just extend the base profile/user account/registration questions and turn it into an application, a registration, a user account page, and a profile page. It’s already halfway there already.

I’m NOT going to put a shoutbox in. I honestly can’t figure out the point of those things.

Now, sadly, it’s all about content. Which is going to be more difficult to find time to post … Because … One last time … Witness this site.

Micro-entry: Stop hotlinking

datePosted 1:34 PM, October 28th, 2010 by MarkleB

Going through my site’s stats the other day, I discovered that somebody had been hotlinking some of my images. I wouldn’t have minded all that much (I have unlimited bandwidth), except it was a picture of my son, and that was just creepy.

I’ve disabled their ability to do this by adding the following lines to the .htaccess file on my server:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^http://(.+\.)? [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteRule .*\.(jpe?g|gif|bmp|png)$ [NC,R,L]

This now displays the following graphic:

For some reason, this makes me very happy.