diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-10-05 13:46:54 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-10-05 13:46:54 -0500 |
commit | 5ed01bd42b0aaf222f3b04b611e31b3d0974b6a4 (patch) | |
tree | e2adf4f018d79bce5853d42cdbda6c05c25955fa /news.php | |
download | website-core-5ed01bd42b0aaf222f3b04b611e31b3d0974b6a4.tar.gz website-core-5ed01bd42b0aaf222f3b04b611e31b3d0974b6a4.zip |
Initial import of static files
Diffstat (limited to 'news.php')
-rw-r--r-- | news.php | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/news.php b/news.php new file mode 100644 index 0000000..ef25704 --- /dev/null +++ b/news.php @@ -0,0 +1,63 @@ +<?php + // (c) 2014 Trinity Desktop Project + // All Rights Reserved + // Authors: Elizabeth Liddell, Timothy Pearson, and Calvin Morrison + + include("globals.php"); + include("header.php"); + include("footer.php"); + doHeader("Trinity News", "Main", "News"); + + include ("media/news-javascript.php"); +?> + +<?php + +if ($handle = opendir('./news/')) { + $filenames = array(); + while ($file = readdir($handle)) { + $filenames[] = $file; + } + rsort($filenames); + + foreach($filenames as $file) { + // sort($handle, SORT_NUMERIC); + if (($file != ".") && ($file != "..") && ($file{0} != '.')) { + echo "<h3>$file: "; + + $data = file_get_contents("news/$file"); //read the file + $data = str_replace("http://", "https://", $data); //force https images and links + $convert = explode("\n", $data); //create array separate by new line + for ($i=0;$i<count($convert);$i++) { + echo $convert[$i]. '<br>'; //write value by index + if ($i == 0){ + echo "</h3>"; + } + if ($i == $newscollapsedlines) { + echo '<div id="hiddennews-' . $file . '" style="display: none">'; + } + } + if (count($convert) > $newscollapsedlines) { + echo '</div>'; + echo '<noscript><div class="floatleft"><a href=\'/newsentry.php?entry=' . $file . '\'>Read entire entry on separate page</a><BR>Javascript is not available or turned off</div></noscript>'; + echo '<div class="floatleft"><a id="hiddennews-toggler-' . $file . '" href="javascript:toggle(\'hiddennews-' . $file . '\',\'hiddennews-toggler-' . $file . '\');" >show all text of this entry</a></div>'; + echo '<div class="floatright"><a href=\'/newsentry.php?entry=' . $file . '\'>permalink</a></div>'; + echo '<div style="clear: both;"></div>'; + } + else { + echo '<div class="floatright"><a href=\'/newsentry.php?entry=' . $file . '\'>permalink</a></div>'; + echo '<div style="clear: both;"></div>'; + } + echo "<div class=\"clearall\"></div><br><br>"; + echo "<p class=\"spacer\">"; + } + } + echo "<br>"; + closedir($handle); +} + +?> + +<?php + doFooter(); +?> |