Ver Fonte

Bug fixes in the sync API

seavenois há 10 anos atrás
pai
commit
986999c5d2
5 ficheiros alterados com 31 adições e 22 exclusões
  1. 4 4
      www/API/v1/sync.php
  2. 2 2
      www/actividades/actividad.php
  3. 2 0
      www/css/blog.css
  4. 10 6
      www/css/m/blog.css
  5. 13 10
      www/css/ui.css

+ 4 - 4
www/API/v1/sync.php

@@ -90,12 +90,12 @@
  	****************************************************/
 	function get_version($con, $section = SEC_ALL){
 		if ($section == SEC_ALL){
-			$q = mysqli_query($con, "SELECT SUM(version) AS version FROM version;");
+		$q = mysqli_query($con, "SELECT SUM(version) AS version FROM version;");
 		}
 		else{
 			$q = mysqli_query($con, "SELECT version FROM version WHERE section = '$section';");
 		}
-		if (mysqli_num_rows == 0){
+		if (mysqli_num_rows($q) == 0){
 			//'Bad request' status code
 			http_response_code(400);
 			return 0;
@@ -292,8 +292,8 @@
 	$user = mysqli_real_escape_string($con, $_GET[GET_USER]);
 	$action = strtolower(mysqli_real_escape_string($con, $_GET[GET_ACTION]));
 	$section = strtolower(mysqli_real_escape_string($con, $_GET[GET_SECTION]));
-	$version = mysqli_real_escape_string($con, $_GET[GET_VERSION]);
-	$foregroud = mysqli_real_escape_string($con, $_GET[GET_FOREGROUND]);
+	$version = (int) mysqli_real_escape_string($con, $_GET[GET_VERSION]);
+	$foregroud = (int) mysqli_real_escape_string($con, $_GET[GET_FOREGROUND]);
 	$format = strtolower(mysqli_real_escape_string($con, $_GET[GET_FORMAT]));
 	
 	//Initialize some variables

+ 2 - 2
www/actividades/actividad.php

@@ -201,13 +201,13 @@
 							$res_year = mysqli_query($con, "SELECT year(date) AS year FROM activity WHERE visible = 1 GROUP BY year(date) ORDER BY year DESC;");
 							while($row_year = mysqli_fetch_array($res_year)){
 								echo "<div class='year pointer' onClick=\"toggleElement('year_$row_year[year]');\">";
-								echo "<img class='slid' id='slid_year_$row_year[year]' src='http://$http_host/img/misc/slid-right.png' alt=' '/>" . $row_year['year'];
+								echo("<img class='slid' id='slid_year_$row_year[year]' src='http://$http_host/img/misc/slid-right.png' alt=' '/><span class='fake_a'>$row_year[year]</span>");
 								echo "</div>\n";
 								echo "<div class='list_year pointer' id='list_year_$row_year[year]'>\n";
 								$res_month = mysqli_query($con, "SELECT month(date) AS month FROM activity WHERE visible = 1 AND year(date) = $row_year[year] GROUP BY month(date) ORDER BY month DESC;");
 								while($row_month = mysqli_fetch_array($res_month)){
 									echo "<div class='month pointer' onClick=\"toggleElement('month_$row_year[year]_$row_month[month]');\">";
-									echo "<img class='slid' id='slid_month_$row_year[year]_$row_month[month]' src='http://$http_host/img/misc/slid-right.png' alt=' '/>" . $lng['months'][$row_month['month'] - 1];
+									echo("<img class='slid' id='slid_month_$row_year[year]_$row_month[month]' src='http://$http_host/img/misc/slid-right.png' alt=' '/><span class='fake_a'>" . $lng['months'][$row_month['month'] - 1] . "</span>");
 									echo "</div>\n";
 									echo "<ul id='list_month_$row_year[year]_$row_month[month]' class='activity_list'>\n";
 									$res_title = mysqli_query($con, "SELECT id, permalink, title_$lang AS title FROM activity WHERE visible = 1 AND year(date) = $row_year[year] AND month(date) = '$row_month[month]' ORDER BY date DESC;");

+ 2 - 0
www/css/blog.css

@@ -23,6 +23,8 @@ div#middle_column{
 div#search_panel{
 /* 	padding:		0 1em 1em 1em; */
 	margin-bottom:	1em;
+	border-top:		0.1em solid #000011;
+	text-align:		center;
 }
 
 div#search_panel div#search_panel_inputs{

+ 10 - 6
www/css/m/blog.css

@@ -12,8 +12,9 @@ div#middle_column{
 /* Search form */
 
 div#search_panel{
-	padding:		1em 1em 1em 1em;
+	padding:		0.5em 0 0 0;
 	margin-bottom:	1em;
+	border-top:		0.1em solid #000011;
 }
 
 div#search_panel h3{
@@ -21,14 +22,17 @@ div#search_panel h3{
 }
 
 div#search_panel input[type='text']{
-	display:	inline-block;
-	width:		80%;
-	margin:		auto;
+	display:		block;
+	width:			90%;
+	margin-left:	auto;
+	margin-right:	auto;
 }
 
 div#search_panel input[type='submit']{
-	display:	inline-block;
-	width:		15%;
+	display:		block;
+	width:			90%;
+	margin-left:	auto;
+	margin-right:	auto;
 }
 
 

+ 13 - 10
www/css/ui.css

@@ -62,31 +62,34 @@ body{
 
 /* WARNING: If styles change dhere, make changes on commment scripts */
 input[type="text"], input[type="number"], input[type="date"]{
-	border-radius:		0.5em;
+	border-radius:		0.3em;
 	height:				1.5em;
-	border:				0.4em solid #9cd3d9;
-	color:				#cccccc;
-	background-color:	#223344;
+	border:				0.2em solid #406896;
+	color:				#ccccdc;
+	background-color:	#0F263C;
+	margin:				0.1em;
 }
 
 input[type="button"], input[type="submit"], select{
-	border-radius:		0.5em;
-	height:				2.5em;
-	border:				0.4em solid #9cd3d9;
+	border-radius:		0.3em;
+	height:				2em;
+	border:				0.2em solid #406896;
 	font-weight:		bold;
 	color:				#ffffff;
-	background-color:	#335577;
+	background-color:	#618CB7;
 	cursor:				pointer;
+	margin:				0.1em;
 }
 
 textarea{
-	border-radius:		0.5em;
+	border-radius:		0.3em;
 	min-height:			2em;
 	max-height:			15em;
-	border:				0.4em solid #9cd3d9;
+	border:				0.2em solid #406896;
 	color:				#bbbbbb;
 	background-color:	#223344;
 	resize:				vertical;
+	margin:				0.1em;
 }
 
 /******************************************