-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
47 lines (38 loc) · 1.13 KB
/
Copy pathindex.php
File metadata and controls
47 lines (38 loc) · 1.13 KB
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
<?php
include('bootstrap.php');
$cutoff_date = date("Y-m-d H:i:s", strtotime(date("Y-m-d", strtotime(date("Y-m-d"))) . " -1 month"));
$rec = news_api::new_search_record();
$rec->set_SquadWar(1);
$rec->set_newer_than($cutoff_date);
$rec->set_sort_by('date_posted');
$rec->set_sort_dir('DESC');
$res = news_api::search($rec);
$main_news = $res->get_results();
include(BASE_PATH.'doc_top.php');
include(BASE_PATH.'menu/main.php');
include(BASE_PATH.'doc_mid.php');
// MAIN PAGE INFO
?>
<div class="newstitle">Recent SquadWar Headlines</div>
<div class="copy">
<?php if(!empty($main_news)): ?>
<ul>
<?php
$count = 0;
foreach($main_news as $news_item):
if(++$count > 5):
break;
endif; ?>
<li><a href="#news<?php echo $news_item->get_id(); ?>"><?php echo $news_item->get_title(); ?></a></li>
<?php endforeach; ?>
</ul>
<?php else: ?>
<br />
<?php endif; ?>
</div>
<div class="copy">
<a href="oldnews.php">SquadWar News Archive</a>
</div>
<br />
<?php // END MAIN PAGE INFO ?>
<?php include(BASE_PATH.'doc_bot.php'); ?>