Modified style

Greentexts now appear correctly, without "reddit spaceing"
This commit is contained in:
Robin Malley 2020-08-18 22:40:09 +00:00
parent 3233af6374
commit e061d1d8a3
2 changed files with 21 additions and 5 deletions

View File

@ -7,6 +7,7 @@ body{
padding:0 10px padding:0 10px
} }
h1,h2,h3{line-height:1.2} h1,h2,h3{line-height:1.2}
p{margin-bottom:0px}
.spoiler,.spoiler2{background:#444} .spoiler,.spoiler2{background:#444}
.spoiler:hover,.spoiler2:hover{color:#FFF} .spoiler:hover,.spoiler2:hover{color:#FFF}
.greentext{color:#282} .greentext{color:#282}

View File

@ -83,6 +83,15 @@ local function sqlassert(...)
return r return r
end end
local function sqlbind(stmnt,call,position,data)
assert(call == "bind" or call == "bind_blob","Bad bind call, call was:" .. call)
local f = stmnt[call](stmnt,position,data)
if f ~= sql.OK then
error(string.format("Failed to %s at %d with %q: %s", call, position, data, db:errmsg()),2)
end
end
print("Hello from init.lua") print("Hello from init.lua")
function configure() function configure()
db = sqlassert(sql.open("data/posts.db")) db = sqlassert(sql.open("data/posts.db"))
@ -563,11 +572,17 @@ function paste(req)
--local iphash = sha3(ip) --local iphash = sha3(ip)
--Don't store this information for now, until I come up --Don't store this information for now, until I come up
--with a more elegent solution. --with a more elegent solution.
assert(stmnt_paste:bind_blob(1,text) == sql.OK)
assert(stmnt_paste:bind(2,esctitle) == sql.OK) sqlbind(stmnt_paste,"bind_blob",1,text)
assert(stmnt_paste:bind(3,-1) == sql.OK) --assert(stmnt_paste:bind_blob(1,text) == sql.OK)
assert(stmnt_paste:bind(4,true) == sql.OK) sqlbind(stmnt_paste,"bind",2,esctitle)
assert(stmnt_paste:bind_blob(5,"") == sql.OK) --assert(stmnt_paste:bind(2,esctitle) == sql.OK)
sqlbind(stmnt_paste,"bind",3,-1)
--assert(stmnt_paste:bind(3,-1) == sql.OK)
sqlbind(stmnt_paste,"bind",4,true)
--assert(stmnt_paste:bind(4,true) == sql.OK)
sqlbind(stmnt_paste,"bind_blob",5,"")
--assert(stmnt_paste:bind_blob(5,"") == sql.OK)
err = do_sql(stmnt_paste) err = do_sql(stmnt_paste)
if err == sql.DONE then if err == sql.DONE then
local rowid = stmnt_paste:last_insert_rowid() local rowid = stmnt_paste:last_insert_rowid()