TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Show Off (http://www.talkphp.com/show-off/)
-   -   Recently rebuilt site (http://www.talkphp.com/show-off/1297-recently-rebuilt-site.html)

obolus 10-12-2007 06:10 AM

Recently rebuilt site
 
I just finished rebuilding this site: http://www.tribalstylemusic.net

It's for a close friend of mine's band, based here in Florida. It's definitely not my best design work, but I still like it enough that I didn't bother changing any of the overall design/layout when I rebuilt it.

Before the rebuild:
-Using PHP4
-Had a phpBB2 forum
-Lots of content for the site was pulled from forum posts
-None of the pages were w3c xhtml valid
-Reeeeeally messing html and php coding
-Site used multiple iframes
-Wasn't too friendly with IE
-Each page was a static page (page.php or page.html)

After the rebuild:
-Upgraded to PHP5
-Site now utilizes Smarty template engine
-Ditched the forum
-Looks great in FF, IE and Safari. Haven't seen it in Opera yet.
-Ditched most of the original design structure and simplified/cleaned it up
-Wrote my own news script and system for "index.php?page" url's
-Installed the supercool ImageVuex Flash gallery
-Built an admin section for band members to add/edit/delete content from their browsers
-All pages except 2 are w3c xhtml valid (other 2 will be fixed soon)

Still to do:
-Fix validation issues on 2 pages
-Add more security into coding
-Finish writing a small & simple but secure online store to sell CDs and shirts
-Prob 1 or 2 things I'm forgetting.

I still have a lot to learn with regards to PHP, but I like using little side-projects like this as a way to put what I'm learning to use and practice my coding. Was my first time using the Smarty engine and I really didn't use it to its full potential. I still thought it was pretty cool though. =) Before I started going full-on with the rebuild, and this is something I do before I begin construction on every site I work on, I recoded the overall layout in a single html file on my computer. Basically, I do this as a final design stage before constructing, after I finish drawing out the site design in PS.

Feedback appreciated. =)

Karl 10-12-2007 12:25 PM

It looks good, nice work. You may want to add an error page for handling errors such as 404:

http://www.tribalstylemusic.net/login.php

Admitidly I shouldn't be so nosy, but you should have something in place just in case someone follows an incorrect URL, always better to gracefully show an error page rather than the typical "404 Not Found".

obolus 10-12-2007 09:03 PM

heh, true. Thanks for the feedback!

I put up simple but nice custom error pages for 401, 403, 404, 500, and 503 errors.

One thing I need to do is find a way to redirect the user in a similar situation. Right now, the url system uses a bunch of elseif statements to determine what page to display to the user. If I put in a bad query (ie page.php?wrong instead of page.php?right) in my browser, I just get a blank page.

The elseif statements look like so (dont mind the messy code)...

PHP Code:

<?php
if(!$_SERVER['QUERY_STRING']) { ?> 

<?php
// blank query displays default page (index.php)
?>

<? elseif ($_SERVER['QUERY_STRING'] == "page"?>

<?php
// display page with index.php?page as url
?>

So, and especially in the future when I might be working with session id's for users (appended to the end of url's), how do I code it to look for bad queries? Thanks all.

Andrew 10-19-2007 07:26 PM

Also, looks perfect in Opera if you still haven't seen it in that browser. I just compared it to FF and didn't see a difference.

sketchMedia 10-19-2007 09:19 PM

good work m8, looks good.

yea i think opera is highly under-rated by many people.

hostfreak 10-29-2007 11:32 PM

Quote:

Originally Posted by obolus (Post 3061)
heh, true. Thanks for the feedback!

I put up simple but nice custom error pages for 401, 403, 404, 500, and 503 errors.

One thing I need to do is find a way to redirect the user in a similar situation. Right now, the url system uses a bunch of elseif statements to determine what page to display to the user. If I put in a bad query (ie page.php?wrong instead of page.php?right) in my browser, I just get a blank page.

The elseif statements look like so (dont mind the messy code)...

PHP Code:

<?php
if(!$_SERVER['QUERY_STRING']) { ?> 

<?php
// blank query displays default page (index.php)
?>

<? elseif ($_SERVER['QUERY_STRING'] == "page"?>

<?php
// display page with index.php?page as url
?>

So, and especially in the future when I might be working with session id's for users (appended to the end of url's), how do I code it to look for bad queries? Thanks all.

I would recommend using a simple switch() statement:
Code:

<?php

    switch ($_SERVER['QUERY_STRING'])
    {
        case 'right':
            //display page
            break;

        default: //Anything not matched by the other cases (blank, wrong etc)
            //default page
    }

?>


obolus 10-30-2007 02:24 AM

I already found a solution, but thanks for that tip!


All times are GMT. The time now is 01:24 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0