-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
82 changed files
with
7,632 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/Src/Cache | ||
/Src/Logs | ||
/Src/Static/Upload | ||
/Src/sitemap.xml |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
class YCComment extends YCBase | ||
{ | ||
/** | ||
* 渲染类型 | ||
* @var unknown | ||
*/ | ||
protected $renderMode = self::RENDER_MODE_NONE; | ||
/** | ||
* 自定义渲染内容 | ||
*/ | ||
protected function __render() | ||
{ | ||
$this->view->display(APP_TEMPLATE . Config::get('@.THEME') . '/Home/Comment/comment.html'); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
Src/Common/Lib/Component/YCCommentList/YCCommentList.class.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
class YCCommentList extends YCBase | ||
{ | ||
/** | ||
* 属性默认值们 | ||
* @var unknown | ||
*/ | ||
protected $attrsDefault = array( | ||
'content_id' => 0, | ||
'comments' => false, | ||
'page' => 1, | ||
'is_child' => false, | ||
'total_records' => 0 | ||
); | ||
/** | ||
* 渲染类型 | ||
* @var unknown | ||
*/ | ||
protected $renderMode = self::RENDER_MODE_NONE; | ||
/** | ||
* comments模版文件路径 | ||
*/ | ||
private $commentsTemplatePath; | ||
/** | ||
* 自定义渲染内容 | ||
*/ | ||
protected function __render() | ||
{ | ||
if(Config::get('Custom.CONTENT_SHOW_STATIC_COMMENTS')) | ||
{ | ||
if(false === $this->comments) | ||
{ | ||
$commentModel = new CommentModel; | ||
$this->comments = $commentModel->where(array('Status'=>COMMENT_STATUS_NORMAL))->orderByNew()->getAssocList($this->content_id,(int)Config::get('@.COMMENTS_SHOW'),$this->page,$totalRecords); | ||
$this->total_records = $totalRecords; | ||
} | ||
$this->renderItem(); | ||
} | ||
} | ||
private function renderItem() | ||
{ | ||
$this->commentsTemplatePath = APP_TEMPLATE . Config::get('@.THEME') . '/Home/Comment/comments.html'; | ||
$this->view->comments = $this->comments; | ||
$this->view->display($this->commentsTemplatePath); | ||
} | ||
public function renderSubItem($comments) | ||
{ | ||
$view = new View(null,$this); | ||
$view->comments = $comments; | ||
$view->display($this->commentsTemplatePath); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.