-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
178 lines (127 loc) · 5.41 KB
/
index.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
176
177
178
<?php
session_start();
$_SESSION['list'] = array();
?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/bootstrap.min.css">
<style>
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar{
overflow:auto;
}
a.share {
padding-right:5px;
color:#4970B3;
text-decoration:none;
font-size:14px;
}
a.share:hover{
color:#4086FF;
font-size:15px;
}
</style>
<link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/font-awesome.css">
<link href="css/jquery.mCustomScrollbar.css" rel="stylesheet" />
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.8.3.js"><\/script>')</script>
<script src="js/jquery.mCustomScrollbar.js"></script>
<script src="js/masonry.js"></script>
<script >
$(function() {
var height = $(window).height();
var type = $(".type").val();
var $container = $('.main_content');
var $search = $('.search').val();
$(".main_content").load("source.php?s=" + encodeURIComponent($search) + "&t=" + type, function() {
$container.masonry({
itemSelector: '.container_item',
columnWidth: 140
});
});
setInterval(function() {
$(".loading").show();
$.get('source.php?s=' + encodeURIComponent($search) + '&t=' + type, function(data){
$container.prepend( data ).masonry( 'reload' );
});
$(".loading").hide();
}, 15000);
});
</script>
</head>
<body>
<!--[if lt IE 7]>
<p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
<![endif]-->
<!-- This code is taken from http://twitter.github.com/bootstrap/examples/hero.html -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="#">KFeed</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active"><a href="index.php">Home</a></li>
</ul>
</div><!--/.nav-collapse -->
<form method='get' class='navbar-search pull-left' action="<?php echo $_SERVER['PHP_SELF']; ?>" >
<input type='text' name='s' placeholder='Search for news by keywords...' value='<?php echo @$_GET['s']; ?>' style="width:300px; margin:0px;" />
<input type='submit' style="margin:0px;" class='btn btn-inverse' value="Search" /> <br/>
</form>
</div>
</div>
</div>
<div class="container-fluid" style="height:100%;">
<div class="row-fluid" style="height:100%;">
<div class="span2" >
<?php
$link = (!@$_GET['u']) ? '' : $_GET['u'];
$type = @$_GET['t'];
?>
<input type='hidden' class='type' value="<?php echo $type; ?>" />
<input type='hidden' class='search' value="<?php echo urlencode(@$_GET['s']); ?>" />
<div style="margin-bottom:10px; padding-bottom:10px; border-bottom:1px solid #EDEDED; ">
<div class="btn-group ">
<a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
<i class='icon-filter'></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="<?php echo ($type == 'all' || $type == '') ? 'active' : ''; ?>"><a href='index.php?t=all&u=<?php echo $link; ?>'>All</a></li>
<li class="<?php echo ($type == 'news') ? 'active' : ''; ?>"><a href='index.php?t=news&u=<?php echo $link; ?>'>News</a></li>
<li class="<?php echo ($type == 'sports') ? 'active' : ''; ?>"><a href='index.php?t=sports&u=<?php echo $link; ?>'>Sports</a></li>
<li class="<?php echo ($type == 'tech') ? 'active' : ''; ?>"><a href='index.php?t=tech&u=<?php echo $link; ?>'>Tech</a></li>
</ul>
</div>
</div>
<div class="sidebar" >
</div>
</div>
<div class="span10 main_content">
</div>
</div>
</div>
<div id="preview">
</div>
<script src="js/vendor/bootstrap.min.js"></script>
</body>
</html>