|
Lines 25-83
Link Here
|
| 25 |
require_once ($root . '/webtools/common.php'); |
25 |
require_once ($root . '/webtools/common.php'); |
| 26 |
require_once ($root . '/community/news/scripts/news.php'); |
26 |
require_once ($root . '/community/news/scripts/news.php'); |
| 27 |
|
27 |
|
| 28 |
function getWTPNews($rssfile, $rssurl, $count) |
|
|
| 29 |
{ |
| 30 |
$rss = get_news($rssfile); |
| 31 |
$html = ""; |
| 32 |
// if($rss->channel == "") |
| 33 |
// { |
| 34 |
// return "empty"; |
| 35 |
// } |
| 36 |
// return $rss; |
| 37 |
foreach ($rss->channel as $channel) |
| 38 |
{ |
| 39 |
$html .= "<h6>"; |
| 40 |
|
| 41 |
// Add the RSS image on the right |
| 42 |
$html .= "<a href=\"$rssurl\"><img src=\"/images/rss.gif\" align=\"right\" alt=\"More...\" /></a>"; |
| 43 |
|
| 44 |
// Add the title of the channel |
| 45 |
$html .= "WTP News"; |
| 46 |
// If we're displaying short format, provide a link to |
| 47 |
// show news in long format. |
| 48 |
$html .= " <a href=\"/webtools/news.html\"><img src=\"/images/more.gif\" title=\"More...\" alt=\"More...\" /></a>"; |
| 49 |
|
| 50 |
$html .= "</h6>"; |
| 51 |
|
| 52 |
// $description = $channel->description; |
| 53 |
// if (strlen($description) > 0) { |
| 54 |
// $html .= $description; |
| 55 |
// } |
| 56 |
$html .= "<ul class=\"midlist\">"; |
| 57 |
|
| 58 |
foreach ($channel->item as $item) |
| 59 |
{ |
| 60 |
if ($count == 0) break; |
| 61 |
$html .= "<li>"; |
| 62 |
$date = $item->pubDate ? (" posted " . date("d‑m‑Y", $item->pubDate)) : ""; |
| 63 |
$html .= "<a href=\"$item->link\" target=\"_blank\">$item->title</a>$date<br/>"; |
| 64 |
$html .= $item->description; |
| 65 |
$html .= "</li>"; |
| 66 |
$count--; |
| 67 |
if($count != 0) |
| 68 |
{ |
| 69 |
$html .= "<br/>"; |
| 70 |
} |
| 71 |
} |
| 72 |
$html .= "</ul>"; |
| 73 |
} |
| 74 |
return $html; |
| 75 |
} |
| 76 |
// Generate the HTML content for the news based on the rss files |
28 |
// Generate the HTML content for the news based on the rss files |
| 77 |
// that appear in the root directory. |
29 |
// that appear in the root directory. |
| 78 |
$rssurl = "/webtools/wtpnews.rss"; |
30 |
$rssurl = "/webtools/wtpnews.rss"; |
| 79 |
$wtpnews = getWTPNews($root . $rssurl, $rssurl, 5);//xml_to_html("news", "news-rss20", "long", "5"); |
31 |
$wtpnews = rss_to_html($root . $rssurl, $rssurl, "/webtools/news.html", "long", "5"); |
| 80 |
|
32 |
|
| 81 |
// Get the project descriptions |
33 |
// Get the project descriptions |
| 82 |
$wtpoverview = read_file('project-info/description.html'); |
34 |
$wtpoverview = read_file('project-info/description.html'); |
| 83 |
$wstoverview = read_file('project-info/wst-description.html'); |
35 |
$wstoverview = read_file('project-info/wst-description.html'); |
|
Lines 114-119
Link Here
|
| 114 |
</tr> |
66 |
</tr> |
| 115 |
</table> |
67 |
</table> |
| 116 |
<div class="homeitem3col"> |
68 |
<div class="homeitem3col"> |
|
|
69 |
$wtpnews |
| 70 |
</div> |
| 71 |
<div class="homeitem3col"> |
| 117 |
<h3>Subprojects</h3> |
72 |
<h3>Subprojects</h3> |
| 118 |
<ul> |
73 |
<ul> |
| 119 |
<li> |
74 |
<li> |
|
Lines 163-171
Link Here
|
| 163 |
<li><a href="/newsgroups/main.html#wtp">Newsgroup</a></li> |
118 |
<li><a href="/newsgroups/main.html#wtp">Newsgroup</a></li> |
| 164 |
</ul> |
119 |
</ul> |
| 165 |
</div> |
120 |
</div> |
| 166 |
<div class="sideitem"> |
|
|
| 167 |
$wtpnews |
| 168 |
</div> |
| 169 |
</div> |
121 |
</div> |
| 170 |
</div> |
122 |
</div> |
| 171 |
EOHTML; |
123 |
EOHTML; |