<% dim storyid,i,menuitemid,strStorySummaryPanel,parentstoryid storyid=request("storyid") if storyid="" or isnull(storyid) or not isnumeric(storyid) then response.redirect "default.asp" end if 'if getStoryAttribute("partnerid",storyid)<>"" then response.Redirect "default.asp" function storytext(byval id) dim tmp,tmp2,tmp3,tmp4, tmpi 'display the story using its template sql="select tblStories.*, tblTemplates.templatename,tbltemplates.templatetext from tblStories left join tbltemplates on tblStories.templateid=tbltemplates.templateid Where tblstories.Approved in (1,-1) and storyid=" & id set rs=conn.execute(sql) if not rs.eof then strStorySummaryPanel="
Title: " & rs("title") & "
" tmp2=left(replace(rs("description"),"'",""),300) tmp2=left(tmp2,instrrev(tmp2,". ")) strStorySummaryPanel=strStorySummaryPanel & "" & tmp2 & "..
" strStorySummaryPanel=strStorySummaryPanel & "Author: " & getContributorAttribute("Contributorname",rs("authorid")) & "
" strStorySummaryPanel=strStorySummaryPanel & "Posted: " & month(rs("dated")) & "/" & day(rs("dated")) & "/" & year(rs("dated")) & "
" if not getStoryAttribute("restricted",storyid) and session("login") then strStorySummaryPanel=strStorySummaryPanel & "
" end if storytext=storytext & "" select case lcase(rs("templatename")) case "test" if not isnull(rs("templatetext")) then sql="Select * from tblStoryPhotos Where StoryID=" & rs("storyid") & " and sortorder=1 and approved in (1,-1)" tmp=rs("storytext") if isrestricted(id) and not session("login") then 'tmp=left(tmp,700) tmp=left(tmp,instrrev(tmp,"")-1) & "    " tmp=tmp & "[Login For More]" end if sql="Select * from tblPolls Left Join tblPollsQuestions on tblPolls.PollSurveyID=tblPollsQuestions.PollSurveyID Where tblPolls.PollName='storyid=" & rs("storyid") & "'" set rs2=conn.execute(sql) tmp2=0 tmp4=vbcr & "" & vbcr storytext=storytext & replace(rs("templatetext"),"",replace(tmp,"",tmp4 & tmp3)) storytext=replace(storytext,"",rs("title")) menuitemid=rs("menuitemid") parentstoryid=rs("parentstoryid") else storytext=storytext & rs("storytext") end if case "review" if not isnull(rs("templatetext")) then sql="Select * from tblStoryPhotos Where StoryID=" & rs("storyid") & " and sortorder=1 and approved in (1,-1)" tmp=rs("storytext") if isrestricted(id) and not session("login") then tmp=left(tmp,1000) tmp=left(tmp,instrrev(tmp,". ")) & "    " tmp=tmp & "[Login For More]" end if sql="Select * from tblPolls Left Join tblPollsQuestions on tblPolls.PollSurveyID=tblPollsQuestions.PollSurveyID Where tblPolls.PollName='storyid=" & rs("storyid") & "'" set rs2=conn.execute(sql) tmp2=0 tmp4=vbcr & "" & vbcr storytext=storytext & replace(rs("templatetext"),"",replace(tmp,"",tmp4 & tmp3)) storytext=replace(storytext,"",rs("title")) menuitemid=rs("menuitemid") parentstoryid=rs("parentstoryid") else storytext=storytext & rs("storytext") end if case else if not isnull(rs("templatetext")) then sql="Select * from tblStoryPhotos Where StoryID=" & rs("storyid") & " and sortorder=1 and approved in (1,-1)" tmp=rs("storytext") if isrestricted(id) and not session("login") then tmp=left(tmp,1000) tmp=left(tmp,instrrev(tmp,". ")) & "    " tmp=tmp & "[Login For More]" end if storytext=storytext & replace(rs("templatetext"),"",tmp) storytext=replace(storytext,"",rs("title")) menuitemid=rs("menuitemid") parentstoryid=rs("parentstoryid") else storytext=storytext & rs("storytext") end if end select storytext=storytext & "" end if end function %> One 2 One Story:
<%=storyphotos(storyid)%>
<% if (isrestricted(storyid) and session("login")) or not isrestricted(storyid) then 'if the story is a child show the intro icon at the bottom sql="select tblstories.* from tblStories where storyid=" & storyid & " Order By SortOrder, Dated desc" set rs=conn.execute(sql) if not rs.eof then if rs("parentstoryid")>0 then strStorySummaryPanel=strStorySummaryPanel & "Intro | " %> ">Intro | <% 'if the story has siblings show their pages at the bottom i=0 sql="select tblStories.* from tblStories Where approved in (1,-1) and ParentStoryid=" & rs("parentstoryid") & " Order By Sortorder"', dated desc" set rs=conn.execute(sql) do until rs.eof i=i+1 strStorySummaryPanel=strStorySummaryPanel & "" & i & " " %> "><%=i%> <% rs.movenext loop end if end if 'if the story has children show their pages at the bottom i=0 sql="select tblStories.* from tblStories Where approved in (1,-1) and ParentStoryid=" & storyid & " Order By Sortorder" set rs=conn.execute(sql) do until rs.eof i=i+1 strStorySummaryPanel=strStorySummaryPanel & "" & i & " " %> "><%=i%> <% rs.movenext loop end if %>