|
楼主 |
发表于 2005-10-26 16:16:36
|
显示全部楼层
还有个问题问一下老大,乔客魅力和经验好象没有的吧,我在数据库里也想调用这两个字段,可是找不到,你们是自己加的吗?
再请教个问题,我首页同样调用article的每个专栏怎么会出现颜色不一致的情况呢?请各位老大进来看一下:http://www.cijizx.cn/
附首页代码如下:
sub main_center_list_pic(cl_type,cl_tnum,cl_cnum,cl_classid)
dim tmp1,tmp2,tmp_title,tmp_tit,tmp_count,tmp_img,tmp_record,tmp_tab,tmp_table,tmp_whe,tmp_where,tmp_url,tmp_topic,tmp_color,tmp_name
dim i:i=0
tmp_where="hidden=1 "
if cl_classid>0 then tmp_where=tmp_where&" and s_id="&cl_classid
select case cl_type
case "shop"
tmp_title="shop"
tmp_tit="商品名称"
tmp_name="发 布 人"
tmp_count="定购次数"
tmp_table="shop_product"
tmp_record="id,name,brand,tim,counter,smallimg"
tmp_whe=" and isgood=1"
case "article"
tmp_title="article"
tmp_tit="校务专栏"
tmp_count="浏览次数"
tmp_img="gif025"
tmp_table="article"
tmp_record="id,topic,username,tim,counter,c_id"
tmp_where="c_id=131"
if cl_classid>0 then tmp_where="c_id="&cl_classid
case "article"
tmp_title="article"
tmp_tit="文章标题"
tmp_count="浏览次数"
tmp_img="gif026"
tmp_table="article"
tmp_record="id,topic,username,tim,counter,c_id"
tmp_where="c_id=132"
if cl_classid>0 then tmp_where="c_id="&cl_classid
case "article"
tmp_title="article"
tmp_tit="文章标题"
tmp_count="浏览次数"
tmp_img="gif027"
tmp_table="article"
tmp_record="id,topic,username,tim,counter,c_id"
tmp_where="c_id=133"
if cl_classid>0 then tmp_where="c_id="&cl_classid
case "article"
tmp_title="article"
tmp_tit="文章标题"
tmp_count="浏览次数"
tmp_img="gif028"
tmp_table="article"
tmp_record="id,topic,username,tim,counter,c_id"
tmp_where="c_id=136"
if cl_classid>0 then tmp_where="c_id="&cl_classid
case "article"
tmp_title="article"
tmp_tit="文章标题"
tmp_count="浏览次数"
tmp_img="gif029"
tmp_table="article"
tmp_record="id,topic,username,tim,counter,c_id"
tmp_where="c_id=135"
if cl_classid>0 then tmp_where="c_id="&cl_classid
case "news"
tmp_title="news"
tmp_tit="新闻标题"
tmp_name="发 布 人"
tmp_count="浏览次数"
tmp_table="news"
tmp_record="id,topic,username,tim,counter,pic"
tmp_img="article"
tmp_whe=" and ispic=1"
case "flea"
tmp_title="flea"
tmp_tit="市场信息"
tmp_name="发 布 人"
tmp_count="浏览次数"
tmp_table="flea"
tmp_record="id,name,username,tim,counter,pic"
tmp_whe=" and isgood=1"
case "video"
tmp_title="video"
tmp_tit="影视名称"
tmp_name="影片主演"
tmp_count="浏览次数"
tmp_table="video"
tmp_record="id,name,role,tim,counter,pic"
tmp_img="video"
tmp_whe=" and star=5"
case "down"
tmp_title="down"
tmp_tit="软件名称"
tmp_name="发 布 人"
tmp_count="下载次数"
tmp_table="down"
tmp_record="id,name,username,tim,counter,pic"
tmp_whe=" and types=5"
case else
cl_type="music_disk"
tmp_title="music_disk"
tmp_tit="专辑名称"
tmp_name="专辑歌手"
tmp_count="浏览次数"
tmp_table="music_disk"
tmp_record="id,name,singer,tim,hits,pic"
tmp_img="music_disk"
tmp_whe=" and istop=1"
end select
sql="select top 1 "&tmp_record&" from "&tmp_table&" where "&tmp_where&tmp_whe&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
if not rs.eof then
tmp1=tmp1&vbcrlf&"<tr align=center>" & _
vbcrlf&"<td width='35%'>"&pic_fk(rs(5),4,""&cl_type&"_view.asp?id="&rs(0))&"</td>" & _
vbcrlf&"<td width='65%'>" & _
vbcrlf&"<table border=0 width='100%' class=tf>" & _
vbcrlf&"<tr><td><b><a href='"&cl_type&"_view.asp?id="&rs(0)&"' alt='"&rs(1)&"'>"&joekoe_cms.code_html(rs(1),1,cl_cnum)&"</a></b></td></tr>" & _
vbcrlf&"<tr><td>发布时间:"&joekoe_cms.time_type(rs(3),4)&"</td></tr>" & _
vbcrlf&"<tr><td>"&tmp_name&":<font class=red2 alt='"&joekoe_cms.code_html(rs(2),1,0)&"'>"&joekoe_cms.code_html(rs(2),1,cl_cnum)&"</font></td></tr>" & _
vbcrlf&"</table>" & _
vbcrlf&"</td>" & _
vbcrlf&"</tr>"
end if
rs.close
tmp1="<table border=0 cellspacing=0 cellpadding=2 width='100%'>"&tmp1&"</table>"
sql="select top "&cl_tnum&" "&tmp_record&" from "&tmp_table&" where "&tmp_where&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
tmp_url=cl_type&"_view.asp?id="&rs(0)
if cl_type="article" then
tmp_color="style=""color:"&rs(5)&";"""
end if
if i mod 2=0 then tmp2=tmp2&vbcrlf&"<tr>"
tmp2=tmp2&vbcrlf&"<td height="&dim_num(6)&">"&img_skin("h_"&tmp_img)&"<a href='"&tmp_url&"' "&tmp_color&" alt='"&tmp_tit&":"&joekoe_cms.code_html(rs(1),1,0)&"<br>"&tmp_name&":"&rs(2)&"<br>"&tmp_count&":"&rs(4)&" 人次<br>整理时间:"&rs(3)&"' target=_blank>"&joekoe_cms.code_html(rs(1),1,cl_cnum)&"</a></td>"
if i+1 mod 2=0 then tmp2=tmp2&vbcrlf&"</tr>"
if i=1 then tmp2=tmp2&vbcrlf&"<tr><td height=1></td></tr>"
rs.movenext
i=i+1
loop
rs.close
tmp2="<table border=0 cellspacing=0 cellpadding=2 width='100%'><tr height=3><td width='50%'></td><td width='50%'></td></tr>"&tmp2&"</table>"
response.write vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 width='100%'><tr>" & _
vbcrlf&"<td height=0 background=''></td>" & _
vbcrlf&"</tr></table>" & _
vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 width='100%'><tr><td height=5></td></tr><tr align=center><td>"&tmp1&"</td></tr>" & _
vbcrlf&"<tr align=center><td>"&tmp2&"</td></tr>" & _
vbcrlf&"</table>"&ukong
end sub
sub main_center_list(cl_type,cl_tnum,cl_cnum,cl_classid)
dim tmp1,tmp_title,tmp_tit,tmp_count,tmp_img,tmp_record,tmp_table,tmp_where,tmp_url,tmp_color,tmp_name
tmp_img=cl_type
tmp_where="hidden=1"
if cl_classid>0 then tmp_where=tmp_where&" and s_id="&cl_classid
select case cl_type
case "forum"
cl_type="forum"
tmp_title="forum"
tmp_tit="论坛标题"
tmp_count="论坛回复"
tmp_img="forum"
tmp_table="bbs_topic"
tmp_record="id,topic,username,tim,re_counter,tcolor,forum_id"
tmp_where="forum_id<>999999999"
if cl_classid>0 then tmp_where="forum_id="&cl_classid
case else
tmp_title="article"
tmp_tit="文章标题"
tmp_count="浏览次数"
tmp_table="article"
tmp_record="id,topic,username,tim,counter,c_id"
tmp_where="c_id=136ss"
if cl_classid>0 then tmp_where="c_id="&cl_classid
end select
sql="select top "&cl_tnum&" "&tmp_record&" from "&tmp_table&" where "&tmp_where&" order by id desc"
set rs=joekoe_cms.exec(sql,1)
do while not rs.eof
tmp_url=cl_type&"_view.asp?id="&rs(0)
if cl_type="forum" then
tmp_url=cl_type&"_view.asp?forum_id="&rs(6)&"&view_id="&rs(0)
end if
if cl_type="article" or cl_type="news" or cl_type="forum" then
tmp_color="style=""color:"&rs(5)&";"""
end if
tmp1=tmp1&vbcrlf&"<tr><td height="&dim_num(6)&">"&img_skin("h_"&tmp_img)&"<a href='"&tmp_url&"' "&tmp_color&" alt='"&tmp_tit&":"&joekoe_cms.code_html(rs(1),1,0)&"<br>发 布 人:"&rs(2)&"<br>"&tmp_count&":"&rs(4)&" 人次<br>整理时间:"&rs(3)&"' target=_blank>"&joekoe_cms.code_html(rs(1),1,cl_cnum)&"</a><td><td align=right><font color=gray size=1>"&rs("username")&"</font></td></tr><tr><td height=1 background='images/bg_dian.gif'></td></tr>"
rs.movenext
loop
rs.close
tmp1="<table border=0 cellspacing=0 cellpadding=2 width='100%'>"&tmp1&vbcrlf&"</table>"
response.write vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 width='100%'><tr>" & _
vbcrlf&"<td height=0></td>" & _
vbcrlf&"</tr></table>" & _
vbcrlf&"<table border=0 cellspacing=0 cellpadding=0 width='100%'><tr><td height=5></td></tr><tr align=center><td>"&tmp1&"</td></tr>" & _
vbcrlf&"</table>"&ukong
end sub
能帮助我,感激不尽! |
|