now it should display news headlines insted of news file names. the headline is the first line in every news TXT file. i tried to read the headlines with stream_get_line() and fgets() but only received error messages.
can you modify this code to display the news headlines as links instead of file names?
Code: Select all
<title>Plain News</title>
<h3>Plain News</h3>
<?php
# creates a link list for of the files found in the parsed directory
# require script with the function to parse directory just once, there's no need for refreshed parsing
require_once("function-parse-dir.php");
# use the parsing function
$files = get_dir_contents('news');
# loop over files and make html links with vars passed on URL
foreach ($files as $file){
echo '<a href="template.php?f=news/' . $file . '">' . $file . '</a><br />';
}
?>
<p><a href="news-admin-1.php">News Admin</a></p>