forked from waheedpay/meta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
145 lines (137 loc) · 3.58 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
<?php
$q=stripslashes(preg_replace('/\s\s+/', ' ', $_GET['q']));
$qw=preg_replace("/[^A-Za-z0-9 ]/", "", $q);
$search=$_GET['search'];
require_once("header.php");
?>
<style type="text/css">
.navigation {
<? if(str_replace(" ","",$qw)=="") {
echo 'margin-top: 15%;
text-align: center;';
} else {
echo 'background: #f2f2f2;
border-bottom: 1px solid #e4e4e4;
padding: 12px 10px;
position:fixed;
top:0;
left:0;
right:0;';
}
?>
}
<? if(str_replace(" ","",$qw)=="") {
echo 'footer {
position:absolute;
left:0;
right:0;
bottom:0;
} nav {
margin:0;
}
.logo {
padding: 17px;
display: block;
}
input.input-text {
width: 40%;
}';
}
?>
</style>
<body>
<nav>
<li><a href="?q=<? echo $q ?>&search=web">Web</a></li>
<li><a href="?q=<? echo $q ?>&search=images">Image</a></li>
<li><a href="?q=<? echo $q ?>&search=videos">Video</a></li>
<li><a href="?q=<? echo $q ?>&search=news">News</a></li>
</nav>
<div class="navigation">
<form>
<div class="logo"><a href="/"><img src="/image/logo_main.png" alt="logo"></a></div><input type="search" class="input-text" name="q" value="<? echo $q ?>" id="search" /><input type="hidden" name="search" value="<? echo $search; ?>"><input type="submit" class="g-button" value="Search" />
</form>
</div>
<? error_reporting(0);
require_once("functions.php");
// now have some fun with the results...
if(str_replace(" ","",$qw)=="") {
} else {
$page = preg_replace('/[^-0-9]/', '', $_GET['page']);
if($page=="" or $page==" ") {
$page="1";
}
$qe=urlencode($q);
$qs=urlencode($qw);
$limit=12;
$start = ($page-1) * $limit;
if($search=="images" || $search=="videos" || $search=="news") {
echo '<ol class="vid_result_main">';
if($search =="images") {
image_str(array_merge(image($qs,$start+1), image($qs,$start+5),image($qs,$start+9),image($qs,$start+13)));
} else
if($search =="videos") {
video($qs,$page,21);
} else
if($search =="news") {
news($qs,$page,21);
}
echo '</ol>';
pagination('?q='.$qe.'&search='.$search);
} else
if($search =="weather") {
weather();
} else {
$limit=12;
$start = ($page-1) * $limit;
echo '<ol class="img_result_main">';
image_str(array_merge(image($qs,$start+1), image($qs,$start+5),image($qs,$start+9)));
echo "</ol>";
echo'<div class="results_container">';
?>
<script type="text/javascript">
( function() {
if (window.CHITIKA === undefined) {
window.CHITIKA = { 'units' : [] };
};
var unit = {
'fluidH' : 1,
'nump' : "2",
'publisher' : "waheedpay",
'width' : 528,
'height' : "auto",
'type' : "mpu",
'sid' : "Chitika Default",
'color_site_link' : "0000CC",
'color_title' : "0000CC",
'color_border' : "FFFFFF",
'color_text' : "000000",
'color_bg' : "FFFFFF"
};
var placement_id = window.CHITIKA.units.length;
window.CHITIKA.units.push(unit);
document.write('<div id="chitikaAdBlock-' + placement_id + '"></div>');
var s = document.createElement('script');
s.type = 'text/javascript';
s.src = 'http://scripts.chitika.net/getads.js';
try {
document.getElementsByTagName('head')[0].appendChild(s);
} catch(e) {
document.write(s.outerHTML);
}
}());
</script>
<?
web_str(array_merge(web($qs,$start), web($qs,$start+4),web($qs,$start+8)));
if (count($results) < $pageslimit) {
echo '<li class="results">Oops!, You\'ve reached the end of the results.</li>';
}
echo '</ol>';
video($qs,$page,6);
pagination('?q='.$qe.'&search='.$search);
echo'</div>';
}
}
require_once("footer.php");
?>
</body>
</html>