Commit 41348585 authored by jan.koester's avatar jan.koester
Browse files

some changes

parent 78c8ec50
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.18)

project(blogi)

SET(CMAKE_CXX_FLAGS "-fPIC -Wall -fstack-check -fstack-protector -fsanitize=address")

list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)

find_package(libnetplus REQUIRED)
+14 −18
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ namespace blogi {

        void contentIdxPage(netplus::con *curcon,libhttppp::HttpRequest *curreq,libhtmlpp::HtmlElement *page,const char *tag,int start,int end){
            libhttppp::HTTPException excep;
            libhtmlpp::HtmlString *condat=new libhtmlpp::HtmlString;
            libhtmlpp::HtmlString condat;

            char url[512];
            std::string sid;
@@ -63,7 +63,6 @@ namespace blogi {
            if (tag) {
                sql = "SELECT id FROM tags where name='"; sql.escaped(tag) << "' LIMIT 1";
                if(Args->database->exec(&sql,res)<1){
                    delete condat;
                    excep[libhttppp::HTTPException::Critical] << "no tag data found for this name!";
                    throw excep;
                }else {
@@ -80,9 +79,9 @@ namespace blogi {
            }

            std::string meta;
            *condat << "<div id=\"contentidx\">";
            condat << "<div id=\"contentidx\">";
            if(Args->auth->isLoggedIn(curreq,sid)){
                *condat << "<div class=\"blog_adminmenu\">"
                condat << "<div class=\"blog_adminmenu\">"
                << "<ul>"
                << "<li><a href=\""<< Args->config->buildurl("content/addpost",url,512) <<"\">Addpost</a></li>"
                << "</ul>"
@@ -90,9 +89,9 @@ namespace blogi {
            }

            if (ncount<1) {
                *condat << " </div>";
                condat << " </div>";
                libhtmlpp::HtmlString out;
                page->getElementbyID("main")->insertChild(condat->parse());;
                page->getElementbyID("main")->insertChild(condat.parse());
                Args->theme->printSite(out,page,curreq->getRequestURL(),Args->auth->isLoggedIn(curreq,sid),meta.c_str());

                libhttppp::HttpResponse resp;
@@ -101,12 +100,11 @@ namespace blogi {
                resp.setContentType("text/html");
                resp.send(curcon,out.c_str(),out.size());

                delete condat;
                return;
            }

            for (int i = 0; i < ncount; i++) {
                *condat << "<div class=\"blog_entry\">"
                condat << "<div class=\"blog_entry\">"
                << "<span class=\"title\">" << res[i][1] << "</span>"
                << "<div  class=\"entry_text\">" << res[i][2] << "</div>"
                << "<span><a href=\""<< Args->config->buildurl("content/read/",url,512) << res[i][0] << "\">Weiterlesen</a> </span>"
@@ -119,15 +117,15 @@ namespace blogi {
                meta.append(" ");
            }

            *condat << "<div id=\"pager\">";
            condat << "<div id=\"pager\">";

            if((start - end) >= 0)
                *condat << "<a href=\"" << curreq->getRequestURL() << "?start=" << (start- end) <<"\" > Zur&uuml;ck </a>";
                condat << "<a href=\"" << curreq->getRequestURL() << "?start=" << (start- end) <<"\" > Zur&uuml;ck </a>";

            if((ncount -10) >= 0 )
                *condat << "<a href=\"" << curreq->getRequestURL() << "?start=" << start+10 <<"\" > Weiter </a>";
                condat << "<a href=\"" << curreq->getRequestURL() << "?start=" << start+10 <<"\" > Weiter </a>";

            *condat << " </div> </div>";
            condat << " </div> </div>";

            sql="SELECT name,id FROM tags";

@@ -135,25 +133,23 @@ namespace blogi {


            if (tcount>0) {
                *condat << "<div id=\"idxtags\"><ul>";
                condat << "<div id=\"idxtags\"><ul>";

                for (int i = 0; i < tcount; i++) {
                    sql="select tag_id FROM tags_content where tag_id = '";
                    sql << res[i][1] << "'";
                    blogi::DBResult rescnt;
                    *condat << "<li><a href=\""
                    condat << "<li><a href=\""
                    << Args->config->buildurl("content/tag/",url,512) << res[i][0] << "\">" << res[i][0] << "(" << Args->database->exec(&sql,rescnt) << ")" << "</a></li>";

                }

                *condat << "</ul></div>";
                condat << "</ul></div>";
            }
            libhtmlpp::HtmlString out;


            page->getElementbyID("main")->insertChild(condat->parse());

            delete condat;
            page->getElementbyID("main")->insertChild(condat.parse());

            Args->theme->printSite(out,page,curreq->getRequestURL(),Args->auth->isLoggedIn(curreq,sid),meta.c_str());

+1 −0
Original line number Diff line number Diff line
@@ -51,6 +51,7 @@ include_directories(
target_link_libraries(blogi
    stdc++
    blogidev
    asan
)

install(
+0 −2
Original line number Diff line number Diff line
@@ -72,8 +72,6 @@ namespace blogi {
            }

            virtual ~Data(){
                delete Column;
                delete nextData;
            }

            int         row;
+0 −2
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@ blogi::Editor::Editor(Config *conf)
}

blogi::Editor::~Editor(){
    delete _firstIcon;
    delete _lastIcon;
}

void blogi::Editor::addIcon(const unsigned char* icon, size_t iconsize,const char *name,const char *type, const char* description){
Loading