discuz首页四格修改有利于SEO吗

查看: 1519|回复: 1
discuz论坛首页四格设置教程
马上注册,还有更多的Discuz教程!享用更多功能,让你轻松玩转Discuz。
才可以下载或查看,没有帐号?
discuz论坛首页四格设置教程
首先登陆我们的网站后台!
后台的默认地址是:http://你的域名/admin.php
& & & & & & & && && && && && && && &&&论坛&&首页四格
14.png (53.58 KB, 下载次数: 29)
discuz论坛首页四格设置教程
12:03 上传
开启后在论坛首页会显示四格内容推荐
是否开启首页四格:在论坛首页展示四格内容
展示风格:图文并茂: 幻灯+新帖+新回复+热帖; 简洁文字:新帖+新回复+精华贴+精华贴;
标题截取长度:设置标题的最大长度,超过的部分将被截取掉, 单位:字符
数据来源版块:数据来源版块,默认为所有版块
是否显示主题高亮:在首页四格中显示主题高亮效果
是否在新窗口打开:在新窗口中打开链接
是否显示帖子信息:鼠标移到标题上方时,显示帖子详细信息
缓存有效期:设置论坛首页四格缓存更新的时间,单位为秒,0代表默认600秒
注意:如果你看完教程不明白的地方,可以跟帖留言,我们会为您详细解答!
本文由DZ起点网原创!转载请说明出处!
就这个首页四格问题一直不能解决,实在没办法只要关闭它不用了。&&
就是后台开启自带的首页四格后选择了图文并茂,数据调用来源也只选择了要调用的几个 板块,可是论坛有两个隐藏板块的帖子也被调用显示到幻灯片播放那里面了,因为隐藏板块的帖子也有图片,就只是幻灯片播放窗口那里调出了隐藏板块的帖子,其它三格都正常的。。到此搜寻至今为找到解决办法
Powered byDiscuz X3自带首页四格开启位置为:后台——论坛——首页四格。
首页四格代码展示位置:template\default\forum\discuz.htm
默认代码如下:
&!–{if !empty($_G['setting']['grid']['showgrid'])}–&
&!– index four grid –&
&div class=&fl bm&&
&div class=&bm bmw cl&&
&div id=&category_grid& class=&bm_c& &
&table cellspacing=&0& cellpadding=&0&&&tr&
&!–{if !$_G['setting']['grid']['gridtype']}–&
&td valign=&top& class=&category_l1&&
&div class=&newimgbox&&
&h4&&span class=&tit_newimg&&&/span&{lang latest_images}&/h4&
&div class=&module cl slidebox_grid& style=&width:218px&&
&script type=&text/javascript&&
var slideSpeed = 5000;
var slideImgsize = [218,200];
var slideBorderColor = ‘{$_G['style']['specialborder']}’;
var slideBgColor = ‘{$_G['style']['commonbg']}’;
var slideImgs = new Array();
var slideImgLinks = new Array();
var slideImgTexts = new Array();
var slideSwitchColor = ‘{$_G['style']['tabletext']}’;
var slideSwitchbgColor = ‘{$_G['style']['commonbg']}’;
var slideSwitchHiColor = ‘{$_G['style']['specialborder']}’;
{eval $k = 1;}
&!–{loop $grids['slide'] $stid $svalue}–&
slideImgs[&!--{echo $k}--&] = ‘$svalue[image]‘;
slideImgLinks[&!--{echo $k}--&] = ‘{$svalue[url]}’;
slideImgTexts[&!--{echo $k}--&] = ‘$svalue[subject]‘;
{eval $k++;}
&!–{/loop}–&
&script language=&javascript& type=&text/javascript& src=&{$_G[setting][jspath]}forum_slide.js?{VERHASH}&&&/script&
&!–{/if}–&
&td valign=&top& class=&category_l2&&
&div class=&subjectbox&&
&h4&&span class=&tit_subject&&&/span&{lang collection_lastthread}&/h4&
&ul class=&category_newlist&&
&!–{loop $grids['newthread'] $thread}–&
&!–{if !$thread['forumstick'] && $thread['closed'] & 1 && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}–&
&!–{eval $thread[tid]=$thread[closed];}–&
&!–{/if}–&
&li&&a href=&forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra&{if $thread['highlight']} $thread['highlight']{/if}{if $_G['setting']['grid']['showtips']} tip=&{lang title}: &strong&$thread[oldsubject]&/strong&&br/&{lang author}: $thread[author] ($thread[dateline])&br/&{lang show}/{lang reply}: $thread[views]/$thread[replies]& onmouseover=&showTip(this)&{else} title=&$thread[oldsubject]&{/if}{if $_G['setting']['grid']['targetblank']} target=&_blank&{/if}&$thread[subject]&/a&&/li&
&!–{/loop}–&
&td valign=&top& class=&category_l3&&
&div class=&replaybox&&
&h4&&span class=&tit_replay&&&/span&{lang show_newthreads}&/h4&
&ul class=&category_newlist&&
&!–{loop $grids['newreply'] $thread}–&
&!–{if !$thread['forumstick'] && $thread['closed'] & 1 && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}–&
&!–{eval $thread[tid]=$thread[closed];}–&
&!–{/if}–&
&li&&a href=&forum.php?mod=redirect&tid=$thread[tid]&goto=lastpost#lastpost&{if $thread['highlight']} $thread['highlight']{/if}{if $_G['setting']['grid']['showtips']}tip=&{lang title}: &strong&$thread[oldsubject]&/strong&&br/&{lang author}: $thread[author] ($thread[dateline])&br/&{lang show}/{lang reply}: $thread[views]/$thread[replies]& onmouseover=&showTip(this)&{else} title=&$thread[oldsubject]&{/if}{if $_G['setting']['grid']['targetblank']} target=&_blank&{/if}&$thread[subject]&/a&&/li&
&!–{/loop}–&
&td valign=&top& class=&category_l3&&
&div class=&hottiebox&&
&h4&&span class=&tit_hottie&&&/span&{lang hot_thread}&/h4&
&ul class=&category_newlist&&
&!–{loop $grids['hot'] $thread}–&
&!–{if !$thread['forumstick'] && $thread['closed'] & 1 && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}–&
&!–{eval $thread[tid]=$thread[closed];}–&
&!–{/if}–&
&li&&a href=&forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra&{if $thread['highlight']} $thread['highlight']{/if}{if $_G['setting']['grid']['showtips']} tip=&{lang title}: &strong&$thread[oldsubject]&/strong&&br/&{lang author}: $thread[author] ($thread[dateline])&br/&{lang show}/{lang reply}: $thread[views]/$thread[replies]& onmouseover=&showTip(this)&{else} title=&$thread[oldsubject]&{/if}{if $_G['setting']['grid']['targetblank']} target=&_blank&{/if}&$thread[subject]&/a&&/li&
&!–{/loop}–&
&!–{if $_G['setting']['grid']['gridtype']}–&
&td valign=&top& class=&category_l4&&
&div class=&goodtiebox&&
&h4&&span class=&tit_goodtie&&&/span&{lang post_digest_thread}&/h4&
&ul class=&category_newlist&&
&!–{loop $grids['digest'] $thread}–&
&!–{if !$thread['forumstick'] && $thread['closed'] & 1 && ($thread['isgroup'] == 1 || $thread['fid'] != $_G['fid'])}–&
&!–{eval $thread[tid]=$thread[closed];}–&
&!–{/if}–&
&li&&a href=&forum.php?mod=viewthread&tid=$thread[tid]&extra=$extra&{if $thread['highlight']} $thread['highlight']{/if}{if $_G['setting']['grid']['showtips']} tip=&{lang title}: &strong&$thread[oldsubject]&/strong&&br/&{lang author}: $thread[author] ($thread[dateline])&br/&{lang show}/{lang reply}: $thread[views]/$thread[replies]& onmouseover=&showTip(this)&{else} title=&$thread[oldsubject]&{/if}{if $_G['setting']['grid']['targetblank']} target=&_blank&{/if}&$thread[subject]&/a&&/li&
&!–{/loop}–&
&!–{/if}–&
&!– index four grid end –&
&!–{/if}–&
以上个别代码说明:
{eval $k = 1;}
&!–{loop $grids['slide'] $stid $svalue}–&
slideImgs[&!--{echo $k}--&] = ‘$svalue[image]‘;
slideImgLinks[&!--{echo $k}--&] = ‘{$svalue[url]}’;
slideImgTexts[&!--{echo $k}--&] = ‘$svalue[subject]‘;
{eval $k++;}
表示图片幻灯片从1开始,有一个幻灯片就会加1,这样会一直循环下去。比如只想显示5张幻灯图片,把$k++改成$k = 5即可。
var slideSpeed = 5000;
var slideImgsize = [218,200];
slideSpeed表示播放速度,slideImgsize表示播放窗口大小。
category_l1是幻灯图片代码区{lang latest_images},category_l2是最后回复{lang collection_lastthread},category_l3是最新帖子{lang show_newthreads}和热门{lang hot_thread},category_l4是精华帖子{lang post_digest_thread},对照代码看,再自己编辑吧
首页四格代码CSS位置:template\default\common\module.css
默认代码如下:
/* 论坛首页四格 by Alice */
#category_grid { padding: 0; border-top:1px solid {COMMONBORDER}; }
#category_grid table { width:100%;table-layout: }
#category_grid td { width: 25%; }
.category_l1, .category_l2, .category_l3, .category_l4 { line-height: 25 background: # overflow: }
.category_l1 { line-height: }
.category_l1, .category_l2, .category_l3 { background: url({IMGDIR}/category_lbg.png) no- }
.ie6 .category_l4 { margin-right: -3 }
.slidebox_grid { position: margin: 10 border: 1px # }
#category_grid h4 { width:100%; height: 30 line-height: 30 text-indent:10 font-size: 12 cursor: background: url({IMGDIR}/tb.png) repeat-x; position: }
.category_newlist { padding: 10 }
.category_newlist li { background:url({IMGDIR}/dot.gif) no-  height: 21 line-height:21 overflow: padding-left:10 }
#category_grid h4 span { background:#CDCDCD; width:1 height:30 display:inline- position: left:0; top:0; }
#category_grid h4 span.tit_newimg { background:#FFF; }
#category_grid .newimgbox:hover h4 span, #category_grid .subjectbox:hover h4 span, #category_grid .replaybox:hover h4 span, #category_grid .hottiebox:hover h4 span, #category_grid .goodtiebox:hover h4 span { width:6 background:url({IMGDIR}/grid.png) no-repeat 0 0;transition:width 0.2s ease 0s; overflow: }
#category_grid .newimgbox:hover h4 span.tit_newimg { background-position:0 -30 }
#category_grid .subjectbox:hover h4 span.tit_subject { background-position:0 0; }
#category_grid .repalybox:hover h4 span.tit_replay { background-position:0 -30 }
#category_grid .hottiebox:hover h4 span.tit_hottie { background-position:0 -60 }
#category_grid .goodtiebox:hover h4 span.tit_goodtie { background-position:0 -90 }
共同探讨,比较喜欢自带的插件!
解决X3自带首页四格最新主题和最新回复一样的问题
由于source\class\table\table_forum_thread.php文件中调用新主题的参数是 newthread,第1105行
if($type == ‘newthread’) {
而source\module\forum\forum_index.php里却是thread,所以默认还是调用的最新回复贴子
$grids['newthread'] = C::t(‘forum_thread’)-&fetch_all_for_guide(‘thread’, 0, array(), 0, 0, 0, 10, $_G['setting']['grid']['fids']);
修改 thread为newthread即可,如下第159行
$grids['newthread'] = C::t(‘forum_thread’)-&fetch_all_for_guide(‘newthread’, 0, array(), 0, 0, 0, 10, $_G['setting']['grid']['fids']);
解决X3自带首页四格幻灯图片最新的图片不在第一显示的问题
X3自带的首页四格幻灯图片的 图片路径、名称==都存放在$grids['slide']数组中
增加一行,对$grids['slide']数组进行一下排序就能让最新的图片显示在第1的位置。
找到source\module\forum\forum_index.php
$grids['slide'][$ithread['tid']] = array(
‘image’ =& $imageurl,
‘url’ =& ‘forum.php?mod=viewthread&tid=’.$ithread['tid'],
‘subject’ =& $ithread['subject']
在上面代码下面增加:
rsort($grids['slide']);
即修改成如下所示代码:
$grids['slide'][$ithread['tid']] = array(
‘image’ =& $imageurl,
‘url’ =& ‘forum.php?mod=viewthread&tid=’.$ithread['tid'],
‘subject’ =& $ithread['subject']
rsort($grids['slide']);
$grids['cachetime'] = TIMESTAMP;
示范论坛demo:
转载请注明来自:[]查看: 71628|回复: 39
首页四格“热帖”不展示的暂时解决方法
本帖最后由 otherbank 于
10:58 编辑
首页四格“热帖”不展示的暂时解决方法:
1、先修改一下程序错误,回帖后热度值不增加;
找到文件&source\class\model\model_forum_post.php&搜索代码$heatthreadset ? $heatthreadset : array();
复制代码修改为:$this-&param['updatethreaddata'] = $heatthreadset ? $heatthreadset : array();
复制代码2、降低一下热门主题显示级别,
默认是50,100,150修改为1,2,3能保证站点很小的情况下也能显示热帖,各站长可以根据自己的实际情况来定:
后台——》全局——》站点功能——》主题热度
QQ截图04.jpg (71.42 KB, 下载次数: 23)
15:57 上传
PS:首页四格的“热帖“默认显示的是站点7天内发布的且热度值达到3级的热帖,如果要修改时间和热度值级别,可以跟帖,我给出解决方案。
找到文件&\source\module\forum\forum_index.php&,在162行左右的代码:$grids['hot'] = C::t('forum_thread')-&fetch_all_for_guide('hot', 0, array(), 3, 0, 0, 10, $_G['setting']['grid']['fids']);复制代码分析如下:$grids['hot'] = C::t('forum_thread')-&fetch_all_for_guide('hot', 0, array(), 3(这是热度级别可以自己修改), 0(这是时间限制), 0, 10, $_G['setting']['grid']['fids']);
复制代码
顶记咚!好帖子!
支持下解决办法
终于出了,哎,急死人了
本帖最后由 178good 于
00:19 编辑
嗯,修改后,好了,谢谢
回帖后热度值不增加&&照到修改以后 还是不出来呢
前排支持下。。。
修改了,表示没反应
Powered by安信网络-十年运营、中国老牌的云主机、高防服务器、虚拟主机、企业邮箱、域名注册服务商!
域名注册云虚拟主机云主机服务器SSL证书企业邮箱手机APP开发
Discuz论坛首页四格(纯DIY版)时间: 22:56:59
首页四格安装说明
majianjun 文件夹为模块用到的图片或样式表文件
xml 文件为导入Discuz X的模块文件
1、把majianjun 文件夹放到 templatedefault 目录下
2、 打开论坛首页,点DIY ,点保存右侧的倒三角 选择导入 然后点保存
版权所有 上海中可信息技术有限公司
《中华人民共和国增值电信业务经营许可证》 沪B2- | 沪ICP备号 | 沪公网安备37号
咨询电话:400-查看: 240|回复: 6
DZ论坛版块内的帖子,可以显示在首页吗?类似首页四格
城市币23879 元
在线时间4641 小时
阅读权限150
主题帖子城市币
实名认证未实名
例如 的& &“域名经验交流“ 设置成 ”不显示版块介绍 和版主名称“,&&而是调用最上面的十几条帖子内容。
&&怎么设置啊?请教
域名经验交流& && && && && && &综合交流区
1、& && && && && && && && && && && && && && && & 1、
2、& && && && && && && && && && && && && && && & 2、
3、& && && && && && && && && && && && && && && & 3、
4、& && && && && && && && && && && && && && && & 4、
5、& && && && && && && && && && && && && && && & 5、
6、& && && && && && && && && && && && && && && & 6、
7、& && && && && && && && && && && && && && && & 7、
8、& && && && && && && && && && && && && && && & 8、
9、& && && && && && && && && && && && && && && & 9、
10、& && && && && && && && && && && && && && & 10、
*.com&&米都出了!
@海云 @阿囧 @cmccvip&&@枪墓传承&&@叶旭建&&@魏志强
城市币23879 元
在线时间4641 小时
阅读权限150
主题帖子城市币
实名认证未实名
最新的内容& &是 在论坛 首页 显示,求设置方法。
*.com&&米都出了!
@海云 @阿囧 @cmccvip&&@枪墓传承&&@叶旭建&&@魏志强
城市币1776 元
在线时间11100 小时
阅读权限150
主题帖子城市币
实名认证已实名
是不是这样?
对,就像最下面那样,不过他这个好像用了别人的模板,模板不好看,
用原版实现就行。。&
cvcv.cn域名投资交流QQ群:5922222
城市币38593 元
在线时间11724 小时
阅读权限150
主题帖子城市币
实名认证已实名
以前用dz做论坛的时候这个很好设置 现在很多年没做过论坛了,已经忘记了
现在米市不好混了,暂时离开,登崩盘再回来,不崩盘 就不回来了。。&
城市币23879 元
在线时间4641 小时
阅读权限150
主题帖子城市币
实名认证未实名
是不是这样? www.hushang.cn
对,就像最下面那样,不过他这个好像用了别人的模板,模板不好看,
用原版实现就行。。
管理员登录后,在前台进行“模块管理”就可以设置数据调用规则了。&
*.com&&米都出了!
@海云 @阿囧 @cmccvip&&@枪墓传承&&@叶旭建&&@魏志强
城市币23879 元
在线时间4641 小时
阅读权限150
主题帖子城市币
实名认证未实名
以前用dz做论坛的时候这个很好设置 现在很多年没做过论坛了,已经忘记了
现在米市不好混了,暂时离开,登崩盘再回来,不崩盘 就不回来了。。
*.com&&米都出了!
@海云 @阿囧 @cmccvip&&@枪墓传承&&@叶旭建&&@魏志强
城市币1776 元
在线时间11100 小时
阅读权限150
主题帖子城市币
实名认证已实名
对,就像最下面那样,不过他这个好像用了别人的模板,模板不好看,
用原版实现就行。。 ...
管理员登录后,在前台进行“模块管理”就可以设置数据调用规则了。
cvcv.cn域名投资交流QQ群:5922222
旗下品牌 -
论坛管理员邮箱:}

我要回帖

更多关于 discuz首页四格 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信