Topic: Some Mods and a New Theme

I was inspired by the forums over at StyleGala to change the look of one of my forums that used PunBB.  Although the end result is really nowhere near what they have over there, I am pretty happy with the initial result so far.

Let me know your thoughts: http://www.barber-shop-talk.com

There was a decent amount of code modification (especially to get the mod_rewrite portion working) as well as doing the style sheets from scratch.

Just as a warning, the code is not pretty...kind of brute force in some areas. smile

NFL-Forums.com administrator

2

Re: Some Mods and a New Theme

Very nice, I like the way the front page looks.

Just in time for football season smile

Re: Some Mods and a New Theme

Thanks. smile  Yes, although the football forum is still on an older version.

Unfortunately my members get comfortable very quickly with the way a site looks, so making any major changes needs to be done carefully.

NFL-Forums.com administrator

4

Re: Some Mods and a New Theme

I like it, very unique.

Any chance you can share the keyword urls mod ?

5

Re: Some Mods and a New Theme

Your style is great. I really like it.

Re: Some Mods and a New Theme

Elzar wrote:

I like it, very unique.

Any chance you can share the keyword urls mod ?

Keyword URL's mod?  Can you clarify?

NFL-Forums.com administrator

7

Re: Some Mods and a New Theme

Instead of

viewtopic.php?id=298

you have

topic/298/The-New-Look-to-Barber-Shop-Talk/

Any info on that would be appreciated.

Re: Some Mods and a New Theme

Sure...I'm using apache mod_rewrite to do that.  I don't have an official mod put together, and there are still a few bugs I need to work out, but here is what I did:

1.  Create the rewrite rules in an .htaccess file.  The file looks like this:

RewriteEngine On
RewriteRule ^topic/([0-9]+)/(.*)/new/$ viewtopic?id=$1&action=new [L]
RewriteRule ^topic/([0-9]+)/(.*)/([0-9]+)/$ viewtopic.php?id=$1&p=$3
RewriteRule ^topic/([0-9]+)/(.*)(/?)$ viewtopic.php?id=$1 [L]

RewriteRule ^forum/([0-9]+)/(.*)(/?)$ viewforum.php?id=$1[L]

2.  Added a function in the file functions.php.  I put the function just below the function pun_htmlspecialchars().  The function looks like this:

function simplify ($str)
{
    $replace = array('`','~','!','@','#','$','%','^','&','*','(',')','_','=','+','\\','|','}',']','{','[','"',';',':',',','<','.','>','?','/',' ');
    $str = str_replace($replace,'-',$str);
    $str = str_replace('\'','',$str);
    $str = preg_replace('/[-]+/s','-',$str);
    $str = preg_replace('/-$/s','',$str);
    return $str;
}

Again, kind of brute force...

3.  Worked through the code in viewforum.php and viewtopic.php to change the links from the old viewtopic.php?id=1 or viewforum.php?id=1 to the new URL's.  This is definitely the most time consuming part.

4.  I also had to work my way through some files to make sure that all links started with a forward slash (<a href="/index.php"> as opposed to <a href="index.php">). 


Again, I wish I had an official mod, but that is basically what I did.  If you have specific questions about what I did, I'd be glad to offer any assistance I can. smile

NFL-Forums.com administrator

9

Re: Some Mods and a New Theme

Perfect thanks.

I'm bound to run into problems in viewtopic and viewfourm, but i'll see how it goes...