<% dim objDb, rsNews, rsParagraph, strSQL, iLastID,iNews_id, bHasBullets set objDb = dbInit("cupcake") strSQL = "select * " &_ "from news n " &_ "where n.status=1 " &_ "order by n.news_date desc" set rsNews = objDb.Execute(strSQL) dim bIsFirst if isObject(rsNews) then while not rsNews.EOF response.write "" response.write " "&vbcrlf&" " rsNews.MoveNext wend end if %>
 
"&vbcrlf response.write "" &vbcrlf response.write "" & rsNews("news_title") & "
" &vbcrlf iNews_id = rsNews("news_id") strSQL= "select *, np.paragraph_id as trueID " &_ "from news_paragraph np " &_ "left join news_media nm " &_ "on np.paragraph_id=nm.paragraph_id " &_ "left join news_paragraph_bullet npb " &_ "on np.paragraph_id=npb.paragraph_id " &_ "where news_id='" & iNews_id & "'" &_ "order by np.p_position asc, npb.bullet_position " set rsParagraph = objDb.Execute(strSQL) iLastID = -1 bIsFirst=1 if isObject(rsParagraph) then while not rsParagraph.EOF if not(rsParagraph("trueID") = iLastID) then if not(rsParagraph("media_src")="") then Response.Write "
" end if if not(bIsFirst=1) and not(rsParagraph("p_data")="") then response.write "" end if Response.Write "" bIsFirst=0 if bHasBullets = 1 then 'response.write "" bHasBullets = 0 end if if not(rsParagraph("bullet_data")="") then bHasBullets = 1 response.write "" end if end if if not(rsParagraph("bullet_data")="") then Response.write " "&vbcrlf&" "&vbcrlf&" "&vbcrlf end if iLastID = rsParagraph("trueID") rsParagraph.MoveNext wend end if Response.Write "
 
" & rsParagraph("p_data") & "
 
 
 
" & rsParagraph("bullet_data") & "
" if not(rsNews("links_title")="") then response.write "" end if strSQL= "select * " &_ "from news n " &_ "left join news_links nl " &_ "on n.news_id=nl.news_id " &_ "where n.news_id='" & iNews_id & "'" &_ "order by link_position asc " set rsLinks = objDb.Execute(strSQL) if isObject(rsLinks) then while not rsLinks.EOF if not (rsLinks("href")="") then 'if (lcase(right(rsLinks("href"),3)) = "pdf") then Response.Write " "&vbcrlf&" "&vbcrlf&" "&vbcrlf 'else ' Response.Write " "&vbcrlf&" "&vbcrlf&" "&vbcrlf 'end if end if rsLinks.MoveNext wend end if Response.Write "
" & rsNews("links_title") & "
 " & rsLinks("link_data") & "
 " & rsLinks("link_data") & "