|Last Updated||Ratings||Unique User Downloads||Download Rankings|
|2003-03-07 (14 years ago)||42%||Total: 4,610||All time: 587 This week: 548|
|classimg 1.0||GNU General Publi...||Databases, Graphics|
This class uses a database table to store images. Is very simple. Has only one public property, and only 6 methods not including the constructor. It makes use of the classMySQL as the database abstraction layer.
This class is very, very simple to use. The constructor has only one parameter: the instance of the classMySQL used in your site. Let's asume you have included the classMySQL in your script, and properly created an instance to it. In this example, I'll supose the script is used to grab an image file uploaded by the user, and that the variable used to upload it was $imgsrc. Examples: $myImg=new classImageManager($theDBLayer); $myImg->addImage($img_src); echo "The Image was saved with id: ".$myImg->added_image_id; You can do anything you want with the addid_image_id property. For example, I've used it to store in an articles table the image ID for later retrieval. Later, you can show the image simply using the method ShowImage: $myImg=new classImageManager($theDBLayer); $myImg->showImage($theID); Save those lines in a script called something like "showimage.php", and then use the HTML image tag (or the classHTML fnTmg function) to show the image: <img src="showimage.php?theID=XXX"> --------------------- That's all... simple, clean, quick... Be sure you are not using any buffering, because the image will not be shown.
|Version Control||Unique User Downloads||Download Rankings|