<styletype="text/css">#gongao{width:1000px;height:30px;overflow:hidden;line-height:30px;font-size:13px;font-family:'宋体';background:#DDE5ED;color:#0C77CF;font-weight:bold;}#gongao#scroll_begin,#gongao#scroll_end{display:inline}</style><scripttype="text/javascript">functionScrollImgLeft(){varspeed=50;varscroll_begin=document.getElementById("scroll_begin");varscroll_end=document.getElementById("scroll_end");varscroll_div=document.getElementById("scroll_div");scroll_end.innerHTML=scroll_begin.innerHTML;functionMarquee(){if(scroll_end.offsetWidth-scroll_div.scrollLeft<=0)scroll_div.scrollLeft-=scroll_begin.offsetWidth;elsescroll_div.scrollLeft++;}varMyMar=setInterval(Marquee,speed);scroll_div.onmouseover=function(){clearInterval(MyMar);}scroll_div.onmouseout=function(){MyMar=setInterval(Marquee,speed);}}</script><divid="gongao"><divstyle="width:900px;height:30px;margin:0auto;white-space:nowrap;overflow:hidden;"id="scroll_div"class="scroll_div"><divid="scroll_begin">${affiche.content}${affiche.content}${affiche.content}${affiche.content}${affiche.content}${affiche.content}</div><divid="scroll_end"></div></div><scripttype="text/javascript">ScrollImgLeft();</script></div>
经过测试貌似{dede:php}标签中不能直接使用其他普通标签例如:{dede:field.title/},{dede:global.cfg_webname/}但是我们可以通过其他方式来实现相应的功能。{dede:php}print_r($refObj->Fields);{/dede:php}这样的输出可以得到当前页面相关联的一些变量,比如dede:field.title/}中的值也会在这个数组中显示,如果这里要得到标题则可以用$title=$refObj->Fields['title'];现在我们要在dede:php标签中使用全局配置的那些变量如何得到了,我目前是通过嵌套数据库标签得到的,如:{dede:php}$row=$dsql->GetOne("selectvaluefromhnx_sysconfigwherevarname='cfg_webname');print_r($row[value]);{/dede:php}这样就可以得到全局配置的变量里面的值了
dedecms5.7交叉栏目可能有点问题,不能使用,以下操作试试:修改相关文件,实现交叉栏目修改的文件:include/taglib/arclist.lib.php第267行:if($ctag->GetAtt('cross')=='1')改成if($ctag->GetAtt('cross')!='0')第282行:if($arr['crossid']!='')$selquery="SELECTid,topidFROM`dede_arctype`WHEREidIN('{$arr['crossid']}')ANDid<>'{$typeid}'ANDtopid<>'{$typeid}'";改成if($arr['crossid']!='')$selquery="SELECTid,topidFROM`dede_arctype`WHEREidIN({$arr['crossid']})ANDid<>'{$typeid}'ANDtopid<>'{$typeid}'";后台在后台栏目里面设置好要交叉,生成相关的栏目列表,这时我们就能看到我们想要的效果了,灵活的运用交叉栏目能够很好的帮助我们实现我们想要的特效。
dede默认的分页是2个不同的url,如下:www.hack001.com/lm/index.htmlwww.hack001.com/lm/list_1.html从seo角度考虑,不是很好(其实也无所谓啦),现在需要把这2个一样的url都搞成index.html,以免网站逼格不够,修改方法如下:1,找到\include\arc.listview.class.php这个文件,将$typedir=ereg_replace('{cmspath}',$GLOBALS['cfg_cmspath'],$this->Fields['typedir']);这段代码添加到"//获得上一页和主页的链接"前面;2,找到下面几行代码(就在"//获得上一页和主页的链接"下面)if($this->PageNo!=1){$prepage.="<li><ahref='".str_replace("{page}",$prepagenum,$tnamerule)."'>上一页</a></li>\r\n";$indexpage="<li><ahref='".str_replace("{page}",1,$tnamerule)."'>首页</a></li>\r\n";}改成:if($this->PageNo!=1){if($prepagenum==1){$prepage.="<li><ahref=\"".$typedir."/\">上一页</a></li>\r\n";}else{$prepage.="<li><ahref=\"".str_replace("{page}",$prepagenum,$tnamerule)."\">上一页</a></li>\r\n";}$indexpage="<li><ahref=\"".$typedir."/\">首页</a></li>\r\n";}3.找到$listdd.="<li><ahref='".str_replace("{page}",$j,$tnamerule)."'>".$j."</a></li>\r\n";改成:if($j==1){$listdd.="<li><ahref=\"".$typedir."/\">".$j."</a></li>\r\n";}else{$listdd.="<li><ahref=\"".str_replace("{page}",$j,$tnamerule)."\">".$j."</a></li>\r\n";}分页url问题解决。