- $file = 'portal/portal_topic_content:'.$topicid;
- $tpldirectory = '';
- $primaltplname = $topic['primaltplname'];
- if(strpos($primaltplname, ':') !== false) {
- list($tpldirectory, $primaltplname) = explode(':', $primaltplname);
- }
- $topicurl = fetch_topic_url($topic);
- include template('diy:'.$file, NULL, $tpldirectory, NULL, $primaltplname);
- function portaltopicgetcomment($topcid, $limit = 20, $start = 0) {
- global $_G;
- $topcid = intval($topcid);
- $limit = intval($limit);
- $start = intval($start);
- $data = array();
- if($topcid) {
- $query = C::t('portal_comment')->fetch_all_by_id_idtype($topcid, 'topicid', 'dateline', 'DESC', $start, $limit);
- foreach($query as $value) {
- if($value['status'] == 0 || $value['uid'] == $_G['uid'] || $_G['adminid'] == 1) {
- $data[$value['cid']] = $value;
- }
- }
- }
- return $data;
- }
复制代码 上面的的代码是portal_topic.php截取的,专题页面怎么改能访问到相应的手机页面而不改变原来的机制
关键就在于这一句:- include template('diy:'.$file, NULL, $tpldirectory, NULL, $primaltplname);
复制代码 如果需要手机版也能访问专题,那就需要根据专题ID来判断写法:!qinai!游客!yincang_youke!
|