Pārlūkot izejas kodu

Merge branch 'V3_API' into V3

Iñigo Valentin 8 gadi atpakaļ
vecāks
revīzija
9207e17d77
2 mainītis faili ar 11 papildinājumiem un 6 dzēšanām
  1. 2 2
      www-admin/estadisticas/web/index.php
  2. 9 4
      www/API/v3/sync.php

+ 2 - 2
www-admin/estadisticas/web/index.php

@@ -56,8 +56,8 @@
                             <h3 class='section_title'>Gr&aacute;fico</h3>
                             <div class='entry'>
 <?php
-                                $q_section = mysqli_query($con, "SELECT COUNT(visit) v, section FROM stat_view WHERE section != 'error' AND entry = '' GROUP BY section ORDER BY COUNT(visit)")
-                                $q_blog = mysqli_query($con, "SELECT COUNT(visit) v, section, entry FROM stat_view WHERE section = 'blog' AND entry IS NOT null GROUP section, entry ORDER BY count(visit) DESC LIMIT 4")
+                                $q_section = mysqli_query($con, "SELECT COUNT(visit) v, section FROM stat_view WHERE section != 'error' AND entry = '' GROUP BY section ORDER BY COUNT(visit)");
+                                $q_blog = mysqli_query($con, "SELECT COUNT(visit) v, section, entry FROM stat_view WHERE section = 'blog' AND entry IS NOT null GROUP section, entry ORDER BY count(visit) DESC LIMIT 4");
 ?>
                             </div> <!-- .entry -->
                         </div> <!-- .section -->

+ 9 - 4
www/API/v3/sync.php

@@ -373,9 +373,17 @@
             $str = rtrim($str, ",");
             $str = $str . "}";
             $str = str_replace(",,", ",", $str);
-            echo($str);
+            if (strlen($str > 0)){
+                log_sync($con, $user, $synced);
+                echo($str);
+                http_response_code(200);
+            }
+            else{
+                http_response_code(204);
+            }
             return true;
         }
+        http_response_code(204);
         return false;
     }
 
@@ -472,7 +480,4 @@
     $v_server = get_server_versions($con);
     $tables = select_tables($v_user, $v_server);
     $synced = sync($con, $tables);
-
-    //Log the sync in the database
-    log_sync($con, $user, $synced);
 ?>