-
-
- Loading.....
-
-
-
-getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
// Set up common variables.
@@ -32,31 +38,31 @@ $headers = ['From: ' . $adminemail];
$message_lines = [];
if ($_email) {
- $pod['email'] === $_email || die('email mismatch');
+ $pod['email'] === $_email || die('email mismatch');
- $to = $_email;
- $subject = 'Temporary edit key for ' . $_SERVER['HTTP_HOST'];
- $headers[] = 'Bcc: ' . $adminemail;
- $expire = time() + 2700;
- $output = 'Link sent to your email.';
+ $to = $_email;
+ $subject = 'Temporary edit key for ' . $_SERVER['HTTP_HOST'];
+ $headers[] = 'Bcc: ' . $adminemail;
+ $expire = time() + 2700;
+ $output = 'Link sent to your email.';
} elseif (!$pod['email']) {
- die('Domain is registered but no email associated, to add an email use the add a pod feature.');
+ die('Domain is registered but no email associated, to add an email use the add a pod feature.');
} else {
- $to = $pod['email'];
- $subject = 'Temporary edit key for ' . $_SERVER['HTTP_HOST'];
- $message_lines[] = 'Looks like you did not enter your email address, be sure to update it if you forgot the one we have for you.';
- $message_lines[] = 'Email found: ' . $pod['email'];
- $expire = time() + 2700;
- $output = 'Link sent to email we have for this pod on file.';
+ $to = $pod['email'];
+ $subject = 'Temporary edit key for ' . $_SERVER['HTTP_HOST'];
+ $message_lines[] = 'Looks like you did not enter your email address, be sure to update it if you forgot the one we have for you.';
+ $message_lines[] = 'Email found: ' . $pod['email'];
+ $expire = time() + 2700;
+ $output = 'Link sent to email we have for this pod on file.';
}
try {
- $pod['token'] = $uuid;
- $pod['tokenexpire'] = date('Y-m-d H:i:s', $expire);
+ $pod['token'] = $uuid;
+ $pod['tokenexpire'] = date('Y-m-d H:i:s', $expire);
- R::store($pod);
+ R::store($pod);
} catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
$message_lines[] = 'Link: ' . $link;
diff --git a/db/monthly_stats.php b/db/monthly_stats.php
index ee4a44069cf58203968d1bbd909f1f554411a8a5..0952acce561f5c6fed2fd8d1ebdf111275927218 100644
--- a/db/monthly_stats.php
+++ b/db/monthly_stats.php
@@ -1,8 +1,14 @@
getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
foreach ($monthly_totals as $monthly) {
- // Format date to timestamp.
- $timestamp = $monthly['yymm'].'-01 01:01:01-01';
+ // Format date to timestamp.
+ $timestamp = $monthly['yymm'] . '-01 01:01:01-01';
- try {
- $p = R::findOrCreate('monthlystats', ['date_checked' => $timestamp]);
+ try {
+ $p = R::findOrCreate('monthlystats', ['date_checked' => $timestamp]);
- $p['total_users'] = $monthly['users'];
- $p['total_posts'] = $monthly['posts'];
- $p['total_comments'] = $monthly['comments'];
- $p['total_pods'] = $monthly['pods'];
- if ($monthly['downtime']) {
- $p['total_uptime'] = round($monthly['downtime'] / $monthly['uptime'] * 100);
- } else {
- $p['total_uptime'] = 100;
- }
+ $p['total_users'] = $monthly['users'];
+ $p['total_posts'] = $monthly['posts'];
+ $p['total_comments'] = $monthly['comments'];
+ $p['total_pods'] = $monthly['pods'];
+ if ($monthly['downtime']) {
+ $p['total_uptime'] = round($monthly['downtime'] / $monthly['uptime'] * 100);
+ } else {
+ $p['total_uptime'] = 100;
+ }
- R::store($p);
- } catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
- }
+ R::store($p);
+ } catch (\RedBeanPHP\RedException $e) {
+ die('Error in SQL query: ' . $e->getMessage());
+ }
}
diff --git a/db/podcrawler.php b/db/podcrawler.php
index b147586ed36c02f47f752d2aa563e1247ffe0497..5452ff323a077a85f939622e71d8ddeb6980bb87 100644
--- a/db/podcrawler.php
+++ b/db/podcrawler.php
@@ -1,8 +1,14 @@
getMessage());
}
@@ -34,23 +40,23 @@ $foundpods = [];
//pulling all nodes for now
if ($pods = json_decode(file_get_contents('https://the-federation.info/graphql?query=%7Bnodes%7Bhost%20platform%7Bname%7Dprotocols%7Bname%7D%7D%7D&raw'), true)) {
- foreach ($pods['data']['nodes'] ?? [] as $poddata) {
- $protocols = array_column($poddata['protocols'] ?? [], 'name');
+ foreach ($pods['data']['nodes'] ?? [] as $poddata) {
+ $protocols = array_column($poddata['protocols'] ?? [], 'name');
- //limiting to diaspora compatible for now
- if (in_array('diaspora', $protocols, true)) {
- $foundpods[] = $poddata['host'];
+ //limiting to diaspora compatible for now
+ if (in_array('diaspora', $protocols, true)) {
+ $foundpods[] = $poddata['host'];
+ }
}
- }
}
if ($pods = json_decode(file_get_contents('https://diasp.org/pods.json'), true)) {
- foreach ($pods ?? [] as $poddata) {
- $foundpods[] = $poddata['host'];
- }
+ foreach ($pods ?? [] as $poddata) {
+ $foundpods[] = $poddata['host'];
+ }
}
$results = array_diff($foundpods, $existingpods);
foreach ($results as $result) {
- echo exec("php-cgi add.php domain={$result}") . "\r\n";
+ echo exec("php-cgi add.php domain={$result}") . "\r\n";
}
diff --git a/db/pull-masterversions.php b/db/pull-masterversions.php
index d15a51d796a8fd05945340e5457d94eada38dd2a..2abde6b57e1a13ac87a4e156c6157c3670d4dddf 100644
--- a/db/pull-masterversions.php
+++ b/db/pull-masterversions.php
@@ -1,9 +1,14 @@
['repo' => 'diaspora/diaspora', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => 'develop'],
- 'friendica' => ['repo' => 'friendica/friendica', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => 'develop'],
- 'hubzilla' => ['repo' => 'hubzilla%2fcore', 'gitsite' => 'framagit.org', 'gittype' => 'gitlab', 'devbranch' => 'dev'],
- 'pleroma' => ['repo' => 'pleroma%2fpleroma', 'gitsite' => 'git.pleroma.social', 'gittype' => 'gitlab', 'devbranch' => 'develop'],
- 'socialhome' => ['repo' => 'jaywink/socialhome', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
- 'social-relay' => ['repo' => 'jaywink/social-relay', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
- 'ganggo' => ['repo' => 'ganggo/ganggo', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
+ 'diaspora' => ['repo' => 'diaspora/diaspora', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => 'develop'],
+ 'friendica' => ['repo' => 'friendica/friendica', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => 'develop'],
+ 'hubzilla' => ['repo' => 'hubzilla%2fcore', 'gitsite' => 'framagit.org', 'gittype' => 'gitlab', 'devbranch' => 'dev'],
+ 'pleroma' => ['repo' => 'pleroma%2fpleroma', 'gitsite' => 'git.pleroma.social', 'gittype' => 'gitlab', 'devbranch' => 'develop'],
+ 'socialhome' => ['repo' => 'jaywink/socialhome', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
+ 'social-relay' => ['repo' => 'jaywink/social-relay', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
+ 'ganggo' => ['repo' => 'ganggo/ganggo', 'gitsite' => 'api.github.com', 'gittype' => 'github', 'devbranch' => ''],
];
$opts = [
- 'http' => ['method' => 'GET', 'header' => ['User-Agent: Poduptime']]
+ 'http' => ['method' => 'GET', 'header' => ['User-Agent: Poduptime']],
];
foreach ($softwares as $software => $details) {
if ($details['gittype'] == 'github') {
- $context = stream_context_create($opts);
+ $context = stream_context_create($opts);
$releasejson = json_decode(file_get_contents('https://' . $details["gitsite"] . '/repos/' . $details["repo"] . '/releases/latest', false, $context));
if ($details["devbranch"]) {
$commitjson = json_decode(file_get_contents('https://' . $details["gitsite"] . '/repos/' . $details["repo"] . '/commits/' . $details["devbranch"], false, $context));
@@ -58,7 +63,7 @@ foreach ($softwares as $software => $details) {
}
}
} elseif ($details['gittype'] == 'gitlab') {
- $context = stream_context_create($opts);
+ $context = stream_context_create($opts);
$releasejson = json_decode(file_get_contents('https://' . $details["gitsite"] . '/api/v4/projects/' . $details["repo"] . '/repository/tags', false, $context));
if ($details["devbranch"]) {
$commitjson = json_decode(file_get_contents('https://' . $details["gitsite"] . '/api/v4/projects/' . $details["repo"] . '/repository/commits/' . $details["devbranch"], false, $context));
@@ -67,9 +72,9 @@ foreach ($softwares as $software => $details) {
}
if ($masterversion = $releasejson[0]->name ? str_replace('v', '', $releasejson[0]->name) : '') {
try {
- $m = R::dispense('masterversions');
+ $m = R::dispense('masterversions');
$m['software'] = $software;
- $m['version'] = $masterversion;
+ $m['version'] = $masterversion;
if ($releasedate = $releasejson[0] ? $releasejson[0]->commit->created_at : '') {
$m['releasedate'] = $releasedate;
}
@@ -84,5 +89,5 @@ foreach ($softwares as $software => $details) {
}
- printf('%s:%s:%s ', $software, $masterversion, $devlastcommit ?: 'n/a');
+ printf('%s:%s:%s ', $software, $masterversion, $devlastcommit ?: 'n/a');
}
diff --git a/db/pull.php b/db/pull.php
index 0cbe16211869ca25aea3f0d48044a08da6440c89..a16e21bff4d09b52d314f6d5f424d42026bcfabe 100644
--- a/db/pull.php
+++ b/db/pull.php
@@ -1,18 +1,24 @@
';
+$debug = isset($_GET['debug']) || (isset($argv) && in_array('debug', $argv, true));
+$sqldebug = isset($_GET['sqldebug']) || (isset($argv) && in_array('sqldebug', $argv, true));
+$write = !(isset($_GET['nowrite']) || (isset($argv) && in_array('nowrite', $argv, true)));
+$newline = PHP_SAPI === 'cli' ? "\n\n" : '
';
$_domain = $_GET['domain'] ?? null;
@@ -31,360 +37,363 @@ R::testConnection() || die('Error in DB connection');
R::usePartialBeans(true);
try {
- $sql = '
- SELECT domain, score, date_created, adminrating, weight, hidden, podmin_notify, email, masterversion, shortversion, status
- FROM pods
- ';
-
- $pods = [];
- if ($_domain) {
- $sql .= ' WHERE domain = ?';
- $pods = R::getAll($sql, [$_domain]);
- } elseif (PHP_SAPI === 'cli' && (isset($argv) && in_array('Check_System_Deleted', $argv, true))) {
- $sql .= ' WHERE status = ?';
- $pods = R::getAll($sql, [PodStatus::System_Deleted]);
- } elseif (PHP_SAPI === 'cli') {
- $sql .= ' WHERE status < ?';
- $pods = R::getAll($sql, [PodStatus::Paused]);
- }
+ $sql = '
+ SELECT domain, score, date_created, adminrating, weight, hidden, podmin_notify, email, masterversion, shortversion, status
+ FROM pods
+ ';
+
+ $pods = [];
+ if ($_domain) {
+ $sql .= ' WHERE domain = ?';
+ $pods = R::getAll($sql, [$_domain]);
+ } elseif (PHP_SAPI === 'cli' && (isset($argv) && in_array('Check_System_Deleted', $argv, true))) {
+ $sql .= ' WHERE status = ?';
+ $pods = R::getAll($sql, [PodStatus::SYSTEM_DELETED]);
+ } elseif (PHP_SAPI === 'cli') {
+ $sql .= ' WHERE status < ?';
+ $pods = R::getAll($sql, [PodStatus::PAUSED]);
+ }
} catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
foreach ($pods as $pod) {
- $domain = $pod['domain'];
- $score = (int) $pod['score'];
- $dateadded = $pod['date_created'];
- $admindb = (int) $pod['adminrating'];
- $weight = $pod['weight'];
- $hiddennow = $pod['hidden'];
- $email = $pod['email'];
- $notify = $pod['podmin_notify'];
- $masterv = $pod['masterversion'];
- $shortv = $pod['shortversion'];
- $dbstatus = $pod['status'];
-
- try {
- $ratings = R::getAll('
- SELECT admin, rating
- FROM rating_comments
- WHERE domain = ?
- ', [$domain]);
- } catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
- }
+ $domain = $pod['domain'];
+ $score = (int) $pod['score'];
+ $dateadded = $pod['date_created'];
+ $admindb = (int) $pod['adminrating'];
+ $weight = $pod['weight'];
+ $hiddennow = $pod['hidden'];
+ $email = $pod['email'];
+ $notify = $pod['podmin_notify'];
+ $masterv = $pod['masterversion'];
+ $shortv = $pod['shortversion'];
+ $dbstatus = $pod['status'];
+
+ try {
+ $ratings = R::getAll('
+ SELECT admin, rating
+ FROM rating_comments
+ WHERE domain = ?
+ ', [$domain]);
+ } catch (\RedBeanPHP\RedException $e) {
+ die('Error in SQL query: ' . $e->getMessage());
+ }
- _debug('Domain', $domain);
+ _debug('Domain', $domain);
- $user_ratings = [];
- $admin_ratings = [];
- foreach ($ratings as $rating) {
- if ($rating['admin'] == 0) {
- $user_ratings[] = $rating['rating'];
- } elseif ($rating['admin'] == 1) {
- $admin_ratings[] = $rating['rating'];
+ $user_ratings = [];
+ $admin_ratings = [];
+ foreach ($ratings as $rating) {
+ if ($rating['admin'] == 0) {
+ $user_ratings[] = $rating['rating'];
+ } elseif ($rating['admin'] == 1) {
+ $admin_ratings[] = $rating['rating'];
+ }
}
- }
- $user_rating = empty($user_ratings) ? 0 : max(10, round(array_sum($user_ratings) / count($user_ratings), 2));
- $admin_rating = empty($admin_ratings) ? 0 : max(10, round(array_sum($admin_ratings) / count($admin_ratings), 2));
-
- if ($admindb == -1) {
- $admin_rating = -1;
- }
-
- $d = new DOMDocument;
- libxml_use_internal_errors(true);
- $d->loadHTMLFile('https://' . $domain);
- $body = $d->getElementsByTagName('body')->item(0);
- if ($body->nodeValue) {
- $ld = new Language;
- $detectedlanguage = strtoupper(key($ld->detect($body->nodeValue)->bestResults()->close()));
- _debug('Detected Language', $detectedlanguage);
- }
-
- if ($infos = json_decode(file_get_contents('https://' . $domain . '/.well-known/nodeinfo'), true)) {
- $link = max($infos['links'])['href'];
- } else {
- $link = 'https://' . $domain . '/nodeinfo/1.0';
- }
-
- $chss = curl_init();
- curl_setopt($chss, CURLOPT_URL, $link);
- curl_setopt($chss, CURLOPT_CONNECTTIMEOUT, 10);
- curl_setopt($chss, CURLOPT_TIMEOUT, 30);
- curl_setopt($chss, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($chss, CURLOPT_CERTINFO, 1);
- curl_setopt($chss, CURLOPT_CAINFO, $cafullpath);
- $outputssl = curl_exec($chss);
- $outputsslerror = curl_error($chss);
- $info = curl_getinfo($chss, CURLINFO_CERTINFO);
- $conntime = curl_getinfo($chss, CURLINFO_CONNECT_TIME);
- $nstime = curl_getinfo($chss, CURLINFO_NAMELOOKUP_TIME);
- $latency = $conntime - $nstime;
- $sslexpire = $info[0]['Expire date'] ?? null;
- curl_close($chss);
-
- _debug('Nodeinfo output', $outputssl, true);
- _debug('Nodeinfo output error', $outputsslerror, true);
- _debug('Cert expire date', $sslexpire);
- _debug('Conntime', $conntime);
- _debug('NStime', $nstime);
- _debug('Latency', $latency);
-
- $jsonssl = json_decode($outputssl);
-
- $xdver = $jsonssl->software->version ?? 0;
- preg_match_all('((?:\d(.|-)?)+(\.|-)\d+\.*)', $xdver, $dverr);
- $shortversion = $dverr[0][0];
- $signup = ($jsonssl->openRegistrations ?? false) === true;
- $softwarename = $jsonssl->software->name ?? 'unknown';
- $name = $jsonssl->metadata->nodeName ?? $softwarename;
- $total_users = $jsonssl->usage->users->total ?? 0;
- $active_users_halfyear = $jsonssl->usage->users->activeHalfyear ?? 0;
- $active_users_monthly = $jsonssl->usage->users->activeMonth ?? 0;
- $local_posts = $jsonssl->usage->localPosts ?? 0;
- $comment_counts = $jsonssl->usage->localComments ?? 0;
- $service_xmpp = ($jsonssl->metadata->xmppChat ?? false) === true;
- $service_facebook = false;
- $service_twitter = false;
- $service_tumblr = false;
- $service_wordpress = false;
- if (json_last_error() === 0) {
- (!$jsonssl->software->version) || $score += 1;
- if (is_array($jsonssl->services->outbound)) {
- $service_facebook = in_array('facebook', $jsonssl->services->outbound, true);
- $service_twitter = in_array('twitter', $jsonssl->services->outbound, true);
- $service_tumblr = in_array('tumblr', $jsonssl->services->outbound, true);
- $service_wordpress = in_array('wordpress', $jsonssl->services->outbound, true);
+ $user_rating = empty($user_ratings) ? 0 : max(10, round(array_sum($user_ratings) / count($user_ratings), 2));
+ $admin_rating = empty($admin_ratings) ? 0 : max(10, round(array_sum($admin_ratings) / count($admin_ratings), 2));
+
+ if ($admindb == -1) {
+ $admin_rating = -1;
}
- }
- if ($jsonssl !== null) {
+ $d = new DOMDocument;
+ libxml_use_internal_errors(true);
+ $d->loadHTMLFile('https://' . $domain);
+ $body = $d->getElementsByTagName('body')->item(0);
+ if ($body->nodeValue) {
+ $ld = new Language;
+ $detectedlanguage = strtoupper(key($ld->detect($body->nodeValue)->bestResults()->close()));
+ _debug('Detected Language', $detectedlanguage);
+ }
- try {
- $c = R::dispense('checks');
- $c['domain'] = $domain;
- $c['online'] = true;
- $c['latency'] = $latency;
- $c['total_users'] = $total_users;
- $c['local_posts'] = $local_posts;
- $c['comment_counts'] = $comment_counts;
- $c['shortversion'] = $shortversion;
- if ($write) {
- R::store($c);
- } else {
- echo $c;
- }
- } catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
+ if ($infos = json_decode(file_get_contents('https://' . $domain . '/.well-known/nodeinfo'), true)) {
+ $link = max($infos['links'])['href'];
+ } else {
+ $link = 'https://' . $domain . '/nodeinfo/1.0';
+ }
+
+ $chss = curl_init();
+ curl_setopt($chss, CURLOPT_URL, $link);
+ curl_setopt($chss, CURLOPT_CONNECTTIMEOUT, 10);
+ curl_setopt($chss, CURLOPT_TIMEOUT, 30);
+ curl_setopt($chss, CURLOPT_RETURNTRANSFER, 1);
+ curl_setopt($chss, CURLOPT_CERTINFO, 1);
+ curl_setopt($chss, CURLOPT_CAINFO, $cafullpath);
+ $outputssl = curl_exec($chss);
+ $outputsslerror = curl_error($chss);
+ $info = curl_getinfo($chss, CURLINFO_CERTINFO);
+ $conntime = curl_getinfo($chss, CURLINFO_CONNECT_TIME);
+ $nstime = curl_getinfo($chss, CURLINFO_NAMELOOKUP_TIME);
+ $latency = $conntime - $nstime;
+ $sslexpire = $info[0]['Expire date'] ?? null;
+ curl_close($chss);
+
+ _debug('Nodeinfo output', $outputssl, true);
+ _debug('Nodeinfo output error', $outputsslerror, true);
+ _debug('Cert expire date', $sslexpire);
+ _debug('Conntime', $conntime);
+ _debug('NStime', $nstime);
+ _debug('Latency', $latency);
+
+ $jsonssl = json_decode($outputssl);
+
+ $xdver = $jsonssl->software->version ?? 0;
+ preg_match_all('((?:\d(.|-)?)+(\.|-)\d+\.*)', $xdver, $dverr);
+ $shortversion = $dverr[0][0];
+ $signup = ($jsonssl->openRegistrations ?? false) === true;
+ $softwarename = $jsonssl->software->name ?? 'unknown';
+ $name = $jsonssl->metadata->nodeName ?? $softwarename;
+ $total_users = $jsonssl->usage->users->total ?? 0;
+ $active_users_halfyear = $jsonssl->usage->users->activeHalfyear ?? 0;
+ $active_users_monthly = $jsonssl->usage->users->activeMonth ?? 0;
+ $local_posts = $jsonssl->usage->localPosts ?? 0;
+ $comment_counts = $jsonssl->usage->localComments ?? 0;
+ $service_xmpp = ($jsonssl->metadata->xmppChat ?? false) === true;
+ $service_facebook = false;
+ $service_twitter = false;
+ $service_tumblr = false;
+ $service_wordpress = false;
+ if (json_last_error() === 0) {
+ (!$jsonssl->software->version) || $score += 1;
+ if (is_array($jsonssl->services->outbound)) {
+ $service_facebook = in_array('facebook', $jsonssl->services->outbound, true);
+ $service_twitter = in_array('twitter', $jsonssl->services->outbound, true);
+ $service_tumblr = in_array('tumblr', $jsonssl->services->outbound, true);
+ $service_wordpress = in_array('wordpress', $jsonssl->services->outbound, true);
+ }
+ }
+
+ if ($jsonssl !== null) {
+
+ try {
+ $c = R::dispense('checks');
+ $c['domain'] = $domain;
+ $c['online'] = true;
+ $c['latency'] = $latency;
+ $c['total_users'] = $total_users;
+ $c['local_posts'] = $local_posts;
+ $c['comment_counts'] = $comment_counts;
+ $c['shortversion'] = $shortversion;
+ if ($write) {
+ R::store($c);
+ } else {
+ echo $c;
+ }
+ } catch (\RedBeanPHP\RedException $e) {
+ die('Error in SQL query: ' . $e->getMessage());
+ }
+
+ $status = PodStatus::UP;
+ }
+
+ if (!$jsonssl) {
+ _debug('Connection', 'Can not connect to pod');
+
+ try {
+ $c = R::dispense('checks');
+ $c['domain'] = $domain;
+ $c['online'] = false;
+ $c['error'] = $outputsslerror;
+ $c['latency'] = $latency;
+ if ($write) {
+ R::store($c);
+ } else {
+ echo $c;
+ }
+ } catch (\RedBeanPHP\RedException $e) {
+ die('Error in SQL query: ' . $e->getMessage());
+ }
+
+ $score -= 1;
+ $status = PodStatus::DOWN;
+ }
+
+ _debug('Version code', $shortversion);
+ _debug('Signup Open', $signup);
+
+ $dnsserver = !empty($dnsserver) ? $dnsserver : '1.1.1.1';
+ $delv = new NPM\Xec\Command("delv @{$dnsserver} {$domain}");
+ $delv->throwExceptionOnError(false);
+
+ $ip = '';
+ $iplookupv4 = explode(PHP_EOL, trim($delv->execute([], null, 15)->stdout));
+ $dnssec = in_array('; fully validated', $iplookupv4, true) ?? false;
+ $getaonly = array_values(preg_grep('/\s+IN\s+A\s+.*/', $iplookupv4));
+ if ($getaonly) {
+ preg_match('/A\s(.*)/', $getaonly[0], $aversion);
+ $ip = trim($aversion[1]) ?? '';
}
+ $ip || $score -= 2;
+
+ $iplookupv6 = explode(PHP_EOL, trim($delv->execute(['AAAA'], null, 15)->stdout));
+ $ipv6 = (bool) preg_grep('/\s+IN\s+AAAA\s+.*/', $iplookupv6);
- $status = PodStatus::Up;
- }
+ _debug('IPv4', $ip);
+ _debug('Iplookupv4', $iplookupv4, true);
+ _debug('IPv6', $ipv6);
+ _debug('Iplookupv6', $iplookupv6, true);
- if (!$jsonssl) {
- _debug('Connection', 'Can not connect to pod');
+ $location = geoip_record_by_name($ip);
+ _debug('Location', $location, true);
+ $countryname = !empty($location['country_name']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['country_name']) : null;
+ $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'] : 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);
+ $days = $diff->days;
try {
- $c = R::dispense('checks');
- $c['domain'] = $domain;
- $c['online'] = false;
- $c['error'] = $outputsslerror;
- $c['latency'] = $latency;
- if ($write) {
- R::store($c);
- } else {
- echo $c;
- }
+ $checks = R::getRow('
+ SELECT
+ round(avg(latency) * 1000) AS latency,
+ round(avg(online::INT) * 100, 2) AS online
+ FROM checks
+ WHERE domain = ?
+ ', [$domain]);
+
+ $avglatency = $checks['latency'] ?? 0;
+ $uptime = $checks['online'] ?? 0;
} catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
- $score -= 1;
- $status = PodStatus::Down;
- }
-
- _debug('Version code', $shortversion);
- _debug('Signup Open', $signup);
-
- $dnsserver = !empty($dnsserver) ? $dnsserver : '1.1.1.1';
- $delv = new NPM\Xec\Command("delv @{$dnsserver} {$domain}");
- $delv->throwExceptionOnError(false);
-
- $ip = '';
- $iplookupv4 = explode(PHP_EOL, trim($delv->execute([], null, 15)->stdout));
- $dnssec = in_array('; fully validated', $iplookupv4, true) ?? false;
- $getaonly = array_values(preg_grep('/\s+IN\s+A\s+.*/', $iplookupv4));
- if ($getaonly) {
- preg_match('/A\s(.*)/', $getaonly[0], $aversion);
- $ip = trim($aversion[1]) ?? '';
- }
- $ip || $score -= 2;
-
- $iplookupv6 = explode(PHP_EOL, trim($delv->execute(['AAAA'], null, 15)->stdout));
- $ipv6 = (bool) preg_grep('/\s+IN\s+AAAA\s+.*/', $iplookupv6);
-
- _debug('IPv4', $ip);
- _debug('Iplookupv4', $iplookupv4, true);
- _debug('IPv6', $ipv6);
- _debug('Iplookupv6', $iplookupv6, true);
-
- $location = geoip_record_by_name($ip);
- _debug('Location', $location, true);
- $countryname = !empty($location['country_name']) ? iconv('UTF-8', 'UTF-8//IGNORE', $location['country_name']) : null;
- $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'] : 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);
- $days = $diff->days;
-
- try {
- $checks = R::getRow('
- SELECT
- round(avg(latency) * 1000) AS latency,
- round(avg(online::INT) * 100, 2) AS online
- FROM checks
- WHERE domain = ?
- ', [$domain]);
-
- $avglatency = $checks['latency'] ?? 0;
- $uptime = $checks['online'] ?? 0;
- } catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
- }
+ _debug('Uptime', $uptime);
- _debug('Uptime', $uptime);
-
- try {
- $masterdata = R::getRow('SELECT version, devlastcommit, releasedate FROM masterversions WHERE software = ? ORDER BY id DESC LIMIT 1', [$softwarename]);
- } catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
- }
+ try {
+ $masterdata = R::getRow('SELECT version, devlastcommit, releasedate FROM masterversions WHERE software = ? ORDER BY id DESC LIMIT 1', [$softwarename]);
+ } catch (\RedBeanPHP\RedException $e) {
+ die('Error in SQL query: ' . $e->getMessage());
+ }
- $masterversion = $masterdata['version'];
- _debug('Masterversion', $masterversion);
- $masterversioncheck = explode('.',$masterversion);
- $shortversioncheck = explode('.',$shortversion);
+ $masterversion = $masterdata['version'];
+ _debug('Masterversion', $masterversion);
+ $masterversioncheck = explode('.', $masterversion);
+ $shortversioncheck = explode('.', $shortversion);
- _debug('Days since master code release', date_diff((new DateTime($masterdata['releasedate'])),(new DateTime()))->format('%d'));
+ _debug('Days since master code release', date_diff((new DateTime($masterdata['releasedate'])), (new DateTime()))->format('%d'));
try {
- $lastpodupdates = R::getRow('SELECT DISTINCT ON (shortversion) shortversion, date_checked FROM checks WHERE domain = ? AND shortversion IS NOT NULL ORDER BY shortversion DESC LIMIT 1', [$domain]);
+ $lastpodupdates = R::getRow('SELECT DISTINCT ON (shortversion) shortversion, date_checked FROM checks WHERE domain = ? AND shortversion IS NOT NULL ORDER BY shortversion DESC LIMIT 1', [$domain]);
} catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
-
- $devlastdays = $masterdata['devlastcommit'] ? date_diff((new DateTime($masterdata['devlastcommit'])),(new DateTime()))->format('%a') : 30;//tmp//if no dev branch then what?
-
-
+
+ $devlastdays = $masterdata['devlastcommit'] ? date_diff((new DateTime($masterdata['devlastcommit'])), (new DateTime()))->format('%a') : 30;//tmp//if no dev branch then what?
+
+
_debug('Dev git last commit was ', $devlastdays);
- if (strpos($xdver,'dev') !== false || strpos($xdver,'rc') !== false || $shortversioncheck > $masterversioncheck) {
+ if (strpos($xdver, 'dev') !== false || strpos($xdver, 'rc') !== false || $shortversioncheck > $masterversioncheck) {
//tmp//if pod is on the development branch - see when you last updated your pod and when the last commit was made to dev branch - if the repo is active and your not updating every 120 days why are you on dev branch?
- $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])),(new DateTime($masterdata['devlastcommit'])))->format('%a');
- if ($updategap + $devlastdays > 130) {
- _debug('Outdated', 'Yes');$score -= 2;
- }
- } elseif (($masterversioncheck[1] - $shortversioncheck[1]) > 1) {
+ $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])), (new DateTime($masterdata['devlastcommit'])))->format('%a');
+ if ($updategap + $devlastdays > 130) {
+ _debug('Outdated', 'Yes');
+ $score -= 2;
+ }
+ } elseif (($masterversioncheck[1] - $shortversioncheck[1]) > 1) {
///tmp/If pod is two versions off AND it's been more than 60 days since that release came out AND your on the master production branch
- _debug('Outdated', 'Yes');$score -= 2;
- $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])),(new DateTime($masterdata['releasedate'])))->format('%a');
- } elseif ($updategap - date_diff((new DateTime($masterdata['releasedate'])),(new DateTime()))->format('%a') > 90) {
- _debug('Outdated', 'Yes');$score -= 2;
- $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])),(new DateTime($masterdata['releasedate'])))->format('%a');
- } else {
- $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])),(new DateTime($masterdata['releasedate'])))->format('%a');
- }
- _debug('Pod code was updated after ', $updategap);
-
- $hidden = $score <= 70;
- _debug('Hidden', $hidden ? 'yes' : 'no');
-
- if (!$hiddennow && $hidden && $notify && !(isset($argv) && in_array('develop', $argv, true))) {
- $to = $email;
- $headers = ['From: ' . $adminemail, 'Bcc: ' . $adminemail];
- $subject = 'Monitoring notice from poduptime';
- $message = 'Notice for ' . $domain . '. Your score fell to ' . $score . ' and your pod is now marked as hidden.';
- @mail($to, $subject, $message, implode("\r\n", $headers));
- _debug('Mail Notice', 'sent to ' . $email);
- }
- if ($score > 100) {
- $score = 100;
- } elseif ($score < 0) {
- $score = 0;
- if ($masterv <> $shortv) {
- $status = PodStatus::System_Deleted;
+ _debug('Outdated', 'Yes');
+ $score -= 2;
+ $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])), (new DateTime($masterdata['releasedate'])))->format('%a');
+ } elseif ($updategap - date_diff((new DateTime($masterdata['releasedate'])), (new DateTime()))->format('%a') > 90) {
+ _debug('Outdated', 'Yes');
+ $score -= 2;
+ $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])), (new DateTime($masterdata['releasedate'])))->format('%a');
+ } else {
+ $updategap = date_diff((new DateTime($lastpodupdates['date_checked'])), (new DateTime($masterdata['releasedate'])))->format('%a');
+ }
+ _debug('Pod code was updated after ', $updategap);
+
+ $hidden = $score <= 70;
+ _debug('Hidden', $hidden ? 'yes' : 'no');
+
+ if (!$hiddennow && $hidden && $notify && !(isset($argv) && in_array('develop', $argv, true))) {
+ $to = $email;
+ $headers = ['From: ' . $adminemail, 'Bcc: ' . $adminemail];
+ $subject = 'Monitoring notice from poduptime';
+ $message = 'Notice for ' . $domain . '. Your score fell to ' . $score . ' and your pod is now marked as hidden.';
+ @mail($to, $subject, $message, implode("\r\n", $headers));
+ _debug('Mail Notice', 'sent to ' . $email);
}
- }
- _debug('Score', $score);
- $weightedscore = ($uptime + $score - (10 - $weight)) / 2;
- _debug('Weighted Score', $weightedscore);
-
- try {
- $p = R::findOne('pods', 'domain = ?', [$domain]);
- $p['secure'] = true;
- $p['hidden'] = $hidden;
- $p['ip'] = $ip;
- $p['ipv6'] = $ipv6;
- $p['daysmonitored'] = $days;
- $p['monthsmonitored'] = $months;
- $p['uptime_alltime'] = $uptime;
- $p['status'] = $status;
- $p['date_laststats'] = $statslastdate;
- $p['date_updated'] = date('Y-m-d H:i:s');
- $p['latency'] = $avglatency;
- $p['score'] = $score;
- $p['adminrating'] = $admin_rating;
- $p['country'] = $country;
- $p['countryname'] = $countryname;
- $p['city'] = $city;
- $p['state'] = $state;
- $p['lat'] = $lat;
- $p['long'] = $long;
- $p['detectedlanguage'] = $detectedlanguage;
- $p['userrating'] = $user_rating;
- $p['masterversion'] = $masterversion;
- $p['weightedscore'] = $weightedscore;
- $p['sslvalid'] = $outputsslerror;
- $p['dnssec'] = $dnssec;
- $p['sslexpire'] = $sslexpire;
- if ($dbstatus == PodStatus::Up && $status == PodStatus::Up) {
- $p['shortversion'] = $shortversion;
- $p['signup'] = $signup;
- $p['total_users'] = $total_users;
- $p['active_users_halfyear'] = $active_users_halfyear;
- $p['active_users_monthly'] = $active_users_monthly;
- $p['local_posts'] = $local_posts;
- $p['name'] = $name;
- $p['comment_counts'] = $comment_counts;
- $p['service_facebook'] = $service_facebook;
- $p['service_tumblr'] = $service_tumblr;
- $p['service_twitter'] = $service_twitter;
- $p['service_wordpress'] = $service_wordpress;
- $p['service_xmpp'] = $service_xmpp;
- $p['softwarename'] = $softwarename;
+ if ($score > 100) {
+ $score = 100;
+ } elseif ($score < 0) {
+ $score = 0;
+ if ($masterv <> $shortv) {
+ $status = PodStatus::SYSTEM_DELETED;
+ }
}
+ _debug('Score', $score);
+ $weightedscore = ($uptime + $score - (10 - $weight)) / 2;
+ _debug('Weighted Score', $weightedscore);
- if ($write) {
- R::store($p);
- } else {
- echo $p;
+ try {
+ $p = R::findOne('pods', 'domain = ?', [$domain]);
+ $p['secure'] = true;
+ $p['hidden'] = $hidden;
+ $p['ip'] = $ip;
+ $p['ipv6'] = $ipv6;
+ $p['daysmonitored'] = $days;
+ $p['monthsmonitored'] = $months;
+ $p['uptime_alltime'] = $uptime;
+ $p['status'] = $status;
+ $p['date_laststats'] = $statslastdate;
+ $p['date_updated'] = date('Y-m-d H:i:s');
+ $p['latency'] = $avglatency;
+ $p['score'] = $score;
+ $p['adminrating'] = $admin_rating;
+ $p['country'] = $country;
+ $p['countryname'] = $countryname;
+ $p['city'] = $city;
+ $p['state'] = $state;
+ $p['lat'] = $lat;
+ $p['long'] = $long;
+ $p['detectedlanguage'] = $detectedlanguage;
+ $p['userrating'] = $user_rating;
+ $p['masterversion'] = $masterversion;
+ $p['weightedscore'] = $weightedscore;
+ $p['sslvalid'] = $outputsslerror;
+ $p['dnssec'] = $dnssec;
+ $p['sslexpire'] = $sslexpire;
+ if ($dbstatus == PodStatus::UP && $status == PodStatus::UP) {
+ $p['shortversion'] = $shortversion;
+ $p['signup'] = $signup;
+ $p['total_users'] = $total_users;
+ $p['active_users_halfyear'] = $active_users_halfyear;
+ $p['active_users_monthly'] = $active_users_monthly;
+ $p['local_posts'] = $local_posts;
+ $p['name'] = $name;
+ $p['comment_counts'] = $comment_counts;
+ $p['service_facebook'] = $service_facebook;
+ $p['service_tumblr'] = $service_tumblr;
+ $p['service_twitter'] = $service_twitter;
+ $p['service_wordpress'] = $service_wordpress;
+ $p['service_xmpp'] = $service_xmpp;
+ $p['softwarename'] = $softwarename;
+ }
+
+ if ($write) {
+ R::store($p);
+ } else {
+ echo $p;
+ }
+ } catch (\RedBeanPHP\RedException $e) {
+ die('Error in SQL query: ' . $e->getMessage());
}
- } catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
- }
- echo 'Success ' . $domain;
+ echo 'Success ' . $domain;
- echo $newline;
- echo $newline;
+ echo $newline;
+ echo $newline;
}
/**
@@ -396,19 +405,19 @@ foreach ($pods as $pod) {
*/
function _debug($label, $var = null, $dump = false)
{
- global $debug, $newline;
+ global $debug, $newline;
- if (!$debug) {
- return;
- }
+ if (!$debug) {
+ return;
+ }
- if ($dump || is_array($var)) {
- $output = print_r($var, true);
- } elseif (is_bool($var)) {
- $output = $var ? 'true' : 'false';
- } else {
- $output = (string) $var;
- }
+ if ($dump || is_array($var)) {
+ $output = print_r($var, true);
+ } elseif (is_bool($var)) {
+ $output = $var ? 'true' : 'false';
+ } else {
+ $output = (string) $var;
+ }
- printf('%s: %s%s', $label, $output, $newline);
+ printf('%s: %s%s', $label, $output, $newline);
}
diff --git a/db/saverating.php b/db/saverating.php
index 2d0dbab95e73866f664633382ff750f472f4c895..d42aba66eee318782f1568921ba5640cc253d53e 100644
--- a/db/saverating.php
+++ b/db/saverating.php
@@ -1,5 +1,11 @@
getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
$to = $adminemail;
@@ -39,11 +45,11 @@ $headers = ['From: ' . $_email];
$subject = 'New rating added to poduptime ';
$message_lines = [
- 'Pod: ' . $_domain,
- 'Username: ' . $_username,
- 'User URL: ' . $_userurl,
- 'Comment: ' . $_comment,
- 'Rating:' . $_rating,
+ 'Pod: ' . $_domain,
+ 'Username: ' . $_username,
+ 'User URL: ' . $_userurl,
+ 'Comment: ' . $_comment,
+ 'Rating:' . $_rating,
];
@mail($to, $subject, implode("\r\n", $message_lines), implode("\r\n", $headers));
diff --git a/db/status.php b/db/status.php
index 7e01adc4c6c9f2de2e4e9efb69e182df1c44c6ea..2c9d5c6a2b7c4c272aef1d741ccc77dba3cd8049 100644
--- a/db/status.php
+++ b/db/status.php
@@ -1,8 +1,15 @@
4500) {
- http_response_code(500);
+ http_response_code(500);
} else {
- http_response_code(200);
+ http_response_code(200);
}
diff --git a/go.php b/go.php
index b1b3edcb2afbb59c2c27adee3c2d4c519fcd73aa..895e998f839839531f7b190b421e16eb2fcf3494 100644
--- a/go.php
+++ b/go.php
@@ -1,7 +1,13 @@
96
- AND monthsmonitored > 2
- AND pods.masterversion = shortversion
- ORDER BY random()
- LIMIT 1
- ');
- $domain || die('no domains exist');
- }
-
- $c = R::dispense('clicks');
- $c['domain'] = $domain;
- $c[$click] = 1;
- if (!(new CrawlerDetect())->isCrawler()) {
- R::store($c);
- }
-
- header('Location: https://' . $domain);
+ if ($_domain) {
+ $click = 'manualclick';
+ $domain = R::getCell('SELECT domain FROM pods WHERE domain LIKE ?', [$_domain]);
+ $domain || die('unknown domain');
+ } else {
+ $click = 'autoclick';
+ $domain = R::getCell('
+ SELECT domain
+ FROM pods
+ WHERE signup
+ AND uptime_alltime > 96
+ AND monthsmonitored > 2
+ AND pods.masterversion = shortversion
+ ORDER BY random()
+ LIMIT 1
+ ');
+ $domain || die('no domains exist');
+ }
+
+ $c = R::dispense('clicks');
+ $c['domain'] = $domain;
+ $c[$click] = 1;
+ if (!(new CrawlerDetect())->isCrawler()) {
+ R::store($c);
+ }
+
+ header('Location: https://' . $domain);
} catch (\RedBeanPHP\RedException $e) {
- die('Error in SQL query: ' . $e->getMessage());
+ die('Error in SQL query: ' . $e->getMessage());
}
diff --git a/index.php b/index.php
index 1be165ca1c399f0d3379f24a2510518fd28bd43c..63b5e31b374c65a91b61a8db0485cc4eb187ff34 100644
--- a/index.php
+++ b/index.php
@@ -1,7 +1,13 @@
-
-
Open Source Social Network Pod Uptime Status
-
-
-
-
-
-
-
-
-
-
-
-
+
+
Open Source Social Network Pod Uptime Status
+
+
+
+
+
+
+
+
+
+
+
+
[
- ['text' => 'Simple View', 'href' => '/', 'active' => $simpleview],
- ['text' => 'Detailed View', 'href' => '/?detailedview', 'active' => $detailedview],
- ['text' => 'Map View', 'href' => '/?mapview', 'active' => $mapview],
- ['text' => 'Network Stats View', 'href' => '/?statsview', 'active' => $statsview],
- ['text' => 'Add a pod', 'href' => '/?podmin', 'active' => $podmin],
- ['text' => 'Edit a pod', 'href' => '/?podminedit', 'active' => $podminedit],
- ],
- 'links' => [
- ['text' => 'Github', 'href' => 'https://github.com/diasporg/Poduptime', 'active' => false],
- ['text' => 'Contact', 'href' => 'https://dia.so/support', 'active' => false],
- ['text' => 'Wiki', 'href' => 'https://github.com/diasporg/Poduptime/wiki', 'active' => false],
- ['text' => 'API', 'href' => 'https://github.com/diasporg/Poduptime/wiki/API', 'active' => false],
- ['text' => 'How to host a pod', 'href' => 'https://diasporafoundation.org/', 'active' => false],
- ],
+ 'views' => [
+ ['text' => 'Simple View', 'href' => '/', 'active' => $simpleview],
+ ['text' => 'Detailed View', 'href' => '/?detailedview', 'active' => $detailedview],
+ ['text' => 'Map View', 'href' => '/?mapview', 'active' => $mapview],
+ ['text' => 'Network Stats View', 'href' => '/?statsview', 'active' => $statsview],
+ ['text' => 'Add a pod', 'href' => '/?podmin', 'active' => $podmin],
+ ['text' => 'Edit a pod', 'href' => '/?podminedit', 'active' => $podminedit],
+ ],
+ 'links' => [
+ ['text' => 'Github', 'href' => 'https://github.com/diasporg/Poduptime', 'active' => false],
+ ['text' => 'Contact', 'href' => 'https://dia.so/support', 'active' => false],
+ ['text' => 'Wiki', 'href' => 'https://github.com/diasporg/Poduptime/wiki', 'active' => false],
+ ['text' => 'API', 'href' => 'https://github.com/diasporg/Poduptime/wiki/API', 'active' => false],
+ ['text' => 'How to host a pod', 'href' => 'https://diasporafoundation.org/', 'active' => false],
+ ],
];
?>
@@ -72,32 +78,32 @@ $navs = [
About
Poduptime helps you find a diaspora, friendica, hubzilla or socialhome pod to use and join the federated social network.
- %3$s%4$s | ',
- $nav_item['active'] ? ' active' : '',
- $nav_item['href'],
- $nav_item['text'],
- $nav_item['active'] ? '
(current)' : ''
- );
- }
- ?>
+ %3$s%4$s | ',
+ $nav_item['active'] ? ' active' : '',
+ $nav_item['href'],
+ $nav_item['text'],
+ $nav_item['active'] ? '
(current)' : ''
+ );
+ }
+ ?>
Views
- %3$s%4$s',
- $nav_item['active'] ? ' active' : '',
- $nav_item['href'],
- $nav_item['text'],
- $nav_item['active'] ? ' (current)' : ''
- );
- }
- ?>
+ %3$s%4$s',
+ $nav_item['active'] ? ' active' : '',
+ $nav_item['href'],
+ $nav_item['text'],
+ $nav_item['active'] ? ' (current)' : ''
+ );
+ }
+ ?>