Loading plugins/google/google.cpp +5 −4 Changes for plugins/google/google.cpp: 5 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -94,9 +94,10 @@ namespace blogi { dbpp::SQL sql; dbpp::DBResult res; sql << "SELECT author_name, rating, text, approved FROM google_reviews;"; Args->database[tid]->exec(sql, res); for(int i = 0; i < res.getRows(); ++i) { int ncount = Args->database[tid]->exec(sql, res); for(int i = 0; i < ncount; ++i) { std::string author = res[i][0]; int rating = atoi(res[i][1]); bool approved = atoi(res[i][3]) == 1; Loading Loading @@ -137,10 +138,10 @@ namespace blogi { dbpp::SQL sql; dbpp::DBResult res; sql << "SELECT author_name, rating, text, time FROM google_reviews WHERE approved=true;"; Args->database[tid]->exec(sql, res); int ncount = Args->database[tid]->exec(sql, res); json_object *list = json_object_new_array(); for(int i = 0; i < res.getRows(); ++i) { for(int i = 0; i < ncount; ++i) { json_object *rev = json_object_new_object(); json_object_object_add(rev, "author_name", json_object_new_string(res[i][0])); json_object_object_add(rev, "rating", json_object_new_int(atoi(res[i][1]))); Loading Loading
plugins/google/google.cpp +5 −4 Changes for plugins/google/google.cpp: 5 added lines, 4 removed lines. Original line number Diff line number Diff line Loading @@ -94,9 +94,10 @@ namespace blogi { dbpp::SQL sql; dbpp::DBResult res; sql << "SELECT author_name, rating, text, approved FROM google_reviews;"; Args->database[tid]->exec(sql, res); for(int i = 0; i < res.getRows(); ++i) { int ncount = Args->database[tid]->exec(sql, res); for(int i = 0; i < ncount; ++i) { std::string author = res[i][0]; int rating = atoi(res[i][1]); bool approved = atoi(res[i][3]) == 1; Loading Loading @@ -137,10 +138,10 @@ namespace blogi { dbpp::SQL sql; dbpp::DBResult res; sql << "SELECT author_name, rating, text, time FROM google_reviews WHERE approved=true;"; Args->database[tid]->exec(sql, res); int ncount = Args->database[tid]->exec(sql, res); json_object *list = json_object_new_array(); for(int i = 0; i < res.getRows(); ++i) { for(int i = 0; i < ncount; ++i) { json_object *rev = json_object_new_object(); json_object_object_add(rev, "author_name", json_object_new_string(res[i][0])); json_object_object_add(rev, "rating", json_object_new_int(atoi(res[i][1]))); Loading