% set cn = Server.CreateObject("ADODB.Connection") set cnBook = Server.CreateObject("ADODB.Connection") set cnNews = Server.CreateObject("ADODB.Connection") cn.open sCDB_contenuti_admin cnBook.open sCDB_books_admin cnNews.open sCDB_news_admin iNumNewsChar = 250 iNumArticleChar = 400 iNumNewsToShow = 3 function ClearHTMLTags(strHTML, intWorkFlow) dim regEx, strTagLess strTagless = strHTML set regEx = New RegExp regEx.IgnoreCase = True regEx.Global = True if intWorkFlow <> 1 then regEx.Pattern = "<[^>]*>" strTagLess = regEx.Replace(strTagLess, "") end if if intWorkFlow > 0 and intWorkFlow < 3 then regEx.Pattern = "[<]" strTagLess = regEx.Replace(strTagLess, "<") regEx.Pattern = "[>]" strTagLess = regEx.Replace(strTagLess, ">") end if set regEx = nothing ClearHTMLTags = strTagLess end function function getALiveStone bFlag=true set rs = Server.CreateObject("ADODB.Recordset") sql = "SELECT MAX(id) AS MaxId FROM tArticoli WHERE sezione='PIETRE VIVE'" set rs = cn.execute(sql) iMaxId = rs("MaxId") rs.close set rs = nothing while bFlag set rs = Server.CreateObject("ADODB.Recordset") Randomize iRndId = int(Rnd * iMaxId) sql = "SELECT * FROM tArticoli WHERE sezione='PIETRE VIVE' AND id = " & iRndId set rs = cn.execute(sql) if not rs.eof then bFlag = false getALiveStone="
| " & "" & rs("titolo") & " | |
di " & rs("autore") & " [" & rs("regione") & "] | |
" & Left(ClearHTMLTags(rs("contenuto"),0),iNumNewsChar) & " [...] | |
Autore: | " & " "& rs("autore") & " |
Titolo: | "& " " & rs("titolo") & " |
Editrice: | " & " " & rs("editrice") & " |
Anno: | " & " " & rs("anno") & " |
Altro: | " & " " & rs("pagine") & " |
| " & sBookPicture & " | " & sBookData & " | |
![]() |
|