TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 10-22-2007, 10:07 PM   #1 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default 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?
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-22-2007, 11:04 PM   #2 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Sorry, what's the link to the website so I can login? :)
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 10-22-2007, 11:04 PM   #3 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

Rofl. Thats embarrassing. :p

http://www.psdlayouts.com
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-22-2007, 11:22 PM   #4 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

:) 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!
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 10-22-2007, 11:26 PM   #5 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

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
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-22-2007, 11:38 PM   #6 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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;

__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 10-23-2007, 12:04 AM   #7 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

Oh wow! Thanks for that. I may as well keep it now. :D
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-23-2007, 01:04 AM   #8 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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);

Salathe is offline  
Reply With Quote
Old 10-23-2007, 02:00 AM   #9 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

Lol. Those ten-thousandths of a second really add up, so I may! :p
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-31-2007, 05:48 PM   #10 (permalink)
The Contributor
Upcoming Programmer 
 
Gurnk's Avatar
 
Join Date: Oct 2007
Location: US
Posts: 66
Thanks: 19
Gurnk is on a distinguished road
Default

I'm thinking of selling the site. How much do you guys think that script is worth unique?
Send a message via MSN to Gurnk
Gurnk is offline  
Reply With Quote
Old 10-31-2007, 06:56 PM   #11 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

Difficult to say. I reckon in excess of $500.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-03-2007, 10:01 AM   #12 (permalink)
Jim
The Addict
 
Jim's Avatar
 
Join Date: Nov 2007
Location: the Netherlands
Posts: 281
Thanks: 2
Jim is on a distinguished road
Default

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.
__________________
Nunchaku! Who doesn't like martial arts? =)
Send a message via MSN to Jim Send a message via Skype™ to Jim
Jim is offline  
Reply With Quote
Old 11-03-2007, 12:29 PM   #13 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Jim View Post
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);

Salathe is offline  
Reply With Quote
Old 11-03-2007, 11:59 AM   #14 (permalink)
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

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;

__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote
Old 11-06-2007, 02:24 AM   #15 (permalink)
The Wanderer
 
cherries's Avatar
 
Join Date: Oct 2007
Posts: 20
Thanks: 0
cherries is an unknown quantity at this point
Default

Hexadecimal colours can also be 3 characters:
#333;
#49DA03;
cherries is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:38 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design