processor.php 762 B

123456789101112131415161718192021
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. defined('IN_IA') or exit('Access Denied');
  7. class BasicModuleProcessor extends WeModuleProcessor {
  8. public function respond() {
  9. $sql = "SELECT * FROM " . tablename('basic_reply') . " WHERE `rid` IN ({$this->rule}) ORDER BY RAND() LIMIT 1";
  10. $reply = pdo_fetch($sql);
  11. if (empty($reply)) {
  12. return false;
  13. }
  14. $reply['content'] = htmlspecialchars_decode($reply['content']);
  15. $reply['content'] = str_replace(array('<br>', '&nbsp;'), array("\n", ' '), $reply['content']);
  16. $reply['content'] = strip_tags($reply['content'], '<a>');
  17. return $this->respText($reply['content']);
  18. }
  19. }