############################################### # Dodos ImgSort Script Version 1.0 # # PHP Version # ############################################### # # # Script Written By Dodo # # http://regretless.com/scripts # # # # No redistribution of my scripts # # without my written permission! # # # # Script is Released Under LinkWare # # You are free to use the script as # # long as you link back to my page. # # # # # ############################################### =================== General Information =================== This script is written mainly for cliques/adoptions pages. This script has three functions. To sort your clique/adoption images by their width or height in either ascending or descending order or just displaying your images in the order you placed them except it will automatically detect your images' width and height. You may also use this script to sort regular images by changing the type variable. Basic Idea: First you create an array/list of the images, url, text descriptions of your clique/adoptions. Then call the function, it will sort your list for you. This means you can add your images in ANY ORDER or delete any in any order. You DO NOT even have to know your image's width and height. All you have to do is upload your image and update your list. TADA, it's all sorted when you refresh your page. Features: - automatically detects your images' width and height - automatically writes html code for you - sort by width or height - sort in an ascending or descending order - use it to sort images with link & text or without - use it as many times as you wish in a file - include the function file only once ============== Included Files ============== readme.txt - This File dodos_imgsort.php - The file that contains my function that does the magic sorting clique.php - The example clique page to show you how my script works a bunch of .gif files - My example clique image files. Replace them with yours. =========== Requirement =========== This script uses getimagesize() function so you must have PHP VERSION 3.0+. You must save your clique file with .php .phtml or .php3 extension. Basic knowledge of PHP is a plus. ============ Installation ============ 1. Upload everything to your text folder and load clique.php to see the example. 2. Open clique.php to customize stuff. The comments should give you very good idea about what to do. Just remember you always beging a list by $img_list = array( and end it with ); to add an item, just put array("your image url", "your description of the clique or adoption", "your link"), in between your list beginning and ending. Of course follow my example. but remember you need to ADD BACKSLASHES in front of all QUOTATION MARKS!! ADD BACKSLASHES in front of all QUOTATION MARKS!! ADD BACKSLASHES in front of all QUOTATION MARKS!! ADD BACKSLASHES in front of all QUOTATION MARKS!! inside of your array(...), means example: array("whatever.gif", "i'm quotation mark, so do this: \" now i show up without giving you an error ", "http://regretless.com/scripts/"), So if you ever wish to delete one, just delete the entire array("your image url", "your description of the clique or adoption", "your link"), save your page, and you are done. =============================== Sort Image without Link or Text =============================== You may also sort your images without any links on them. If you wish to have text in the alt but no links. first in your array, if you want, you may skip the url part so do this: array("loverevolution.gif", "love revolution"), then call your function like this: dodos_imgsort($img_list, "height", "asc", " ", 1); If you want NO link nor text: first in your array, if you want, you may skip the url & text part so do this: array("loverevolution.gif"), then call your function like this: dodos_imgsort($img_list, "height", "asc", " ", 2); The second is demonstrated in the example. ================ Script In Action ================ To see the script in action, please visit http://pure-essence.net/www.php ==== Logs ==== Feburary 19, 2003: Script released.