<%@ codepage="65001" language="VBScript" %> <% call sm_header() %> <% ''****************************************************************************** ''* ''* IndexNo.#123 ''* Name : fncRtnSubjInfo ''* input parameter : ps_col - 원하는 코드 ''* Date / Author : 2010.3.11 / David.J ''* ''******************************************************************************* function fncRtnSubjInfo(ps_col) dim f_Qry, f_Rs f_Qry = "SELECT KNAME FROM WP_COMMON WHERE CODE = '"& ps_col &"'" set f_Rs = server.CreateObject("ADODB.Recordset") f_Rs.Open f_Qry, o_Cn, 1 if f_Rs.eof Then fncRtnSubjInfo = "" else fncRtnSubjInfo = trim(f_Rs(0)) end if f_Rs.Close Set f_Rs = Nothing end Function function fncRtnInfoSubj(ps_col) dim f_Qry, f_Rs f_Qry = "SELECT TOP 1 CODE FROM WP_COMMON WHERE PCODE = 'THMSUB' and KNAME = '"& ps_col &"'" set f_Rs = server.CreateObject("ADODB.Recordset") f_Rs.Open f_Qry, o_Cn, 1 if f_Rs.eof Then fncRtnInfoSubj = "" else fncRtnInfoSubj = trim(f_Rs(0)) end if f_Rs.Close Set f_Rs = Nothing end function %> <% dim PID : PID = fncRequest(request("PID"),1) dim DPID : DPID = fncRequest(request("DPID"),1) dim THMCATE : THMCATE = fncRequest(request("THMCATE"),1) dim o_MRs dim s_MQry dim MainImg : MainImg = "" dim s_AirTime : s_AirTime = "" dim s_LFACEPIC : s_LFACEPIC = "" dim s_LFACEPIC_PATH : s_LFACEPIC_PATH = "" dim s_LNAMEPIC : s_LNAMEPIC = "" dim s_LNAMEPIC_PATH : s_LNAMEPIC_PATH = "" dim s_CNAMEPIC : s_CNAMEPIC = "" dim s_CNAMEPIC_PATH : s_CNAMEPIC_PATH = "" dim s_THEME : s_THEME = "" dim s_LECTUREDATE : s_LECTUREDATE = "" dim s_WORDS : s_WORDS = "" dim s_Clauses : s_Clauses = "" dim s_Content : s_Content = "" dim s_MOV_A : s_MOV_A = "" dim s_MOV_A_PATH : s_MOV_A_PATH = "" dim s_MOV_B : s_MOV_B = "" dim s_MOV_B_PATH : s_MOV_B_PATH = "" dim s_MOV_C : s_MOV_C = "" dim s_MOV_C_PATH : s_MOV_C_PATH = "" dim s_MOV_P : s_MOV_P = "" dim s_MOV_P_PATH : s_MOV_P_PATH = "" dim s_PDF : s_PDF = "" dim s_PDF_PATH: s_PDF_PATH = "" dim s_HOMEPAGE: s_HOMEPAGE = "" dim s_BRIEF_PROF : s_BRIEF_PROF = "" dim s_EMAIL : s_EMAIL = "" dim s_LNAME : s_LNAME = "" if THMCATE="" then dim cc randomize num=138 cc=int((num*rnd)+1) if cc<10 then cc="00" & cc elseif cc<100 then cc="0" & cc end if THMCATE="THMSUB" & cc end if %>
 
<% call sm_top() %>
<% ''**************************************************************************************** '' 페이지셋팅(pageno) ''**************************************************************************************** CookiesPageNo = request.cookies(PID & "SONGLIST" & gs_UID)("Pageno") CookiesSkip = request.cookies(PID & "SONGLIST" & gs_UID)("skip") if CookiesPageNo = "" then ''// pageno = request("pageno")''페이지 넘버 else pageno = CookiesPageNo end if if pageno = "" or pageno < 0 then pageno = 1 else pageno = Cint(pageno) end if ''**************************************************************************************** '' 페이지셋팅(skip) ''**************************************************************************************** if CookiesSkip = "" then ''// skip = request("skip") else skip = CookiesSkip end if if skip = "" or skip < 0 then '' skip = 0 else skip = Cint(skip) end if ''// 검색을 위한 쿠키 셋팅 dim CookiesSearchMenu, CookiesSearchText CookiesSearchMenu = request.cookies(PID & "SONGLIST" & gs_UID)("SearchMenu") CookiesSearchText = request.cookies(PID & "SONGLIST" & gs_UID)("SearchText") If fncRtnSubjInfo(THMCATE) <> "" Then CookiesSearchText = fncRtnSubjInfo(THMCATE) End If ''//response.write "CookiesPageNo: " & CookiesPageNo & "
" ''//response.write "CookiesSkip: " & CookiesSkip & "
" ''//response.write "CookiesSearchMenu: " & CookiesSearchMenu & "
" ''//response.write "CookiesSearchText: " & CookiesSearchText & "
" ''**************************************************************************************** '' 본문내용 ''**************************************************************************************** i = fncDPIDRcdCntByPID(PID) j = 5 s_MQry = " SELECT A.PID, A.DPID, A.THEME, A.LID, A.LECTUREDATE, A.SONGTITLE, B.CID, C.KNAME AS CKNAME, D.KNAME AS LKNAME, MOV_A, MOV_A_PATH, MOV_B, MOV_B_PATH, MOV_C, MOV_C_PATH, MOV_E, MOV_E_PATH, mp3, mp3_path, WORDS, CLAUSES, CONTENT, C.AID, C.ADDRESS1, THMCATE10, THMCATE11, THMCATE12, THMCATE14, THMCATE15, THMCATE16 " s_MQry = s_MQry & " FROM " s_MQry = s_MQry & " (SELECT PID, DPID, THEME, LID, LECTUREDATE, SONGTITLE, MOV_A, MOV_A_PATH, MOV_B, MOV_B_PATH, MOV_C, MOV_C_PATH, MOV_E, MOV_E_PATH, mp3, mp3_path, WORDS, CLAUSES, CONTENT, THMCATE10, THMCATE11, THMCATE12, THMCATE14, THMCATE15, THMCATE16 FROM WP_PROGDETAIL " s_MQry = s_MQry & " WHERE PID IN ( SELECT PID FROM WP_PROG WHERE DELFLAG = 'N' AND MOV_B = 'Y' ) AND DELFLAG = 'N' " s_MQry = s_MQry & " AND LEN(MOV_B_PATH) > 0 ) " s_MQry = s_MQry & " A, " s_MQry = s_MQry & " (SELECT CID, LID, PID FROM WP_PROG " s_MQry = s_MQry & " WHERE PID IN ( SELECT PID FROM WP_PROG WHERE DELFLAG = 'N' AND MOV_B = 'Y' ) AND CATE1 = 'CATSM') " s_MQry = s_MQry & " B, " s_MQry = s_MQry & " (SELECT CID, KNAME, AID, ADDRESS1 FROM WP_CHURCH) " s_MQry = s_MQry & " C, " s_MQry = s_MQry & " (SELECT LID, KNAME FROM WP_LECTURER) " s_MQry = s_MQry & " D " s_MQry = s_MQry & " WHERE A.PID = B.PID " s_MQry = s_MQry & " AND B.CID = C.CID " s_MQry = s_MQry & " AND B.LID = D.LID " If THMCATE <> "" then s_MQry = s_MQry & " AND (THMCATE10 = '"& THMCATE &"' OR THMCATE11 = '"& THMCATE &"' OR THMCATE12 = '"& THMCATE &"') " End If if CookiesSearchMenu = "TITLE" then s_MQry = s_MQry & " AND A.THEME LIKE '%" & CookiesSearchText & "%' " elseif CookiesSearchMenu = "CHURCH" then s_MQry = s_MQry & " AND C.KNAME LIKE '%" & CookiesSearchText & "%' " elseif CookiesSearchMenu = "LECTURER" then s_MQry = s_MQry & " AND D.KNAME LIKE '%" & CookiesSearchText & "%' " elseif CookiesSearchMenu = "THMCATE10" then s_MQry = s_MQry & " AND (THMCATE10 = '" & fncRtnInfoSubj(CookiesSearchText) & "' OR THMCATE11 = '" & fncRtnInfoSubj(CookiesSearchText) & "' OR THMCATE12 = '" & fncRtnInfoSubj(CookiesSearchText) & "') " end if s_MQry = s_MQry & " ORDER BY A.LECTUREDATE DESC " ''//response.write "s_MQry : " & s_MQry & "
" ''//response.end set o_Rs = server.CreateObject("ADODB.Recordset") o_Rs.PageSize = 5 PageSize = o_Rs.PageSize o_Rs.Open s_MQry, o_Cn, 1 %>

<%= CookiesSearchText %> 검색결과   <%=o_Rs.recordcount%> 건 검색되었습니다.

<% if o_Rs.eof then ''***************************************************************************** '' 레코드가 없을때 ''***************************************************************************** response.write "" response.write "
등록된 내용이 없습니다.
" else ''***************************************************************************** '' 레코드가 하나 이상일때 ''***************************************************************************** b_RsExist = true TotRecord = o_Rs.recordcount ''전체레코드 TotPage = o_Rs.PageCount ''전체페이지수 o_Rs.Absolutepage = pageno ''절대 페이지 ''***************************************************************************** '' 최종페이지 이동을 위해서 : 10 페이지씩 이동할때 ''***************************************************************************** i_mod = int(TotPage / 10) i_divide = TotPage mod 10 if i_divide = 0 and i_mod > 0 then i_Eskip = (i_mod - 1) * 10 i_Epage = i_Eskip + 1 else i_Eskip = i_mod * 10 i_Epage = i_Eskip + 1 end if ''//response.write TotPage / 10 & "
" ''//response.write TotPage mod 10 & "
" if pageno = 1 or pageno < 1 then '' 현재페이지가 첫 페이지 일때 i = TotRecord elseif pageno = TotPage or pageno > TotPage then ''현재 페이지가 마지막 페이지일때 if TotRecord mod pagesize = 0 then ''마지막페이지에서 전체레코드에서 pagesize로 나눈 나머지가 0일때 i = pagesize else ''마지막페이지에서 전체레코드에서 pagesize로 나눈 나머지가 0아닐때 i = TotRecord mod pagesize end if else '' 나머지 대부분의 경우 i = TotRecord - (pagesize * (pageno-1)) end if ''***************************************************************************** j = 1 do until o_Rs.eof or j > PageSize %>
&DPID=<%=o_Rs("DPID")%>" style="color:#CC66CC"><%=fncTruncStr(o_Rs("theme"),27,2)%> <%=o_Rs("WORDS")%> <%=o_Rs("lecturedate")%>
<%=o_Rs("LKNAME")%> 목사 <%=left(o_Rs("ADDRESS1"),2)%>,<%=fncIdToKname(o_Rs("AId"),"A")%> <% if not (o_Rs("MOV_E")="" or o_Rs("MOV_E_PATH")="") then %> ','full','SM')"class="A00" alt="고화질"> <% end if%> <% if o_Rs("MOV_B") <> "" or o_Rs("MOV_B_PATH") <> "" then %> ','300','SM')"class="A00" alt="표준"> <% end if%> <% if o_Rs("MOV_C") <> "" or o_Rs("MOV_C_PATH") <> "" then %> ','56','SM')"class="A00" alt="저화질"> <% end if%> <% if o_Rs("MOV_A") <> "" or o_Rs("MOV_A_PATH") <> "" then %> ','700','SM')"class="A00" alt="저화질"> <% end if%> <% if not (o_Rs("MP3")="" or o_Rs("MP3_PATH")="") then %> ','mp3','')"class="A00" alt="저화질"> <% end if%>
<% If o_Rs("CONTENT") = "" then %> <%=fncTruncStr(Replace(o_Rs("CLAUSES"),"
"," "),300,2)%> <% Else %><%=fncTruncStr(o_Rs("CONTENT"),300,2)%><% End If %>
주제이미지 <% dim thm_string, thm_string1, thm_string2, thm_string3 dim chm_string, chm_string1, chm_string2 if trim(o_Rs("THMCATE10"))<>"" then thm_string1="" & fncRtnSubjInfo(o_RS("THMCATE10")) & "" end if if trim(o_Rs("THMCATE11"))<>"" then thm_string2="" & fncRtnSubjInfo(o_RS("THMCATE11")) & "" end if if trim(o_Rs("THMCATE12"))<>"" then thm_string3="" & fncRtnSubjInfo(o_RS("THMCATE12")) & "" end if thm_string=thm_string1 & ", " & thm_string2 & ", " & thm_string3 thm_string=replace(thm_string,", , ",", ") if right(thm_string,2)=", " then thm_string=mid(thm_string,1,len(thm_string)-2) end if if trim(o_Rs("THMCATE15"))<>"" then chm_string1="" & fncRtnSubjInfo(o_RS("THMCATE15")) & "" end if if trim(o_Rs("THMCATE16"))<>"" then chm_string2="" & fncRtnSubjInfo(o_RS("THMCATE16")) & "" end if chm_string=chm_string1 & ", " & chm_string2 if left(chm_string,2)=", " then chm_string=mid(chm_string,3,len(chm_string)) end if if right(chm_string,2)=", " then chm_string=mid(chm_string,1,len(chm_string)-2) end if %> <%= thm_string %><%= chm_string %> "><%=fncRtnSubjInfo(o_RS("THMCATE14"))%> ','<%=o_Rs("DPID")%>');" onFocus="this.blur()" class="B00">

선

<% i = i - 1 j = j + 1 o_Rs.movenext loop end if %>
<% if b_RsExist = true then ''*[레코드가 하나도 없을때]* %>
<% if skip = "" or skip = 1 then skip = 0 absoluteskip = skip skip = 1 + skip kk = skip + 9 if skip + 9 > TotPage then kk = TotPage '' skip변수값에 4를 더한 값이 전체페이지수보다 크면 전체페이지수 %> <% if kk > 10 then absoluteskip = absoluteskip - 10 '' 이전 10페이지로 가기 위해 skip변수에 넣을 값을 -10 해준다. %> | |   <% absoluteskip = absoluteskip + 10 '' 다시 현재 10 페이지에서 계속 유지하기 위해 다시 +10를 해준다. end if %> <% for k = skip to kk '' skip변수 값에서 순차적으로 1씩 증가해서 skip + 4 까지 보여주도록 한다. %> <% response.write " | " %> <% if pageno = k then response.write " " & k & " " else response.write " " & k & " " end if %> <% next %> <% response.write " | " %> <% if kk <> TotPage then '' kk가 전체페이지수가 아닐때만 다음의 내용을 보여준다. absoluteskip = absoluteskip + 10 '' 다음 10페이지로 가기 위해 skip변수에 넣을 값을 +10 해준다. next10page = 10 if (kk + (TotPage mod 10)) = TotPage then next10page = TotPage mod 10 '' kk 값에 전체페이지의 나머지값을 더한 것이 전체페이지와 같다면 다음 10페이지가 아니라 전체페이지를 나눈 나머지값만큼의 페이지 수가 된다. %>   | | <% end if %>    
<% end if %>
<% call sm_left() %> <% call sm_plus() %>
<% call sm_copy() %> <% call sm_bottom() %>