Commit 95a42087 authored by dmorley's avatar dmorley

make random a gooder start

parent 134c1762
......@@ -70,7 +70,7 @@ if ($detect->isMobile()) {echo '<link rel="stylesheet" href="css/mobile.css" />'
<div class="container-fluid"><div id="map" style="width:80%;height:500px;position:absolute;display:none"></div>
<div class="content">
<div id="results">
<a href='https://diasp.org/users/sign_up' class='btn danger large'>Confused and just want to sign up?? Click Here</a><br>
<a href='random.php' class='btn danger large'>Confused and just want to sign up?? Click Here</a><br>
<?php if ($hidden == "true") {echo "<a href='http://podupti.me' class='btn danger large'>NOTICE: These pods are Hidden and have problems, click here to go to working pods</a>";} include("show.php"); ?>
</div>
<div id="add">
......
......@@ -4,11 +4,12 @@
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
$sql = "SELECT domain,pingdomurl,score,datecreated,adminrating FROM pods ORDER BY RANDOM() LIMIT 1";
$sql = "SELECT * FROM pods WHERE adminrating <> -1 AND hidden <> 'yes' AND uptimelast7 > 95 AND status = 'Up' AND masterversion = shortversion AND signup = 1 ORDER BY RANDOM() LIMIT 1";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query1: " . pg_last_error());
}
$row = pg_fetch_all($result);
header("Location: http://" . $row[0]['domain'] . "/users/sign_up");
if ($row[0]['secure'] == "true") {$ssl="s";} else {$ssl="";}
header("Location: http" . $ssl . "://" . $row[0]['domain'] . "/users/sign_up");
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment