level 1
羞羞的老王🌵
楼主
//该方法返回一个table 用于流动图片
public String DynamicImage(String categoryid,int cut,int width,int height){
StringBuffer imgStr = new StringBuffer();
StringBuffer thePics1 = new StringBuffer();
StringBuffer theLinks1 = new StringBuffer();
StringBuffer theTexts1 = new StringBuffer();
imgStr.append("<div id=picViwer1 align=center></div><SCRIPT src='/databasesys/js/dynamicImage.js' type=text/javascript></SCRIPT>\n<script language=JavaScript>\n");
thePics1.append("var thePics1=\n'");
theLinks1.append("var theLinks1='");
theTexts1.append("var theTexts1='");
List<HashMap> co = this.select("select * from news where title!='系统简介计算机课程管理系统' and title!='毕业设计栏目管理' order by id desc", 1, 6);
int j = 0;
int i = co.size();
for(HashMap b:co)
{
j++;
String id = b.get("id").toString();
String title = b.get("title").toString();
String url = "/databasesys/upfile/"+b.get("picurl");
String purl = "";
if(j!=i){
thePics1.append(url.replaceAll("\n", "")+"|");
theLinks1.append(purl+"|");
theTexts1.append(title+"|");
}
if(j==i)
{
thePics1.append(url.replaceAll("\n", ""));
theLinks1.append("#");
theTexts1.append(title);
}
}
thePics1.append("';");
theLinks1.append("';");
theTexts1.append("';");
imgStr.append(thePics1+"\n");
imgStr.append(theLinks1+"\n");
imgStr.append(theTexts1+"\n");
imgStr.append("\n setPic(thePics1,theLinks1,theTexts1,"+width+","+height+",'picViwer1');</script>");
return imgStr.toString();
}
2020年05月05日 03点05分
1
public String DynamicImage(String categoryid,int cut,int width,int height){
StringBuffer imgStr = new StringBuffer();
StringBuffer thePics1 = new StringBuffer();
StringBuffer theLinks1 = new StringBuffer();
StringBuffer theTexts1 = new StringBuffer();
imgStr.append("<div id=picViwer1 align=center></div><SCRIPT src='/databasesys/js/dynamicImage.js' type=text/javascript></SCRIPT>\n<script language=JavaScript>\n");
thePics1.append("var thePics1=\n'");
theLinks1.append("var theLinks1='");
theTexts1.append("var theTexts1='");
List<HashMap> co = this.select("select * from news where title!='系统简介计算机课程管理系统' and title!='毕业设计栏目管理' order by id desc", 1, 6);
int j = 0;
int i = co.size();
for(HashMap b:co)
{
j++;
String id = b.get("id").toString();
String title = b.get("title").toString();
String url = "/databasesys/upfile/"+b.get("picurl");
String purl = "";
if(j!=i){
thePics1.append(url.replaceAll("\n", "")+"|");
theLinks1.append(purl+"|");
theTexts1.append(title+"|");
}
if(j==i)
{
thePics1.append(url.replaceAll("\n", ""));
theLinks1.append("#");
theTexts1.append(title);
}
}
thePics1.append("';");
theLinks1.append("';");
theTexts1.append("';");
imgStr.append(thePics1+"\n");
imgStr.append(theLinks1+"\n");
imgStr.append(theTexts1+"\n");
imgStr.append("\n setPic(thePics1,theLinks1,theTexts1,"+width+","+height+",'picViwer1');</script>");
return imgStr.toString();
}