Loading plugins/content/content.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ namespace blogi { } libhtmlpp::HtmlString out; if(page->getElementbyID("main")) page->getElementbyID("main")->insertChild(condat.parse()); Args->theme->printSite(tid,out,page,curreq->getRequestURL(),Args->auth->isLoggedIn(tid,curreq,sid),meta.c_str()); Loading src/blogi.cpp +8 −13 Original line number Diff line number Diff line Loading @@ -85,10 +85,9 @@ blogi::Blogi::Blogi(Config *blgcfg,netplus::socket *serversocket) : HttpEvent(se PlgArgs->theme=new Template(tplcfg); Page = new libhtmlpp::HtmlPage; PlgArgs->theme->renderPage(0,"index.html",Page,&Index); MPage = new libhtmlpp::HtmlPage; PlgArgs->theme->renderPage(0,"mobile.html",MPage,&MIndex); PlgArgs->theme->renderPage(0,"index.html",Page,Index); PlgArgs->theme->renderPage(0,"mobile.html",MPage,MIndex); PlgArgs->maxthreads=threads; Loading @@ -109,8 +108,6 @@ blogi::Blogi::~Blogi(){ delete[] PlgArgs->database; delete BlogiPlg; delete PlgArgs; delete Page; delete MPage; } void blogi::Blogi::loginPage(libhttppp::HttpRequest *curreq,const int tid){ Loading Loading @@ -333,14 +330,14 @@ RETRY_REQUEST: } if(!PlgArgs->theme->Controller(tid,curreq)){ libhtmlpp::HtmlElement *index; libhtmlpp::HtmlElement index; if(curreq->isMobile()) index= new libhtmlpp::HtmlElement(MIndex); index=MIndex; else index= new libhtmlpp::HtmlElement(Index);; index=Index; for(blogi::Plugin::PluginData *curplg=BlogiPlg->getFirstPlugin(); curplg; curplg=curplg->getNextPlg()){ curplg->getInstace()->Rendering(tid,curreq,index); curplg->getInstace()->Rendering(tid,curreq,&index); } for(blogi::Plugin::PluginData *curplg=BlogiPlg->getFirstPlugin(); curplg; curplg=curplg->getNextPlg()){ Loading @@ -349,13 +346,11 @@ RETRY_REQUEST: url+="/"; url+=api->getName(); if(strncmp(curreq->getRequestURL(),url.c_str(),url.length())==0){ if(api->Controller(tid,curreq,index)){ delete index; if(api->Controller(tid,curreq,&index)){ return; } } } delete index; libhtmlpp::HtmlString output; libhtmlpp::HtmlString err; Loading src/blogi.h +2 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,8 @@ namespace blogi { void ResponseEvent(libhttppp::HttpRequest *curreq,const int tid,void *args); private: PluginArgs *PlgArgs; libhtmlpp::HtmlPage *Page,*MPage; libhtmlpp::HtmlElement *Index,*MIndex; libhtmlpp::HtmlPage Page,MPage; libhtmlpp::HtmlElement Index,MIndex; blogi::Config *BlogConfig; blogi::Plugin *BlogiPlg; }; Loading src/theme.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ blogi::Template::~Template(){ } void blogi::Template::renderPage(const int tid,const char *name,libhtmlpp::HtmlPage* page, libhtmlpp::HtmlElement** index){ void blogi::Template::renderPage(const int tid,const char *name,libhtmlpp::HtmlPage& page, libhtmlpp::HtmlElement &index){ std::string htmlfile=_Config.Theme; htmlfile.append("/"); htmlfile.append(name); Loading Loading @@ -139,7 +139,7 @@ void blogi::Template::renderPage(const int tid,const char *name,libhtmlpp::HtmlP data.push_back('\0'); page->loadString(**index,data.data()); page.loadString(index,data.data()); } Loading src/theme.h +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ namespace blogi { Template(TemplateConfig &config); ~Template(); void renderPage(const int tid,const char *name,libhtmlpp::HtmlPage *page,libhtmlpp::HtmlElement **index); void renderPage(const int tid,const char *name,libhtmlpp::HtmlPage &page,libhtmlpp::HtmlElement &index); bool Controller(const int tid,libhttppp::HttpRequest *req); Loading Loading
plugins/content/content.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -149,7 +149,7 @@ namespace blogi { } libhtmlpp::HtmlString out; if(page->getElementbyID("main")) page->getElementbyID("main")->insertChild(condat.parse()); Args->theme->printSite(tid,out,page,curreq->getRequestURL(),Args->auth->isLoggedIn(tid,curreq,sid),meta.c_str()); Loading
src/blogi.cpp +8 −13 Original line number Diff line number Diff line Loading @@ -85,10 +85,9 @@ blogi::Blogi::Blogi(Config *blgcfg,netplus::socket *serversocket) : HttpEvent(se PlgArgs->theme=new Template(tplcfg); Page = new libhtmlpp::HtmlPage; PlgArgs->theme->renderPage(0,"index.html",Page,&Index); MPage = new libhtmlpp::HtmlPage; PlgArgs->theme->renderPage(0,"mobile.html",MPage,&MIndex); PlgArgs->theme->renderPage(0,"index.html",Page,Index); PlgArgs->theme->renderPage(0,"mobile.html",MPage,MIndex); PlgArgs->maxthreads=threads; Loading @@ -109,8 +108,6 @@ blogi::Blogi::~Blogi(){ delete[] PlgArgs->database; delete BlogiPlg; delete PlgArgs; delete Page; delete MPage; } void blogi::Blogi::loginPage(libhttppp::HttpRequest *curreq,const int tid){ Loading Loading @@ -333,14 +330,14 @@ RETRY_REQUEST: } if(!PlgArgs->theme->Controller(tid,curreq)){ libhtmlpp::HtmlElement *index; libhtmlpp::HtmlElement index; if(curreq->isMobile()) index= new libhtmlpp::HtmlElement(MIndex); index=MIndex; else index= new libhtmlpp::HtmlElement(Index);; index=Index; for(blogi::Plugin::PluginData *curplg=BlogiPlg->getFirstPlugin(); curplg; curplg=curplg->getNextPlg()){ curplg->getInstace()->Rendering(tid,curreq,index); curplg->getInstace()->Rendering(tid,curreq,&index); } for(blogi::Plugin::PluginData *curplg=BlogiPlg->getFirstPlugin(); curplg; curplg=curplg->getNextPlg()){ Loading @@ -349,13 +346,11 @@ RETRY_REQUEST: url+="/"; url+=api->getName(); if(strncmp(curreq->getRequestURL(),url.c_str(),url.length())==0){ if(api->Controller(tid,curreq,index)){ delete index; if(api->Controller(tid,curreq,&index)){ return; } } } delete index; libhtmlpp::HtmlString output; libhtmlpp::HtmlString err; Loading
src/blogi.h +2 −2 Original line number Diff line number Diff line Loading @@ -44,8 +44,8 @@ namespace blogi { void ResponseEvent(libhttppp::HttpRequest *curreq,const int tid,void *args); private: PluginArgs *PlgArgs; libhtmlpp::HtmlPage *Page,*MPage; libhtmlpp::HtmlElement *Index,*MIndex; libhtmlpp::HtmlPage Page,MPage; libhtmlpp::HtmlElement Index,MIndex; blogi::Config *BlogConfig; blogi::Plugin *BlogiPlg; }; Loading
src/theme.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -109,7 +109,7 @@ blogi::Template::~Template(){ } void blogi::Template::renderPage(const int tid,const char *name,libhtmlpp::HtmlPage* page, libhtmlpp::HtmlElement** index){ void blogi::Template::renderPage(const int tid,const char *name,libhtmlpp::HtmlPage& page, libhtmlpp::HtmlElement &index){ std::string htmlfile=_Config.Theme; htmlfile.append("/"); htmlfile.append(name); Loading Loading @@ -139,7 +139,7 @@ void blogi::Template::renderPage(const int tid,const char *name,libhtmlpp::HtmlP data.push_back('\0'); page->loadString(**index,data.data()); page.loadString(index,data.data()); } Loading
src/theme.h +1 −1 Original line number Diff line number Diff line Loading @@ -67,7 +67,7 @@ namespace blogi { Template(TemplateConfig &config); ~Template(); void renderPage(const int tid,const char *name,libhtmlpp::HtmlPage *page,libhtmlpp::HtmlElement **index); void renderPage(const int tid,const char *name,libhtmlpp::HtmlPage &page,libhtmlpp::HtmlElement &index); bool Controller(const int tid,libhttppp::HttpRequest *req); Loading