diff --git a/ossearch.php b/ossearch.php deleted file mode 100644 index f352c11..0000000 --- a/ossearch.php +++ /dev/null @@ -1,724 +0,0 @@ -query("SELECT * FROM $osmain.useraccounts WHERE FirstName = '$FirstName' AND LastName = '$LastName'"); - $r = $q->fetch_array(MYSQLI_BOTH); - $q->free(); - return $r; - } - - function uuid2name($uuid) { - global $mysqli; - global $osmain; - $q2 = $mysqli->query("SELECT * FROM $osmain.useraccounts WHERE PrincipalID = '$uuid'"); - $r2 = $q2->fetch_array(MYSQLI_BOTH); - $q2->free(); - return $r2; - } - - function regionname($ruuid) { - global $mysqli; - global $osmain; - $getregionq = $mysqli->query("SELECT * FROM $osmain.regions WHERE uuid = '$ruuid'"); - $regionrow = $getregionq->fetch_array(MYSQLI_BOTH); - $r3 = $regionrow['regionName']; - $getregionq->free(); - return $r3; - } - - function regionip($UUID) { - global $mysqli; - global $osmain; - $getregionq2 = $mysqli->query("SELECT * FROM $osmain.regions WHERE uuid = '$UUID'"); - $regionrow2 = $getregionq2->fetch_array(MYSQLI_BOTH); - $r4 = $regionrow2['serverIP']; - $getregionq2->free(); - return $r4; - } - - function online($uuid) { - global $mysqli; - global $osmain; - $oq = $mysqli->query("SELECT * FROM $osmain.griduser WHERE UserID = '$uuid'"); - $or = $oq->fetch_array(MYSQLI_BOTH); - $online = $or['Online']; - $oq->free(); - return $online; - } - - function userspersim($sim) { - global $mysqli; - global $osmain; - $simq = $mysqli->query("SELECT * FROM $osmain.presence WHERE RegionID = '$sim'"); - $count = $simq->num_rows; - $simq->close(); - return $count; - } - - function time2date($time) { - $dt = new DateTime("@$time"); - $r = $dt->format('M d Y g:ia T'); - return $r; - } - - function oscat($catid) { - switch ($catid) { - case "0": - $r = "Any"; - break; - case "18": - $r = "Discussion"; - break; - case "19": - $r = "Sports"; - break; - case "20": - $r = "Live Music"; - break; - case "22": - $r = "Commercial"; - break; - case "23": - $r = "Nightlife/Entertainment"; - break; - case "24": - $r = "Games/Contests"; - break; - case "25": - $r = "Pageants"; - break; - case "26": - $r = "Education"; - break; - case "27": - $r = "Arts and Culture"; - break; - case "28": - $r = "Charity/Support Groups"; - break; - case "29": - $r = "Miscellaneous"; - break; - } - return $r; - } - -// only mess with this function if you know wtf your doing. -// screwing this up could (WILL) result in a hackable websearch page. -function sqlprotection ($s) { -global $mysqli; -$s = htmlspecialchars(stripslashes($s)); -$s = rawurlencode($s); -$s = str_replace(array("1=1", ";", "-", "script", "SELECT", "INSERT", "UPDATE", "DELETE", "UNION", "OR"), array("", "", "", "", "", "", "", "", "", ""), $s); -return $s; -} - -if (isset($_GET['search'])) { - $search = sqlprotection($_GET['search']); - $search = strtoupper($search); - $search = strip_tags($search); - $search = trim ($search); - $searchlink = $search; -}else{ - $search = ""; - $searchlink = "everything"; -} -if (isset($_GET['type'])) { - $type = $_GET['type']; -}else{ - $type = ""; -} -if (isset($_GET['m'])) { - $m = $_GET['m']; -}else{ - $m = ""; -} - -if ($search) { -$placeholder = "Searching for $search"; -}else if (!$search) { -$placeholder = "Search"; -} - -$select = "selected"; - -if (!$m) { -$m = "1"; -} - -$eventcat = ""; - -$searchtitle = strtolower($search); -$ptitle = "Searching for $searchtitle"; - -$PG = "PG"; -$MATURE = "M"; -$ADULT = "A"; -?> - - -
- - - - -| - - | -
-
-query("SELECT * FROM $osmod.classifieds WHERE name LIKE '%$search%' OR description LIKE '%$search%' AND creationdate < '$now' AND expirationdate > '$now' AND classifiedflags < '$m' ORDER BY 'creationdate' DESC LIMIT 0,100");
-while ($cn = $cq->fetch_array(MYSQLI_BOTH)) {
-$creatoruuid = $cn['creatoruuid'];
-$creationdate = $cn['creationdate'];
-$expirationdate = $cn['expirationdate'];
-$category = $cn['category'];
-$name = $cn['name'];
-$parceluuid = $cn['parceluuid'];
-$description = $cn['description'];
-$snapshotuuid = $cn['snapshotuuid'];
-$simname = $cn['simname'];
-$classifiedflags = $cn['classifiedflags'];
-
-$creationdate = date("M d Y h:i a T",$creationdate);
-$expirationdate = date("M d Y h:i a T",$expirationdate);
-
-$parq = $mysqli->query("SELECT * FROM $osmod.allparcels WHERE parcelUUID = '$parceluuid'");
-$parrow = $parq->fetch_array(MYSQLI_BOTH);
-$regionid = $parrow['regionUUID'];
-$parcelname = $parrow['parcelname'];
-$loc = $parrow['landingpoint'];
-$parq->free();
-
-$simq = $mysqli->query("SELECT * FROM $osmain.regions WHERE uuid = '$regionid'");
-$simr = $simq->fetch_array(MYSQLI_BOTH);
-$sim = $simr['regionName'];
-$simq->free();
-
-if (!$loc) {
- $locr = "128,128,25";
-}else{
- $locr = str_replace("/", ",", $loc);
-}
-
-$FL = uuid2name($creatoruuid);
-$FName = $FL['FirstName'];
-$LName = $FL['LastName'];
-
-if ($classifiedflags == 0) {
-$classifiedflags = "$PG";
-}else if ($classifiedflags == 1) {
-$classifiedflags = "$MATURE";
-}else if ($classifiedflags == 2) {
-$classifiedflags = "$ADULT";
-}
-
-if (!$snapshotuuid || $snapshotuuid == "00000000-0000-0000-0000-000000000000") {
-$pic = "
-
-
-";
-}
-$cq->free();
-}
-if ($type == "destinations" || !$type) {
-$popq = $mysqli->query("SELECT * FROM $osmod.popularplaces WHERE name LIKE '%$search%' AND mature < '$m' ORDER BY `dwell` DESC LIMIT 0,100");
-while ($popn = $popq->fetch_array(MYSQLI_BOTH)) {
-$parcelUUID = $popn['parcelUUID'];
-$name = $popn['name'];
-$mature = $popn['mature'];
-
-if ($mature == 0) {
-$mature = "$PG";
-}else if ($mature == 1) {
-$mature = "$MATURE";
-}else if ($mature == 2) {
-$mature = "$ADULT";
-}
-
-$parq = $mysqli->query("SELECT * FROM $osmod.parcels WHERE parcelUUID = '$parcelUUID'");
-$parrow = $parq->fetch_array(MYSQLI_BOTH);
-$reguuid = $parrow['regionUUID'];
-$landing = $parrow['landingpoint'];
-$desc = $parrow['description'];
-$parq->free();
-$simname = regionname($reguuid);
-$usersonregion = userspersim($reguuid);
-
-echo "
-
- - - $name - --
-
-
-$pic
-
-
-$parcelname, $sim ($locr)
- ";
-
-}
-$popq->free();
-}
-if ($type == "events" || !$type) {
-$evq = $mysqli->query("SELECT * FROM $osmod.events WHERE name LIKE '%$search%' OR description LIKE '%$search%' AND dateUTC > $now AND eventflags < '$m' ORDER BY `dateUTC` LIMIT 0,100");
-while ($evnum = $evq->fetch_array(MYSQLI_BOTH)) {
-
-$creator = $evnum['creatoruuid'];
-$time = $evnum['dateUTC'];
-$eventid = $evnum['eventid'];
-$eventname = $evnum['name'];
-$eventinfo = $evnum['description'];
-$event_type = $evnum['eventflags'];
-
-$event_time = date("M d Y h:i a T",$time);
-
-$getname = uuid2name($creator);
-$first = $getname['FirstName'];
-$last = $getname['LastName'];
-$event_host = "$first $last";
-
-if ($event_type == 0) {
-$event_type = "$PG";
-}else if ($event_type == 1) {
-$event_type = "$MATURE";
-}else if ($event_type == 2) {
-$event_type = "$ADULT";
-}
-
-if ($time >= $now) {
-echo "
-
- - - $name - --
-
-
-
-
-";
-}else if ($time <= $now) {
-// dont display anything
-}
-
-}
-$evq->free();
-}
-if ($type == "groups" || !$type) {
-$grpq = $mysqli->query("SELECT * FROM $osmain.os_groups_groups WHERE Name LIKE '%$search%' AND ShowInList = '1' ORDER BY `Name` ASC LIMIT 0,100");
-while ($grpn = $grpq->fetch_array(MYSQLI_BOTH)) {
-
-$GroupID = $grpn['GroupID'];
-$Name = $grpn['Name'];
-$Charter = $grpn['Charter'];
-$InsigniaID = $grpn['InsigniaID'];
-$FounderID = $grpn['FounderID'];
-$OpenEnrollment = $grpn['OpenEnrollment'];
-$MembershipFee = $grpn['MembershipFee'];
-$MaturePublish = $grpn['MaturePublish'];
-
-$FL = uuid2name($FounderID);
-$FName = $FL['FirstName'];
-$LName = $FL['LastName'];
-
-$gmq = $mysqli->query("SELECT * FROM $osmain.os_groups_membership WHERE GroupID = '$GroupID'");
-$gmcount = $gmq->num_rows;
-$gmq->close();
-
-if ($InsigniaID == "00000000-0000-0000-0000-000000000000" || !$InsigniaID) {
-$pic = "
-
- - -$eventname - $event_time - --
-
-
-$eventinfo
- -
-
-";
-}
-$grpq->free();
-}
-if ($type == "4sale" || !$type) {
-$forsaleq = $mysqli->query("SELECT * FROM $osmod.parcelsales WHERE parcelname LIKE '%$search%' AND mature < '$m' ORDER BY `saleprice` ASC LIMIT 0,100");
-while ($forsnum = $forsaleq->fetch_array(MYSQLI_BOTH)) {
-
-$regionUUID = $forsnum['regionUUID'];
-$parcelname = $forsnum['parcelname'];
-$parcelUUID = $forsnum['parcelUUID'];
-$area = $forsnum['area'];
-$saleprice = $forsnum['saleprice'];
-$landingpoint = $forsnum['landingpoint'];
-
-$regionname = regionname($regionUUID);
-
-echo "
-
- - -$Name - --
-
-
-$pic
-$MaturePublish
-$Charter
-
- -Total Members: $gmcount - -Enrollment: $join - -Created by $FName $LName -
-
-";
-}
-$forsaleq->free();
-}
-if ($type == "people" || !$type) {
-$pplq = $mysqli->query("SELECT * FROM $osmain.useraccounts WHERE FirstName LIKE '%$search%' OR LastName LIKE '%$search%' ORDER BY `Created` ASC LIMIT 0,100");
-while ($pplnum = $pplq->fetch_array(MYSQLI_BOTH)) {
-
-$uuid = $pplnum['PrincipalID'];
-$sFirst = $pplnum['FirstName'];
-$sLast = $pplnum['LastName'];
-
-if ($sLast == "Resident") {
-$profname = $sFirst;
-}else{
-$profname = $sFirst.".".$sLast;
-}
-
-$online = online($uuid);
-if ($online == "False") {
-$onoff = "offlinedot.png";
-}else if ($online == "True") {
-$onoff = "onlinedot.png";
-}
-
-$profq = $mysqli->query("SELECT * FROM $osmod.userprofile WHERE useruuid = '$uuid' AND profileMaturePublish < '$m'");
-$prow = $profq->fetch_array(MYSQLI_BOTH);
-
-$show = $prow['profileAllowPublish'];
-if ($show == "0") {
-
-$MaturePublish = $prow['profileMaturePublish'];
-$abouttext = $prow['profileAboutText'];
-$fakepic = $prow['profileImage'];
-
-$profq->free();
-
-if ($abouttext) {
-$abouttext = htmlspecialchars_decode($abouttext, ENT_QUOTES);
-$abouttext = html_entity_decode($abouttext);
-$abouttext = substr($abouttext, 0, 125);
-$fakelife = "
-
- - -$parcelname - --
-
-
-
-
-Area: $area -$abouttext - "; -}else if (!$abouttext) { -$fakelife = ""; -} - -if ($MaturePublish == 0) { -$MaturePublish = "$PG"; -}else if ($MaturePublish == 1) { -$MaturePublish = "$MATURE"; -}else if ($MaturePublish == 2) { -$MaturePublish = "$ADULT"; -} - -if ($fakepic == "00000000-0000-0000-0000-000000000000" || !$fakepic) { -$pic = "
-
-";
-
-}else if ($show == "1" || !$show){
-}
-
-}
-$pplq->free();
-}
-if ($type == "places" || !$type) {
-$placeq = $mysqli->query("SELECT * FROM $osmod.parcels WHERE parcelname LIKE '%$search%' OR description LIKE '%$search%' AND public = 'true' ORDER BY `parcelUUID` ASC LIMIT 0,100");
-while ($placenum = $placeq->fetch_array(MYSQLI_BOTH)) {
-
-$regionUUID = $placenum['regionUUID'];
-$parcelname = $placenum['parcelname'];
-$parcelUUID = $placenum['parcelUUID'];
-$landingpoint = $placenum['landingpoint'];
-$description = $placenum['description'];
-$searchcategory = $placenum['searchcategory'];
-$mature = $placenum['mature'];
-
-$regionname = regionname($regionUUID);
-$usersonregion = userspersim($regionUUID);
-
-if ($mature == "PG") {
-$mr = "1";
-$mat = "$PG";
-}
-if ($mature == "Mature") {
-$mr = "2";
-$mat = "$MATURE";
-}
-if ($mature == "Adult") {
-$mr = "3";
-$mat = "$ADULT";
-}
-
-if ($mr <= $m) {
-echo "
-
-
-
-$sFirst $sLast
- |
-