-
Notifications
You must be signed in to change notification settings - Fork 1
/
newsfeed.php
175 lines (150 loc) · 5.05 KB
/
newsfeed.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php require('Includefiles/header.php'); ?>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<?php
$cid = (int)$_GET['cid'];
if ($cid == 0) {$cid=3;}
?>
<!-- Main Menu -->
<div class="main menu">
<div class="container">
<nav class="navbar navbar-default" role="navigation">
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li class="#"><a href="index.php">Home</a></li>
<li class="divider"></li>
<li class="active"><a href="performance.php">County Overview</a></li>
<li class="divider"></li>
<li><a href="comparison.php">County Comparison</a></li>
<li class="divider"></li>
<li><a href="http://www.opencounty.org/">About Open County</a></li>
<li class="divider"></li>
<li><a href="contact.php">Contacts</a></li>
<li class="divider"></li>
<li><a href="#">Login</a></li>
<li class="divider"></li>
</ul>
</div>
</nav>
</div>
</div>
<!-- //End of Main Menu -->
<!-- Main Content -->
<div class="main">
<div class="container">
<?php require('Includefiles/banner.php'); ?>
<a name="overview"></a>
<div class="col-md-12">
<fieldset class="rsslib">
<?php
if ($cid == 0)
{ $news='kenya'; }
else {
$query_Contents_ =mysql_query("SELECT * FROM countyInfo WHERE countyid = $cid ");
$row_Contents_=mysql_fetch_assoc($query_Contents_);
$news = 'county+'.$row_Contents_['County'];
}
//$cachename = "./Includefiles/rss-cache.php";
$url = "http://news.google.com/news?cf=all&ned=us&hl=en&q=".$news."&output=rss";
//echo $url;
/*if(file_exists($cachename))
{
$now = date("G");
$time = date("G", filemtime($cachename));
if($time == $now)
{
include($cachename);
exit();
}
}*/
require_once("./Includefiles/rsslib.php");
$cache = RSS_Display($url, 15, false, true);
//file_put_contents($cachename, $cache);
echo $cache;
?>
</fieldset>
</div>
<!-- /.container -->
</div><!-- /.main -->
<!-- //End Content -->
<!-- Footer -->
<?php include ("./Includefiles/footer.php"); ?>
<!-- //End Footer -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="js/bootstrap-progressbar.js"></script>
<script src="js/d3.min.js"></script>
<script src="js/d3.pie.js"></script>
<script src="js/angular.js"></script>
<script src="js/nv.d3.js"></script>
<script src="js/angularjs-nvd3-directives.js"></script>
<script type="text/javascript" src="js/bootstrap-select.js"></script>
<script src="js/control.js"></script>
<script type="text/javascript">
function getStyleSheetPropertyValue(selectorText, propertyName) {
// search backwards because the last match is more likely the right one
for (var s= document.styleSheets.length - 1; s >= 0; s--) {
var cssRules = document.styleSheets[s].cssRules ||
document.styleSheets[s].rules || []; // IE support
for (var c=0; c < cssRules.length; c++) {
if (cssRules[c].selectorText === selectorText)
return cssRules[c].style[propertyName];
}
}
return null;
}
$(document).ready(function() {
$(".dropdown-menu").on("click", "li", function(){
var cid =$(this).attr('cid');// $(this).text();
window.location.href='performance.php?cid=' + cid;
});
$("li.level2").click(function(){
var cid = $(this).attr('cid');
var mcaCons = $(this).attr('Cons');
var divto = $(this).attr('divto');
mcaAJAX(cid,mcaCons,divto);
});
function mcaAJAX(c,d,t) {
$.ajax({
url: "mca_list.php",
type: "post",
async: false,
data: { cid : c, cons : d},
success:function(dat){
// alert(dat);
$("#mcaData").html(dat);
},
error:function(d){
alert("failure"+d);
$("#"+t).html('there is error while submit');
}
});
}
$('.selectpicker').selectpicker({
maxOptions: 1
});
$(".selectpicker").change(function() {
var element = $('option:selected',this);
var countyid = element.attr('value');
window.location.href = './newsfeed.php?cid='+countyid;
});
});
</script>
<?php
function formatter($text){
//echo $text;
$list="<ul>";
$t = explode('|', $text);
for($i=0; $i < count($t); $i++){
$tCont = explode(':', $t[$i]);
$list .= "<b>". $tCont[0] ."</b>";
$tD = explode(';', $tCont[1]);
for($j=0; $j<count($tD); $j++){
$list .= "<li>". $tD[$j] ."</li>";
}
}
$list.="</ul>";
echo $list;
}
?>
</body>
</html>