人人商城

channel.ctrl.php 2.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. if (!empty($_GPC['styleid'])) {
  8. $_W['account']['styleid'] = $_GPC['styleid'];
  9. $_W['account']['template'] = pdo_fetchcolumn("SELECT name FROM ".tablename('site_templates')." WHERE id = '{$_W['account']['styleid']}'");
  10. }
  11. load()->model('app');
  12. $channel = array('index', 'mc', 'list', 'detail', 'album', 'photo','exchange');
  13. $name = $_GPC['name'];
  14. if ($name == 'home') {
  15. header("Location: ".url('mobile/mc', array('uniacid' => $_W['uniacid'])));
  16. exit;
  17. }
  18. $name = in_array($_GPC['name'], $channel) ? $name : 'index';
  19. if ($name == 'index') {
  20. load()->model('site');
  21. $position = 1;
  22. $title = $_W['account']['name'];
  23. $navs = app_navs($position);
  24. $cover = pdo_fetch("SELECT description, title, thumb FROM ".tablename('cover_reply')." WHERE uniacid = :uniacid AND module = 'wesite'", array(':uniacid' => $_W['uniacid']));
  25. $_share_content = $cover['description'];
  26. $title = $cover['title'];
  27. $_share_img = $cover['thumb'];
  28. } elseif ($name == 'mc') {
  29. $title = '个人中心';
  30. $position = 2;
  31. if (empty($_W['uid']) && empty($_W['openid'])) {
  32. message('非法访问,请重新点击链接进入个人中心!');
  33. }
  34. $navs = app_navs($position);
  35. if (!empty($navs)) {
  36. foreach ($navs as $row) {
  37. $menus[$row['module']][] = $row;
  38. }
  39. foreach ($menus as $module => $row) {
  40. if (count($row) <= 2) {
  41. $menus['other'][$module] = $row;
  42. unset($menus[$module]);
  43. }
  44. }
  45. }
  46. } elseif ($name == 'list') {
  47. header("Location: ".url('mobile/module/list', array('name' => 'site', 'uniacid' => $_W['uniacid'], 'cid' => $_GPC['cid'])));
  48. exit;
  49. } elseif ($name == 'detail') {
  50. header("Location: ".url('mobile/module/detail', array('name' => 'site', 'uniacid' => $_W['uniacid'], 'id' => $_GPC['id'])));
  51. exit;
  52. } elseif ($name == 'album') {
  53. header("Location: ".url('mobile/module/list', array('name' => 'album', 'uniacid' => $_W['uniacid'])));
  54. exit;
  55. } elseif ($name == 'photo') {
  56. header("Location: ".url('mobile/module/detail', array('name' => 'album', 'uniacid' => $_W['uniacid'], 'id' => $_GPC['id'])));
  57. exit;
  58. }
  59. template('channel/'.$name);