299 lines
5.6 KiB
PHP
299 lines
5.6 KiB
PHP
<?php
|
|
|
|
|
|
|
|
/* $Id: profile.php 42 2009-01-29 04:55:14Z john $ */
|
|
|
|
|
|
|
|
$page = "nooutputgeneralmobile";
|
|
|
|
|
|
|
|
|
|
|
|
include "header-ajax.php";
|
|
|
|
if($user->user_info["user_id"]<1||$user->user_info["user_id"]==""||$user->user_exists == 0)
|
|
{
|
|
|
|
|
|
exit;
|
|
}
|
|
|
|
//include "include/class_database_mysqli.php";
|
|
|
|
|
|
|
|
header("Expires: Sat, 1 Jan 2005 00:00:00 GMT");
|
|
|
|
header("Last-Modified: ".gmdate( "D, d M Y H:i:s")."GMT");
|
|
|
|
header("Cache-Control: no-cache, must-revalidate");
|
|
|
|
header("Pragma: no-cache");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//$database->database_select("bateworldcom_zips");
|
|
|
|
$coslat=cos(deg2rad($_GET["lat"]));
|
|
|
|
$sinlat=sin( deg2rad($_GET["lat"]) );
|
|
|
|
$radlon=deg2rad($_GET["long"]);
|
|
|
|
$acos=acos($coslat);
|
|
|
|
|
|
|
|
|
|
|
|
$query=$database->database_query("SELECT country_code, place_name, admin_name1, admin_code1, postal_code, ( 3959 * acos( ".$coslat."
|
|
|
|
* cos( radianslat ) * cos( radianslon - ".$radlon." )
|
|
|
|
+ ".$sinlat." * sin( radianslat ) ) )
|
|
|
|
AS distance FROM bateworldcom_zips.zipcodes1 WHERE (latitude<=".($_GET["lat"]+.5)." AND latitude>=".($_GET["lat"]-.5).") AND (longitude<=".($_GET["long"]+.5)." AND longitude>=".($_GET["long"]-.5).") HAVING distance < 25
|
|
|
|
ORDER BY distance ASC LIMIT 0 , 10000");
|
|
|
|
|
|
|
|
$t=0;
|
|
|
|
$zips="";
|
|
|
|
$distance=array();
|
|
|
|
//$database->database_select("bateworld");
|
|
|
|
while($row=$database->database_fetch_array($query))
|
|
|
|
{//
|
|
|
|
$distance[$row["postal_code"]]["distance"]=$row["distance"];
|
|
|
|
if($zips==""){
|
|
|
|
$zips="se_profilevalues.profilevalue_27='".$row["postal_code"]."'";
|
|
|
|
|
|
|
|
}
|
|
|
|
else{ $zips=$zips." OR se_profilevalues.profilevalue_27='".$row["postal_code"]."'";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//if($row["country_code"]=="US")
|
|
|
|
{
|
|
|
|
|
|
|
|
$sql="SELECT * FROM se_users, se_profilevalues WHERE se_users.user_id=se_profilevalues.profilevalue_user_id AND user_lastactive>='".(time()-(60*60*24*90))."' AND (".$zips.")";
|
|
|
|
if($_GET["membername"]!=""){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_2='".$_GET["membername"]."'";
|
|
|
|
}
|
|
|
|
|
|
|
|
if($_GET["min"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_4<='".$_GET["min"]."-".date("m")."-".date("d")."'";
|
|
|
|
}
|
|
|
|
if($_GET["max"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_4>='".$_GET["max"]."-".date("m")."-".date("d")."'";
|
|
|
|
}
|
|
|
|
if($_GET["orientation"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_10='".$_GET["orientation"]."'";
|
|
|
|
}
|
|
|
|
if($_GET["size"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_9='".$_GET["size"]."'";
|
|
|
|
}
|
|
|
|
if($_GET["cut"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_15='".$_GET["cut"]."'";
|
|
|
|
}
|
|
|
|
if($_GET["bodytype"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_28='".$_GET["bodytype"]."'";
|
|
|
|
}
|
|
|
|
if($_GET["hair"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_16='".$_GET["hair"]."'";
|
|
|
|
}
|
|
|
|
if($_GET["decoration"]!="-1"){
|
|
|
|
$sql=$sql." AND se_profilevalues.profilevalue_17='".$_GET["decoration"]."'";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if($_GET["online"]=="1"){
|
|
|
|
$sql=$sql." AND user_lastactive>'".(time()-10*60)."' AND user_invisible=0 ";
|
|
|
|
}
|
|
|
|
if($_GET["photo"]=="1"){
|
|
|
|
$sql=$sql." AND user_photo <> '' ";
|
|
|
|
}
|
|
|
|
if($_GET["intro"]=="1"){
|
|
|
|
$sql=$sql." AND (introvid <> '' AND introapproved=1) ";
|
|
|
|
}
|
|
|
|
if($_GET["motm"]=="1"){
|
|
|
|
$sql=$sql." AND se_users.user_id IN (SELECT user_id FROM motm_answers GROUP BY user_id) ";
|
|
|
|
}
|
|
|
|
$sql.=" ORDER BY se_users.".$_GET["sortby"];
|
|
|
|
|
|
|
|
|
|
|
|
$query1=$database->database_query($sql);
|
|
|
|
|
|
|
|
while($row1=$database->database_fetch_array($query1))
|
|
|
|
{
|
|
|
|
$owner1 = new SEUser(Array($row1["user_id"]));
|
|
|
|
?>
|
|
|
|
<div class="browse_result locatorcontent" >
|
|
|
|
<a href="http://bateworld.com/profile.php?user=<?=$row1["user_username"]?>">
|
|
<?php $profilepicture=$owner1->user_photo("./images/nophoto.png");
|
|
echo $owner1->userprofiledot($profilepicture, "75px", "75px", "0");?>
|
|
|
|
<?=substr($row1["user_username"],0,10)?></a><br />
|
|
|
|
<?php if($owner1->online_now()){?>Online<br /><?php } ?>
|
|
|
|
<?php
|
|
|
|
echo floor($distance[$row1["profilevalue_27"]]["distance"]);
|
|
|
|
?> mile<?php if($row["distance"]!=1){echo "s";}?><br />
|
|
|
|
|
|
|
|
<span class="loggedinlocator">Logged in on:</span><br />
|
|
|
|
<?php echo date("n/j/Y", $owner1->user_info['user_lastlogindate']);?>
|
|
|
|
</div>
|
|
|
|
<?
|
|
|
|
//<div style="margin-top: 3px;"><!--<img src='./images/icons/online16.gif' border='0' class='icon2'>-->Online</div>
|
|
|
|
$t++;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
/*else
|
|
|
|
{
|
|
|
|
$query1=$database->database_query("SELECT * FROM se_users, se_profilevalues WHERE se_users.user_id=se_profilevalues.profilevalue_user_id AND se_profilevalues.profilevalue_27='".$row["postal_code"]."'");
|
|
|
|
|
|
|
|
while($row1=$database->database_fetch_array($query1))
|
|
|
|
{
|
|
|
|
$owner1 = new SEUser(Array($row1["user_id"]));
|
|
|
|
?>
|
|
|
|
<div class="browse_result locatorcontent" >
|
|
|
|
<a href="http://bateworld.com/profile.php?user=<?=$row1["user_username"]?>"><img src="<?=$owner1->user_photo('./images/nophoto.png', TRUE)?>" class="photo" style="display: block; margin-left: auto; margin-right: auto;" width="60" height="60" border="0" alt="<?=$row1["user_username"]?>'s Profile"><?=substr($row1["user_username"],0,10)?></a><br />
|
|
|
|
<?php if($owner1->online_now()){?>Online<br /><?php } ?>
|
|
|
|
<?php echo floor($row["distance"]);?> mile<?php if($row["distance"]!=1){echo "s";}?><br />
|
|
|
|
|
|
|
|
<span class="loggedinlocator">Logged in on:</span><br />
|
|
|
|
<?php echo date("n/j/Y", $owner1->user_info['user_lastactive']);?>
|
|
|
|
</div>
|
|
|
|
<?
|
|
|
|
//<div style="margin-top: 3px;"><!--<img src='./images/icons/online16.gif' border='0' class='icon2'>-->Online</div>
|
|
|
|
$t++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
//}
|
|
|
|
if($t==0){echo "No users matched your criteria";}
|
|
|
|
?><div class="clear"></div><?
|
|
|
|
|
|
|
|
include("footer-ajax.php");
|
|
|
|
exit;
|
|
|
|
?>
|