人人商城

processor.php 1.2KB

123456789101112131415161718192021222324252627282930313233343536
  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 CoverModuleProcessor extends WeModuleProcessor {
  8. public function respond() {
  9. global $_W;
  10. $content = $this->message['content'];
  11. $reply = pdo_fetch('SELECT * FROM ' . tablename('cover_reply') . ' WHERE `rid`=:rid', array(':rid' => $this->rule));
  12. if(!empty($reply)) {
  13. load()->model('module');
  14. $module = module_fetch($reply['module']);
  15. if (empty($module) && !in_array($reply['module'], array('site', 'mc', 'card', 'page', 'clerk'))) {
  16. return '';
  17. }
  18. $url = $reply['url'];
  19. if(empty($reply['url'])) {
  20. $entry = pdo_fetch("SELECT eid FROM ".tablename('modules_bindings')." WHERE module = :module AND do = :do", array(':module' => $reply['module'], ':do' => $reply['do']));
  21. $url = url('entry', array('eid' => $entry['eid']));
  22. }
  23. $news = array();
  24. $news[] = array(
  25. 'title' => $reply['title'],
  26. 'description' => $reply['description'],
  27. 'picurl' => $reply['thumb'],
  28. 'url' => $url
  29. );
  30. return $this->respNews($news);
  31. }
  32. return '';
  33. }
  34. }