forked from projectsend/projectsend
-
Notifications
You must be signed in to change notification settings - Fork 1
/
home-news-widget.php
35 lines (34 loc) · 909 Bytes
/
home-news-widget.php
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
<?php
require_once('sys.includes.php');
$allowed_news = array(9,8,7);
if (in_array(CURRENT_USER_LEVEL,$allowed_news)) {
?>
<div class="widget">
<h4><?php _e('ProjectSend news','cftp_admin'); ?></h4>
<div class="widget_int">
<ul class="home_news">
<?php
$feed = simplexml_load_file(NEWS_FEED_URI);
$max_news = 3;
$n = 0;
foreach ($feed->channel->item as $item) {
if ($n < $max_news) {
?>
<li>
<span class="date"><?php echo date(TIMEFORMAT_USE,strtotime($item->pubDate)); ?></span>
<a href="<?php echo html_output($item->link); ?>" target="_blank">
<h5><?php echo html_output($item->title); ?></h5>
</a>
<p><?php echo make_excerpt(html_output(strip_tags($item->description, '<br />')),200); ?>
</li>
<?php
$n++;
}
}
?>
</ul>
</div>
</div>
<?php
}
?>