Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. # Close Theme
  2. if not self.sentinel:
  3. self.RequireLevel(self.userTypeNeededForPeutModerer)
  4. else:
  5. if not str(self.forum_id) in self.sf:
  6. self.RequireLevel(self.userTypeNeededForPeutModerer)
  7. p = ByteArray(data)
  8. thread_id, closed = p.readInt(), p.readBoolean()
  9. Cursor.execute("SELECT closed FROM forum_threads where thread_id=?", [thread_id])
  10. page = None
  11.  
  12. if int(Cursor.fetchone()[0]) == 0:
  13. #Cursor.execute("INSERT INTO forum_log VALUES(?, ?, ?, ?, ?)", (self.username, self.f, [self.username, self.forum_id, thread_id, "", "Konu Kilitlendi."])
  14. Cursor.execute("UPDATE forum_threads SET closed=1 WHERE thread_id = ?", [thread_id])
  15. Cursor.execute("UPDATE forum_threads SET last_forum_id=? WHERE thread_id = ?", [self.forum_id,thread_id])
  16. if self.forum_id != 1 and data.endswith('\x01'):
  17. Cursor.execute("UPDATE forum_threads SET forum_id=551 WHERE thread_id = ?", [thread_id])
  18. Cursor.execute("UPDATE forum_comments SET forum_id=551 WHERE thread_id = ?", [thread_id])
  19. page = 551
  20. else:
  21. page = self.forum_id
  22. else:
  23. if data.endswith('\x01'):
  24. #Cursor.execute("INSERT INTO forum_log VALUES(?, ?, ?, ?, ?)", [self.username, self.forum_id, thread_id, "", "Konu Kilidi Kaldırıldı."])
  25. Cursor.execute("UPDATE forum_threads SET forum_id=611 WHERE thread_id = ?", [thread_id])
  26. Cursor.execute("UPDATE forum_comments SET forum_id=611 WHERE thread_id = ?", [thread_id])
  27. self.openForums(self.forum_id,0)
  28. self.openThread(-1, 0)
  29. Cursor.execute("DELETE FROM forum_threads where thread_id = ?", [thread_id])
  30. Cursor.execute("DELETE FROM forum_comments where thread_id = ?", [thread_id])
  31. else:
  32. Cursor.execute("UPDATE forum_threads SET closed=0 WHERE thread_id = ?", [thread_id])
  33. Cursor.execute("SELECT last_forum_id FROM forum_threads where thread_id=?", [thread_id])
  34. page = Cursor.fetchone()[0]
  35. Cursor.execute("UPDATE forum_threads SET forum_id=? WHERE thread_id = ?", [page,thread_id])
  36. Cursor.execute("UPDATE forum_comments SET forum_id=? WHERE thread_id = ?", [page,thread_id])
  37.  
  38. if closed:
  39. try:
  40. Cursor.execute("SELECT forum_id FROM forum_threads where thread_id=?", [thread_id])
  41. rrf = Cursor.fetchone()
  42. page = rrf[0]
  43. except:
  44. pass
  45.  
  46. self.openForums(page,0)
  47. self.openThread(-1, 0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement