From e9a0a02f9e17a7a03e39d066c8157285e774a376 Mon Sep 17 00:00:00 2001 From: junk Date: Wed, 31 Mar 2021 06:07:15 -0300 Subject: Nuevos estilos --- cgi/templates/catalog.html | 1 + cgi/templates/stats.html | 61 +++++++++++++++++++--------------------- cgi/templates/txt_archive.html | 2 +- cgi/templates/txt_thread.en.html | 2 ++ cgi/templates/txt_thread.html | 2 ++ cgi/weabot.py | 33 +++++----------------- 6 files changed, 42 insertions(+), 59 deletions(-) (limited to 'cgi') diff --git a/cgi/templates/catalog.html b/cgi/templates/catalog.html index 8c0d80e..d4822ae 100644 --- a/cgi/templates/catalog.html +++ b/cgi/templates/catalog.html @@ -29,4 +29,5 @@ +
\ No newline at end of file diff --git a/cgi/templates/stats.html b/cgi/templates/stats.html index 6cfe4f1..b284d7a 100644 --- a/cgi/templates/stats.html +++ b/cgi/templates/stats.html @@ -5,7 +5,7 @@
-
Bienvenido a Internet Estadísticas
-
- Última actualización: ${timestamp} GMT${tz} - - (en caché) - -
+
+ Bienvenido a Internet Estadísticas +
+
+ Última actualización: ${timestamp} GMT${tz} + + (en caché) + +

@@ -100,12 +102,7 @@ td a{display:block;padding:5px} - - ${iter} - ${iter} - ${iter} - ${iter} - + ${iter} ${board} ${num} ${percent}% @@ -158,6 +155,6 @@ td a{display:block;padding:5px}
- + \ No newline at end of file diff --git a/cgi/templates/txt_archive.html b/cgi/templates/txt_archive.html index 2b5caa3..88b3196 100644 --- a/cgi/templates/txt_archive.html +++ b/cgi/templates/txt_archive.html @@ -68,7 +68,7 @@ -
#{thread['size']}
+
#{thread['size']}

■ Este hilo se encuentra guardado en el archivo

diff --git a/cgi/templates/txt_thread.en.html b/cgi/templates/txt_thread.en.html index 45f8f8e..4b16fca 100644 --- a/cgi/templates/txt_thread.en.html +++ b/cgi/templates/txt_thread.en.html @@ -20,6 +20,8 @@
1000: ?>
The thread got over 1000 posts and has been closed.
+ 950: ?> +
The thread has reached 950 posts. When it reaches 1000 posts it will be closed.
900: ?>
The thread has reached 900 posts. When it reaches 1000 posts it will be closed.
diff --git a/cgi/templates/txt_thread.html b/cgi/templates/txt_thread.html index 18293c1..c8d70d1 100644 --- a/cgi/templates/txt_thread.html +++ b/cgi/templates/txt_thread.html @@ -20,6 +20,8 @@
1000: ?>
El hilo superó los 1000 mensajes y ha sido cerrado. Ya no se puede postear en él.
+ 950: ?> +
El hilo ha recibido más de 950 mensajes. Cuando llegue a 1000 será cerrado.
900: ?>
El hilo ha recibido más de 900 mensajes. Cuando llegue a 1000 será cerrado.
diff --git a/cgi/weabot.py b/cgi/weabot.py index 7e27ca7..eba4c72 100755 --- a/cgi/weabot.py +++ b/cgi/weabot.py @@ -192,8 +192,9 @@ class weabot(object): elif path_split[1] == "api": import api caught = True - self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"), ("Access-Control-Allow-Methods", - "PUT, GET, POST, DELETE, OPTIONS"), ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")] + self.headers = [("Content-Type", "application/json"), ("Access-Control-Allow-Origin", "*"), + ("Access-Control-Allow-Methods", "PUT, GET, POST, DELETE, OPTIONS"), + ("Access-Control-Allow-Headers", "Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With")] OpenDb() api.api(self, path_split) elif path_split[1] == "threadlist": @@ -492,7 +493,7 @@ class weabot(object): message = message.replace("\r", "") # check ! functions before - extend = extend_str = dice = ball = None + extend = extend_str = None if not post["parentid"] and board["dir"] not in ['bai', 'world']: # creating thread @@ -504,20 +505,6 @@ class weabot(object): extend_str = res.group(0) message = message[res.end(0):] - if board["dir"] in ['juegos', '0', 'polka']: - __dice = re.compile(r"^!dado(:\w+)(:\w+)?\n") - res = __dice.match(message) - if res: - dice = res.groups() - message = message[res.end(0):] - - if board["dir"] in ['zonavip', '0', 'polka']: - __ball = re.compile(r"^!bola8\n") - res = __ball.match(message) - if res: - ball = True - message = message[res.end(0):] - # use and format message if message.strip(): post["message"] = format_post( @@ -527,10 +514,6 @@ class weabot(object): if extend_str: extend_str = extend_str.replace('!extend', 'EXTEND') post["message"] += '
' + extend_str + ' configurado.' - if dice: - post["message"] += '
' + throw_dice(dice) - if ball: - post["message"] += '
' + magic_ball() if not post["parentid"] and post["email"].lower() == 'sage': post["email"] = "" @@ -1016,12 +999,11 @@ class weabot(object): # 1 week = 604800 query_day = FetchAll("SELECT DATE_FORMAT(FROM_UNIXTIME(FLOOR((timestamp-10800)/86400)*86400+86400), \"%Y-%m-%d\"), COUNT(1), COUNT(IF(parentid=0, 1, NULL)) " "FROM posts " - "WHERE (timestamp-10800) > (UNIX_TIMESTAMP()-604800) AND (IS_DELETED = 0 OR IS_DELETED = 3) " + "WHERE (timestamp-10800) > (UNIX_TIMESTAMP()-604800) AND (IS_DELETED = 0) " "GROUP BY FLOOR((timestamp-10800)/86400) " "ORDER BY FLOOR((timestamp-10800)/86400)", 0) - query_count = FetchOne( - "SELECT COUNT(1), COUNT(NULLIF(file, '')), VERSION() FROM posts", 0) + query_count = FetchOne("SELECT COUNT(1), COUNT(NULLIF(file, '')), VERSION() FROM posts", 0) total = int(query_count[0]) total_files = int(query_count[1]) mysql_ver = query_count[2] @@ -1033,8 +1015,7 @@ class weabot(object): for date, count, threads in query_day[1:]: days.append((date, count, threads)) - query_b = FetchAll( - "SELECT id, dir, name FROM boards WHERE boards.secret = 0", 0) + query_b = FetchAll("SELECT id, dir, name FROM boards WHERE boards.secret = 0", 0) boards = [] totalp = 0 -- cgit v1.2.1-18-gbd029