Loading plugins/content/content.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -594,9 +594,9 @@ namespace blogi { return; } bool Controller(netplus::con * curcon, libhttppp::HttpRequest * req,libhtmlpp::HtmlElement &page){ bool Controller(netplus::con * curcon, libhttppp::HttpRequest * req,libhtmlpp::HtmlElement page){ char url[512]; if(strncmp(req->getRequestURL(),Args->config->buildurl("content",url,512),strlen(Args->config->buildurl("content",url,125)))!=0){ if(strncmp(req->getRequestURL(),Args->config->buildurl("content",url,512),strlen(Args->config->buildurl("content",url,512)))!=0){ return false; } Loading plugins/gameinfo/gameinfo.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ namespace blogi { } } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement &page){ bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ char url[512]; if(strncmp(req->getRequestURL(),Args->config->buildurl("gamestatus",url,512),strlen(Args->config->buildurl("gamestatus",url,512)))!=0){ return false; Loading plugins/navbar/navbar.cpp +13 −19 Original line number Diff line number Diff line Loading @@ -37,11 +37,9 @@ namespace blogi { class Navbar : public PluginApi { public: Navbar(){ Navigation = new libhtmlpp::HtmlElement(); } ~Navbar(){ delete Navigation; } const char* getName(){ Loading @@ -60,12 +58,16 @@ namespace blogi { return; } void Rendering(libhtmlpp::HtmlElement* curpage){ void Rendering(libhttppp::HttpRequest *req,libhtmlpp::HtmlElement& curpage){ blogi::SQL sql; blogi::DBResult res; sql << "select url,name from navbar ORDER BY id"; std::string turl=req->getRequestURL(); if(turl.rfind('?')>0){ turl=turl.substr(0,turl.rfind('?')); } int n = Args->database->exec(&sql,res); if(n<1){ libhttppp::HTTPException excep; Loading @@ -76,13 +78,16 @@ namespace blogi { buf << "<div id=\"navbar\">" << "<ul>"; for (int i = 0; i < n; i++) { buf << "<li "; if(turl.compare(0,strlen(res[i][0]),res[i][0]) == 0 ) buf << "class=\"active\""; else buf << "class=\"inactive\""; buf << "><a href=\"" << res[i][0] << "\">" << res[i][1] << "</a></li>"; } //<li class=\"active\" style=\"padding:1px 10px; float:left\"><a href=\"" << _Config.config->buildurl(index,url,512) <<"\">Blog</a></li> buf << "</ul></div>"; Navigation->appendChild(buf.parse()); Args->theme->Rendering(curpage,"header",Navigation); curpage.getElementbyID("header")->appendChild(buf.parse()); } bool haveSettings(){ Loading @@ -93,20 +98,9 @@ namespace blogi { setdiv << "<div id=\"navsettings\"><span>Navbar Settings</span></div>"; } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req){ std::string turl=req->getRequestURL(); if(turl.rfind('?')>0){ turl=turl.substr(0,turl.rfind('?')); } // if(turl.compare(0,strlen(res[i][0]),res[i][0]) == 0 ) // // buf << "class=\"active\""; // else // bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ return false; } private: libhtmlpp::HtmlElement *Navigation; }; }; Loading plugins/nodeinfo/nodeinfo.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ namespace blogi { } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement &page){ bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ char url[512]; if(strncmp(req->getRequestURL(),Args->config->buildurl("nodeinfo",url,512),strlen(Args->config->buildurl("nodeinfo",url,512)))!=0){ return false; Loading plugins/staticpage/static.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -314,7 +314,7 @@ void blogi::StaticPage::uploadPage(libhttppp::HttpRequest* req, libhtmlpp::HtmlS bool blogi::StaticPage::Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement &page){ bool blogi::StaticPage::Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ char url[512]; if (strncmp(req->getRequestURL(),Args->config->buildurl("staticpage",url,512),strlen(Args->config->buildurl("staticpage",url,512)))==0){ std::string surl=req->getRequestURL()+strlen(Args->config->buildurl("staticpage/",url,512)); Loading Loading
plugins/content/content.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -594,9 +594,9 @@ namespace blogi { return; } bool Controller(netplus::con * curcon, libhttppp::HttpRequest * req,libhtmlpp::HtmlElement &page){ bool Controller(netplus::con * curcon, libhttppp::HttpRequest * req,libhtmlpp::HtmlElement page){ char url[512]; if(strncmp(req->getRequestURL(),Args->config->buildurl("content",url,512),strlen(Args->config->buildurl("content",url,125)))!=0){ if(strncmp(req->getRequestURL(),Args->config->buildurl("content",url,512),strlen(Args->config->buildurl("content",url,512)))!=0){ return false; } Loading
plugins/gameinfo/gameinfo.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -74,7 +74,7 @@ namespace blogi { } } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement &page){ bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ char url[512]; if(strncmp(req->getRequestURL(),Args->config->buildurl("gamestatus",url,512),strlen(Args->config->buildurl("gamestatus",url,512)))!=0){ return false; Loading
plugins/navbar/navbar.cpp +13 −19 Original line number Diff line number Diff line Loading @@ -37,11 +37,9 @@ namespace blogi { class Navbar : public PluginApi { public: Navbar(){ Navigation = new libhtmlpp::HtmlElement(); } ~Navbar(){ delete Navigation; } const char* getName(){ Loading @@ -60,12 +58,16 @@ namespace blogi { return; } void Rendering(libhtmlpp::HtmlElement* curpage){ void Rendering(libhttppp::HttpRequest *req,libhtmlpp::HtmlElement& curpage){ blogi::SQL sql; blogi::DBResult res; sql << "select url,name from navbar ORDER BY id"; std::string turl=req->getRequestURL(); if(turl.rfind('?')>0){ turl=turl.substr(0,turl.rfind('?')); } int n = Args->database->exec(&sql,res); if(n<1){ libhttppp::HTTPException excep; Loading @@ -76,13 +78,16 @@ namespace blogi { buf << "<div id=\"navbar\">" << "<ul>"; for (int i = 0; i < n; i++) { buf << "<li "; if(turl.compare(0,strlen(res[i][0]),res[i][0]) == 0 ) buf << "class=\"active\""; else buf << "class=\"inactive\""; buf << "><a href=\"" << res[i][0] << "\">" << res[i][1] << "</a></li>"; } //<li class=\"active\" style=\"padding:1px 10px; float:left\"><a href=\"" << _Config.config->buildurl(index,url,512) <<"\">Blog</a></li> buf << "</ul></div>"; Navigation->appendChild(buf.parse()); Args->theme->Rendering(curpage,"header",Navigation); curpage.getElementbyID("header")->appendChild(buf.parse()); } bool haveSettings(){ Loading @@ -93,20 +98,9 @@ namespace blogi { setdiv << "<div id=\"navsettings\"><span>Navbar Settings</span></div>"; } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req){ std::string turl=req->getRequestURL(); if(turl.rfind('?')>0){ turl=turl.substr(0,turl.rfind('?')); } // if(turl.compare(0,strlen(res[i][0]),res[i][0]) == 0 ) // // buf << "class=\"active\""; // else // bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ return false; } private: libhtmlpp::HtmlElement *Navigation; }; }; Loading
plugins/nodeinfo/nodeinfo.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -57,7 +57,7 @@ namespace blogi { } bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement &page){ bool Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ char url[512]; if(strncmp(req->getRequestURL(),Args->config->buildurl("nodeinfo",url,512),strlen(Args->config->buildurl("nodeinfo",url,512)))!=0){ return false; Loading
plugins/staticpage/static.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -314,7 +314,7 @@ void blogi::StaticPage::uploadPage(libhttppp::HttpRequest* req, libhtmlpp::HtmlS bool blogi::StaticPage::Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement &page){ bool blogi::StaticPage::Controller(netplus::con *curcon,libhttppp::HttpRequest *req,libhtmlpp::HtmlElement page){ char url[512]; if (strncmp(req->getRequestURL(),Args->config->buildurl("staticpage",url,512),strlen(Args->config->buildurl("staticpage",url,512)))==0){ std::string surl=req->getRequestURL()+strlen(Args->config->buildurl("staticpage/",url,512)); Loading