//////////////////////////////////////////////////////////////////////////////////////////////////////// // NAME: // imagebrowser.php // // VERSION: // Version 1.0 - 18/07/01 // // AUTHOR: // Jo Demol (de_paashaas@yahoo.com) // // DESCRIPTION: // Drop this file in any directory that you want and it automaticaly generates // an easy to use browsable interface for your images // // RETURNED VARIABLES: // no variables are returned // // Configuration Variables // ====================== // // imgperpage : the number of thumbnail images displayed // its best to give this a value that is a multiple of imgperrow // imgperrow : the number of thumbnail images per row // typelist : array that contains the imagetypes shown by the browser // currentdir : default the directory where this php file resides, // can be replaced by any directory of your choice // title : enter the title of your page here // home : enter path to your home directory or any other desired directory // stylesheet : enter the path to your stylesheet here // the stylesheet should have these classe: // // .imag { border-style : solid; // border-color: blue; // border-width : 1px;} // .thumb { border-style : solid; // border-color: #999999; // border-width : 2px;} // A:link { color: #999999; // text-decoration : none; } // A:visited { color: #999999; // text-decoration : none; } // A:hover { color:blue; } // any of these classses can be adjusted to your needs // // USAGE: // to browse through the images use the back and forward images // click on one of the thumbnails // or use one of the pagelinks to go directly to another set of images // clicking on the large image will give you the full image ///////////////////////////////////////////////////////////////////////////////////////////////////////// //---Variables--- $imgperpage = 36; $imgperrow = 12; $currentdir = getcwd (); $typelist = array("jpg","jpeg","gif","png"); $imagelist = array(); $title = "TriumphStag.net Registry Gallery"; $stylesheet = "link to your stylesheet" ; $home = "link to the returnpage"; //--- ind is put to zero when the script is first called uppon--- if(!isset($ind)) $ind = 0; $index = $ind; //---the following code iterates through the directory and puts any image found in the imagelist array--- //$dp=opendir($currentdir); //while ( false != ( $file=readdir($dp) ) ) { // if (is_file($file) && $file!="." && $file!=".."){ // // $extention = explode(".",$file); // $extention = $extention['1']; // // if( in_array($extention,$typelist) ){ // array_push ($imagelist,$file); // } // } //} // // My Code to get Files from the database instead of from the directory starts here: // Include the header file include ("../include/header.php"); // get data connection require("../include/sqlcon.php"); $sql = new MySQL_class; $sql->Create("triumphstag_db"); $sql1 = new MySQL_class; $sql1->Create("triumphstag_db"); $imagelist = array(); $commission = array(); $name=array(); $prefix=array(); $sufix=array(); //get filenames $sql->Query("Select commnumber,stagpic,name,comprefix,comsufix from stagdata where picyn like 'Yes' order by commnumber"); for ($i = 0; $i < $sql->rows; $i++) { $sql->Fetch($i); $commnum=$sql->data[0]; $stagpic = $sql->data[1]; $name1 = $sql->data[2]; $prefix1 = $sql->data[3]; $sufix1 = $sql->data[4]; array_push ($imagelist,$stagpic); array_push ($commission,$commnum); array_push ($name,$name1); array_push ($prefix,$prefix1); array_push ($sufix,$sufix1); } ?>
/*this id the code for moving forward through the images?*/ ?> if($index-1 >= 0) {?> < } ?> | /*this id the code for moving backward through the images?*/ ?> if($index+1 < count($imagelist) ) {?> > } ?> |