- {get sql="SELECT a.contentid,a.catid,a.title,a.style,a.url,a.thumb,a.description,a.updatetime,a.inputtime FROM `ezzcc_content` a, `ezzcc_content_position` p WHERE a.status=99 AND a.contentid=p.contentid AND p.posid=7 $arrchildid ORDER BY a.contentid DESC limit 0,4"}
- {php $flash_texts .= str_replace('"',"'",$r[title]).'|';$flash_pics .= $r[thumb].'|';$flash_links .= $r[url].'|';$arr=array('/n','/r','/r/n','"',' ');$flash_des .= str_replace($arr,"",str_cut($r[description],50)).'|';}
- {/get} //Vevb.com
上面是从推荐位获取四组幻灯片,并进行了一些字符串处理,代码如下:
- {php $flash_texts=substr($flash_texts,0,-1);$flash_pics=substr($flash_pics,0,-1);$flash_links=substr($flash_links,0,-1);$flash_des=substr($flash_des,0,-1);}
- <SCRIPT type=text/javascript>
- var pics_b="{$flash_pics}";
- var pics_s="{$flash_pics}";
- var mylinks="{$flash_link}";
- var texts="{$flash_texts}";
- var texts_con="{$flash_des}";
- var sohuFlash2 = new sohuFlash("templates/201007/skins/201007/images/flash/pz1.swf","sohuFlashID01","332","290","4","#d7d7d7");
- sohuFlash2.addParam("quality", "high");
- sohuFlash2.addParam("salign", "t");
- sohuFlash2.addVariable("b",pics_b);
- sohuFlash2.addVariable("p",pics_s);
- sohuFlash2.addVariable("l",mylinks);
- sohuFlash2.addVariable("icon",texts);
- sohuFlash2.addVariable("icon2",texts_con);
- sohuFlash2.write("flashcontent01");
- </script>
新闻热点
疑难解答