Recommend this page to a friend! |
Download .zip |
Info | View files (2) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2006-11-05 (9 years ago) | Not enough user ratings | Total: 1,900 | All time: 2,013 This week: 916 |
Version | License | Categories | ||||
file_find 1.0 | GNU General Publi... | HTML, Graphics |
Description | Author | ||||||||||||||
A class that handles all operations required to check if a pic file exists, calculates appropiate width/height to fit a required area and generates the <img> tag |
|
===== BASIC DOCUMENTATION FOR FILE_FINDER CLASS ===== 0.- INTRODUCTION AND EXTENTS I implemented this class due to a necessity on a website where the users could upload pictures and those pictures had to be shown and scaled to fit into general site design... It handles all operations required to determine wether a pic exists (checks for different img types if not specified), scales accordingly to aspect ratio to fit on a fixed space and echoes <img> tag 1.- BASICS OF OPERATION The class works on 2 basic functions PUBLIC INTERFACE: function file_find($imgdir="images") ; The constructor: $imgdir-> string with full path to your web img directory (from WEB ROOT DIR) i.e.: ROOTDIR = "../" (ROOTDIR IS DETERMINED AUTOMATICALLY BY THE CLASS ALWAYS RELATIVE TO CURRENT SCRIPT PATH!!) imgdir = "images" This will mean to get an image you can state "../images" or "/images" Relative path used on file_find ops function get_file($fname,$alttext,$maxw=0,$maxh=0,$altimg) Finds the file and echoes <img> $fname -> the name of the img file (can have .ext or not... if not stated cycles through .gif, .jpg, .png in that order) $alttext -> ALT text for the img tag $maxw -> Max Width for the pic $maxh -> Max Height for the pic $altimg -> Determines substitute for the pic (recursive get_file) useful for a default img i.e. 2.- Future releases and WIP I don't think i'll work much on this class, but any new release will be posted at http://phpclasses.upperdesign.com Any suggestions are wellcome 3.- Contact information Carlos Falo Hervás slainte@jet.es |
Files |
File | Role | Description |
---|---|---|
file_finder_class.php | Class | Base class file |
README_EN | Doc. | Documentation (english) |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.