Gönderen Konu: v2.1 sürümünde article_read.asp kodları  (Okunma sayısı 1355 defa)

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı burajan

  • Web Programcısı
  • Administrator
  • *
  • İleti: 5109
  • Puan: 334
  • Cinsiyet: Bay
  • Web Programcısı
    • Burak ŞİMŞEK - Kişisel İnternet Sitesi
v2.1 sürümünde article_read.asp kodları
« : Ekim 08, 2006, 21:35:07 ÖS »
Hazırlayan bilgi

Kod: [Seç]
<%
'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
'<> Copyright (C) 2004-2005 Tom Nance (SkyDogg) All Rights Reserved
'<> Events Suite Copyright (C) 2004-2005 Ken Smiley All Rights Reserved
'<>
'<> By using this program, you are agreeing to the terms of the
'<> GNU General Public License.
'<>
'<> This program is free software; you can redistribute it and/or
'<> modify it under the terms of the GNU General Public License
'<> as published by the Free Software Foundation; either version 2
'<> of the License, or any later version.
'<>
'<> All copyright notices regarding MaxWebPortal must remain intact
'<> in the scripts and in the outputted HTML.
'<> The "powered by" text/logo with a link back to
'<> http://www.maxwebportal.info in the footer of the pages MUST
'<> remain visible when the pages are viewed on the internet or intranet.
'<>
'<> Support can be obtained from support forums at:
'<> http://www.maxwebportal.info
'<>
'<> Email: maxweb@maxwebportal.info
'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
'<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
'***********************************************************************
'** Copyright (C) 2001 - 2004 Max Yuan All Rights Reserved
'**
'** By using this program, you are agreeing to the terms of the
'** GNU General Public License.
'**
'** This program is free software; you can redistribute it and/or
'** modify it under the terms of the GNU General Public License
'** as published by the Free Software Foundation; either version 2
'** of the License, or any later version.
'**
'** All copyright notices regarding MaxWebPortal must remain intact
'** in the scripts and in the outputted HTML.
'** The "powered by" text/logo with a link back to
'** http://www.maxwebportal.com in the footer of the pages MUST
'** remain visible when the pages are viewed on the internet or intranet.
'**
'** Support can be obtained from support forums at:
'** http://www.maxwebportal.com
'**
'** Email: maxwebportal@hotmail.com
'** ICQ: 148111300
'***********************************************************************
CurPageType = "makaleler"
CurPageInfoChk = "1"
function CurPageInfo ()
strOnlineQueryString = ChkActUsrUrl(Request.QueryString)
PageName = "Makale Okuma"
PageAction = "okuyor<br>"
PageLocation = "article_read.asp?" & strOnlineQueryString & ""
CurPageInfo = PageAction & " " & "<a href=" & PageLocation & ">" & PageName & "</a>"

end function
%>
<!-- #INCLUDE FILE="config.asp" -->
<!-- #INCLUDE FILE="inc_functions.asp" -->
<!-- #INCLUDE FILE="inc_top.asp" -->
<%

reward = "2"
reward = cint(reward)

if Request.QueryString("id") <> "" or  Request.QueryString("id") <> " " then
if IsNumeric(Request.QueryString("id")) = True then
articleid = Request.QueryString("id")
else
Response.Redirect("article.asp")
end if
end if
intMMID = 0
if Request.QueryString("mm") <> "" or  Request.QueryString("mm") <> " " then
if IsNumeric(Request.QueryString("mm")) = True then
intMMID = Request.QueryString("mm")
else
Response.Redirect("pic.asp")
end if
end if
if Request.QueryString("cmd") <> "" or  Request.QueryString("cmd") <> " " then
intCmd = Request.QueryString("cmd")
end if
 
  if intCmd = "del" and intMMID > 0 and mLev = 4 then
    sSql = "SELECT RATING FROM ARTICLE_RATING WHERE ARTICLE = " & articleid & " and RATE_BY = " & intMMID
set rsRate = my_Conn.execute(sSql)
if not rsRate.eof then
  strRate = rsRate("RATING")
      sSql = "SELECT VOTES, RATING FROM ARTICLE WHERE ARTICLE_ID = " & articleid
  set rsChk = my_Conn.execute(sSql)
    totalVotes = rsChk("VOTES")
    totalRate = rsChk("RATING")
  set rsChk = nothing
  intRating = totalRate - strRate
  intVotes = totalVotes - 1
      sSql = "DELETE FROM ARTICLE_RATING WHERE ARTICLE = " & articleid & " and RATE_BY = " & intMMID
  my_Conn.execute(sSql)
  strSQL = "UPDATE ARTICLE SET VOTES = " & intVotes & " , RATING = " & intRating & " Where ARTICLE_ID = " & articleid
  my_Conn.execute(strSQL)
 
  sSql = "SELECT RATING FROM ARTICLE WHERE ARTICLE_ID = " & articleid
  set rsRt = my_Conn.execute(sSql)
  if rsRt(0) < 0 then
  my_Conn.execute("update ARTICLE set RATING = 0 where ARTICLE_ID = " & articleid & "")
  end if
  set rsRt = nothing
 
end if
set rsRate = nothing
my_Conn.close
set my_Conn = nothing
response.Redirect("article_read.asp?id=" & articleid)
  end if

lastdate = Request.Cookies("date")
lastid   = Request.Cookies("articleid")


if lastid <> articleid then
    my_Conn.Execute("UPDATE ARTICLE SET Hit = HIT + 1 Where ARTICLE_ID =" & articleid)
    Response.Cookies("articleid") = articleid
Response.Cookies("articleid").Expires = dateadd("d",7,strForumTimeAdjust)
end If

strSQL = "SELECT ARTICLE_ID, TITLE, POST_DATE, CONTENT, POSTER, KEYWORD, HIT, CATEGORY, PARENT_ID, AUTHOR, AUTHOR_EMAIL, SHOW, HIT from ARTICLE where show = 1 and ARTICLE_ID = " & articleid & ""

set rs = my_Conn.Execute (strSQL)

strSQL1 = "SELECT count(*) as Comments FROM ARTICLE_RATING WHERE COMMENTS NOT LIKE ' ' AND ARTICLE = " & articleid

set rsArticleComments = server.CreateObject("adodb.recordset")
rsArticleComments.Open strSQL1, my_Conn

dim intVotes
dim intRating
if not rsArticleComments.eof then
Comments = rsArticleComments("Comments")
else
    Comments = "0"
end if
rsArticleComments.Close
set rsArticleComments = nothing

dim strPoster
strPoster = rs("POSTER")
if len( Trim(strPoster)) > 0 then
strPoster = strPoster
else
strPoster = "Bilinmiyor"
end if

dim strAuthor
strAuthor = rs("AUTHOR")
if len( Trim(strAuthor)) > 0 then
strAuthor = strAuthor
else
strAuthor = "Bilinmiyor"
end if

dim strAuthorEmail
strAuthorEmail = rs("AUTHOR_EMAIL")
if len( Trim(strAuthorEmail)) > 0 then
strAuthorEmail = strAuthorEmail
else
strAuthorEmail = "Bilinmiyor"
end if

strSQL = "SELECT CATEGORY,TITLE, PARENT_ID from ARTICLE where show = 1 and ARTICLE_ID = " & articleid & ""
set rsM = my_Conn.Execute (strSQL)

title =rsM("TITLE")
parentid = rsM("PARENT_ID")
catid = rsM("CATEGORY")

strSQL1 = "SELECT CAT_NAME from ARTICLE_CATEGORIES where CAT_ID = " & parentid & ""
set rs2 = my_Conn.Execute (strSql1)

strSQL2 = "SELECT SUBCAT_NAME from ARTICLE_SUBCATEGORIES where SUBCAT_ID = " & catid & " and CAT_ID = " & parentid & ""

set rs3 = my_Conn.Execute (strSql2)
mwpThemeTableCustomCode = " border=""1"" cellpadding=""0"" cellspacing=""0"" style=""border-collapse: collapse"" align=""center"" width=""99%"""
mwpThemeSmallBlock_open()%>
  <tr>
    <td bgcolor="<%= strForumCellColor %>"width="95%" align="left" nowrap><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
    <img src="Images/nav_icon.gif" align="absbottom" border="0"> <a href="default.asp">Anasayfa</a> >> <a href="article.asp">Makaleler</a> >> <a href="article_showsub.asp?cat_id=<%=parentid%>&Cat=<% =rs2("CAT_NAME")%>"><% =rs2("CAT_NAME")%></a> >> <a href="article_showall.asp?cat_id=<%=catid%>&parent_id=<%=parentid%>&sub_name=<% =rs3("SUBCAT_NAME")%>&parent_name=<% =rs2("CAT_NAME")%>"><% =rs3("SUBCAT_NAME")%></a> >> <% =title%>
    </font></td>
  </tr>
<%mwpThemeSmallBlock_close()%><br>
<%
rsM.Close
set rsM = nothing
rs2.Close
set rs2 = nothing
rs3.Close
set rs3 = nothing %>
<table border="0" width="99%" align="center">
<tr>
<td width="200" valign="top">
<!-- #include file="article_menu.asp" --><br>
<!-- #include file="inc_article.asp" -->
</td>
<td width="100%" valign="top">
<%
mwpThemeTableCustomCode = "width=""99%"" align=""center"""
mwpThemeBlock_open()
%>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Baslik:</b></font></td>
<td bgcolor="<% =strAltHeadCellColor %>"><a href="JavaScript:openWindow('pop_send_to_friend.asp?sender=article&url=<% = strForumURL & "article_read.asp?ID=" & articleID  %>')"><img border="0" src="images/icons/icon_email.gif" align="right" alt="Makaleyi E-Mail Gönder" style="display:inline;" hspace="4"></a><a href="JavaScript:openWindow5('article_print.asp?id=<%=articleid%>')"><img border="0" src="images/icons/print.gif" align="right" alt="Printer" style="display:inline;" hspace="4"></a><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"> <b><% =rs("TITLE")%></b></font></td>
</tr>
<%maintext(articleid)%>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Hit:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><% =rs("HIT")%></font></td>
</tr>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Puanlama:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><% GetRating(articleid) %></font></td>
</tr>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Eklenme Tarihi:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><% =ChkDate(rs("POST_DATE"))%></font></td>
</tr>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Yazar/Kaynak:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><% =HTMLEncode(strAuthor)%></font></td>
</tr>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Yazarin E-Mail/website:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><% =HTMLEncode(strAuthorEmail)%></font></td>
</tr>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Gönderen:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><% =HTMLEncode(formatStr(strPoster))%></font></td>
</tr>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Yorumlar:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><%=Comments%> Yorum<%if not strDBNTUserName = "" then%> | <a href="JavaScript:openWindow4('article_rate.asp?id=<%=articleid%>')">Puan ver</a><% End If %></font></td>
</tr>
<tr>
<td <%= mwpThemeBlock_subTitleCell %> width="20%"><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strHeadFontColor %>"><b>Makaleler:</b></font></td>
<td bgcolor="<% =strForumCellColor %>" width="80%"> <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><a href="article_read.asp?id=<%=ArticleID-1%>">Önceki</a> | <a href="article_read.asp?id=<%=ArticleID+1%>">Sonraki</a></font></td>
</tr>
<%if Comments > 0 then%>
<tr><td width="100%" colspan="2"><hr>
<% GetComments(articleid) %>
</td></tr>
<%end if%>
<%mwpThemeBlock_close()%>
<%
set rs = nothing
%>
<br>
<center>
<font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>">
<a href="<% =chkString(Request.ServerVariables("HTTP_REFERER"), "refer") %>">Geri</font></a>
</center>
</td>
    <td width="2" valign="top">
<!-- this is the 3rd column add content as you wish and change the <td> width -->
</td>
</tr>
</table>
<!-- #INCLUDE FILE="inc_footer.asp" -->
<%
function maintext(articleid)

strSQL = "SELECT CONTENT from ARTICLE where show = 1 and ARTICLE_ID = " & articleid & ""
set rsC = my_Conn.Execute (strSQL)

'################## V2.1 #################################
'mainContent = formatStr(rsC("CONTENT"))
'mainContent = HTMLDecode(mainContent)
'################## V2.11 #################################
mainContent = rsC("CONTENT")
mainContent = replace(mainContent, "&", "&", 1, -1, 1)
mainContent = replace(mainContent, "&59;", ";", 1, -1, 1)
%>
<tr>
<td bgcolor="<% =strForumCellColor %>" width="100%" colspan="2"><hr size="1"><table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
<td><font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>"><% =mainContent%></font></td></table><hr size="1"></td>
</tr>
<%
rsC.Close
set rsC = nothing
end function

function GetComments(ArticleID)
strSQL = "SELECT COMMENTS, RATE_BY, RATE_DATE, RATING FROM ARTICLE_RATING WHERE COMMENTS NOT LIKE ' ' AND ARTICLE = " & articleid
set rs = server.CreateObject("adodb.recordset")
rs.Open strSQL, my_Conn

dim intVotes
dim intRating
dim intRateBy
do while not rs.eof
Comments = rs("Comments")
intRateBy = rs("RATE_BY")
%>
<table width="100%" border="1" cellpadding="0" cellspacing="2" style="border-collapse: collapse">

<td bgcolor="<% =strPopUpTableColor %>" width="20%" nowrap>
  <% If mLev = 4 Then %>
  <a href="article_read.asp?cmd=del&id=<%= articleid %>&mm=<%= intRateBy %>"><img src="images/icons/icon_trashcan.gif" alt="Yorumu Sil" title="Yorumu Sil" width="12" height="12" border="0" /></a>
  <% End If %>
      <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>">
Gönderen <b><%=getMemberName(rs("RATE_BY"))%></b></font><br><font face="<%= strDefaultFontFace %>" size="<%= strFooterFontSize %>" color="<%= strDefaultFontColor %>"><%=ChkDate(rs("RATE_DATE"))%>
      </font>
</td>

    <td bgcolor="<% =strForumCellColor %>" width="80%">
      <font face="<%= strDefaultFontFace %>" size="<%= strDefaultFontSize %>" color="<%= strDefaultFontColor %>">
<%=formatstr(Comments)%><br></font>
    </td>
</table>
<%
rs.MoveNext
loop
rs.Close
set rs = nothing

end function

function GetRating(ArticleID)
strSQL = "SELECT VOTES, RATING FROM ARTICLE WHERE ARTICLE_ID = " & ArticleID
set rsArticleRating = server.CreateObject("adodb.recordset")
rsArticleRating.Open strSQL, my_Conn

dim intVotes
dim intRating
intVotes = rsArticleRating("VOTES")
intRating = rsArticleRating("RATING")
rsArticleRating.Close
set rsArticleRating = nothing

if intVotes > 0 then
intRating = Round(intRating/intVotes)%>
Puanlama:<% =intRating%>  Oylama:<% =intVotes%> (Puan Durumu: <font color=red>1</font> = kötü, <font color=green>10</font> = iyi)
<%else%>
Puanlama:<% =intRating%>  Oylama:0 (Puan Durumu: <font color=red>1</font> = kötü, <font color=green>10</font> = iyi)
<%end if
end function%>

Ekleyen: admin
Konuyu Paylaş:
  delicious  facebook  twitter  google
Kişisel İnternet Sitem => buraksimsek.com.tr - http://www.buraksimsek.com.tr

Lütfen özel mesaj ile destek istemeyiniz. Önce forumda arama yapınız daha sonra forumda ilgili bölüme konu açınız.

 

Benzer Konular

  Konu / Başlatan Yanıt Son İleti
0 Yanıt
1000 Gösterim
Son İleti Ocak 22, 2007, 11:41:10 ÖÖ
Gönderen: CaSh
36 Yanıt
8461 Gösterim
Son İleti Eylül 17, 2010, 10:22:16 ÖÖ
Gönderen: AdmiN
0 Yanıt
616 Gösterim
Son İleti Mayıs 12, 2010, 13:08:36 ÖS
Gönderen: burajan
0 Yanıt
426 Gösterim
Son İleti Eylül 14, 2010, 15:28:22 ÖS
Gönderen: jamuk
0 Yanıt
58 Gösterim
Son İleti Mart 17, 2012, 23:40:39 ÖS
Gönderen: nexem