Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[求助] discuz X的portal.php 的源码分析

[复制链接]
googlg 发表于 2013-7-22 17:38:10 | 显示全部楼层 |阅读模式
问题描述
适用版本: Discuz! X3
浏览器: 其他(帖子中请注明浏览器) 
使用模板: 其他模板(请在回帖中说明模板的名称或者是模板的下载地址)
BUG地址: http://www.google.com
本帖最后由 googlg 于 2013-7-22 17:47 编辑

在  http://www.oicto.com/discuzx-portal-php/ 上看到的protal.php 的源码分析:

<?php


/**
*      [Discuz!] (C)2001-2099 Comsenz Inc.
*      This is NOT a freeware, use is subject to license terms
*
*      $Id: portal.php 33234 2013-05-08 04:13:19Z andyzheng $
*/
//====定义app类型id以及当前脚本名称常量====
define('APPTYPEID', 4);
define('CURSCRIPT', 'portal');


//====加载核心类库,函数库====
require './source/class/class_core.php';
require DISCUZ_ROOT.'./source/function/function_home.php';
require DISCUZ_ROOT.'./source/function/function_portal.php';





$discuz = C::app();




//====设置缓存列表====
$cachelist = array('userapp', 'portalcategory', 'diytemplatenameportal');
$discuz->cachelist = $cachelist;


//====初始化系统====
$discuz->init();



if(empty($_GET['mod']) || !in_array($_GET['mod'], array('list', 'view', 'comment', 'portalcp', 'topic', 'attachment', 'rss', 'block'))) $_GET['mod'] = 'index';




define('CURMODULE', $_GET['mod']);
runhooks();
//====判断$_GET['mod']是否为空或是否在允许数组中,如果为空或不存在则更改为index====
$navtitle = str_replace('{bbname}', $_G['setting']['bbname'], $_G['setting']['seotitle']['portal']);
$_G['disabledwidthauto'] = 1;




//====加载source/module/portal/文件夹下的mod文件====
require_once libfile('portal/'.$_GET['mod'], 'module');


?>




不知道对不对,本人菜鸟,在想portal.php 在哪里调用的 template/default/portal/index.htm文件的啊????


hihiweb 发表于 2014-7-20 12:50:53 | 显示全部楼层
有可能是


source/module/portal/ 下的php文件再调用 template/default/portal/index.htm文件
回复

使用道具 举报

 楼主| googlg 发表于 2014-7-20 15:37:52 | 显示全部楼层

应该是对的,那时候我还了解
回复

使用道具 举报

幽壑潜蛟 发表于 2014-7-22 10:07:26 | 显示全部楼层
require_once libfile('portal/'.$_GET['mod'], 'module');引入了source\module\portal\portal_index.php然后在这个文件中调用的模板include_once template('diy:portal/index');
回复

使用道具 举报

 楼主| googlg 发表于 2014-7-25 08:54:45 | 显示全部楼层
幽壑潜蛟 发表于 2014-7-22 10:07
require_once libfile('portal/'.$_GET['mod'], 'module');引入了source\module\portal\portal_index.php然 ...

佩服,分析的很对。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-9-28 05:56 , Processed in 0.452175 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表