首页四格的路径/template/default/forum/discuz.htm
下面是discuz.htm里面四格默认代码
<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>1、查找下面这个代码,把里面的数字1改为2,并把下面的代码添加到这里的上面
{eval $k = 1;}2、添加下面这个代码在上面的代码上面
slideImgs[1] = '图片链接'; slideImgLinks[1] = '帖子网址,或其他网址'; slideImgTexts[1] = '帖子标题,或广告、公告标题';
修改后的首页四格
<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']}'; slideImgs[1] = '图片链接'; slideImgLinks[1] = '帖子网址'; slideImgTexts[1] = '帖子标题'; {eval $k = 2;} <!--{loop $grids['slide'] $stid $svalue}--> slideImgs[<!--{echo $k}-->] = '$svalue[image]'; slideImgLinks[<!--{echo $k}-->] = '{$svalue[url]}'; slideImgTexts[<!--{echo $k}-->] = '$svalue[subject]'; {eval $k++;} <!--{/loop}--> </script>
标签:style,svalue,discuz,slideImgTexts,四格,首页,var,new,slideImgLinks From: https://www.cnblogs.com/moyini/p/16840346.html