TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Show Off (http://www.talkphp.com/show-off/)
-   -   PSDLayouts - CMS (http://www.talkphp.com/show-off/1326-psdlayouts-cms.html)

Gurnk 10-22-2007 10:07 PM

PSDLayouts - CMS
 
Hey peeps. I've been working on a CMS for my site for a couple months now, adding a bunch of features. They include the following. A full list can be found here. Features
  • Full Member System
  • Full Admin Panel
  • Full Upload System
  • PM System
  • Feedback System
  • Tons of other stuff

I'm quite proud of it, as I haven't been using PHP and MySQL that long. You can login with "Demo" and "demopass". You will only have the options of a normal member, as I don't feel comfortable giving you access to the whole site. :p

Anyway, what do you guys think? Suggestions?

Wildhoney 10-22-2007 11:04 PM

Sorry, what's the link to the website so I can login? :)

Gurnk 10-22-2007 11:04 PM

Rofl. Thats embarrassing. :p

http://www.psdlayouts.com

Wildhoney 10-22-2007 11:22 PM

:) Lol.

Just a few observations from browsing:
  • Add, Edit, Profile, etc. should really be next to FAQ, Search and Logout.
  • Keywords textbox needs to be wider on search page.
  • ...And on the send message page.
  • When I create a category there's no sign of what happened.
  • Bit of regex checking on the hex when I add a colour, no need to add the warning then that invalid colours will mean my account gets removed.
  • Typo on send message page: "Recipiant".
  • Popular categories look a bit squashed in. Hope they're not claustrophobic!

Also a little whoopsy on the edit profile page...

Quote:

Parse error: parse error, unexpected T_STRING, expecting T_VARIABLE or '$' in /homepages/46/d174339026/htdocs/psdlayouts/pages/cp/editProfile.php on line 12
But apart from that, a good system from the looks of it!

Gurnk 10-22-2007 11:26 PM

Thanks for the review Wildhoney. Its those kind of suggestions that I need. :) I've been thinking about just removing the ability for users to add colors and categories, as its not that crucial of a function. I'll be sure to fix those mentioned items sometime, and I just fixed the edit profile page, as its a more immediate error. :p

Wildhoney 10-22-2007 11:38 PM

Pleasure :) I've written you a nice function for validating the hexadecimal value of the colour if you decide to keep it in.

PHP Code:

function is_colour($szHex)
{
    
/* Prepend the hash symbol */
    
if(substr($szHex01) != '#')
    {
        
$szHex '#' $szHex;
    }
    
    
    
/* If we can save a call to regex then why not! */
    
if(strlen($szHex) != 7)
    {
        return 
false;
    }
    
    
/* Check to see if the colour value is valid */
    
if(!preg_match('/^#{1}[0-9A-F]{6}$/i'$szHex))
    {
        return 
false;
    }
    
    
/* It's all good! */
    
return true;



Gurnk 10-23-2007 12:04 AM

Oh wow! Thanks for that. I may as well keep it now. :D

Salathe 10-23-2007 01:04 AM

On the topic of validating the hexadecimal colour string, if you don't care too much about wasted ten-thousands of a second, you could simply use:
PHP Code:

function is_colour($hex)
{
    return (bool) 
preg_match('/^#?[a-fA-F0-9]{6}$/'$hex);



Gurnk 10-23-2007 02:00 AM

Lol. Those ten-thousandths of a second really add up, so I may! :p

Gurnk 10-31-2007 05:48 PM

I'm thinking of selling the site. How much do you guys think that script is worth unique?

Wildhoney 10-31-2007 06:56 PM

Difficult to say. I reckon in excess of $500.

Jim 11-03-2007 10:01 AM

Check if a colour is at least 6 chars after the # of course is fine, but people can also use a 3 char code (eg #000 also returns black), to really make it perfect you can also check if it's 3 chars before returning False.

Wildhoney 11-03-2007 11:59 AM

Quite true, Jim! I totally overlooked that possibility.

PHP Code:

function is_colour($szHex)
{
    
/* Prepend the hash symbol */
    
if(substr($szHex01) != '#')
    {
        
$szHex '#' $szHex;
    }
    
    
    
/* If we can save a call to regex then why not! */
    
    
$iCharacters strlen($szHex);

    if(
$iCharacters != && $iCharacters != 4)
    {
        return 
false;
    }
    
    
/* Check to see if the colour value is valid */
    
if(!preg_match('/^#{1}([0-9A-F]{6}|[0-9A-F]{3})$/i'$szHex))
    {
        return 
false;
    }
    
    
/* It's all good! */
    
return true;



Salathe 11-03-2007 12:29 PM

Quote:

Originally Posted by Jim (Post 3604)
Check if a colour is at least 6 chars after the # of course is fine, but people can also use a 3 char code (eg #000 also returns black), to really make it perfect you can also check if it's 3 chars before returning False.

If that's the case, shouldn't the code also allow the valid names for colours (red, blue, black, etc)? Since Wildhoney amended his colour function, here's mine -- just a tiny change to the RegExp. :)

PHP Code:

function is_colour($hex)
{
    
// True for hexadecimal strings of three or six characters in length
    // with an optional preceding hash.
    
return (bool) preg_match('/^#?[a-fA-F0-9]{3}|[a-fA-F0-9]{6}$/'$hex);



cherries 11-06-2007 02:24 AM

Hexadecimal colours can also be 3 characters:
#333;
#49DA03;


All times are GMT. The time now is 03:14 AM.

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