01. april 2001 - 22:18Der er
24 kommentarer og 1 løsning
Billeder
Jaja, jeg er her igen. Er sgu nybegynder. Fandt det her script på et eller andet sted, og det virker faktisk også fint nok, pånær ville jeg gerne når jeg klikker for at enlarge at baggrunder så er sort og ikke hvid, plus at jeg gerne ville kunne skrive en lille tekst under hvert billede (enlarged) altså... How do I ??? Herunder er filen:
<? //---- Settings Start ---\\\\ // Image Information $imageWidth=100; $imageHeight=100;
// Table Layout $rows=3; $cols=6;
//Image path $libery=\"../pictures/\"; // remember to finish with /
// Settings Stop----------//
$viewNum=$cols*$rows; if(!$firstImage){ // so it works if you just enter default.php and show the pictures without having to define the variables in the path $firstImage=1; } function getImages($firstImage){ global $viewNum, $imageWidth, $imageHeight,$cols,$libery; //insures that the function gets the variables $handle=opendir($libery); //opens directory while($file=readdir($handle)){ // reads the directory $extension=substr($file,-4); // gets the extension of the files if(($extension == \".jpg\") || ($extension == \".gif\") || ($extension == \".png\") ){ // checks for image files $all[]=$file; //adds positive results to the archive } } $colscounter=0; // variable that controls the tablebuilding system below $firstImage--; // variable that insures that the first image is being showed. Case: It looks best if the links begins with 1 but the array begins with 0 if(isset($all)){ // if array is set build the table print \"<table>\"; for($i=$firstImage; $i < $firstImage+$viewNum; $i++){ if($all[$i]){ // checks for rinning dry of imges if($i==$firstImage + $colscounter*$cols){ // if true: new row $colscounter++; print \"<tr>\"; } // add the image print \"<td><a href=\'\".$libery.\"\".$all[$i].\"\'><img src=\'\".$libery.\"\".$all[$i].\"\' border=\'0\' width=\'$imageWidth\' height=\'$imageHeight\' alt=\'Click to Enlarge\'></a></td>\"; } else{ // stop if no more images break; } } print \"</table><br>\"; $num=count($all); //number of pictures in actual libery makeList($num); // function to make the links list } else{ print \"Der var desværre ingen billeder i dette bibliotek<br><a href=\'java script:history.back()\'>Go Back</a>\"; } } function makeList($num){ global $libery, $firstImage, $viewNum; //insures that the function gets the variables $numLinks = $num / $viewNum; // finds the number og links to be maked for($a=0; $a < $numLinks;$a++){ $start=$a*$viewNum+1; //adds 1 because then the links begins with ex. number 1-10 and 11-20 instead of 0-10 and 10-20 $finish=$a*$viewNum+$viewNum; if($finish>$num){ // insures that the final link returns the right amount of pictures instead of to much $finish=$num; } if(($firstImage >= $start) && ($firstImage < $a * $viewNum+$viewNum)){ // if true: makes no link because you already are on the page print \"$start - $finish</a> \"; } else{ // makes the link print \"<a href=\'default.php?libery=$libery&firstImage=$start\'>$start - $finish</a> \"; } } } ?> </html>
I dette særtema ser vi på, hvordan cloud og AI bliver fundamentet for virksomhedernes digitale forretning, og hvordan de nye muligheder for automatisering og forretningsværdi kan udnyttes uden at miste overblik, sikkerhed og menneskelig kontrol.
Hmmm, ja og ja... Men det kræver at en del skal laves om, f.eks skal man opbygge en HTML fil for hvert billed, så man kan sætte baggrunds farve... Og teksten må så lægges i database (eller evt i tekst fil) som så har filnavn som nøgle....
<? //---- Settings Start ---\\\\ // Image descrition $Des = Array ( [\"Filnavn1\"] => \"Her er jeg\" [\"Filnavn2\"] => \"Her er jeg\" [\"Filnavn3\"] => \"Her er jeg\" [\"Filnavn4\"] => \"Her er jeg\" [\"Filnavn5\"] => \"Her er jeg\" [\"Filnavn6\"] => \"Her er jeg\" [\"Filnavn7\"] => \"Her er jeg\" );
// Image Information $imageWidth=100; $imageHeight=100;
// Table Layout $rows=3; $cols=6;
//Image path $libery=\"../pictures/\"; // remember to finish with /
// Settings Stop----------//
if(!$Filename) { $viewNum=$cols*$rows; if(!$firstImage){ // so it works if you just enter default.php and show the pictures without having to define the variables in the path $firstImage=1; } function getImages($firstImage){ global $viewNum, $imageWidth, $imageHeight,$cols,$libery; //insures that the function gets the variables $handle=opendir($libery); //opens directory while($file=readdir($handle)){ // reads the directory $extension=substr($file,-4); // gets the extension of the files if(($extension == \".jpg\") || ($extension == \".gif\") || ($extension == \".png\") ){ // checks for image files $all[]=$file; //adds positive results to the archive } } $colscounter=0; // variable that controls the tablebuilding system below $firstImage--; // variable that insures that the first image is being showed. Case: It looks best if the links begins with 1 but the array begins with 0 if(isset($all)){ // if array is set build the table print \"<table>\"; for($i=$firstImage; $i < $firstImage+$viewNum; $i++){ if($all[$i]){ // checks for rinning dry of imges if($i==$firstImage + $colscounter*$cols){ // if true: new row $colscounter++; print \"<tr>\"; } // add the image print \"<td><a href=\'\".$PHP_SELF.\"?Filname=\".$all[$i].\"\'><img src=\'\".$libery.\"\".$all[$i].\"\' border=\'0\' width=\'$imageWidth\' height=\'$imageHeight\' alt=\'Click to Enlarge\'></a></td>\"; } else{ // stop if no more images break; } } print \"</table><br>\"; $num=count($all); //number of pictures in actual libery makeList($num); // function to make the links list } else{ print \"Der var desværre ingen billeder i dette bibliotek<br><a href=\'java script:history.back()\'>Go Back</a>\"; } } function makeList($num){ global $libery, $firstImage, $viewNum; //insures that the function gets the variables $numLinks = $num / $viewNum; // finds the number og links to be maked for($a=0; $a < $numLinks;$a++){ $start=$a*$viewNum+1; //adds 1 because then the links begins with ex. number 1-10 and 11-20 instead of 0-10 and 10-20 $finish=$a*$viewNum+$viewNum; if($finish>$num){ // insures that the final link returns the right amount of pictures instead of to much $finish=$num; } if(($firstImage >= $start) && ($firstImage < $a * $viewNum+$viewNum)){ // if true: makes no link because you already are on the page print \"$start - $finish</a> \"; } else{ // makes the link print \"<a href=\'default.php?libery=$libery&firstImage=$start\'>$start - $finish</a> \"; } } } ?> </html> <? } else { ?> <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
Jeg kan kun sige at functions.inc ikke bliver hentet! For det er deri at getimages() funktionen ligger. Jeg har fået scriptet til at virke lokalt (har endda gjort at man ikke skal hente alle de store biller)
Den må da blive hentet functions.inc ellers ville den vel slet ikke lave de små billeder osv, det er jo først når man enlarge billedet at fejlen kommer (og det virker sådan set godt nok, selvom fejlen kommer.... underligt nok)...... må være en lille fejl some where.....
eller en af de meget ufine: <body> <div align=\"center\"><img src=\"<? echo $libery.$Filename?>\" border=\"0\" alt=\"<? echo $Des[$Filename]; ?>\"></div> <div align=\"center\"><? echo $Des[$Filename]; ?></div> </body> </html>
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.