在商业区看到有用户需要这个功能,考虑到部分免费版本用户也可能用得着待发布修改方法
打开Space/Space.asp,增加替换函数
第一个地方,70行左右:
Template=Replace(Template,"{$BlogMain}","<div id=""blogmain"">" & GetMain & "</div><div id=""kspage"" style=""display:none"" align=""right""></div>")
Template=ReplaceEnterpriseInfo(Template)
Response.Write Template
End Sub
修改的第二个地方,差不多在文件尾:
Function GetEnterpriseShortintro()
On Error Resume Next
GetEnterpriseShortintro=KS.Gottopic(KS.LoseHtml(KS.Htmlcode(Conn.execute("select Intro From KS_EnterPrise where UserName='" & UserName & "'")(0))),580) &" <a href=""intro.asp?username=" & Username & """> 详细>>></a>"
End Function
Function ReplaceEnterpriseInfo(ByVal Content)
On Error Resume Next
Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
RS.Open "Select top 1 * From KS_EnterPrise Where UserName='" & UserName & "'",conn,1,1
IF RS.Eof Then
RS.Close:Set RS=Nothing
ReplaceEnterpriseInfo=""
End If
Content=Replace(Content,"{$GetCompanyName}",RS("CompanyName"))
if isnull(RS("BusinessLicense")) then
Content=Replace(Content,"{$GetBusinessLicense}","---")
else
Content=Replace(Content,"{$GetBusinessLicense}",RS("BusinessLicense"))
end if
if isnull(RS("profession")) then
Content=Replace(Content,"{$GetProfession}","---")
else
Content=Replace(Content,"{$GetProfession}",RS("profession"))
end if
if isnull(RS("Companyscale")) then
Content=Replace(Content,"{$GetCompanyScale}","---")
else
Content=Replace(Content,"{$GetCompanyScale}",RS("Companyscale"))
end if
if isnull(rs("province")) then
Content=Replace(Content,"{$GetProvince}","---")
else
Content=Replace(Content,"{$GetProvince}",RS("province"))
end if
if isnull(rs("city")) then
Content=Replace(Content,"{$GetCity}","---")
else
Content=Replace(Content,"{$GetCity}",RS("city"))
end if
if isnull(RS("Contactman")) then
Content=Replace(Content,"{$GetContactMan}","---")
else
Content=Replace(Content,"{$GetContactMan}",RS("Contactman"))
end if
if isnull(RS("address")) then
Content=Replace(Content,"{$GetAddress}","---")
else
Content=Replace(Content,"{$GetAddress}",RS("address"))
end if
if isnull(RS("ZipCode")) Then
Content=Replace(Content,"{$GetZipCode}","---")
Else
Content=Replace(Content,"{$GetZipCode}",RS("zipcode"))
End If
If Isnull(RS("telphone")) Then
Content=Replace(Content,"{$GetTelphone}","---")
Else
Content=Replace(Content,"{$GetTelphone}",RS("telphone"))
End If
If IsNull(rs("fax")) then
Content=Replace(Content,"{$GetFax}","---")
else
Content=Replace(Content,"{$GetFax}",RS("fax"))
end if
if isnull(rs("weburl")) then
Content=Replace(content,"{$GetWebUrl}","---")
else
Content=Replace(Content,"{$GetWebUrl}",RS("weburl"))
end if
if isnull(rs("bankaccount")) then
Content=Replace(Content,"{$GetBankAccount}","---")
else
Content=Replace(Content,"{$GetBankAccount}",RS("bankaccount"))
end if
if isnull(RS("accountnumber")) then
Content=Replace(Content,"{$GetAccountNumber}","---")
else
Content=Replace(Content,"{$GetAccountNumber}",RS("accountnumber"))
end if
ReplaceEnterpriseInfo=Content
End Function
End Class
以上的红部分为添加的代码.好了这样你的企业空间首页就支持调用企业联系方式了,如电话,传真等
支持的标签如下: