1) I would like to filter out the .txt files in column one.
2) Add a html link for the filter out .txt item to column two.
2b) Parse the 'Short description' from the README.TEMPLATE & display it !
3) Filter an item by name or partial name.
...
Well, one was easy:
// parse short description
$myFile = $myFile = '
http://hobbes.nmsu.edu/download/pub/incoming/' . $fileinfo['name'];
$lines = file($myFile); //file in to an array not recommeded for large files, use $lines[4] to print short desc.
// get extension
$ext = pathinfo($fileinfo['name'], PATHINFO_EXTENSION);
// filter txt files
if ($ext !== 'txt') {
// rename extension
$textName = preg_replace('"\.(zip|wpi)$"', '.txt', $fileinfo['name']); // rename zip/wpi to txt
// split short description line in two, to print $pieces[1]
$pieces = explode(":", $lines[4]);
// print file listing here
}
// filter item
$string = $item['title'];
if(stristr($string, 'netlabs.org newsletter') === FALSE) {
// filter in match
}
Funny note: always work with proofed data ! While I was working on this Hobbes processed the incoming directory. I went over the code 3 or 4 times wondering why only the README.TEMPLATE was showing.