summaryrefslogtreecommitdiffstats
path: root/index.php
blob: 3f518086768853c154f5a6ca3150b7b7c219c726 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
// (c) 2014 Trinity Desktop Project
// All Rights Reserved
// Authors: Elizabeth Liddell, Timothy Pearson, and Calvin Morrison

include("globals.php");
include("tde-head-and-foot.php");
doHeader("Trinity Desktop Environment", "Home", "_");

include ("media/news-javascript.php");

// Override for main page
$newscollapsedlines = 10000;
?>

<P><H2>Efficient. Productive.</H2>
The Trinity Desktop Environment (TDE) project is a computer desktop environment for Unix-like operating systems
with a primary goal of retaining the function and form of traditional desktop computers.
<P CLASS="spacer">
<P><SPAN CLASS="snapwrapper">
    <A HREF="media/screenshots/large/tde6.png"><IMG ALT="Introductory Screenshot" SRC="media/screenshots/large/tde6_mainpage.png" CLASS="snap" ID="introsnap"></A>
</SPAN>
<P STYLE="text-align:center"><A HREF="screenshots.php">More Screenshots</A>
<P CLASS="spacer">
<A HREF="rss.php"><IMG ALT="RSS Feed" SRC="media/tde-rss.png" ID="rssicon"></A><H2>Latest News</H2>
<?php
if ($handle = opendir('./news/')) {
	$filenames = array();
	while ($file = readdir($handle)) {
		$filenames[] = $file;
	}
	rsort($filenames);

	$file=$filenames[0];
	if ($file != "." && $file != "..") {
		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 '<div class="floatright"><div class="plain"> <a href="news.php">click here for older news</a> </div></div>';
	closedir($handle);
}
?>

<?php
	doFooter();
?>