date support easy

This commit is contained in:
UndeadMaelys
2022-05-05 08:22:53 +02:00
parent 50c30c3788
commit 977b68249d
3 changed files with 96 additions and 2 deletions

View File

@@ -41,6 +41,14 @@ function convo_image(string,alt_text)
end
end
function convo_date(string)
if string then
apply_html("html/convo/header/date/start.html")
print(string)
apply_html("html/convo/header/date/end.html")
end
end
function convo_header_start()
if not header then
header = true
@@ -137,13 +145,24 @@ while p ~= nil do
user[current_user] = user[current_user] or {image = nil}
if nlp and string.sub(text,nl+1,nl+1) == "i" then
user[current_user].image = string.sub(text,nl+3,nlp-1)
skip = 2
skip = skip + 1
nl = string.find(text,"\n",nl+1)
nlp = string.find(text,"\n",nlp+1)
end
convo_image(user[current_user].image)
-- print name
apply_html("html/convo/header/name/start.html")
print(string.sub(text,p+1,np-1))
apply_html("html/convo/header/name/end.html")
-- lets check for dates
if nlp and string.sub(text,nl+1,nl+1) == "d" then
convo_date(string.sub(text,nl+3,nlp-1))
skip = skip + 1
else
convo_date("")
end
header = true
end