-
Notifications
You must be signed in to change notification settings - Fork 1
/
GOOGLEindex.php
477 lines (352 loc) · 12.7 KB
/
GOOGLEindex.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
<?php
require_once("initvars.inc.php");
require_once("config.inc.php");
if($_GET['lang']){
$url_safe = preg_replace('/&lang=.{2}/', '', $_SERVER['REQUEST_URI']);
$url_safe = preg_replace('/\?lang=.{2}$/', '', $url_safe);
$url_safe = preg_replace('/\?lang=.{2}/', '?', $url_safe);
header('location: '.$url_safe);
exit();
}
require_once('mobile_device_detect.php');
mobile_device_detect(true,false,true,true,true,true,true,$mobile_site_url,false);
if($offline == "yes")
{
echo "<h3 align='center'>".$offmesg."</h3>";
exit();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="<?php echo $langx['lang']; ?>">
<head>
<title><?php echo $page_title; ?></title>
<base href="<?php echo $script_url; ?>/">
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $langx['charset']; ?>">
<meta name="keywords" content="<?php echo $meta_keywords; ?>">
<meta name="description" content="<?php echo $meta_description; ?>">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100italic,100,300,300italic,400italic,500,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100italic,100,300,300italic,400italic,500,500italic,700,700italic,900,900italic' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<link rel="stylesheet" type="text/css" href="style.css">
<link rel="stylesheet" type="text/css" href="pager.css">
<link rel="stylesheet" type="text/css" href="styled.css">
<link rel="stylesheet" type="text/css" href="cal.css">
<link rel="alternate" type="application/rss+xml" title="<?php echo rssTitle("", ""); ?>"
href="<?php echo "{$script_url}/{$global_rssurl}"; ?>">
<?php if (!empty($rssurl)) { ?>
<link rel="alternate" type="application/rss+xml" title="<?php echo rssTitle(($xsubcatname?$xsubcatname:$xcatname), ($xcityname?$xcityname:"")); ?>"
href="<?php echo "{$script_url}/{$rssurl}"; ?>">
<?php } ?>
<script type="text/javascript" src="js/jquery.js"></script>
<script src="jquery.tools.min.js"></script>
<!-- comments code start -->
<?php
if($xview == "showad" OR $xview == "showevent" OR $xview == "showimg") {
?>
<link rel="stylesheet" href="comments/css/comments.css" type="text/css" media="screen" />
<script type="text/javascript" src="comments/js/comment.js"></script>
<?php
}
?>
<!-- comments code end-->
<script language="JavaScript" src="gen_validatorv4.js"
type="text/javascript" xml:space="preserve"></script>
<?php if ($xview == "showad" OR $xview == "showevent") { ?>
<!-- star rating files -->
<link href="rateanything.css" rel="stylesheet" type="text/css" />
<script src="rateanything.js" type="text/javascript" language="javascript"></script>
<?php } ?>
<?php
if($xview == "ads") {
?>
<script type="text/javascript" src="bookmarkAds.js"></script>
<?php
}
?>
<!-- clear input on focus starts here. just add onFocus="clearText(this)"-->
<script>
function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}
</script>
<!-- clear input on focus ends here -->
<?php
if ($xview == "selectcity") {
?>
<!-- ajax cat loader starts here -->
<script type="text/javascript">
var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""
function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
</script>
<!-- ajax cat loader ends here -->
<script type="text/javascript">
var whosChanged = null;
function changeMe(el)
{
el.style.backgroundColor = "PaleGreen";
el.style.color = "#000000";
el.style.fontSize ="12px";
if (whosChanged != null)
{
whosChanged.style.backgroundColor = "#FFEFD5"
whosChanged.style.color = ""
whosChanged.style.fontSize ="12px";
}
whosChanged = el;
}
var whosChanged2 = null;
function changeMe2(el)
{
el.style.backgroundColor = "PaleGreen";
el.style.color = "#000000";
el.style.fontSize ="12px";
if (whosChanged2 != null)
{
whosChanged2.style.backgroundColor = "#FFEFD5"
whosChanged2.style.color = ""
whosChanged2.style.fontSize ="12px";
}
whosChanged2 = el;
}
var whosChanged3 = null;
function changeMe3(el)
{
el.style.backgroundColor = "PaleGreen";
el.style.color = "#000000";
el.style.fontSize ="12px";
if (whosChanged2 != null)
{
whosChanged3.style.backgroundColor = "#FFEFD5"
whosChanged3.style.color = ""
whosChanged3.style.fontSize ="12px";
}
whosChanged3 = el;
}
</script>
<?php
}
?>
<script type="text/javascript">
window.onload=function(){
var formref=document.getElementById("switchform")
indicateSelected(formref.switchcontrol)
}
</script>
<?php include("catheader.inc.php"); ?>
<?php //include("indexmaps2.html"); ?>
<?php
$xcity="1";
/// SELECT distinct(city_zip) FROM cities WHERE (3958*3.1415926*sqrt((city_latitude-'42.7959')*(city_latitude-'42.7959') + cos(city_latitude/57.29578)*cos('42.7959'/57.29578)*(city_longitude-'-71.057')*(city_longitude-'-71.057'))/180) <= '25';
$location = file_get_contents('http://freegeoip.net/json/'.$_SERVER['REMOTE_ADDR']);
$locationdata = json_decode($location, TRUE);
// $location2 = var_dump(json_decode($location));
$lat =$locationdata[latitude];
$long= $locationdata[longitude];
$city = $locationdata[city];
$state = $locationdata[region_code];
echo $city; echo $state;
//echo $lat; echo $long; echo $city;
echo $state;
$radius ="20";
// get all the zipcodes within the specified radius - default 20
function zipcodeRadius($lat, $lon, $radius)
{
$radius = $radius ? $radius : 20;
echo $radius;
$sql = 'SELECT distinct(city_zip) FROM cities WHERE (3958*3.1415926*sqrt((city_latitude-42.7959)*(city_latitude-42.7959) + cos(city_latitude/57.29578)*cos(42.7959/57.29578)*(city_longitude-'.$lon.')*(city_longitude-'.$lon.'))/180) <= '.$radius.';';
// $result = $this->db->query($sql);
$result = $this->db->query($sql);
// $result = mysql_query($sql);
// get each result
echo $result; print_r($result);
$zipcodeList = array();
while($row = mysql_fetch_assoc($result))
{
array_push($zipcodeList, $row['city_zip']);
}
print_r($zipcodeList);
}
while($row = mysql_fetch_array($sql)){
$array1 = $row['city_name'];
$array2 = $row['city_zip'];
// $array3 = $row['url'];
echo $array1;
print_r($array2);
}
?>
<?php if ( $xview == "signup" || $xview == "login") { ?>
<script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
<?php } ?>
</head>
<?php
if ($xview == "showad" OR $xview == "showevent") {
?>
<body onload="load()" onunload="GUnload()" >
<?php
}
else {
?>
<body>
<?php
}
$cityurl = buildURL("main", array($xcityid, $xcityname));
$homeurl = buildURL("main", array(0));
?>
<table align="center" cellpadding="0" cellspacing="0" style="">
<tr>
<td>
<div>
</div>
</td>
<tr>
</table>
<table align="center" cellpadding="0" cellspacing="0" style="">
<tr>
<td>
<table class="websiteheader" align="center" width="1000" cellspacing="0" cellpadding="0" style="background:#FFFFFF;border-top-right-radius: 4px;-moz-border-top-right-radius:4px;border-top-left-radius: 4px;-moz-border-top-left-radius:4px;">
<tr>
<td align="" valign="middle" style="width:200px;padding-left:30px;height:60px;">
<a style="color:#404040;font-weight:bold;font-family:'Roboto',sans-serif;font-size:26px;padding-top:10px;padding-bottom:10px;color:#317AF1;" href="<?php echo $homeurl; ?>">shufflebuy
</a>
</td>
<td style="width:400px;">
<div style="">
<?php if(isset($_COOKIE[$ck_session])) { ?>
<td align="right" valign="middle" style="width:45px;">
<?php include("accounts/dropdownindex.php"); ?>
</td>
<?php } ?>
<td align="right" valign="middle" style="width:45px;">
<?php if(isset($_COOKIE[$ck_session])) { ?>
<img class="checkinbox" id="<?php echo $id; ?>" style="margin-right:0px;height:30px;width:auto;max-height:30px;" src="images/nomsg.png" valign="middle">
<?php } ?>
</td>
<?php if(!isset($_COOKIE[$ck_session])) { ?>
<td align="left" valign="middle" style="width:45px;">
<a href="<?php echo $script_url ?>/signup.html" style="font-family:'Roboto',san-serif;color:#404040;font-style:bold;font-size:11pt;">sign up</a>
</td>
<?php } ?>
<td align="left" valign="middle" style="width:45px;">
<?php include("accounts/profileddown.php"); ?>
</td>
</td>
</tr>
</table>
<table width="1000" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="white" style="background:#E5E5E5;border-left:1px solid lightgray;border-right:1px solid lightgray;">
<tr>
<table width="100%" cellspacing="0" cellpadding="0" bgcolor="#E5E5E5">
<tr>
<?php
$page = "main.php";
switch($xview)
{
case "subcats" : $page = "subcats.php"; break;
case "login" : $page = $acc_dir . "/login.php"; break;
case "userpanel" : $page = $acc_dir . "/user_panel.php"; break;
case "signup" : $page = $acc_dir . "/signup.php"; break;
case "forgot" : $page = $acc_dir . "/forgot.php"; break;
case "ads" : $page = "ads.php"; break;
case "events" : $page = "ads.php"; break;
case "showad" : $page = "showad.php"; break;
case "showevent" : $page = "showad.php"; break;
case "post" : $page = "post.php"; break;
case "spec" : $page = "spec.php"; break;
case "edit" : $page = "edit.php"; break;
case "renew" : $page = "renew.php"; break;
case "imgs" : $page = "imgs.php"; break;
case "showimg" : $page = "showimg.php"; break;
case "postimg" : $page = "postimg.php"; break;
case "widget" : $page = "widget.php"; break;
case "editimg" : $page = "editimg.php"; break;
case "activate" : $page = "activate.php"; break;
case "selectcity" : $page = "selectcity.php"; break;
case "mailad" : $page = "mailad.php"; break;
/*bookmark mod start*/
case "bookmarkstotal" : $page = "bookmarkstotal.php"; break;
case "delete_conversation" : $page = "accounts/messaging/core/pages/inbox.page.inc.php"; break;
case "new_conversation" : $page = "accounts/messaging/core/pages/new_conversation.page.inc.php"; break;
case "view_conversation" : $page = "accounts/messaging/core/pages/view_conversation.page.inc.php"; break;
case "messagebox2" : $page = "accounts/messaging/index.php"; break;
case "messagebox" : $page = "accounts/messaging/core/pages/inbox.page.inc.php"; break;
case "commentstotal" : $page = "commentstotal.php"; break;
/*bookmark mod end*/
case "post404" : $page = "post404.php"; break;
case "page" : if (isCustomPage($_GET['pagename'])) { $page = "$_GET[pagename].php"; } break;
}
include_once($page);
?>
</td>
</tr></table>
</td>
<?php if($xview == "main") { ?>
</td>
<?php } ?>
<td width="120" valign="top" id="sidebar_right" bgcolor="#E5E5E5" style="padding-right:5px;">
<?php include("sidebar_right.inc.php"); ?>
</td>
</tr>
<tr><td colspan="3"><?php include("footer.inc.php"); ?>
</td></tr>
</table>
</td></tr>
</table>
</td></tr></table>
</body>
</html>