discuz学习记录:最基本的入口、控制、模板3个文件


    

      本学习过程涉及到入口php文件、控制php文件、模板html文件的最基本内容。最终仅显示模板文件的内容。未涉及任何数据库及变量。这个学习过程可以说什么也没干,只是验证了一下动作流程。

    目录及文件:

/gycp.php
/source/module/gycp/gycp_publish.php
/template/default/gycp/gycp_publish.htm


    入口文件 /gycp.php

<?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: gycp.php  cuibq $
 */


define('APPTYPEID', 101);
define('CURSCRIPT', 'gycp');

require './source/class/class_core.php';

$discuz = C::app();

$discuz->reject_robot();
$modarray = array('gycp', 'gycp_publish');


$mod = getgpc('mod');
$mod = (empty($mod) || !in_array($mod, $modarray)) ? 'error' : $mod;


$discuz->init();

define('CURMODULE', $mod);


require DISCUZ_ROOT.'./source/module/gycp/gycp_publish.php';

?>


控制文件 /source/module/gycp/gycp_publish.php

<?php
// mod文件只能被入口文件引用,不能直接访问
if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}



//显示发布表单
include_once template("gycp/gycp_publish");
?>


模板文件 /template/default/gycp/gycp_publish.htm

<!--//说明: 显示公共头部模板-->
<!--{template common/header}-->

<br/>
<br/>
<br/>
<br/>
aaa
<br/>
<br/>
<br/>
<br/>

<!--//说明: 显示公共尾部模板-->
<!--{template common/footer}-->



    




  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值