Loading plugins/staticpage/static.cpp +3 −19 Changes for plugins/staticpage/static.cpp: 3 added lines, 19 removed lines. Original line number Diff line number Diff line Loading @@ -516,7 +516,6 @@ bool blogi::StaticPage::Controller(const int tid,libhttppp::HttpRequest &req,lib std::string surl=req.getRequestURL().substr(Args->config->buildurl("staticpage/").length(), req.getRequestURL().length()-Args->config->buildurl("staticpage/").length()); libhtmlpp::HtmlString condat; libhttppp::HTTPException excep; dbpp::SQL sql; Loading @@ -530,24 +529,8 @@ bool blogi::StaticPage::Controller(const int tid,libhttppp::HttpRequest &req,lib throw excep; } libhtmlpp::HtmlString out; condat << "<div id=\"content\" class=\"staticpage\" >" << res[0][1] << "</div>"; try { page->getElementbyID("main")->insertChild(condat.parse()); } catch(libhtmlpp::HTMLException &e) { std::cerr << "staticpage: HTML error in '" << surl << "': " << e.what() << std::endl; // Retry with content as plain text so the page still displays something libhtmlpp::HtmlElement content("div"); content.setAttribute("id","content"); content.setAttribute("class","staticpage"); if(res[0][1]) content.appendChild(libhtmlpp::TextElement(res[0][1])); page->getElementbyID("main")->appendChild(content); } std::string text = res[0][1] ? res[0][1] : ""; RenderPublished(tid, text, nullptr, *page); libhtmlpp::HtmlElement canon("link"); std::stringstream href; Loading @@ -557,6 +540,7 @@ bool blogi::StaticPage::Controller(const int tid,libhttppp::HttpRequest &req,lib if(page->getElementbyTag("head")) page->getElementbyTag("head")->appendChild(canon); libhtmlpp::HtmlString out; Args->theme->printSite(tid,out,page,req.getRequestURL(),Args->auth->isLoggedIn(tid,req,sessionid),res[0][2]); libhttppp::HttpResponse resp; Loading src/edit.h +4 −1 Changes for src/edit.h: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -49,7 +49,10 @@ namespace blogi { void Renderer( libhttppp::HttpRequest& curreq, const int tid, const std::string &sessionid,const libhtmlpp::HtmlElement &index, const std::string &rootEl const std::string &rootEl, Plugin *plugins = nullptr, const std::string &publishTarget = "", json_object *publishParams = nullptr ); std::vector<std::string> getPluginNames() const; void JsonApi(const int tid, json_object *request, json_object *response, Plugin *plugins = nullptr); Loading Loading
plugins/staticpage/static.cpp +3 −19 Changes for plugins/staticpage/static.cpp: 3 added lines, 19 removed lines. Original line number Diff line number Diff line Loading @@ -516,7 +516,6 @@ bool blogi::StaticPage::Controller(const int tid,libhttppp::HttpRequest &req,lib std::string surl=req.getRequestURL().substr(Args->config->buildurl("staticpage/").length(), req.getRequestURL().length()-Args->config->buildurl("staticpage/").length()); libhtmlpp::HtmlString condat; libhttppp::HTTPException excep; dbpp::SQL sql; Loading @@ -530,24 +529,8 @@ bool blogi::StaticPage::Controller(const int tid,libhttppp::HttpRequest &req,lib throw excep; } libhtmlpp::HtmlString out; condat << "<div id=\"content\" class=\"staticpage\" >" << res[0][1] << "</div>"; try { page->getElementbyID("main")->insertChild(condat.parse()); } catch(libhtmlpp::HTMLException &e) { std::cerr << "staticpage: HTML error in '" << surl << "': " << e.what() << std::endl; // Retry with content as plain text so the page still displays something libhtmlpp::HtmlElement content("div"); content.setAttribute("id","content"); content.setAttribute("class","staticpage"); if(res[0][1]) content.appendChild(libhtmlpp::TextElement(res[0][1])); page->getElementbyID("main")->appendChild(content); } std::string text = res[0][1] ? res[0][1] : ""; RenderPublished(tid, text, nullptr, *page); libhtmlpp::HtmlElement canon("link"); std::stringstream href; Loading @@ -557,6 +540,7 @@ bool blogi::StaticPage::Controller(const int tid,libhttppp::HttpRequest &req,lib if(page->getElementbyTag("head")) page->getElementbyTag("head")->appendChild(canon); libhtmlpp::HtmlString out; Args->theme->printSite(tid,out,page,req.getRequestURL(),Args->auth->isLoggedIn(tid,req,sessionid),res[0][2]); libhttppp::HttpResponse resp; Loading
src/edit.h +4 −1 Changes for src/edit.h: 4 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -49,7 +49,10 @@ namespace blogi { void Renderer( libhttppp::HttpRequest& curreq, const int tid, const std::string &sessionid,const libhtmlpp::HtmlElement &index, const std::string &rootEl const std::string &rootEl, Plugin *plugins = nullptr, const std::string &publishTarget = "", json_object *publishParams = nullptr ); std::vector<std::string> getPluginNames() const; void JsonApi(const int tid, json_object *request, json_object *response, Plugin *plugins = nullptr); Loading