<!--首页栏目调用:最新文章标红--> [e:loop={栏目ID/专师ID,显示信息条数,0,0,'',''}]//调用栏目 <table width="100%" border="0" cellspacing="0" cellpadding="0" background="skin/default/images/jg_04.gif" > <? //PHP代码开始 $newimg=""; $title2=sub($bqr[title] ,0,40,false) ;//截取标题字符数 $title=$bqr[title];//标题字符全部显示 if($bqr[title]>$title2)//判断是否截取字符,如为真显示下面标题 { $title="$title2...";//截取标题字符后加省略号 } if(time()-$bqr[newstime]<=7*24*3600)//判断信息发布时间,7为发布的天数即7天内的信息加红 { $newimg="<img src='New图片地址'>";//加以在最新标题后加一个NEW图片 $title1=sub($bqr[title] ,0,40,false) ;//标红标题同样判断是否截取字符为真加省略号 $title="<font color=#FF0000>$title1</font>"; if($bqr[title]>$title1) { $title="<font color=#FF0000>$title1...</font>"; } } //PHP代码结束 ?> <tr><td height="25" width="10" align="center"> <img border="0" src="skin/default/images/Article_common.gif" width="9" height="15"></td> <td width="80%"> <a title="<?=$bqr[title]?>" href="<?=$bqsr[titleurl]?>" target="_blank"><?=$title?></a> </td> <td width="20%">(<?=date('m-d',$bqr[newstime])?>) </td> </tr> </table>[/e:loop] <!--首页栏目调用:最新文章标红-->
|