?? createnewshtml.java
字號:
}
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#href#}", "zixun_list.jsp?news_type="+class_id ); //////////////////////////////////////////////////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#big:title#}", class_name );
strTemp1 = "";
strTemp2 = "";
ArrayList nsList = new NewsInfo().genNewsByNewsType( class_id,9 );
if( nsList != null && nsList.size() > 0 )
{
for( int j = 0; j < nsList.size(); j++ )
{
HashMap newsmap = ( HashMap )nsList.get( j );
String news_id = "";
String cust_id ="";
String title = "",sub_title="";
String content ="";
if( newsmap.get( "news_id" ) != null )
{
news_id = newsmap.get( "news_id" ).toString();
}
if( newsmap.get( "cust_id" ) != null )
{
cust_id = newsmap.get( "cust_id" ).toString();
}
if( newsmap.get( "title" ) != null )
{
title = newsmap.get( "title" ).toString();
if( title.length() > 16 )
{
title = StringUtil.getLimitLengthString( title, "", 33 )+"..";
}
}
if( newsmap.get( "content" ) != null )
{
content = newsmap.get( "content" ).toString();
}
if( j == 0)
{
String filePath = new NewsInfo().getCustAttachPath( news_id, "0");
if( filePath == "" || filePath == null )
{
filePath = "/upload/default.gif";
}
if( content.length() > 30)
{
content = StringUtil.getLimitLengthString( content, "", 28) + "...";
}
strTemp1 = strTemp1 + initStr1;
strTemp1 = StrReplace.replace( strTemp1, "{#src1#}", filePath );
strTemp1 = StrReplace.replace( strTemp1, "{#href1#}", "zixun_list_content.jsp?news_id="+news_id ); //////////////////////////////////////////////////////////////////////////////////
strTemp1 = StrReplace.replace( strTemp1, "{#small:title#}", title );
strTemp1 = StrReplace.replace( strTemp1, "{#content#}", content );
}
else if( j >= 1 && j < nsList.size() )
{
strTemp2 = strTemp2 + initStr2;
strTemp2 = StrReplace.replace( strTemp2, "{#href2#}", "zixun_list_content.jsp?news_id="+news_id ); ///////////////////////////////////////////////////////////////////////////////////
strTemp2 = StrReplace.replace( strTemp2, "{#title#}", title ) ;
}
}
}
str = StrReplace.replace( str, className[i], strTemp );
str = StrReplace.replace(str,classtitle1[i], strTemp1 );
str = StrReplace.replace(str,classtitle2[i], strTemp2 );
}
}
//顯示方式二的新聞
log.LOG_INFO( "顯示方式二的新聞" );
initStr = "<tr><td width=\"5%\"><img src=\"/zone_b2b/images/zse.gif\" width=\"5\" height=\"9\" /></td>"+
"<td width=\"78%\" class=\"bthong\">{#big_title#}</td>"+
"<td width=\"17%\"><a href=\"{#href#}\" class=\"zhong\">更多>></a></td></tr>";
initStr1 = "<tr><td colspan=\"2\"><a href=\"{#href2#}\" class=\"chengonganli\">{#title#}</a> </td>"+
"</tr><tr><td width=\"81\"><img src=\"{#src#}\" alt=\"\" width=\"76\" height=\"75\"></td>"+
"<td width=\"127\">摘要:{#content#}</td></tr>";
ArrayList class2List = new Productclass().genClassByRsrv_str1( "2", 1 );
if( class2List != null && class2List.size() > 0 )
{
for( int i = 0; i < class2List.size(); i++ )
{
strTemp ="";
HashMap map = ( HashMap )class2List.get( i );
String class_id ="";
String class_name ="";
if( map.get( "class_id" ) != null )
{
class_id = map.get( "class_id" ).toString();
}
if( map.get( "class_name" ) != null )
{
class_name = map.get( "class_name" ).toString();
}
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#href#}", "zixun_list.jsp?news_type="+class_id ); //////////////////////////////////////////////////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#big_title#}", class_name );
strTemp1 = "";
ArrayList ns2List = new NewsInfo().genNewsByNewsType( class_id,3 );
if( ns2List != null && ns2List.size() > 0 )
{
for( int j = 0; j < ns2List.size(); j++ )
{
HashMap newsmap = ( HashMap )ns2List.get( j );
String news_id = "";
String cust_id ="";
String title = "",sub_title="";
String content ="";
if( newsmap.get( "news_id" ) != null )
{
news_id = newsmap.get( "news_id" ).toString();
}
if( newsmap.get( "cust_id" ) != null )
{
cust_id = newsmap.get( "cust_id" ).toString();
}
if( newsmap.get( "title" ) != null )
{
title = newsmap.get( "title" ).toString();
if( title.length() > 16 )
{
title = StringUtil.getLimitLengthString( title, "", 30 )+"..";
}
}
if( newsmap.get( "content" ) != null )
{
content = newsmap.get( "content" ).toString();
}
String filePath = new NewsInfo().getCustAttachPath( news_id, "0");
if( filePath == "" || filePath == null )
{
filePath = "/upload/default.gif";
}
if( content.length() > 5)
{
content = StringUtil.getLimitLengthString( content, "", 44) + "...";
}
strTemp1 = strTemp1 + initStr1;
strTemp1 = StrReplace.replace( strTemp1, "{#src#}", filePath );
strTemp1 = StrReplace.replace( strTemp1, "{#href2#}", "zixun_list_content.jsp?news_id="+news_id ); //////////////////////////////////////////////////////////////////////////////////
strTemp1 = StrReplace.replace( strTemp1, "{#title#}", title );
strTemp1 = StrReplace.replace( strTemp1, "{#content#}", content );
}
}
str = StrReplace.replace( str, "{#show:2#}", strTemp );
str = StrReplace.replace( str,"{#show:2:content#}", strTemp1 );
}
}
//顯示方式三的新聞
log.LOG_INFO( "顯示方式三的新聞" );
initStr = " <tr> <td width=\"5%\"><img src=\"/zone_b2b/images/lujian.gif\" width=\"5\" height=\"9\" /></td>"+
"<td width=\"78%\" class=\"btlanse\">{#big_title2#}</td><td width=\"17%\"><a href=\"{#href#}\" class=\"lanse\">更多>></a></td></tr>";
initStr1 = "<li><a href=\"{#href2#}\">·{#title2#}</a></li>";
ArrayList class3List = new Productclass().genClassByRsrv_str1( "3", 1 );
if( class3List != null && class3List.size() > 0 )
{
for( int i = 0; i < class3List.size(); i++ )
{
strTemp ="";
HashMap map = ( HashMap )class3List.get( i );
String class_id ="";
String class_name ="";
if( map.get( "class_id" ) != null )
{
class_id = map.get( "class_id" ).toString();
}
if( map.get( "class_name" ) != null )
{
class_name = map.get( "class_name" ).toString();
}
strTemp = strTemp + initStr;
strTemp = StrReplace.replace( strTemp, "{#href#}", "zixun_list.jsp?news_type="+class_id ); //////////////////////////////////////////////////////////////////////////////////
strTemp = StrReplace.replace( strTemp, "{#big_title2#}", class_name );
strTemp1 = "";
ArrayList ns3List = new NewsInfo().genNewsByNewsType( class_id,10);
if( ns3List != null && ns3List.size() > 0 )
{
for( int j = 0; j < ns3List.size(); j++ )
{
HashMap newsmap = ( HashMap )ns3List.get( j );
String news_id = "";
String cust_id ="";
String title = "",sub_title="";
String content ="";
if( newsmap.get( "news_id" ) != null )
{
news_id = newsmap.get( "news_id" ).toString();
}
if( newsmap.get( "cust_id" ) != null )
{
cust_id = newsmap.get( "cust_id" ).toString();
}
if( newsmap.get( "title" ) != null )
{
title = newsmap.get( "title" ).toString();
if( title.length() > 16 )
{
title = StringUtil.getLimitLengthString( title, "", 30 )+"..";
}
}
strTemp1 = strTemp1 + initStr1;
strTemp1 = StrReplace.replace( strTemp1, "{#href2#}", "zixun_list_content.jsp?news_id="+news_id ); //////////////////////////////////////////////////////////////////////////////////
strTemp1 = StrReplace.replace( strTemp1, "{#title2#}", title );
}
}
str = StrReplace.replace( str, "{#show:3#}", strTemp );
str = StrReplace.replace( str,"{#show:3:title#}", strTemp1 );
}
}
FileIO.SaveToFile(str,filepath);
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -