V6.5企业空间调用不了自定义字段的解决方法

经用户反应V6.5企业空间里的模板调用不了会员系统的自定义字段,经官方测试证实确实存在这个问题,原因是企业空间的标签替换函数没有去查询会员表.解决方法如下:

打开KS_Cls/Kesion.SpaceCls.asp找到,函数:ReplaceEnterpriseInfo代码如下:

Function ReplaceEnterpriseInfo(ByVal Content,username)
     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
    if isnull(RS("Mobile")) then
    Content=Replace(Content,"{$GetMobile}","---")
    else
    Content=Replace(Content,"{$GetMobile}",RS("mobile"))
    end if
    if isnull(RS("QQ")) then
    Content=Replace(Content,"{$GetQQ}","---")
    else
    Content=Replace(Content,"{$GetQQ}",RS("QQ"))
    end if
    if isnull(RS("Email")) then
    Content=Replace(Content,"{$GetEmail}","---")
    else
    Content=Replace(Content,"{$GetEmail}",RS("Email"))
    end if


    Content =ReplaceUserDefine(101,Content,RS)
    ReplaceEnterpriseInfo=Content
 End Function

我们将其替换成

 Function ReplaceEnterpriseInfo(ByVal Content,username)
    On Error Resume Next
    Dim RS:Set RS=Server.CreateObject("ADODB.RECORDSET")
    RS.Open "Select top 1 a.classid,a.smallclassid,a.CompanyName as myCompanyName,BusinessLicense,profession,Companyscale,Contactman,a.ZipCode as myZipCode,a.telphone as mytelphone,a.province as myprovince,a.city as mycity,a.address as myaddress,a.fax as myfax,a.Mobile as mymobile,a.qq as myqq,a.email as myemail,weburl,bankaccount,accountnumber,b.* From KS_EnterPrise a inner join ks_user b on a.username=b.username Where a.UserName='" & UserName & "'",conn,1,1
    IF RS.Eof Then
     RS.Close:Set RS=Nothing
  ReplaceEnterpriseInfo=""
    End If
    Content=Replace(Content,"{$GetCompanyName}",RS("myCompanyName"))
    if isnull(RS("BusinessLicense")) then
    Content=Replace(Content,"{$GetBusinessLicense}","---")
    else
    Content=Replace(Content,"{$GetBusinessLicense}",RS("BusinessLicense"))
    end if
    if instr(content,"{$GetProfession}")<>0 then
    Content=Replace(Content,"{$GetProfession}",conn.execute("select top 1 classname from ks_enterpriseclass where id=" &RS("classid"))(0)&"-" &conn.execute("select top 1 classname from ks_enterpriseclass where id=" &RS("smallclassid"))(0))
    end if
    if isnull(RS("Companyscale")) then
    Content=Replace(Content,"{$GetCompanyScale}","---")
    else
    Content=Replace(Content,"{$GetCompanyScale}",RS("Companyscale"))
    end if
    if isnull(rs("myprovince")) then
    Content=Replace(Content,"{$GetProvince}","---")
    else
    Content=Replace(Content,"{$GetProvince}",RS("myprovince"))
    end if
    if isnull(rs("mycity")) then
    Content=Replace(Content,"{$GetCity}","---")
    else
    Content=Replace(Content,"{$GetCity}",RS("mycity"))
    end if
    if isnull(RS("Contactman")) then
    Content=Replace(Content,"{$GetContactMan}","---")
    else
    Content=Replace(Content,"{$GetContactMan}",RS("Contactman"))
    end if
    if isnull(RS("myaddress")) then
    Content=Replace(Content,"{$GetAddress}","---")
    else
    Content=Replace(Content,"{$GetAddress}",RS("myaddress"))
    end if
    if isnull(RS("myZipCode")) Then
    Content=Replace(Content,"{$GetZipCode}","---")
    Else
    Content=Replace(Content,"{$GetZipCode}",RS("myzipcode"))
    End If
       If Isnull(RS("mytelphone")) Then
    Content=Replace(Content,"{$GetTelphone}","---")
    Else
    Content=Replace(Content,"{$GetTelphone}",RS("mytelphone"))
    End If
   
    If IsNull(rs("myfax")) then
    Content=Replace(Content,"{$GetFax}","---")
    else
    Content=Replace(Content,"{$GetFax}",RS("myfax"))
    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
    if isnull(RS("myMobile")) then
    Content=Replace(Content,"{$GetMobile}","---")
    else
    Content=Replace(Content,"{$GetMobile}",RS("mymobile"))
    end if
    if isnull(RS("myQQ")) then
    Content=Replace(Content,"{$GetQQ}","---")
    else
    Content=Replace(Content,"{$GetQQ}",RS("myQQ"))
    end if
    if isnull(RS("myEmail")) then
    Content=Replace(Content,"{$GetEmail}","---")
    else
    Content=Replace(Content,"{$GetEmail}",RS("myEmail"))
    end if


    Content =ReplaceUserDefine(101,Content,RS)
    ReplaceEnterpriseInfo=Content
 End Function

 

这样替换后,在企业空间里就可以直接通过{$KS_自定义字段名称}调用到会员表的数据了.

tips:不仅在config/space.xml文件里可以调用,经测试也可以直接在企业空间的首页模板和其它页模板里调用


【本站声明】
  1、本站文章中所选用的图片及文字来源于网络以及用户投稿,由于未联系到知识产权人或未发现有关知识产权的登记,如有知识产权人并不愿意我们使用,如果有侵权请立即联系。
  2、本网站不对文章中所涉及的内容真实性、准确性、可靠性负责,仅系客观性描述,如您需要了解该类商品/服务详细的资讯,请您直接与该类商品/服务的提供者联系。


KESION 科汛软件

KESION 科汛软件是国内领先的在线教育软件及私域社交电商软件服务提供商,长期专注于为企业提供在线教育软件及社交电商SaaS平台解决方案。
公司核心产品云开店SaaS社交电商服务平台、在线教育SaaS服务平台、教育企业数字化SaaS云平台、企微营销助手、私有化独立部署品牌网校和在线教育咨询等。

KESION 不断通过技术创新,提供产品和服务,助力企业向数字化转型,通过科技驱动商业革新,让商业变得更智慧!



▼点击进入科汛官网了解更多



热门标签
上/下篇
  • 没有升级6.5的6.0用户,相关信息出错的解决方法

  • V6.5快线支付接口支付成功无法返回的修改方法

换一换相关推荐
  • 暂无相关信息!
  • 精选内容
    热点精选