Merge pull request !71 from Brownsugar/DIY_extend

This commit is contained in:
Brownsugar 2017-06-03 17:39:36 +08:00 committed by Discuz!
commit 4ef56bada9
3 changed files with 14 additions and 0 deletions

View File

@ -45,6 +45,10 @@ class block_thread extends discuz_block {
'type' => 'mselect', 'type' => 'mselect',
'value' => array() 'value' => array()
), ),
'reply' => array(
'title' => 'threadlist_reply',
'type' => 'radio'
),
'digest' => array( 'digest' => array(
'title' => 'threadlist_digest', 'title' => 'threadlist_digest',
'type' => 'mcheckbox', 'type' => 'mcheckbox',
@ -189,6 +193,7 @@ class block_thread extends discuz_block {
'sorturl' => array('name' => lang('blockclass', 'blockclass_thread_field_sorturl'), 'formtype' => 'text', 'datatype' => 'string'), 'sorturl' => array('name' => lang('blockclass', 'blockclass_thread_field_sorturl'), 'formtype' => 'text', 'datatype' => 'string'),
'posts' => array('name' => lang('blockclass', 'blockclass_thread_field_posts'), 'formtype' => 'text', 'datatype' => 'int'), 'posts' => array('name' => lang('blockclass', 'blockclass_thread_field_posts'), 'formtype' => 'text', 'datatype' => 'int'),
'todayposts' => array('name' => lang('blockclass', 'blockclass_thread_field_todayposts'), 'formtype' => 'text', 'datatype' => 'int'), 'todayposts' => array('name' => lang('blockclass', 'blockclass_thread_field_todayposts'), 'formtype' => 'text', 'datatype' => 'int'),
'lastposter' => array('name' => lang('blockclass', 'blockclass_thread_field_lastposter'), 'formtype' => 'string', 'datatype' => 'string'),
'lastpost' => array('name' => lang('blockclass', 'blockclass_thread_field_lastpost'), 'formtype' => 'date', 'datatype' => 'date'), 'lastpost' => array('name' => lang('blockclass', 'blockclass_thread_field_lastpost'), 'formtype' => 'date', 'datatype' => 'date'),
'dateline' => array('name' => lang('blockclass', 'blockclass_thread_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'), 'dateline' => array('name' => lang('blockclass', 'blockclass_thread_field_dateline'), 'formtype' => 'date', 'datatype' => 'date'),
'replies' => array('name' => lang('blockclass', 'blockclass_thread_field_replies'), 'formtype' => 'text', 'datatype' => 'int'), 'replies' => array('name' => lang('blockclass', 'blockclass_thread_field_replies'), 'formtype' => 'text', 'datatype' => 'int'),
@ -256,11 +261,13 @@ class block_thread extends discuz_block {
$digest = isset($parameter['digest']) ? $parameter['digest'] : 0; $digest = isset($parameter['digest']) ? $parameter['digest'] : 0;
$stick = isset($parameter['stick']) ? $parameter['stick'] : 0; $stick = isset($parameter['stick']) ? $parameter['stick'] : 0;
$orderby = isset($parameter['orderby']) ? (in_array($parameter['orderby'],array('lastpost','dateline','replies','views','heats','recommends')) ? $parameter['orderby'] : 'lastpost') : 'lastpost'; $orderby = isset($parameter['orderby']) ? (in_array($parameter['orderby'],array('lastpost','dateline','replies','views','heats','recommends')) ? $parameter['orderby'] : 'lastpost') : 'lastpost';
$lastposter = !empty($parameter['lastposter']) ? $parameter['lastposter'] : '';
$lastpost = isset($parameter['lastpost']) ? intval($parameter['lastpost']) : 0; $lastpost = isset($parameter['lastpost']) ? intval($parameter['lastpost']) : 0;
$postdateline = isset($parameter['postdateline']) ? intval($parameter['postdateline']) : 0; $postdateline = isset($parameter['postdateline']) ? intval($parameter['postdateline']) : 0;
$titlelength = !empty($parameter['titlelength']) ? intval($parameter['titlelength']) : 40; $titlelength = !empty($parameter['titlelength']) ? intval($parameter['titlelength']) : 40;
$summarylength = !empty($parameter['summarylength']) ? intval($parameter['summarylength']) : 80; $summarylength = !empty($parameter['summarylength']) ? intval($parameter['summarylength']) : 80;
$recommend = !empty($parameter['recommend']) ? 1 : 0; $recommend = !empty($parameter['recommend']) ? 1 : 0;
$reply = !empty($parameter['reply']);
$keyword = !empty($parameter['keyword']) ? $parameter['keyword'] : ''; $keyword = !empty($parameter['keyword']) ? $parameter['keyword'] : '';
$tagkeyword = !empty($parameter['tagkeyword']) ? $parameter['tagkeyword'] : ''; $tagkeyword = !empty($parameter['tagkeyword']) ? $parameter['tagkeyword'] : '';
$typeids = !empty($parameter['typeids']) ? explode(',',$parameter['typeids']) : array(); $typeids = !empty($parameter['typeids']) ? explode(',',$parameter['typeids']) : array();
@ -343,6 +350,10 @@ class block_thread extends discuz_block {
$sqlfrom .= " $joinmethod JOIN `".DB::table('forum_forumrecommend')."` fc ON fc.tid=t.tid"; $sqlfrom .= " $joinmethod JOIN `".DB::table('forum_forumrecommend')."` fc ON fc.tid=t.tid";
} }
if($reply) {
$sql .= " AND t.replies>'0'";
}
if($tagids) { if($tagids) {
$sqlfrom .= " $joinmethod JOIN `".DB::table('common_tagitem')."` tim ON tim.tagid IN (".dimplode(array_keys($tagids)).") AND tim.itemid=t.tid AND tim.idtype='tid' "; $sqlfrom .= " $joinmethod JOIN `".DB::table('common_tagitem')."` tim ON tim.tagid IN (".dimplode(array_keys($tagids)).") AND tim.itemid=t.tid AND tim.idtype='tid' ";
} }
@ -383,6 +394,7 @@ class block_thread extends discuz_block {
'avatar_big' => avatar(($data['author'] ? $data['authorid'] : 0), 'big', true, false, false, $_G['setting']['ucenterurl']), 'avatar_big' => avatar(($data['author'] ? $data['authorid'] : 0), 'big', true, false, false, $_G['setting']['ucenterurl']),
'posts' => $data['posts'], 'posts' => $data['posts'],
'todayposts' => $data['todayposts'], 'todayposts' => $data['todayposts'],
'lastposter' => str_replace('\\\'', ''', addslashes($data['lastposter'])),
'lastpost' => $data['lastpost'], 'lastpost' => $data['lastpost'],
'dateline' => $data['dateline'], 'dateline' => $data['dateline'],
'replies' => $data['replies'], 'replies' => $data['replies'],

View File

@ -39,6 +39,7 @@ $lang = array
'threadlist_sortids' => '分类信息', 'threadlist_sortids' => '分类信息',
'threadlist_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤', 'threadlist_sortids_comment' => '设置特定分类信息的主题。注意: 全选或全不选均为不进行任何过滤',
'threadlist_sortids_all' => '全部的分类信息', 'threadlist_sortids_all' => '全部的分类信息',
'threadlist_reply' => '无回复主题过滤',
'threadlist_digest' => '精华主题过滤', 'threadlist_digest' => '精华主题过滤',
'threadlist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤', 'threadlist_digest_comment' => '设置特定的主题范围。注意: 全选或全不选均为不进行任何过滤',
'threadlist_digest_0' => '普通主题', 'threadlist_digest_0' => '普通主题',

View File

@ -65,6 +65,7 @@ $lang = array(
'blockclass_thread_field_sorturl' => '分类信息URL', 'blockclass_thread_field_sorturl' => '分类信息URL',
'blockclass_thread_field_posts' => '总发帖数', 'blockclass_thread_field_posts' => '总发帖数',
'blockclass_thread_field_todayposts' => '今日发帖数', 'blockclass_thread_field_todayposts' => '今日发帖数',
'blockclass_thread_field_lastposter' => '最后回复作者',
'blockclass_thread_field_lastpost' => '最后回复时间', 'blockclass_thread_field_lastpost' => '最后回复时间',
'blockclass_thread_field_dateline' => '发帖时间', 'blockclass_thread_field_dateline' => '发帖时间',
'blockclass_thread_field_replies' => '回复数', 'blockclass_thread_field_replies' => '回复数',