preview.ctrl.php 858 B

1234567891011121314151617
  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. $dos = array('home');
  8. $do = in_array($do, $dos) ? $do : exit('Access Denied');
  9. if ($do == 'home') {
  10. $multiid = intval($_GPC['multiid']);
  11. $multi = pdo_fetch("SELECT styleid FROM ".tablename('site_multi')." WHERE id = :id", array(':id' => $multiid));
  12. $sql = 'SELECT `s`.*, `t`.`name` AS `tname`, `t`.`title` FROM ' . tablename('site_styles') . ' AS `s`
  13. LEFT JOIN ' . tablename('site_templates') . ' AS `t` ON `s`.`templateid` = `t`.`id` WHERE `s`.`uniacid` = :uniacid AND s.id = :styleid';
  14. $style = pdo_fetch($sql, array(':uniacid' => $_W['uniacid'], ':styleid' => $multi['styleid']), 'id');
  15. template("../{$style['tname']}/home/home");
  16. }