Re:[PHP] code quest

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Frankly, while that modulo looks like something worthy of learning, for my immediate time critical need I went with a quicker method, which is working. The complete script is below. It simply counts cells and resets the row when a number is exceeded.
<?php
# The next several lines declare an array of directories which are NOT to be listed!#
$excludes[] = 'attachments'; #20
$excludes[] = 'data';
$excludes[] = 'include';
$excludes[] = 'resources';
$excludes[] = 'stats';
$excludes[] = '_private';
$excludes[] = '_vti_bin';
$excludes[] = '_vti_cnf';
$excludes[] = '_vti_log';
$excludes[] = '_vti_pvt';
$excludes[] = '_vti_txt'; #30
$excludes[] = '_vxi_txt';
$excludes[] = 'css';
$excludes[] = 'img';
$excludes[] = 'images';
$excludes[] = 'js';
$excludes[] = 'cgi';
$excludes[] = 'cgi-bin';
$excludes[] = 'ssfm';
$ls = scandir(dirname(__FILE__));
$counter=0; #40
echo '<table border="1" cellspacing="1" cellpadding="5" bgcolor="F0F0F0"><tr>'; foreach ($ls as $d) { if (is_dir($d) && !preg_match('/^\./',basename($d)) &&!in_array(basename($d),$excludes))
 {
  ++$counter ;
echo '<td width="150" valign="top"><center>'.$d.'<br><a href="'.$d.'">'; echo '<img src="./'.$d.'/thumb.png" width="120" HEIGHT="175" border="5"></a><br></center>';
  include($d."/desc.txt");
  echo '</td>';
  if ($counter > 3)
    {
    echo '</tr><tr>'; #50
    $counter=0;
    }
  };
};
echo '</tr></table>';
?>

--
end

Very Truly yours,
                 - Kirk Bailey,
                   Largo Florida

                       kniht
                      +-----+
                      | BOX |
                      +-----+
                       think


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux