Jump to content
php.lv forumi

gallery


Gacha

Recommended Posts

<head>
<link rel="stylesheet" type="text/css" href="../stils.css">
<script language=JavaScript>
 function pic(file) {
   window.open(file,"_blank","toolbar=no,status=no,menubar=no,resizable=no,scrollbars=no,fullscreen=no,wid
th=500,height=500");
 }
</script>
</head>
<?

chdir('pics/');
$handle=opendir('.');
readdir($handle);
readdir($handle);
echo "<BR>";
while (($file = readdir($handle))!==false){
$size=(filesize($file)/100);
echo "<table class='pictable' width='200' border='0' cellspacing='0' cellpadding='0'>
 <tr> 
   <td><div align='center'><A HREF=JavaScript:pic('pics/$file')><img src=pics/$file width=100 height=75></A></div></td>
 </tr>
 <tr>
   <td><div align='center'>Nosaukums: $file <BR> Izmers: $size Kb</div></td>
 </tr>
</table>
<table width='200' border='0' cellspacing='0' cellpadding='0'>
 <tr>
   <td> </td>
 </tr>
</table>
";
}
echo "<BR>";
?>

Tur teiblaa ieliekas bildite, bet tie teibli raadaas viens zem otra, bet es gribetu, ka tas bildes raditos kaadas 3 vienaa rindaa! Un ja to varetu panaakt, tad shis mazais skriptinjsh ir lloti noderiigs.

Link to comment
Share on other sites

Nepārbaudīju, bet varētu būt šāds.

<head>
<link rel="stylesheet" type="text/css" href="../stils.css">
<script language=JavaScript>
function pic(file) {
  window.open(file,"_blank","toolbar=no,status=no,menubar=no,resizable=no,scrollbars=no,fullscreen=no,wid
th=500,height=500");
}
</script>
</head>
<?

chdir('pics/');
$handle=opendir('.');
readdir($handle);
readdir($handle);
echo "<BR>";
echo '<table><tr>'; //PIEVIENOTS 
$maxkol = 3; //PIEVIENOTS
$kolsk = 1;
while (($file = readdir($handle))!==false){
$size=(filesize($file)/100);
echo '<td>';//PIEVIENOTS
echo "<table class='pictable' width='200' border='0' cellspacing='0' cellpadding='0'>
<tr>
  <td><div align='center'><A HREF=JavaScript:pic('pics/$file')><img src=pics/$file width=100 height=75></A></div></td>
</tr>
<tr>
  <td><div align='center'>Nosaukums: $file <BR> Izmers: $size Kb</div></td>
</tr>
</table>
<table width='200' border='0' cellspacing='0' cellpadding='0'>
<tr>
  <td> </td>
</tr>
</table>
";
echo '</td>';//PIEVIENOTS
if($kolsk == $maxkol){ //PIEVIENOTS
echo '</tr><tr>';//PIEVIENOTS
$kolsk = 0;//PIEVIENOTS
}//PIEVIENOTS
$kolsk++;//PIEVIENOTS
}
echo '</tr></table>';//PIEVIENOTS  
echo "<BR>";
?>

Link to comment
Share on other sites

×
×
  • Create New...