Commit 053134c1 authored by dmorley's avatar dmorley

cleanup

parent 0301f715
db/api-more.php
\ No newline at end of file
<?php
//Copyright (c) 2011, David Morley. This file is licensed under the Affero General Public License version 3 or later. See the COPYRIGHT file.
//this is just a single api for a pod for the android app to get data
include('config.php');
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
$sql = "SELECT * FROM pods WHERE domain = $1";
$result = pg_query_params($dbh, $sql, array($_GET['url']));
if (!$result) {
die("Error in SQL query: " . pg_last_error());
}
while ($row = pg_fetch_array($result)) {
echo "Status: " . $row["status"] . "<br>";
echo "Last Git Pull: " . $row["hgitdate"] . "<br>";
echo "Uptime This Month " . $row["uptimelast7"] . "<br>";
echo "Months Monitored: " . $row["monthsmonitored"] . "<br>";
echo "Response Time: " . $row["responsetimelast7"] . "<br>";
echo "User Rating: ". $row["userrating"] . "<br>";
echo "Server Location: ". $row["country"] . "<br>";
echo "Latitude: ". $row["lat"] . "<br>";
echo "Longitude: ". $row["long"] . "<br>";
}
pg_free_result($result);
pg_close($dbh);
?>
html,body{margin:0;padding:0;}
h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:1;font-family:inherit;}
h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,cite,code,del,dfn,em,img,q,s,samp,small,strike,strong,sub,sup,tt,var,dd,dl,dt,li,ol,ul,fieldset,form,label,legend,button,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;font-weight:normal;font-style:normal;font-size:100%;line-height:6;font-family:inherit;}
table{border-collapse:collapse;border-spacing:0;}
ol,ul{list-style:none;}
q:before,q:after,blockquote:before,blockquote:after{content:"";}
......@@ -180,7 +180,7 @@ input[disabled],select[disabled],textarea[disabled],input[readonly],select[reado
.form-stacked .inputs-list{margin-bottom:0;}.form-stacked .inputs-list li{padding-top:0;}.form-stacked .inputs-list li label{font-weight:normal;padding-top:0;}
.form-stacked div.clearfix.error{padding-top:10px;padding-bottom:10px;padding-left:10px;margin-top:0;margin-left:-10px;}
.form-stacked .actions{margin-left:-20px;padding-left:20px;}
table{width:100%;margin-bottom:18px;padding:0;border-collapse:separate;*border-collapse:collapse;font-size:12px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}table th,table td{padding:10px 10px 9px;line-height:2px;text-align:left;}
table{width:100%;margin-bottom:18px;padding:0;border-collapse:separate;*border-collapse:collapse;font-size:12px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}table th,table td{padding:10px 10px 9px;line-height:6px;text-align:left;}
table th{padding-top:9px;font-weight:bold;vertical-align:middle;border-bottom:1px solid #ddd;}
table td{vertical-align:top;}
table th+th,table td+td{border-left:1px solid #ddd;}
......
......@@ -178,7 +178,7 @@ $local_posts = isset($jsonssl->local_posts)?$jsonssl->local_posts:0;
} else {
$secure="false";
$score = $score - 1;
$dver =0;
$dver =".connect error";
$dverr=0;
//$hidden="yes";
//no diaspora cookie on either, lets set this one as hidden and notify someone its not really a pod
......
......@@ -32,7 +32,7 @@ if (!$_POST['rating']){
}
$to = $adminemail;
$subject = "New rating added to poduptime ";
$message = "Pod:" . $_POST["domain"] . "\n\n";
$message = "Pod:" . $_POST["domain"] . $_POST['domain'] . $_POST['username'] . $_POST['userurl'] . $_POST['comment'] . $_POST['rating'] . "\n\n";
$headers = "From: ".$_POST["email"]."\r\n";
@mail( $to, $subject, $message, $headers );
......
File mode changed from 100755 to 100644
File mode changed from 100755 to 100644
......@@ -9,6 +9,7 @@
$('#commentform').show('slow'); $('#ratings').hide('slow');
});
$('#submitrating').click(function() {
<?php
echo "var domain = \"{$_GET['domain']}\";";
?>
......@@ -17,6 +18,7 @@ $.ajax({
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>");
} else {$('#errortext').html(msg);$('#error').slideDown(633).delay(2500).slideUp(633);}
......
......@@ -7,7 +7,8 @@
<th>Version<a class="tipsy" title="Version of Diaspora this pod runs">?</a></th>
<th>Uptime<a class="tipsy" title="Percent of the time the pod is online for <?php echo date("F") ?>.">?</a></th>
<th>Signups<a class="tipsy" title="Open to public or Closed/Invite only.">?</a></th>
<th>Users<a class="tipsy" title="Number of total users on this pod.">?</a></th>
<th>Total Users<a class="tipsy" title="Number of total users on this pod.">?</a></th>
<th>Active Users<a class="tipsy" title="Number of users active last 6 months on this pod.">?</a></th>
<th>Posts<a class="tipsy" title="Number of total posts on this pod.">?</a></th>
<th>Months<a class="tipsy" title="How many months has this pod been online? Click number for more history.">?</a></th>
<th>Rating<a class="tipsy" title="User and Admin rating for this pod.">?</a></th>
......@@ -51,7 +52,7 @@ $verdiff = str_replace(".", "", $row["masterversion"]) - str_replace('.', '', $
$tip.="\n This pod {$row["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";
echo "<tr><td><div title='$tip' class='tipsy'><a class='$class' target='new' href='". $method . $row["domain"] ."'>" . $row["domain"] . "</a></div></td>";
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>";
if (stristr($row["shortversion"],'head'))
......@@ -67,6 +68,7 @@ if ($row["shortversion"] == $row["masterversion"] && $row["shortversion"] != "")
if ($row["signup"] == 1) {$signup="Open";} else {$signup="Closed";}
echo "<td>" . $signup . "</td>";
echo "<td>" . $row["total_users"] . "</td>";
echo "<td>" . $row["active_users_halfyear"] . "</td>";
echo "<td>" . $row["local_posts"] . "</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>";
......
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