Server : nginx/1.22.1 System : Linux iZwz9daxib3w3i063fw434Z 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 User : www ( 1000) PHP Version : 5.6.40 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv Directory : /www/wwwroot/www.jkmold.com/phpcms/modules/wap/classes/ |
<?php defined('IN_PHPCMS') or exit('No permission resources.'); class wap_url{ private $urlrules,$categorys,$html_root; public function __construct() { self::set_siteid(); } /** * WAP内容页链接 */ public function show($id, $page = 0, $catid = 0, $typeid = 0, $prefix = '',$data = '',$action = 'edit') { $page = max($page,1); $urls = ''; $urlrules = 'c=index&a=show&catid={$catid}&typeid={$typeid}&id={$id}|c=index&a=show&catid={$catid}&typeid={$typeid}&id={$id}&page={$page}'; $urlrules_arr = explode('|',$urlrules); if($page==1) { $urlrule = $urlrules_arr[0]; } else { $urlrule = $urlrules_arr[1]; } $urls = str_replace(array('{$catid}','{$typeid}','{$id}','{$page}'),array($catid,$typeid,$id,$page),$urlrule); $laststr = substr(trim(WAP_SITEURL), -1); if($laststr=='?'){ $url_arr[0] = $url_arr[1] = WAP_SITEURL.$urls; }else{ $url_arr[0] = $url_arr[1] = WAP_SITEURL.'&'.$urls; } return $url_arr; } /** * 设置站点id */ private function set_siteid() { if(defined('IN_ADMIN')) { $this->siteid = get_siteid(); } else { param::get_cookie('siteid'); $this->siteid = param::get_cookie('siteid'); } } }