|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Bannato
Iscritto dal: Oct 2000
Messaggi: 552
|
PHP aiutino
Ho uno script che genera una galleria delle immagini e dovrei trovare il modo di far stampare sopra (o anche sotto) ogni immagine la directory nella quale è contenuto il file e il nome del file...come posso fare?
|
![]() |
![]() |
![]() |
#2 |
Bannato
Iscritto dal: Oct 2000
Messaggi: 552
|
script
lo script è questo, che ci posso fare?:
<?php // USER CONFIGURATION $picdir = "C:\Programmi\EasyPHP\www\img\friedrich"; // Directory the pictures are in (make sure you leave this as a relative path) $tablecolumns = 4; // Number of pictures to display horizontally $show_size=1; // Show image size? (1=yes, 0=no) $show_filename=1; // Show file name? (1=yes, 0=no) $thumb_width = 60; // Thumbnail width in pixels (height determined by W:H ratio of each image) $font = "verdana"; // Font name $fontsize = 1; // Font size $fontcolor = "#000080"; // Font color (hex or text-name format) $fontattribs="<B>"; // Additional font attributes as they would appear in regular HTML (i.e. <B><I><U>) // END OF USER CONFIGURATION! $column_width = 100 / $tablecolumns; // Figures out percentage of screen each column should take up $rowcount = 0; echo "<center>"; echo "<table border='0' cellpadding='5' cellspacing='5' style='border-collapse: collapse' bordercolor='#111111' width='100%' id='AutoNumber1'>"; echo "<tr>"; if ($handle = opendir($picdir)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { echo "<td align='center' width=$column_width%>"; echo "<font face='$font' size='$fontsize' color='$fontcolor'>"; echo "$fontattribs"; $size = getimagesize ("$picdir/$file"); $image_ratio = $size[1] / $size[0]; $thumb_height = $thumb_width * $image_ratio; echo "<a href='$picdir/$file' target='_blank'>"; echo "<img border=0 src ='$picdir/$file' width='$thumb_width' height='$thumb_height'><br>"; if ($show_size==1) { echo "$size[0] x $size[1]<br>"; // shows picture dimensions } if ($show_filename==1) { echo "$file"; // shows file name } echo "</a>"; echo "</td>"; $rowcount++; if ($rowcount >= $tablecolumns) { echo "</tr>"; echo "<tr>"; $rowcount=0; } } } closedir($handle); } // Close out the table echo "</tr>"; echo "</table>"; echo "</center>"; echo "</font>"; ?> |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Oct 2001
Messaggi: 11471
|
intendi scrivere direttamente sull'immagine oppure nella pagina html normale ?
ciao ![]() |
![]() |
![]() |
![]() |
#4 |
Bannato
Iscritto dal: Oct 2000
Messaggi: 552
|
?
sotto l'immagine dove dice il nome del file vorrei inserirci anche il nome della directory in cui è contenuto il file della jpg
|
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
if ($show_filename==1)
{ echo "$picdir/$file"; // shows file name } Basta fare questa piccola modifica !!! |
![]() |
![]() |
![]() |
#6 |
Bannato
Iscritto dal: Oct 2000
Messaggi: 552
|
:-P
Grazie,
te sei sempre il mio salvatore se mi dai una tua foto e le tue misure ti faccio una statua :-P |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 13:36.