Re:code quest

From: Date: Tue, 15 Feb 2011 16:59:38 +0000
Subject: Re:code quest
Groups: php.general 
Request: Send a blank email to php-general+get-311307@lists.php.net to get a copy of this message
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

« previous php.general (#311307) next »