Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Close Theme
- if not self.sentinel:
- self.RequireLevel(self.userTypeNeededForPeutModerer)
- else:
- if not str(self.forum_id) in self.sf:
- self.RequireLevel(self.userTypeNeededForPeutModerer)
- p = ByteArray(data)
- thread_id, closed = p.readInt(), p.readBoolean()
- Cursor.execute("SELECT closed FROM forum_threads where thread_id=?", [thread_id])
- page = None
- if int(Cursor.fetchone()[0]) == 0:
- #Cursor.execute("INSERT INTO forum_log VALUES(?, ?, ?, ?, ?)", (self.username, self.f, [self.username, self.forum_id, thread_id, "", "Konu Kilitlendi."])
- Cursor.execute("UPDATE forum_threads SET closed=1 WHERE thread_id = ?", [thread_id])
- Cursor.execute("UPDATE forum_threads SET last_forum_id=? WHERE thread_id = ?", [self.forum_id,thread_id])
- if self.forum_id != 1 and data.endswith('\x01'):
- Cursor.execute("UPDATE forum_threads SET forum_id=551 WHERE thread_id = ?", [thread_id])
- Cursor.execute("UPDATE forum_comments SET forum_id=551 WHERE thread_id = ?", [thread_id])
- page = 551
- else:
- page = self.forum_id
- else:
- if data.endswith('\x01'):
- #Cursor.execute("INSERT INTO forum_log VALUES(?, ?, ?, ?, ?)", [self.username, self.forum_id, thread_id, "", "Konu Kilidi Kaldırıldı."])
- Cursor.execute("UPDATE forum_threads SET forum_id=611 WHERE thread_id = ?", [thread_id])
- Cursor.execute("UPDATE forum_comments SET forum_id=611 WHERE thread_id = ?", [thread_id])
- self.openForums(self.forum_id,0)
- self.openThread(-1, 0)
- Cursor.execute("DELETE FROM forum_threads where thread_id = ?", [thread_id])
- Cursor.execute("DELETE FROM forum_comments where thread_id = ?", [thread_id])
- else:
- Cursor.execute("UPDATE forum_threads SET closed=0 WHERE thread_id = ?", [thread_id])
- Cursor.execute("SELECT last_forum_id FROM forum_threads where thread_id=?", [thread_id])
- page = Cursor.fetchone()[0]
- Cursor.execute("UPDATE forum_threads SET forum_id=? WHERE thread_id = ?", [page,thread_id])
- Cursor.execute("UPDATE forum_comments SET forum_id=? WHERE thread_id = ?", [page,thread_id])
- if closed:
- try:
- Cursor.execute("SELECT forum_id FROM forum_threads where thread_id=?", [thread_id])
- rrf = Cursor.fetchone()
- page = rrf[0]
- except:
- pass
- self.openForums(page,0)
- self.openThread(-1, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement