Commit 175df882 authored by Armando Luescher's avatar Armando Luescher

Single quotes for HTML and JS.

parent e62dd79c
......@@ -10,12 +10,12 @@ if (!$dbh) {
}
if ($_GET['format'] == 'georss') {
echo <<<EOF
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<title>Diaspora Pods</title>
<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle>
<link href="http://podupti.me/"/>
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss">
<title>Diaspora Pods</title>
<subtitle>IP Locations of Diaspora pods on podupti.me</subtitle>
<link href="http://podupti.me/"/>
EOF;
$sql = "SELECT * FROM pods WHERE hidden <> 'yes'";
......@@ -26,20 +26,27 @@ EOF;
$numrows = pg_num_rows($result);
while ($row = pg_fetch_array($result)) {
$pod_name = htmlentities($row['name'], ENT_QUOTES);
$tip= '';
$tip.="\n This pod {$pod_name} has been watched for {$row['monthsmonitored']} months and its average ping time is {$row['responsetimelast7']} with uptime of {$row['uptimelast7']}% this month and was last checked on {$row['dateupdated']}. ";
$tip.="On a score of 100 this pod is a {$row['score']} right now";
$tip = sprintf(
'This pod %1$s has been watched for %2$s months and its average ping time is %3$s with uptime of %4$s%% this month and was last checked on %5$s. On a score of 100 this pod is a %6$s right now',
$pod_name,
$row['monthsmonitored'],
$row['responsetimelast7'],
$row['uptimelast7'],
$row['dateupdated'],
$row['score']
);
if ($row['secure'] == 'true') {$method = 'https://';} else {$method = 'http://';}
echo <<<EOF
<entry>
<title>{$method}{$row['domain']}</title>
<link href="{$method}{$row['domain']}"/>
<id>urn:{$row['domain']}</id>
<summary>Pod Location is: {$row['country']}
&#xA;{$tip}</summary>
<georss:point>{$row['lat']} {$row['long']}</georss:point>
<georss:featureName>{$row['domain']}</georss:featureName>
</entry>
<entry>
<title>{$method}{$row['domain']}</title>
<link href="{$method}{$row['domain']}"/>
<id>urn:{$row['domain']}</id>
<summary>Pod Location is: {$row['country']}
&#xA;
{$tip}</summary>
<georss:point>{$row['lat']} {$row['long']}</georss:point>
<georss:featureName>{$row['domain']}</georss:featureName>
</entry>
EOF;
}
......
......@@ -11,13 +11,10 @@ require_once __DIR__ . '/config.php';
if (!$result) {
die('Error in SQL query: ' . pg_last_error());
}
$numrows = pg_num_rows($result);
echo "<meta property='og:title' content='";
echo $numrows;
echo " #Diaspora Pods listed, Come see the privacy aware social network.' />";
echo $numrows;
$numrows = pg_num_rows($result);
?>
pods that are open for signup now.
<meta property="og:title" content="<?php echo $numrows; ?> #Diaspora Pods listed, Come see the privacy aware social network." /><?php echo $numrows; ?> pods that are open for signup now.
<meta charset="utf-8">
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
<table id="myTable" class="table table-striped table-sm tablesorter table-hover tfont">
......@@ -57,11 +54,17 @@ $verdiff = str_replace('.', '', $row['masterversion']) - str_replace('.', '', $r
$pod_name = htmlentities($row['name'], ENT_QUOTES);
$tip.="\n This pod {$pod_name} has been watched for {$row['monthsmonitored']} months and its average ping time is {$row['responsetimelast7']} with uptime of {$row['uptimelast7']}% this month and was last checked on {$row['dateupdated']}. ";
$tip.="On a score of -20 to +20 this pod is a {$row['score']} right now";
$tip .= sprintf(
"\n" . 'This pod %1$s has been watched for %2$s months and its average ping time is %3$s with uptime of %4$s%% this month and was last checked on %5$s. On a score of -20 to +20 this pod is a %6$s right now',
$pod_name,
$row['monthsmonitored'],
$row['responsetimelast7'],
$row['uptimelast7'],
$row['dateupdated'],
$row['score']
);
echo "<tr><td><a class='$class' target='new' href='". $method . $row['domain'] . "'>" . $row['domain'] . " <div title='$tip' class='tipsy' style='display: inline-block'>?</div></a></td>";
'</div></td>';
echo '<tr><td><a class="' . $class . '" target="_self" href="' . $method . $row['domain'] . '">' . $row['domain'] . '<div title="' . $tip . '" class="tipsy" style="display: inline-block">?</div></a></td>';
if (stristr($row['shortversion'],'head'))
{$version = '.dev';$pre = 'This pod runs pre release
......@@ -71,7 +74,7 @@ unknown code';}
else
{$version =$row['shortversion'];$pre = 'This pod runs production code';}
if ($row['shortversion'] == $row['masterversion'] && $row['shortversion'] != '') {$classver = 'green';} elseif ($verdiff > 6) {$classver = 'red';} else {$classver = 'black';}
echo "<td class='$classver'><div title='{$pre} codename: {$row['longversion']} master version is: {$row['masterversion']}' class='tipsy'>{$version}</div></td>";
echo '<td class="' . $classver . '"><div title="' . $pre . ' codename: ' . $row['longversion'] . ' master version is: ' . $row['masterversion'] . '" class="tipsy">' . $version . '</div></td>';
echo '<td>' . $row['uptimelast7'] . '</td>';
echo '<td>' . $row['responsetimelast7'] . '</td>';
if ($row['signup'] == 1) {$signup = 'Open';} else {$signup = 'Closed';}
......@@ -83,22 +86,22 @@ if ($row['signup'] == 1) {$signup = 'Open';} else {$signup = 'Closed';}
echo '<td>' . $row['comment_counts'] . '</td>';
if (strpos($row['pingdomurl'],
'pingdom.com')) {$moreurl = $row['pingdomurl'];} else {$moreurl = 'http://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=' . $row['pingdomurl'];}
echo "<td><div title='Last Check ".$row['dateupdated'] . "' class='tipsy'><a target='new' href='" . $moreurl . "'>" . $row['monthsmonitored'] . '</a></div></td>';
echo '<td>' . $row['score'] . "</td>\n";
echo "<td><div class='tipsy' title='".$row['sslvalid'] . "'>con info </td>\n";
echo '<td><div title="Last Check ' . $row['dateupdated'] . '" class="tipsy"><a target="_self" href="' . $moreurl . '">' . $row['monthsmonitored'] . '</a></div></td>';
echo '<td>' . $row['score'] . '</td>';
echo '<td><div class="tipsy" title="' . $row['sslvalid'] . '">con info </td>';
?>
<td>
<form method="post" action="db/kill.php" target="_blank">
<input name="comments" value="<?php echo $row['sslvalid'] ?>" size=10>
<input name="domain" value="<?php echo $row['domain'] ?>" type="hidden">
<input name="adminkey" value="<?php echo $_COOKIE['adminkey'] ?>" type="hidden">
<input name="comments" value="<?php echo $row['sslvalid']; ?>" size=10>
<input name="domain" value="<?php echo $row['domain']; ?>" type="hidden">
<input name="adminkey" value="<?php echo $_COOKIE['adminkey']; ?>" type="hidden">
<input name="action" type="radio" value="warn">warn
<input name="action" type="radio" value="delete">delete
<input type="submit" value="Process">
</form>
</td>
<?php
echo "</td></tr>\n";
echo '</td></tr>';
}
pg_free_result($result);
pg_close($dbh);
......
......@@ -88,7 +88,12 @@ if ($valid == '1') {
$to = $adminemail;
$cc = $_POST['email'];
$subject = 'New pod added to podupti.me ';
$message.= "https://podupti.me\n\n Stats Url: https://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=" . $_POST['url'] . "\n\n Pod: https://podupti.me/db/pull.php?debug=1&domain=" . $_POST['domain'] . "\n\n";
$message.= sprintf(
"%1$s\n\n Stats Url: %2$s\n\n Pod: %3$s\n\n",
'https://podupti.me',
'https://api.uptimerobot.com/getMonitors?format=json&customUptimeRatio=7-30-60-90&apiKey=' . $_POST['url'],
'https://podupti.me/db/pull.php?debug=1&domain=' . $_POST['domain']
);
$message.= 'Your pod will not show right away, needs to pass a few checks, Give it a few hours!';
$headers = 'From: ' . $_POST['email'] . "\r\nReply-To: " . $_POST['email'] . "\r\nCc: " . $_POST['email'] . "\r\n";
@mail( $to, $subject, $message, $headers );
......@@ -99,6 +104,7 @@ if ($valid == '1') {
pg_close($dbh);
} else {
echo "Could not validate your pod on http or https, check your setup!<br>Take a look at <a href='https://".$_POST['domain']."/nodeinfo/1.0'>your /nodeinfo</a>";$log->lwrite('Could not validate your pod on http or https, check your setup! '.$_POST['domain']);
$log->lwrite('Could not validate your pod on http or https, check your setup! ' . $_POST['domain']);
echo 'Could not validate your pod on http or https, check your setup!<br>Take a look at <a href="https://' . $_POST['domain'] . '/nodeinfo/1.0">your /nodeinfo</a>';
}
$log->lclose();
......@@ -60,12 +60,21 @@ while ($row = pg_fetch_array($result)) {
//form
echo 'Authorized to edit <b>' . $domain . '</b> until ' . $row['tokenexpire'] . '<br>';
echo "<form action='' method='get'><input type=hidden name=oldemail value=" . $row['email'] . '><input type=hidden name=save value=' . $_GET['token'] . '><input type=hidden name=token value=' . $_GET['token'] . '><input type=hidden name=domain value=' . $_GET['domain'] . '>';
echo 'Stats Key <input type=text size=50 name=pingdomurl value=' . $row['pingdomurl'] . '>Uptimerobot API key for this monitor<br>';
echo 'Email <input type=text size=20 name=email value=' . $row['email'] . '><br>';
echo 'Weight <input type=text size=2 name=weight value=' . $row['weight'] . '> This lets you weight your pod lower on the list if you have too much trafic coming in, 10 is the norm use lower to move down the list.<br>';
echo '<input type=submit name=submit><br><br><br>';
echo '<form action="" method="get">';
echo '<input type="hidden" name="oldemail" value="' . $row['email'] . '">';
echo '<input type="hidden" name="save" value="' . $_GET['token'] . '">';
echo '<input type="hidden" name="token" value="' . $_GET['token'] . '">';
echo '<input type="hidden" name="domain" value="' . $_GET['domain'] . '">';
echo 'Stats Key <input type="text" size="50" name="pingdomurl" value="' . $row['pingdomurl'] . '"">Uptimerobot API key for this monitor<br>';
echo 'Email <input type="text" size="20" name="email" value="' . $row['email'] . '"><br>';
echo 'Weight <input type="text" size="2" name="weight" value="' . $row['weight'] . '"> This lets you weight your pod lower on the list if you have too much trafic coming in, 10 is the norm use lower to move down the list.<br>';
echo '<input type="submit" name="submit">';
echo '</form><br><br><br>';
echo "<form action='' method='get'><input type=hidden name=delete value=" . $_GET['token'] . '><input type=hidden name=token value=' . $_GET['token'] . '><input type=hidden name=domain value=' . $_GET['domain'] . '>';
echo 'WARNING: This can not be undone, you will need to add your pod again if you want back on list: <input type=submit name=submit value=delete><br><br><br>';
echo '<form action="" method="get">';
echo '<input type="hidden" name="delete" value="' . $_GET['token'] . '">';
echo '<input type="hidden" name="token" value="' . $_GET['token'] . '">';
echo '<input type="hidden" name="domain" value="' . $_GET['domain'] . '">';
echo 'WARNING: This can not be undone, you will need to add your pod again if you want back on list: <input type="submit" name="submit" value="delete">';
echo '</form><br><br><br>';
}
......@@ -68,7 +68,7 @@ $podminedit = isset($_GET['podminedit'])?$_GET['podminedit']:null;
Data last refreshed: <br><?php echo date('F d Y H:i:s.', filemtime($lastfile)) ?> EST
</div>
<div class="main col-md-10 offset-md-2">
<a href='random.php' class='btn btn-sm btn-success'>Confused? Auto pick a pod for you.</a>
<a href="random.php" class="btn btn-sm btn-success">Confused? Auto pick a pod for you.</a>
<div class="row placeholders">
</div>
<div class="table-responsive">
......
......@@ -2,7 +2,7 @@ $(document).ready(function(){
$.facebox.settings.closeImage = 'bower_components/facebox/src/closelabel.png'
$.facebox.settings.loadingImage = 'bower_components/facebox/src/loading.gif'
$('a[rel*=facebox]').facebox()
$("#myTable").tablesorter();
$('#myTable').tablesorter();
});
$(function () {
......
......@@ -9,25 +9,23 @@ $(document).ready(function() {
$('#commentform').show('slow'); $('#ratings').hide('slow');
});
$('#submitrating').click(function() {
<?php
echo "var domain = \"{$_GET['domain']}\";";
?>
var domain = '<?php echo $_GET['domain']; ?>';
$.ajax({
type: "POST",
url: "db/saverating.php",
data: "username="+$('#username').val()+"&userurl="+$('#userurl').val()+"&comment="+$('#comment').val()+"&rating="+$('#rating').val()+"&domain="+domain,
type: 'POST',
url: 'db/saverating.php',
data: 'username='+$('#username').val()+'&userurl='+$('#userurl').val()+'&comment='+$('#comment').val()+'&rating='+$('#rating').val()+'&domain='+domain,
success: function(msg){
$('#submitrating').unbind('click');
if (msg == 1) {
$("#commentform").replaceWith("<h3>Your comment was saved, Thank You!</h3>");
$('#commentform').replaceWith('<h3>Your comment was saved, Thank You!</h3>');
} else {$('#errortext').html(msg);$('#error').slideDown(633).delay(2500).slideUp(633);}
}
});
});
$("#slider").slider({ animate: true, max: 10, min: 1, step: 1, value: 10, stop: function(event, ui) {
var value = $( "#slider" ).slider( "option", "value" );
$("#rating").prop( "value", value )
$('#slider').slider({ animate: true, max: 10, min: 1, step: 1, value: 10, stop: function(event, ui) {
var value = $( '#slider' ).slider( 'option', 'value' );
$('#rating').prop( 'value', value )
}
});
});
......@@ -51,15 +49,15 @@ if (!$result) {
die('Error in SQL query: ' . pg_last_error());
}
$numrows = pg_num_rows($result);
echo "<input id='addrating' class='btn primary' style='float:right;margin-right:15px;' type='submit' value='Add a Rating'><h3>Podupti.me ratings for ".$_GET['domain'] . " pod</h3><div id='ratings'><hr>";
echo '<input id="addrating" class="btn primary" style="float:right;margin-right:15px;" type="submit" value="Add a Rating"><h3>Podupti.me ratings for ' . $_GET['domain'] . ' pod</h3><div id="ratings"><hr>';
if (!$numrows) {echo '<b>This pod has no rating yet!</b>';}
while ($row = pg_fetch_array($result)) {
if ($row['admin'] == 1) {
echo 'Poduptime Approved Comment - User: <b>' . $row['username'] . "</b> Url: <a href='" . $row['userurl'] . "'>" . $row['userurl'] . '</a> Rating: <b>' . $row['rating'] . '</b> <br>';
echo '<i>' . $row['comment'] . "</i><span class='label' title='id: " . $row['id'] . "' style='float:right;margin-right:115px;'>" . $row['date'] . '</span><hr>';
echo 'Poduptime Approved Comment - User: <b>' . $row['username'] . '</b> Url: <a href="' . $row['userurl'] . '">' . $row['userurl'] . '</a> Rating: <b>' . $row['rating'] . '</b> <br>';
echo '<i>' . $row['comment'] . '</i><span class="label" title="id: ' . $row['id'] . '" style="float:right;margin-right:115px;">' . $row['date'] . '</span><hr>';
} elseif ($row['admin'] == 0) {
echo 'User Comment - User: <b>' . $row['username'] . "</b> Url: <a href='" . $row['userurl'] . "'>" . $row['userurl'] . '</a> Rating: <b>' . $row['rating'] . '</b> <br>';
echo '<i>' . $row['comment'] . "</i><span class='label' title='id: " . $row['id'] . "' style='float:right;margin-right:115px;'>" . $row['date'] . "</span><hr style='margin-top:0;margin-bottom:15px;'>";
echo 'User Comment - User: <b>' . $row['username'] . '</b> Url: <a href="' . $row['userurl'] . '">' . $row['userurl'] . '</a> Rating: <b>' . $row['rating'] . '</b> <br>';
echo '<i>' . $row['comment'] . '</i><span class="label" title="id: ' . $row['id'] . '" style="float:right;margin-right:115px;">' . $row['date'] . '</span><hr style="margin-top:0;margin-bottom:15px;">';
}
}
echo <<<EOF
......
......@@ -20,19 +20,18 @@ if (!$result) {
die('Error in SQL query: ' . pg_last_error());
}
$numrows = pg_num_rows($result);
echo "<meta property='og:title' content='";
echo $numrows;
echo " Federated Pods listed, Come see the privacy aware social networks.' />";
?>
<meta property="og:title" content="<?php echo $numrows; ?> Federated Pods listed, Come see the privacy aware social networks." />
<div class="hidden-sm-up">Scroll right or rotate device for more</div>
<table class="table table-striped table-sm tablesorter table-hover" id="myTable">
<thead class="thead-inverse">
<tr>
<th><a data-toggle='tooltip' data-placement='bottom' title="A pod is a site for you to set up your account.">Pod</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Percent of the time the pod is online for <?php echo date('F') ?>.">Uptime %</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of users active last 6 months on this pod.">Active Users</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Pod location, based on IP Geolocation">Location</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="External Social Networks this pod can post to">Services Offered</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="A pod is a site for you to set up your account.">Pod</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Percent of the time the pod is online for <?php echo date('F') ?>.">Uptime %</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of users active last 6 months on this pod.">Active Users</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Pod location, based on IP Geolocation">Location</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="External Social Networks this pod can post to">Services Offered</a></th>
</tr>
</thead>
<tbody>
......@@ -41,7 +40,6 @@ echo " Federated Pods listed, Come see the privacy aware social networks.' />";
<?php
while ($row = pg_fetch_array($result)) {
$tt=$tt+1;
$tip= '';
if ($row['secure'] == 'true') {
$method = 'https://';
$class= 'text-success';
......@@ -55,25 +53,30 @@ $class= 'red';
}
$verdiff = str_replace('.', '', $row['masterversion']) - str_replace('.', '', $row['shortversion']);
$pod_name = htmlentities($row['name'], ENT_QUOTES);
$tip.="\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months and with an uptime of {$row['uptimelast7']}% this month. ";
$tip.="On a scale of 100 this pod is a {$row['score']} right now";
echo "<tr><td><div title='$tip' data-toggle='tooltip' data-placement='bottom'><a class='$class url' target='new' href='". $method . $row['domain'] . "'>" . $row['domain'] . '</a></div></td>';
'</div></td>';
$tip = sprintf(
'This %1$s pod %2$s has been watched for %3$s months and with an uptime of %4$s%% this month. On a scale of 100 this pod is a %5$s right now',
$row['softwarename'],
$pod_name,
$row['monthsmonitored'],
$row['uptimelast7'],
$row['score']
);
echo '<tr><td><div title="' . $tip . '" data-toggle="tooltip" data-placement="bottom"><a class="' . $class . ' url" target="_self" href="' . $method . $row['domain'] . '">' . $row['domain'] . '</a></div></td>';
echo '<td>' . $row['uptimelast7'] . '%</td>';
echo "<td data-toggle='tooltip' data-placement='bottom' title='active six months: " . $row['active_users_halfyear'] . ', active one month: ' . $row['active_users_monthly'] . "'>" . $row['active_users_halfyear'] . '</td>';
echo '<td data-toggle="tooltip" data-placement="bottom" title="active six months: ' . $row['active_users_halfyear'] . ', active one month: ' . $row['active_users_monthly'] . '">' . $row['active_users_halfyear'] . '</td>';
if ($country_code == $row['country']) {
echo "<td class='text-success' data-toggle='tooltip' data-placement='bottom' title='".$row['whois'] . " '><b>" . $row['country'] . "</b></td>\n";
echo '<td class="text-success" data-toggle="tooltip" data-placement="bottom" title="' . $row['whois'] . '"><b>' . $row['country'] . '</b></td>';
} else {
echo "<td data-toggle='tooltip' data-placement='bottom' title='".$row['whois'] . " '>" . $row['country'] . "</td>\n";
echo '<td data-toggle="tooltip" data-placement="bottom" title="' . $row['whois'] . '">' . $row['country'] . '</td>';
}
echo "<td class='' title=''>";
if ($row["service_facebook"] === "t") {echo "<div class='smlogo smlogo-facebook'></div>";}
if ($row["service_twitter"] === "t") {echo "<div class='smlogo smlogo-twitter'></div>";}
if ($row["service_tumblr"] === "t") {echo "<div class='smlogo smlogo-tumblr'></div>";}
if ($row["service_wordpress"] === "t") {echo "<div class='smlogo smlogo-wordpress'></div>";}
if ($row["xmpp"] === "t") {echo "<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></tr>\n";
echo '<td>';
if ($row['service_facebook'] === 't') {echo '<div class="smlogo smlogo-facebook"></div>';}
if ($row['service_twitter'] === 't') {echo '<div class="smlogo smlogo-twitter"></div>';}
if ($row['service_tumblr'] === 't') {echo '<div class="smlogo smlogo-tumblr"></div>';}
if ($row['service_wordpress'] === 't') {echo '<div class="smlogo smlogo-wordpress"></div>';}
if ($row['xmpp'] === 't') {echo '<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></tr>';
}
pg_free_result($result);
pg_close($dbh);
......
......@@ -17,31 +17,30 @@ if (!$result) {
die('Error in SQL query: ' . pg_last_error());
}
$numrows = pg_num_rows($result);
echo "<meta property='og:title' content='";
echo $numrows;
echo " federated Pods listed, Come see the privacy aware social networks.' />";
?>
<meta property="og:title" content="<?php echo $numrows; ?> Federated Pods listed, Come see the privacy aware social networks." />
<meta charset="utf-8">
<!-- /* Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file. */ -->
<table id="myTable" class="table table-striped table-sm tablesorter table-hover tfont">
<thead class="thead-inverse">
<tr>
<th><a data-toggle='tooltip' data-placement='bottom' title="A pod is a site for you to set up your account.">Pod</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Version of software this pod runs">Version</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Percent of the time the pod is online for <?php echo date('F') ?>.">Uptime</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="A pod is a site for you to set up your account.">Pod</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Version of software this pod runs">Version</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Percent of the time the pod is online for <?php echo date('F') ?>.">Uptime</a></th>
<th>IPv6</th>
<th>Response Time</th>
<th>Signups</th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of total users on this pod.">Users</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of users active last 6 months on this pod.">Active Users 6</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of users active last 1 month on this pod.">Active Users 1</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of total posts on this pod.">Posts</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Number of total comments on this pod.">Comments</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="How many months has this pod been online? Click number for more history.">Months</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="User rating for this pod.">Rating</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="System Score on a 100 point scale">Score</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="Pod location, based on IP Geolocation">Country</a></th>
<th><a data-toggle='tooltip' data-placement='bottom' title="External Social Networks this pod can post to">Services</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of total users on this pod.">Users</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of users active last 6 months on this pod.">Active Users 6</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of users active last 1 month on this pod.">Active Users 1</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of total posts on this pod.">Posts</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Number of total comments on this pod.">Comments</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="How many months has this pod been online? Click number for more history.">Months</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="User rating for this pod.">Rating</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="System Score on a 100 point scale">Score</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="Pod location, based on IP Geolocation">Country</a></th>
<th><a data-toggle="tooltip" data-placement="bottom" title="External Social Networks this pod can post to">Services</a></th>
</tr>
</thead>
<tbody>
......@@ -62,8 +61,7 @@ $pod_name = htmlentities($row['name'], ENT_QUOTES);
$tip.="\n This {$row['softwarename']} pod {$pod_name} has been watched for {$row['monthsmonitored']} months with an uptime of {$row['uptimelast7']}% this month and a response time average today of {$row['responsetimelast7']}ms was last checked on {$row['dateupdated']}. ";
$tip.="On a scale of 100 this pod is a {$row['score']} right now";
echo "<tr><td><a title='$tip' data-toggle='tooltip' data-placement='bottom' class='$class' target='new' href='". $method . $row['domain'] . "'>" . $row['domain'] . '</a></td>';
'</div></td>';
echo '<tr><td><a title="' . $tip . '" data-toggle="tooltip" data-placement="bottom" class="' . $class . '" target="_self" href="' . $method . $row['domain'] . '">' . $row['domain'] . '</a></td>';
if (stristr($row['shortversion'],'head'))
{$version = '.dev';$pre = 'This pod runs pre release
......@@ -73,7 +71,7 @@ unknown code';}
else
{$version =$row['shortversion'];$pre = 'This pod runs production code';}
if ($row['shortversion'] == $row['masterversion'] && $row['shortversion'] != '') {$classver = 'green';} elseif ($verdiff > 6) {$classver = 'red';} else {$classver = 'black';}
echo "<td class='$classver'><div title='{$pre} codename: {$row['longversion']} master version is: {$row['masterversion']}' data-toggle='tooltip' data-placement='bottom'>{$version}</div></td>";
echo '<td class="' . $classver . '"><div title="' . $pre . ' codename: ' . $row['longversion'] . ' master version is: ' . $row['masterversion'] . '" data-toggle="tooltip" data-placement="bottom">' . $version . '</div></td>';
echo '<td>' . $row['uptimelast7'] . '%</td>';
echo '<td>' . $row['ipv6'] . '</td>';
echo '<td>' . $row['responsetimelast7'] . '</td>';
......@@ -86,20 +84,21 @@ if ($row['signup'] == 1) {$signup = 'Open';} else {$signup = 'Closed';}
echo '<td>' . $row['comment_counts'] . '</td>';
if (strpos($row['pingdomurl'],
'pingdom.com')) {$moreurl = $row['pingdomurl'];} else {$moreurl = '/db/showuptimerobot.php?domain=' . $row['domain'];}
echo "<td><div title='Last Check ".$row['dateupdated'] . "' data-toggle='tooltip' data-placement='bottom'><a rel='facebox' href='" . $moreurl . "'>" . $row['monthsmonitored'] . '</a></div></td>';
echo '<td><div title="Last Check ' . $row['dateupdated'] . '" data-toggle="tooltip" data-placement="bottom"><a rel="facebox" href="' . $moreurl . '">' . $row['monthsmonitored'] . '</a></div></td>';
echo "<td><a rel=\"facebox\" href=\"rate.php?domain=".$row['domain'] . "\">" . $row['userrating'] . '/10';
echo '<td><a rel="facebox" href="rate.php?domain=' . $row['domain'] . '">' . $row['userrating'] . '/10';
echo '</a></td>';
echo '<td>' . $row['score'] . "/100</td>\n";
echo '<td>' . $row['country'] . "</td>\n";
echo "<td class='' title=''>";
if ($row["service_facebook"] === "t") {echo "<div class='smlogo smlogo-facebook'></div>";}
if ($row["service_twitter"] === "t") {echo "<div class='smlogo smlogo-twitter'></div>";}
if ($row["service_tumblr"] === "t") {echo "<div class='smlogo smlogo-tumblr'></div>";}
if ($row["service_wordpress"] === "t") {echo "<div class='smlogo smlogo-wordpress'></div>";}
if ($row["xmpp"] === "t") {echo "<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></tr>\n";
echo '<td>' . $row['score'] . '/100</td>';
echo '<td>' . $row['country'] . '</td>';
echo '<td>';
if ($row['service_facebook'] === 't') {echo '<div class="smlogo smlogo-facebook"></div>';}
if ($row['service_twitter'] === 't') {echo '<div class="smlogo smlogo-twitter"></div>';}
if ($row['service_tumblr'] === 't') {echo '<div class="smlogo smlogo-tumblr"></div>';}
if ($row['service_wordpress'] === 't') {echo '<div class="smlogo smlogo-wordpress"></div>';}
if ($row['xmpp'] === 't') {echo '<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></tr>';
}
pg_free_result($result);
pg_close($dbh);
......
......@@ -18,8 +18,8 @@ foreach ($csv as $cords) {
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<script type="text/javascript">
var geoJsonData = {
"type": "FeatureCollection",
"features": [
'type': 'FeatureCollection',
'features': [
<?php
require_once __DIR__ . '/config.php';
......@@ -34,27 +34,41 @@ if (!$result) {
}
$numrows = pg_num_rows($result);
while ($row = pg_fetch_array($result)) {
unset($feat);
if ($row["service_facebook"] === "t") {$feat .= "<div class='smlogo smlogo-facebook'></div>";}
if ($row["service_twitter"] === "t") {$feat .= "<div class='smlogo smlogo-twitter'></div>";}
if ($row["service_tumblr"] === "t") {$feat .= "<div class='smlogo smlogo-tumblr'></div>";}
if ($row["service_wordpress"] === "t") {$feat .= "<div class='smlogo smlogo-wordpress'></div>";}
if ($row["xmpp"] === "t") {$feat .= "<div class='smlogo smlogo-xmpp'><img src='/images/icon-xmpp.png' width='16' height='16' title='XMPP chat server' alt='XMPP chat server'></div>";}
unset($signup);if ($row["signup"] == 1) {$signup = "yes";} else {$signup= "no";}
$pod_name = htmlentities($row["name"], ENT_QUOTES);
if ($row["secure"] == "true") {$ur="https";} else {$ur="http";}
$feat = '';
if ($row['service_facebook'] === 't') {$feat .= '<div class="smlogo smlogo-facebook"></div>';}
if ($row['service_twitter'] === 't') {$feat .= '<div class="smlogo smlogo-twitter"></div>';}
if ($row['service_tumblr'] === 't') {$feat .= '<div class="smlogo smlogo-tumblr"></div>';}
if ($row['service_wordpress'] === 't') {$feat .= '<div class="smlogo smlogo-wordpress"></div>';}
if ($row['xmpp'] === 't') {$feat .= '<div class="smlogo smlogo-xmpp"><img src="/images/icon-xmpp.png" width="16" height="16" title="XMPP chat server" alt="XMPP chat server"></div>';}
unset($signup);if ($row['signup'] == 1) {$signup = 'yes';} else {$signup = 'no';}
$pod_name = htmlentities($row['name'], ENT_QUOTES);
if ($row['secure'] == 'true') {$ur = 'https';} else {$ur = 'http';}
echo <<<EOF
{ "type": "Feature", "id":"1", "properties":
{ "html":"{$pod_name}<br><a href=\'{$ur}://{$row['domain']}\'>Visit</a><br> Open Signup: {$signup}<br> Users: {$row['active_users_halfyear']}<br> Uptime: {$row['uptimelast7']}%<br> Services:{$feat}" }, "geometry": { "type": "Point", "coordinates": [{$row['long']},{$row['lat']} ] } },
{
'type': 'Feature',
'id': '1',
'properties' : {
'html': '{$pod_name}<br><a href="{$ur}://{$row['domain']}">Visit</a><br> Open Signup: {$signup}<br> Users: {$row['active_users_halfyear']}<br> Uptime: {$row['uptimelast7']}%<br> Services:{$feat}'
},
'geometry': {
'type': 'Point',
'coordinates': [{$row['long']},{$row['lat']} ]
}
},
EOF;
}
?>
{ "type": "Feature", "id":"1", "properties": { "html":"" }, "geometry": { "type": "Point", "coordinates": [0,0 ] } }
{
'type': 'Feature',
'id':'1',
'properties': { 'html': '' },
'geometry': { 'type': 'Point', 'coordinates': [0,0 ] }
}
]
};
var tiles = L.tileLayer('https://{s}.tiles.mapbox.com/v4/diasporg.l615e519/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoiZGlhc3BvcmciLCJhIjoibTVBaldtayJ9.HdGPBIFeZyNKKQqCmU11nA', {
maxZoom: 18,
attribution: "<a href='https://www.mapbox.com/about/maps/' target='_blank'>&copy; Mapbox &copy; OpenStreetMap</a> <a class='mapbox-improve-map' href='https://www.mapbox.com/map-feedback/' target='_blank'>Improve this map</a>"
attribution: '<a href="https://www.mapbox.com/about/maps/" target="_blank">&copy; Mapbox &copy; OpenStreetMap</a> <a class="mapbox-improve-map" href="https://www.mapbox.com/map-feedback/" target="_blank">Improve this map</a>'
});
var map = L.map('map', { zoom: 5, center: [<?php echo $lat; ?>, <?php echo $long; ?>] }).addLayer(tiles);
var markers = L.markerClusterGroup({maxClusterRadius: 2, animateAddingMarkers: true, iconCreateFunction: function(cluster) {return new L.DivIcon({ html: '<b class="icon">' + cluster.getChildCount() + '</b>', className: 'mycluster', iconSize: L.point(35, 35) });}});
......
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