diff --git a/db/pull.php b/db/pull.php index 58dbc62ee05643665a7ac98b552e6b302909223d..2269ebec4f4a0b3b1160c742def74d0c24660500 100644 --- a/db/pull.php +++ b/db/pull.php @@ -4,7 +4,6 @@ $debug = isset($_GET['debug']) || (isset($argv) && in_array('debug', $argv, true)); $newline = PHP_SAPI === 'cli' ? "\n" : '
'; -// 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'; diff --git a/db/pull.sh b/db/pull.sh index 3e81f6c811e99da3f5fa8596883cb04daf5fddae..453e22787b7a1d7e73ad99134f0d64363e16e8bd 100755 --- a/db/pull.sh +++ b/db/pull.sh @@ -1,5 +1,5 @@ -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" diff --git a/showfull.php b/showfull.php index a3b5e492ba8e5d5f59384797408f8f0e9603c002..ef18a488fe82828a660b394660eb72af6fe363da 100644 --- a/showfull.php +++ b/showfull.php @@ -97,7 +97,7 @@ $numrows = pg_num_rows($result); $row['service_wordpress'] === 't' && print ''; $row['service_xmpp'] === 't' && print ''; echo ''; - echo '🔗'; + $row['terms'] === 't' ? print '🔗' : print ''; } ?>