From 5ed01bd42b0aaf222f3b04b611e31b3d0974b6a4 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Oct 2015 13:46:54 -0500 Subject: Initial import of static files --- newsentry.php | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 newsentry.php (limited to 'newsentry.php') diff --git a/newsentry.php b/newsentry.php new file mode 100644 index 0000000..c4fe2f4 --- /dev/null +++ b/newsentry.php @@ -0,0 +1,81 @@ + + +'; + echo "

$file: "; + + $data = file_get_contents($prefix . "/$file"); //read the file + $convert = explode("\n", $data); //create array separate by new line + for ($i=0;$i'; //write value by index + if ($i == 0){ + echo "

"; + } + } + echo ''; + } +} + +if ($handle = opendir('./news/')) { +$filenames = array(); +while ($file = readdir($handle)) { + $filenames[] = $file; +} +rsort($filenames); + +$entryfound = 0; +foreach($filenames as $file) { + if ($file == $_GET["entry"]) { + writeNewsEntry($file, 'news'); + $entryfound = 1; + } +} +closedir($handle); + +if ($entryfound == 0) { + if ($handle = opendir('./rssentries/')) { + $filenames = array(); + while ($file = readdir($handle)) { + $filenames[] = $file; + } + rsort($filenames); + + $entryfound = 0; + foreach($filenames as $file) { + if ($file == $_GET["entry"]) { + writeNewsEntry($file, 'rssentries'); + $entryfound = 1; + } + } + closedir($handle); + + if ($entryfound == 0) { + echo 'Requested news entry not found!'; + echo "

"; + } + } +} + +echo 'Go back to News'; +echo "

"; +} +?> + + + + -- cgit v1.2.1