Commit f06c9246 authored by root's avatar root

fix missing saverating file

parent 68f60f71
This diff is collapsed.
...@@ -17,5 +17,5 @@ ...@@ -17,5 +17,5 @@
font-size:9px; font-size:9px;
} }
.content { .content {
margin-left: 299px !important; margin-left: 2px !important;
} }
<?php
include('config.php');
if (!$_POST['username']){
echo "no username given";
die;
}
if (!$_POST['userurl']){
echo "no userurl given";
die;
}
if (!$_POST['domain']){
echo "no pod domain given";
die;
}
if (!$_POST['comment']){
echo "no comment";
die;
}
if (!$_POST['rating']){
echo "no rating given";
die;
}
$domain = pg_escape_string($_POST['domain']);
$comment = pg_escape_string($_POST['comment']);
$rating = pg_escape_string($_POST['rating']);
$username = pg_escape_string($_POST['username']);
$userurl = pg_escape_string($_POST['userurl']);
$dbh = pg_connect("dbname=$pgdb user=$pguser password=$pgpass");
if (!$dbh) {
die("Error in connection: " . pg_last_error());
}
$sql = "INSERT INTO rating_comments (domain, comment, rating, username, userurl) VALUES('$domain', '$comment', '$rating', '$username', '$userurl')";
$result = pg_query($dbh, $sql);
if (!$result) {
die("Error in SQL query: " . pg_last_error());
}
$to = $adminemail;
$subject = "New rating added to poduptime ";
$message = "Pod:" . $_POST["domain"] . "\n\n";
$headers = "From: ".$_POST["email"]."\r\n";
@mail( $to, $subject, $message, $headers );
echo "Comment posted!";
pg_free_result($result);
pg_close($dbh);
?>
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
<script type="text/javascript" src="http://c807316.r16.cf2.rackcdn.com/jquery-ui-1.8.21.custom.min.js"></script> <script type="text/javascript" src="http://c807316.r16.cf2.rackcdn.com/jquery-ui-1.8.21.custom.min.js"></script>
<script src="OpenLayers.js"></script> <script src="OpenLayers.js"></script>
<link href="http://c807316.r16.cf2.rackcdn.com/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css"/> <link href="http://c807316.r16.cf2.rackcdn.com/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="http://c790230.r16.cf2.rackcdn.com/bootstrap.min.css"> <link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/newstyle.css" /> <link rel="stylesheet" href="css/newstyle.css" />
<link rel="stylesheet" href="css/facebox.css" /> <link rel="stylesheet" href="css/facebox.css" />
...@@ -68,16 +68,14 @@ s1.parentNode.insertBefore(s, s1); ...@@ -68,16 +68,14 @@ s1.parentNode.insertBefore(s, s1);
<div class="container-fluid"> <div class="container-fluid">
<div class="sidebar"> <div class="sidebar">
<div class="adsense2"> <div class="adsense2">
<script type="text/javascript"><!-- <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
google_ad_client = "ca-pub-3662181805557062"; <!-- poduptimebigger -->
/* poduptimenew */ <ins class="adsbygoogle"
google_ad_slot = "3969028081"; style="display:inline-block;width:336px;height:280px"
google_ad_width = 300; data-ad-client="ca-pub-3662181805557062"
google_ad_height = 250; data-ad-slot="8271090637"></ins>
//--> <script>
</script> (adsbygoogle = window.adsbygoogle || []).push({});
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> </script>
</div> </div>
<a href="https://market.android.com/details?id=appinventor.ai_david_morley.DiasporaPoduptime"><img src="http://c807316.r16.cf2.rackcdn.com/android-dude128.png"></a> <a href="https://market.android.com/details?id=appinventor.ai_david_morley.DiasporaPoduptime"><img src="http://c807316.r16.cf2.rackcdn.com/android-dude128.png"></a>
...@@ -88,13 +86,12 @@ src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> ...@@ -88,13 +86,12 @@ src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
<?php if ($hidden == "true") {echo "<a href='http://podupti.me' class='btn danger large'>NOTICE: These pods are Hidden and have problems, click here to go to working pods</a>";} include("show.php"); ?> <?php if ($hidden == "true") {echo "<a href='http://podupti.me' class='btn danger large'>NOTICE: These pods are Hidden and have problems, click here to go to working pods</a>";} include("show.php"); ?>
</div> </div>
<div id="add"> <div id="add">
Pod Host? <u style="cursor: pointer; cursor: hand;">Click here</u> to add/manage your listing.<br> Pod Host? <u style="cursor: pointer; cursor: hand;">Click here</u> to add your listing.<br>
</div> </div>
<div id="info"> <div id="info">
Data last refreshed at: <?php echo date("F d Y H:i:s.", filemtime($lastfile)) ?> Pacific Time<br> Data last refreshed at: <?php echo date("F d Y H:i:s.", filemtime($lastfile)) ?> Pacific Time<br>
Poduptime is run by <a href="https://diasp.org/u/davidmorley" target=_new>David Morley</a> and is open source on <a href="https://github.com/diasporg/Poduptime">GitHub</a><br> Poduptime is run by <a href="https://diasp.org/u/davidmorley" target=_new>David Morley</a> and is open source on <a href="https://github.com/diasporg/Poduptime">GitHub</a> Feel free to contribute with pull requests or bugs!<br>
I also run the pods <a href="https://diasp.org/?2" target=_new>diasp.org</a> and the <a href="http://dia.so" target=_new>dia.so</a> site.<br> Some pods are <a href="http://podupti.me/?hidden=true">Hidden</a> hat have too many issues, see <a href="https://github.com/diasporg/Poduptime/wiki">Wiki</a> for more.<br><br>
Some pods are <a href="http://podupti.me/?hidden=true">Hidden</a> That have too many issues.<br><br>
</div> </div>
<div id="howto" style="display:none; margin-left:50px"> <div id="howto" style="display:none; margin-left:50px">
<br> <br>
......
...@@ -14,7 +14,7 @@ echo "var domain = \"{$_GET['domain']}\";"; ...@@ -14,7 +14,7 @@ echo "var domain = \"{$_GET['domain']}\";";
?> ?>
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "saverating.php", url: "db/saverating.php",
data: "username="+$('#username').val()+"&userurl="+$('#userurl').val()+"&comment="+$('#comment').val()+"&rating="+$('#rating').val()+"&domain="+domain, data: "username="+$('#username').val()+"&userurl="+$('#userurl').val()+"&comment="+$('#comment').val()+"&rating="+$('#rating').val()+"&domain="+domain,
success: function(msg){ success: function(msg){
if (msg == 1) { if (msg == 1) {
...@@ -77,4 +77,4 @@ EOF; ...@@ -77,4 +77,4 @@ EOF;
pg_free_result($result); pg_free_result($result);
pg_close($dbh); pg_close($dbh);
?> ?>
</div> </div>
\ No newline at end of file
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