");
s=replace(s,"[/URL]","");
s=replace(s,"\r\n","
");
return s;//.replaceAll("\r\n","
");
}
public String replace(String parentStr,String ch,String rep)//第一个参数是 字符串 第二个参数是 要查找的字符串
{
int i = parentStr.indexOf(ch);
StringBuffer sb = new StringBuffer();
if (i == -1)
return parentStr; //如果没有要查找的字符串 返回原串
sb.append(parentStr.substring(0,i) + rep);
if (i+ch.length() < parentStr.length())
sb.append(replace(parentStr.substring(i+ch.length(),parentStr.length()),ch,rep));
return sb.toString();
}
%>
<%
String sql="SELECT title,time,content,t.name,n.origin,type FROM news n left join news_type t on n.type=t.id WHERE n.id = "+id;
String[][] sqlResult=DBQueryer.getResultStrings(sql);
String title="";
String time="";
String content="";
String type="";
String origin="";
String typeid="";
if(sqlResult!=null && sqlResult.length>0){
title=sqlResult[0][0];
time=sqlResult[0][1];
content=sqlResult[0][2];
type=sqlResult[0][3];
origin=sqlResult[0][4];
typeid=sqlResult[0][5];
}
if("4".equals(typeid)){
%>
<%
}
content=strFormat(content);
String sqlatt="select fid,filetitle,filepath from news_att where nid="+id;
String rs[][]=DBQueryer.getResultStrings(sqlatt);
%>
当前位置: <%=type %>
<%=(title.length()>43)?(title.substring(0,43)+"
"+title.substring(43,title.length())):title %>
可再生能源工程造价信息网 | 时间:<%=time%> | 文章来源:<%=origin %>
<%=content %>
<%if(rs!=null){%>
<%for(int i=0;i
附件<%=i+1 %>:" target="_blank"><%=rs[i][1] %>
<%}}%>