site.php 986 B

1234567891011121314151617181920212223242526272829
  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 NewsModuleSite extends WeModuleSite {
  8. public function doMobileDetail() {
  9. global $_W, $_GPC;
  10. $id = intval($_GPC['id']);
  11. $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE `id`=:id";
  12. $row = pdo_fetch($sql, array(':id'=>$id));
  13. if (!empty($row['url'])) {
  14. header("Location: ".$row['url']);
  15. }
  16. $row = istripslashes($row);
  17. $title = $row['title'];
  18. if($_W['os'] == 'android' && $_W['container'] == 'wechat' && $_W['account']['account']) {
  19. $subscribeurl = "weixin://profile/{$_W['account']['account']}";
  20. } else {
  21. $sql = 'SELECT `subscribeurl` FROM ' . tablename('account_wechats') . " WHERE `acid` = :acid";
  22. $subscribeurl = pdo_fetchcolumn($sql, array(':acid' => intval($_W['acid'])));
  23. }
  24. include $this->template('detail');
  25. }
  26. }