"
end if
if rsArticles.EOF then
buffer = buffer & "
"
else
buffer = buffer & "
"
end if
buffer = buffer & "
"
buffer = buffer & "
" & sName & "
" & sBody & " ...
"
buffer = buffer & "
"
if rsArticles.eof then
buffer = buffer & "
"
end if
fCount = fCount + 1
Wend
if fCount >= MAXFEATURE then
buffer = buffer & "
"
rsArticles.Close
set rsArticles = Nothing
End If
BuildConditionLandingPage = buffer
End Function
Function TruncateAtWord (str, size)
dim FullText, myText, lastSpaceAt
FullText = str
myText = Left( FullText, size )
lastSpaceAt = InStrRev( myText , " " )
If lastSpaceAt > 0 Then
myText = Left( myText , lastSpaceAt )
TruncateAtWord = myText
End If
End Function
Function BuildMidCol()
dim style
if Num4thColAdsInCollection = 0 then
if ret_blnLNAV then
style = "style=""left:186px;"""
end if
Response.Write "
"
else
if ret_blnLNAV then
style = "style=""left:182px;"""
else
style = "style=""width:790px;"""
end if
Response.Write "
"
end if
If len(sHeaderImageName) > 0 Then
' Force header image (it is part of the paid advertisement)
ret_blnHeaderImage = True
call DisplayHeaderImageCCStyle (sHeaderImageName)
End If
Response.Write "
"
Response.Write newsHTML
Response.Write "
"
If IsNumeric(ArticleID) Then
response.write ("
")
End If
Response.Write "
" ' midCol
End Function
''' the calling of this function has been disabled
Function BuildThirdCol()
If len(ArticleID) > 0 Or len(ConditionID) > 0 Then
Response.Write "
"
If Not ret_blnWideFormat Then
Response.Write objRightCol.TopXModules(1)
End If
'DisplayRelatedArticleLinks()
'DisplayRelatedMaterialsLinks()
If CouponID > 0 Then
DisplayCoupon(CouponID)
End If
' was -> If PromotionID > 0 And SupplierID > 0 Then
If SupplierID > 0 Then
DisplayB2CTile(SupplierID)
End If
Response.Write ""
Set objRightCol = Nothing
Response.Write "
"
Else
Call BuildRightColDiv()
End If
End Function
Function BuildFourthColumnCustom()
Response.Write "
"
Call GetFeaturedArticle ()
If Not ret_blnContentGenius And ret_TileAdsPosition = POSITION_RIGHT Then
'Response.Write GetPGAds() ' comment out, no ads anymore
End If
' coupon module
if sCouponId <> 0 and ArticleId > 0 then
response.write "
"
response.write "
"
else if ArticleId > 0 then
response.write "
"
end if
end if
' was If PromotionID > 0 And SupplierID > 0 And ArticleID > 0 Then
If SupplierID > 0 And ArticleID > 0 Then
DisplayB2CTile(SupplierID)
End If
Call DisplayConditionCenterLinks()
Response.Write "
"
End Function
Function GetFeaturedArticle()
dim rsFA
Set rsFA = server.CreateObject("ADODB.Recordset")
' first lets pull in a featured article on top
'Response.Write "" & vbCrLf
rsFA.Open "spPGGetWGFeaturedArticle " & ret_oid & ",1", MSCS
if not rsFA.eof then
response.write "
"
end if
rsFA.close
set rsFA = Nothing
End function
Function DisplayRelatedArticleLinks()
Dim sHTML
Dim rsLinks
If IsNumeric(ConditionID) and IsNumeric(ArticleID) and ArticleID > 0 Then
set rsLinks = server.CreateObject("ADODB.Recordset")
sSQL = "Exec spPGGetRelatedArticleLinks " & ConditionID & ", " & ArticleID
'Response.Write "" & vbCrLf
rsLinks.Open sSQL, MSCS ' using MSCS database connection
If Not rsLinks.EOF Then
sHTML = sHTML & "
"
sHTML = sHTML & " |
"
While Not rsLinks.EOF
sHTML = sHTML & " | "
sHTML = sHTML & "" & rsLinks("Name") & " |
"
rsLinks.MoveNext
Wend
sHTML = sHTML & "
" & vbCrLf
sHTML = sHTML & "
" & vbCrLf
Response.Write sHTML
End If
End If
End Function
Function DisplayRelatedMaterialsLinks()
Dim sHTML
sHTML = sHTML & "
"
sHTML = sHTML & " |
"
sHTML = sHTML & " | "
sHTML = sHTML & "Wellness Center |
"
sHTML = sHTML & "
" & vbCrLf
sHTML = sHTML & "
|
" & vbCrLf
Response.Write sHTML
End Function
Function DisplayConditionCenter()
Dim rsCC, htmlCC
Dim iCount
Set rsCC=server.CreateObject("ADODB.Recordset")
sSQL = "select distinct a.OID, a.Name from mpd..Condition a where OID in " & _
"(select distinct x.ConditionID from mpd..ConditionArticle x, mpd..Article Y where x.ArticleID = y.OID and y.elevated = 1 and (getdate() between StartDate and EndDate)) order by a.Name"
'Response.Write "" & vbCrLf
With rsCC
.CursorLocation = 3 ' adUseClient
.CursorType = 3
.Open sSQL,mscs
set .ActiveConnection = Nothing
End With
If Not rsCC.EOF Then
htmlCC = htmlCC & ""
htmlCC = htmlCC & ""
End If
rsCC.close
set rsCC = nothing
DisplayConditionCenter = htmlCC
End Function
Function DisplayCoupon(ByVal CouponID)
Dim sHTML
Dim CouponServer, Coupon
Set CouponServer = Server.CreateObject("LNCouponServer.CouponsHES")
CouponServer.ConnectionString = WGConnStr
CouponServer.RetailerGUID = ret_store_id
CouponServer.RetailerPK = ret_oid
CouponServer.LNDomainName = Application("ln_domain_name")
Set Coupon = CouponServer.GetLivNatCouponByID(CouponID)
If DateDiff("d", Coupon.ExpirationDate , Now()) > 0 Then
Exit Function
End If
sHTML = sHTML & "
" & vbCrLf
sHTML = sHTML & " |
"
sHTML = sHTML & " |
" & vbCrLf
sHTML = sHTML & "" & Coupon.Offer & " |
" & vbCrLf
sHTML = sHTML & "
" & vbCrLf
sHTML = sHTML & "
" & vbCrLf
sHTML = sHTML & " |
" & vbCrLf
sHTML = sHTML & "
" & vbCrLf
Response.Write sHTML
End Function
Function DisplayB2CTile(ByVal SupplierID)
Dim rsTile, PromotionIDForTile
Dim sHTML, BannerAd
Dim objPGAdServer
Response.Write "" & vbCrLf
set rsTile = mscs.execute("spPGGetTileID " & ret_oid & ", " & SupplierID)
If rsTile.EOF Then
Exit Function
End If
PromotionIDForTile = rsTile(0)
Response.Write "" & vbCrLf
Set objPGAdServer = Server.CreateObject("LNPromoGenius.AdServer")
Call objPGAdServer.Init(PGConnStr, SOURCE_WEBGENIUS, ret_oid, mscsShopperID)
Set BannerAd = objPGAdServer.GetB2CTileForCluster(PromotionIDForTile, ret_store_id)
If IsObject(BannerAd) Then
If Not BannerAd Is Nothing Then
sHTML = BannerAd.AdHTML(SOURCE_WEBGENIUS, ret_oid, mscsShopperID)
End If
End If
response.Write sHTML
End Function
Function DisplayConditionCenterLinks()
Dim sHTML
Dim rsLinks
set rsLinks = server.CreateObject("ADODB.Recordset")
sSQL = "Exec spPGGetConditionCenterLinks "
rsLinks.Open sSQL, MSCS ' using MSCS database connection
sHTML = sHTML & "
|
" & vbCrLf
sHTML = sHTML & "
"
sHTML = sHTML & " |
"
While Not rsLinks.EOF
sHTML = sHTML & " | "
sHTML = sHTML & "" & rsLinks("Name") & " |
"
rsLinks.MoveNext
Wend
sHTML = sHTML & "
" & vbCrLf
Response.Write sHTML
End Function
Function ReadNSContent(ByVal iContentID)
Dim rsMono, cmd, sTitle, DocID, OID
Dim rsSection, sArticleDesc, strHTML
Dim sHeader, sSections, sMonographCategory
Dim AlsoListedAs, sCategory
Dim QuickLinks, QuickLinksCount, sType
Dim SectionName
Dim sPicture
Dim iCount
Dim IntegrativeTherapyLinks
Set cmd = Server.CreateObject("ADODB.Command")
With cmd
Set .ActiveConnection = MSCS
.CommandText = "spNSGetDocByDocID"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@DocID", adVarchar, adParamInput, 50, iContentID)
set rsMono = .Execute (, , adCmdStoredProc)
End With
Set cmd = Nothing
If Not rsMono.EOF Then
sTitle = rsMono("Title").Value
sArticleDesc = rsMono("Description").Value
sType = rsMono("Type")
sCategory = rsMono("Category")
sMonographCategory = rsMono("MonographCategory")
sPicture = "" & rsMono("Picture")
DocID = "" & rsMono("DocID")
iContentID = DocID
oid = rsMono("oid")
End If
'If len("" & sTitle) = 0 Then
' sTitle = GetTitle()
'End If
Set cmd = Server.CreateObject("ADODB.Command")
With cmd
Set .ActiveConnection = MSCS
.CommandText = "spNSGetDocSections"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@DocID", adVarchar, adParamInput, 50, iContentID)
.Parameters.Append .CreateParameter("@RetailerID", adInteger, adParamInput, 4, ret_oid)
End With
set rsSection = Server.CreateObject("ADODB.Recordset")
With rsSection
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.ActiveConnection = MSCS
.Open cmd
.ActiveConnection = Nothing
End With
Set cmd = Nothing
' main div and table
strHTML = strHTML & "
" & _
"
" & _
"
"
' removed breadcrumb
' wrapper around sections
strHTML = strHTML & "" & _
" | " & _
"" & _
" " & _
" "
While Not rsSection.EOF
If rsSection("Name").Value = "AlsoListedAs" Then
AlsoListedAs = rsSection("HTML")
ElseIf rsSection("Name").Value = "IntegrativeTherapyLinks" Then
IntegrativeTherapyLinks = rsSection("HTML")
IntegrativeTherapyLinks = replace (IntegrativeTherapyLinks, "DisplayMonograph.asp?", "/ns/DisplayMonograph.asp?")
' this was cuz displaymonograph.asp resides in ns folder
Else
QuickLinksCount = QuickLinksCount + 1
sSections = sSections & rsSection("HTML").Value
End If
rsSection.MoveNext
Wend
' Quick Links
If QuickLinksCount > 0 Then
rsSection.MoveFirst
If len(IntegrativeTherapyLinks) = 0 Then
QuickLinks = QuickLinks & "" & vbCrLf
iCount = 1
While not rsSection.EOF And iCount <= (QuickLinksCount / 2)
SectionName = rsSection("DisplayName")
If SectionName <> "IntegrativeTherapyLinks" And SectionName <> "AlsoListedAs" Then
QuickLinks = QuickLinks & " | "
QuickLinks = QuickLinks & "" & CamelCase(SectionName) & " | "
iCount = iCount + 1
End If
rsSection.MoveNext
Wend
QuickLinks = QuickLinks & " | " & vbCrLf
While not rsSection.EOF
SectionName = rsSection("Name")
If SectionName <> "IntegrativeTherapyLinks" And SectionName <> "AlsoListedAs" Then
QuickLinks = QuickLinks & " | "
QuickLinks = QuickLinks & "" & CamelCase(SectionName) & " | "
iCount = iCount + 1
End If
rsSection.MoveNext
Wend
QuickLinks = QuickLinks & " | "
Else
QuickLinks = QuickLinks & ""
QuickLinks = QuickLinks & ""
While Not rsSection.EOF
SectionName = rsSection("Name")
If SectionName <> "AlsoListedAs" And SectionName <> "IntegrativeTherapyLinks" Then
QuickLinks = QuickLinks & ""
QuickLinks = QuickLinks & " | "
QuickLinks = QuickLinks & "" & CamelCase(SectionName) & " | "
End If
rsSection.MoveNext
Wend
QuickLinks = QuickLinks & " | "
End If
End If
' Article Header goes here
strHTML = strHTML & GetMonographHeader(sTitle, AlsoListedAs, QuickLinks, sPicture, IntegrativeTherapyLinks)
' Add Sections
strHTML = strHTML & sSections
' Copyright & Discplaimer ?
strHTML = strHTML & NSCopyrightAndDisclaimer()
' end wrapper around sections
strHTML = strHTML & " |
"
' end main table and div
strHTML = strHTML & "
"
strHTML=replace(strHTML, "INSERT_STOREID_HERE", "storeID=" & ret_store_id)
strHTML=replace(strHTML, "THIS_DOC_ID", DocID)
'strHTML=replace(strHTML, "INSERT_INDEXTYPE_HERE", GetIndexType)
'strHTML=replace(strHTML, "INSERT_TITLE_HERE", GetTitle)
strHTML=replace(strHTML, "Relatedterms", "Related Terms")
'strHTML=replace(strHTML, ";", "; ")
strHTML=replace(strHTML, "& ", "&")
strHTML=replace(strHTML, "%20DocID", "DocID")
' email_friend HACK by SHE (was going to Mangos everytime)
strHTML=replace(strHTML, "D9339NK282S92NV700AKHLBD3LHF7NV2", ret_store_id)
If ret_store_id = "87787841A0BB4FC881E8154B05C458B5" or ret_store_id = "EFFC034EDD1F4068887698C0668B1397" Then
strHTML = replace(strHTML, "
", "
")
strHTML = replace(strHTML, "
", "
")
strHTML = replace(strHTML, "images/top.gif", "images/SPNtop.gif")
End If
ReadNSContent = strHTML
End Function
Function CamelCase(str)
CamelCase = ucase(left(str, 1)) + lcase(right(str, len(str)-1))
End Function
Function NSCopyrightAndDisclaimer()
NSCopyrightAndDisclaimer= "
" & _
" Copyright © 2011 Natural Standard (www.naturalstandard.com)
" & _
" " & _
" " & _
" " & _
" | " & _
" | " & _
" | " & _
" " & _
" | " & _
" | " & _
" " & _
" " & _
" |
" & _
"
" & _
" The information in this monograph is intended for informational purposes only, and is meant to help users better understand health concerns. Information is based on review of scientific research data, historical practice patterns, and clinical experience. This information should not be interpreted as specific medical advice. Users should consult with a qualified healthcare provider for specific questions regarding therapies, diagnosis and/or health conditions, prior to making therapeutic decisions.
" & _
" |
"
End Function
Function GetMonographHeader(sTitle, ByVal AlsoListedAs, ByVal QuickLinks, ByVal Picture, ByVal IntegrativeTherapyLinks)
Dim sHeader, sPic : sHeader = ""
' no picture in this page
If len(Picture) > 0 Then
'sPic = "
"
else
'sPic = ""
End If
sHeader = "
" & vbCrLf
If len(IntegrativeTherapyLinks) > 0 Then
sHeader = sHeader & "" & sTitle & "" & sPic & " " & _
""
If len("" & AlsoListedAs) > 0 Then
sHeader = sHeader & "Also listed as: " & _
"" & AlsoListedAs & " "
End If
sHeader = sHeader & QuickLinks
sHeader = sHeader & " | "
sHeader = sHeader & ""
sHeader = sHeader & "Integrative Therapy Quick Links:"
sHeader = sHeader & "
"
sHeader = sHeader & IntegrativeTherapyLinks
sHeader = sHeader & " |
| "
Else
sHeader = sHeader & "" & sTitle & "" & sPic & "
"
If len("" & AlsoListedAs) > 0 Then
sHeader = sHeader & "Also listed as: "
sHeader = sHeader & "" & AlsoListedAs & " "
End If
sHeader = sHeader & QuickLinks
sHeader = sHeader & " | "
End If
sHeader = sHeader & "
|
"
GetMonographHeader = sHeader
End Function
Dim htmlAsset, NewGuid, objP
Set objP = Server.CreateObject("LNPromoGenius.Promotions")
NewGUID = objP.NewGUID
Set objP = Nothing
If BannerID > 0 Then
htmlAsset=htmlAsset & "
"
Response.Write htmlAsset
Else
Response.Write "" & vbCrLf
End If
%>