Commit 7b233d54 authored by dmorley's avatar dmorley

some more

parent aa99799e
......@@ -4,7 +4,6 @@
$debug = isset($_GET['debug']) || (isset($argv) && in_array('debug', $argv, true));
$newline = PHP_SAPI === 'cli' ? "\n" : '<br>';
// Other parameters.
$_domain = $_GET['domain'] ?? '';
require_once __DIR__ . '/../config.php';
......@@ -70,7 +69,6 @@ while ($row = pg_fetch_assoc($result)) {
_debug('Cert expire date', $sslexpire);
_debug('TTL', $ttl);
//get new json from nodeinfo
$jsonssl = json_decode($outputssl);
if (!$jsonssl) {
......@@ -133,15 +131,14 @@ while ($row = pg_fetch_assoc($result)) {
$country = !empty($location['country_code']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['country_code']) : null;
$city = !empty($location['city']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['city']) : null;
$state = !empty($location['region']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['region']) : null;
$lat = !empty($location['latitude']) ? $location['latitude'] : null;
$long = !empty($location['longitude']) ? $location['longitude'] : null;
$lat = !empty($location['latitude']) ? $location['latitude'] : 0;
$long = !empty($location['longitude']) ? $location['longitude'] : 0;
echo $newline;
$statslastdate = date('Y-m-d H:i:s');
$diff = (new DateTime())->diff(new DateTime($dateadded));
$months = $diff->m + ($diff->y * 12);
$diff = (new DateTime())->diff(new DateTime($dateadded));
$months = $diff->m + ($diff->y * 12);
$responsetime = 0;
$sqlttl = 'SELECT round(avg(ttl) * 1000) AS ttl FROM checks WHERE domain = $1';
......@@ -164,14 +161,12 @@ while ($row = pg_fetch_assoc($result)) {
$hidden = $score <= 70;
_debug('Hidden', $hidden ? 'yes' : 'no');
// lets cap the scores or you can go too high or too low to never be effected by them
if ($score > 100) {
$score = 100;
} elseif ($score < 0) {
$score = 0;
}
$weightedscore = ($uptime + $score + ($active_users_monthly / 19999) - ((10 - $weight) * .12));
//sql it
$timenow = date('Y-m-d H:i:s');
$sql_set = 'UPDATE pods SET secure = $2, hidden = $3, ip = $4, ipv6 = $5, monthsmonitored = $6, uptime_alltime = $7, status = $8, date_laststats = $9, date_updated = $10, responsetime = $11, score = $12, adminrating = $13, country = $14, city = $15, state = $16, lat = $17, long = $18, userrating = $19, shortversion = $20, masterversion = $21, signup = $22, total_users = $23, active_users_halfyear = $24, active_users_monthly = $25, local_posts = $26, name = $27, comment_counts = $28, service_facebook = $29, service_tumblr = $30, service_twitter = $31, service_wordpress = $32, weightedscore = $33, service_xmpp = $34, softwarename = $35, sslvalid = $36, dnssec = $37, sslexpire = $38 WHERE domain = $1';
......
SCRIPT_DIR = "$( cd "$( dirname "$0" )" && pwd )"
TIME = `date +%k`
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
TIME=`date +%k`
if [ -s /tmp/index.google ];then
echo "already running die"
......
......@@ -97,7 +97,7 @@ $numrows = pg_num_rows($result);
$row['service_wordpress'] === 't' && print '<div class="smlogo smlogo-wordpress" title="Publish to WordPress"></div>';
$row['service_xmpp'] === 't' && print '<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>';
echo '</td>';
echo '<td><a href="https://' . $row['domain'] . $row['terms'] . '">&#128279;</a></td></tr>';
$row['terms'] === 't' ? print '<td><a href="https://' . $row['domain'] . $row['terms'] . '">&#128279;</a></td></tr>' : print '<td></td></tr>';
}
?>
</tbody>
......
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