Phpwind 8.5相关知识点

<1>  关于phpwind的推送php

 

最近在学习phpwind,挺不错的一个开源系统,由于刚开始接触,不少东西都不太熟悉。这是网上看到的一个关于首页推送的东西,感受写的挺不错的,就移植到这里来了。post

http://www.zzbaike.com/wiki/Phpwind_8.5/%E5%86%85%E5%AE%B9%E6%8E%A8%E9%80%81学习

 

<2> 关于phpwind数据表网站

pw_threads:  该表记录帖子的标题,点击次数,回复次数等主要信息this

 

pw_elements:该表主要记录了网站的排行,好比会员的积分、威望、在线时间、帖子点击等。数据字段以下:url

    eid(表主键),type(排行类型,包括usersort、hitsort),id(会员id,活着是帖子id),value(值)。htm

 

<3>关于phpwind URL解析模式的说明,以http://localhost:8080/phpwind/wind/upload/index.php?m=bbs&c=post&a=reply&tid=2为例element

$this->_m = $handlerAdapter->getModule();//m=bbs,bbs是一个模块,以文件夹的形式存在,m默认为bbs
$this->_c = $handlerAdapter->getController();//c=forumlist,forumlistController.php是一个控制器
$this->_a = $handlerAdapter->getAction();//a=XXX,xxx即为控制器中的一个方法
$this->_mc = $this->_m . '/' . $this->_c;
$this->_mca = $this->_mc . '/' . $this->_a;get

 

 

<4>phpWind简单的说也是基于MVC的简单描述以下:it

ACtion:

public function replyAction() {

//获取数据
$pid = $this->getInput('pid');
$this->runHook('c_post_reply', $this->post);
$info = $this->post->getInfo();

//将得到的信息压入模板
$this->setOutput('', 'atc_title');
$this->setOutput('Re:' . $info['subject'], 'default_title');
$this->setOutput('doreply', 'do');
$this->setOutput($info['tid'], 'tid');
$this->setOutput($pid, 'pid');
$this->setOutput('checked', 'reply_notice');

 

//调用模板,模板路径为template/bbs/post_run.htm

$this->setTemplate('post_run');

 }

 

View代码:

...........<ul id="tabTypeHead"> <!--# if ($action == 'reply') { #--> <li class="current"><a href="{@url:bbs/post/reply?tid=$tid}">发表回复</a></li> <!--# } elseif ($action == 'modify') { #--> <li class="current"><a href="{@url:bbs/post/modify?tid=$tid&pid=$pid}">编辑帖子</a></li>..........

相关文章
相关标签/搜索