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>..........

相關文章
相關標籤/搜索