Commit 8d9d8358 authored by jan.koester's avatar jan.koester
Browse files

test

parent 3eeb2fd8
Loading
Loading
Loading
Loading
+4 −4
Changes for plugins/google/google.cpp: 4 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
#include <plugin.h>
#include <session.h>
#include <blogi.h>
#include <compress.h>

#include <json-c/json.h>

@@ -189,9 +190,9 @@ namespace blogi {
                            dbpp::SQL sqlexist, sql;
                            dbpp::DBResult res;
                            sqlexist << "SELECT author_name FROM google_reviews WHERE author_name='" << author << "';";
                            Args->database[tid]->exec(sqlexist, res);
                            int ncount = Args->database[tid]->exec(sqlexist, res);
                            
                            if (res.getRows() > 0) {
                            if (ncount > 0) {
                                // update
                                sql << "UPDATE google_reviews SET rating='" << rating 
                                    << "', text='" << text << "', time='" << time 
@@ -210,10 +211,9 @@ namespace blogi {
                if(jobj) json_object_put(jobj);

                libhttppp::HttpResponse res;
                res.setVersion(HTTPVERSION(1.1));
                res.setState(HTTP200);
                res.setContentType("application/json");
                res.send(&req, "{\"status\":\"ok\"}", 15);
                sendCompressed(req,res, "{\"status\":\"ok\"}", 15);
                return true;
            }