Skip to content

Commit a6904b0

Browse files
committed
Show max. 10 news records on the dashboard.
1 parent fb5ebb5 commit a6904b0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

interface/web/dashboard/lib/custom_menu.inc.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,19 @@
4646
$items = $app->simplepie->get_items();
4747

4848
$rows = array();
49+
$n = 1;
4950

5051
foreach ($items as $item)
5152
{
52-
$rows[] = array('title' => $item->get_title(),
53-
'link' => $item->get_link(),
54-
'content' => $item->get_content(),
55-
'date' => $item->get_date('Y-m-d')
56-
);
53+
//* We want to show only the first 10 news records
54+
if($n <= 10) {
55+
$rows[] = array('title' => $item->get_title(),
56+
'link' => $item->get_link(),
57+
'content' => $item->get_content(),
58+
'date' => $item->get_date('Y-m-d')
59+
);
60+
}
61+
$n++;
5762
}
5863

5964
$_SESSION['s']['rss_news'] = $rows;

0 commit comments

Comments
 (0)