Simple Error Class





ranking Sort Sort   |   date Sort Sort   |   member Sort Sort
Syndication

15
Date Submitted Sun. Sep. 24th, 2006 5:35 PM
Revision 1
Helper kahotep
Tags Form | HTML | PHP
Comments 1 comments
Generates a tree view within a dropdown select box.
12
Date Submitted Sun. Sep. 24th, 2006 5:43 PM
Revision 1
Helper kahotep
Tags HTML | PHP
Comments 6 comments
Generates select boxes, text boxes, check boxes and radio buttons. Via a handful of functions.
-8
Date Submitted Tue. Nov. 7th, 2006 11:06 AM
Revision 1
Helper kahotep
Tags mysql | PHP
Comments 6 comments
This class is a simple authentication scheme which makes it easy to add authentication to any page by including one class and adding one table to your MySQL database.

The following functions are employed by this authentication class:

auth()
this is the default constructor; it automatically checks for the POST vars "username" and "password", it also checks to see if the user passed the GET variable "logout", which would prompt it to set the authentication status to un-authenticated.

is_authorized()
Checks the SESSION variable "authorized" and returns true or false depending on that variable.

mysql_bind()
This is automatically called by the constructor each time the class is instantiated and $_POST['username'] and $_POST['password'] are present. It queries the db for a valid username and MD5 encoded password.

user_create($username,$email,$password)
Creates a user, if the username is available, and creates an MD5 hash based on username, password and date, to be used in the "activation" of the account.

user_activation_message($username)
Sends the custom activation message to the email address for the username specified

user_activation($activation_hash)
Checks to see if the activation hash is valid, if it is, the activation_hash variable is set to NULL, thus signifying that the account is active.

user_password_change($username,$password_old,$password_new)
Quick and easy way to change the user's password with one function call.

user_logout()
Sets the authorization status in $_SESSION['authorized'] to FALSE

is_username_available( $username )
Returns TRUE or FALSE depending on whether or not the username is free.
28
Date Submitted Tue. Nov. 8th, 2005 4:53 AM
Revision 1
Beginner jelena
Tags Image | PHP | Thumbnail
Comments 8 comments
Create a Thumbnail
13
Date Submitted Mon. Oct. 23rd, 2006 10:19 PM
Revision 1
Helper jdenton
Tags Calendar | Date | days | PHP
Comments 0 comments
daysBeteenDates will calculate the number of days between 2 dates in the form of 'YYYY-MM-DD'.
5
Date Submitted Mon. Oct. 23rd, 2006 10:48 PM
Revision 1
Helper jdenton
Tags GD | gif | images | jpeg | PHP | png | Resize
Comments 1 comments
The resize_image function allows you to resize a GIF, JPEG or PNG file to any dimension you wish and put an optional black border around the image. Here's an explanation of the arguements:

$image_path: The complete path to the image to be resized

$max_width: Maximum width of the resized image. Leave 0 if you want to specify only the height and have the width auto-scale.

$max_height: Maximum height of the resized image. Leave 0 if you want to specify only the width and have the height auto-scale.

$file_prefix: This will prepend a string onto the resized image filename. If you want to create a thumbnail image and keep the original, set $file_prefix = 'thumb'.

$dir: Allows you to save the resized image to a sub directory under the $image_path directory. If you want to save thumbnail images to images/thumbs, set $dir = 'thumbs'.

$border: boolean, 1 = border, 0 = no border

$mime: Image mime type. (image/jpeg, image/gif, image/png)
10
Date Submitted Mon. Dec. 4th, 2006 11:03 PM
Revision 1
Helper jdenton
Tags "date convert" | PHP
Comments 0 comments
Give this little function a start date and number of days and it will calculate the end date.
14
Date Submitted Mon. Oct. 9th, 2006 10:09 AM
Revision 1
Helper inxilpro
Tags debug | HTML | PHP | Variable
Comments 2 comments
Here's a basic function for debugging any kind of PHP variable. It allows for "invisible" or "visible" output--that is output in HTML comments or within visible HTML tags. It also supports customizable "containers" which lets you easily edit the look of the visible and invisible blocks. Examples in code below.
15
Date Submitted Mon. Oct. 9th, 2006 3:13 PM
Revision 1
Helper inxilpro
Tags classes | Database | DB | PHP | Simple
Comments 5 comments
This is a bare-bones DB connectivity class. It's really just meant to abstract a few basic mysql_ functions so that if you ever have to change DBs you don't have to change every database function call.

I really just threw this together on a whim with no testing what-so-ever. Also, it only abstracts the most basic MySQL functions--this is intentional; please expand it as you see fit.
15
Date Submitted Mon. Oct. 9th, 2006 9:57 PM
Revision 1
Helper inxilpro
Tags Convert | CSV | PHP | XML
Comments 1 comments
This function converts a CSV file to a simple XML file.