İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

ASP + MYSQL BAĞLANTI SORUNU YARDIMCI OLABİLECEK BİR DELİKANLI VARMI?

İceberk1

0
İyinet Üyesi
Katılım
29 Eylül 2011
Mesajlar
26
Reaction score
0
Asp + mysql bir sitem var bunun galerisini değiştirmeye çalışıyorum bir yere kadar getirdim ama yeni eklemek istediğim galeri mdb olduğundan tabloları karıştırıyorum. örnek sayfaları eklesem asp den anlayan bir arkadaş varmı acaba benim için 5 dakikasını ayırıp yaparmı? Eğer isterseniz ücretinide verebilirim emeğinizin.

---------------------Benim şuan kullandığım galeri------------ burdaki veritabanı resim yolu vs.. bilgiler ağaıdakine göre düzenlenecek -----------
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="ayarlar.asp"-->
<!--#include file="include/degiskenler.asp"-->
<!--#include file="include/baglanti.asp"-->
<!--#include file="include/bloklar.asp"-->
<!--#include file="fonksiyonlar/database.asp"-->
<!--#include file="fonksiyonlar/filtreler.asp"-->
<!--#include file="fonksiyonlar/link.asp"-->
<!--#include file="fonksiyonlar/tarih.asp"-->
<%
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' MyDesign Haber
' http://www.mydesign.gen.tr

' Galeriler Sayfası Kodları
' Son Düzenleme: 11 Temmuz 2009 (v0.7)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

'// Sayfanın önbellekten alnması önleniyor
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 2
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","private"
Response.CacheControl = "No-Store"

'// Değişkenler Tanımlanıyor
Dim iGaleriSayisi
Dim strTab
Dim strOrderBy
Dim Aralik
Dim intSayfaAltSiniri
Dim intSayfaUstSiniri
Dim intSolGrupSayisi
Dim intSagAltSinir

If LinkTuru = 1 Then
intGecerliSayfa = Temizle(Trim(Request.QueryString("s")))
Else
Set strURL = Request.Servervariables("QUERY_STRING")
strBolum = Split(strURL,"/")
If UBound(strBolum) >= 3 + KarakterBul(strScriptYolu, "/") Then strKonu = Temizle(strBolum(3 + KarakterBul(strScriptYolu, "/")))

strKonu = Split(strKonu,"-")
intGecerliSayfa = strKonu(0)
strTab = strKonu(1)
End If

If intGecerliSayfa = "" Or IsNumeric(intGecerliSayfa) = False Then intGecerliSayfa = 1
intGecerliSayfa = CInt(intGecerliSayfa)
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Foto Galeri - <%=strSiteAdi%></title>
<% Call Head() %>
<meta name="generator" content="Microsoft FrontPage 5.0" />
<link rel="stylesheet" type="text/css" href="<%=strScriptYolu%>css/stil.css" />
<script type="text/javascript" src="<%=strScriptYolu%>js/ajax.js"></script>
<!--#include file="include/ajax.asp"-->
</head>
<body>
<div id="ana">
<table id="main" cellpadding="0" border="0" cellspacing="0">
<tr>
<td colspan="3" id="ust"><% Call Ust() %></td></tr>
<tr>
<td colspan="3" id="bant"><% Call UstMenu() %></td></tr>
<tr>
<td colspan="3" id="son-dakika"><% Call SonDakika() %></td></tr>
<tr>
<td id="sol">
<% Call Menu("galeri") %>
</td>

<td id="orta2" colspan="2">

<h1>Foto Galeri</h1>

<div class="navigasyon">
<% If strTab <> "populer" Then %><b>En Yeni Galeriler</b><% Else %><a href="<%=LinkVer("galeriler", 1, "", "yeni")%>">En Yeni Galeriler</a><% End If %> |
<% If strTab = "populer" Then %><b>En Popüler Galeriler</b><% Else %><a href="<%=LinkVer("galeriler", 1, "", "populer")%>">En Popüler Galeriler</a><% End If %>
</div>

<table width="100%" cellpadding="0" cellspacing="0" border="0">
<%
kdYardimci.Open "SELECT COUNT(Galeri_ID) AS Toplam FROM tblGaleriler", adoCOn, 1, 3
iGaleriSayisi = kdYardimci("Toplam")
kdYardimci.Close

If strTab = "populer" Then
strOrderBy = "hit"

Else
strOrderBy = "tarih"

End If

kdGenel.Open "SELECT * FROM tblGaleriler ORDER BY "& strOrderBy &" DESC", adoCon, 1, 3

If Not kdGenel.Eof Then

intTdLooper = 0

If strVtTuru = "mySQL" Then
intSayfaSayisi = Yuvarla(CInt(iGaleriSayisi) / 20)
Else
If strVtTuru = "msSQL" Then
intSayfaSayisi = FIX(iGaleriSayisi / 20)
Else
intSayfaSayisi = kdGenel.PageCount
End If
kdGenel.PageSize = 20
kdGenel.AbsolutePage = intGecerliSayfa

End If

If intGecerliSayfa > intSayfaSayisi Then intGecerliSayfa = intSayfaSayisi

Do While Not kdGenel.Eof AND intTdLooper < 20

intTdLooper = intTdLooper + 1

If intTdLooper Mod 4 = 1 Then Response.Write "<tr>" %>

<td style="width:25%; <%

If intTdLooper Mod 4 = 1 Then
Response.Write "padding-right:5px;"
Elseif intTdLooper Mod 4 = 0 Then
Response.Write "padding-left:5px;"
Else
Response.Write "padding:0 5px;"
End If %>">

<div class="son_haber" style="text-align:center;">

<h3><a href="<%=LinkVer("galeri", kdGenel("Galeri_ID"), "1", kdGenel("Ad"))%>"><%=kdGenel("Ad")%></a></h3>

<a href="<%=LinkVer("galeri", kdGenel("Galeri_ID"), "1", kdGenel("Ad"))%>"><img src="<%=GaleriVarsayilanFoto(kdGenel("Galeri_ID"))%>" onError="this.src='<%=strScriptYolu%>upload/resimler/haber/th_resimyok.gif';" border="0" style="width:100px; height:76px;" /></a>

</div>

</td><%

If intTdLooper Mod 4 = 0 Then Response.Write "</tr>"

kdGenel.Movenext
Loop


If intSayfaSayisi > 1 Then

Response.Write "<tr><td colspan=""4""><p>"

Aralik = 2

intSayfaAltSiniri = intGecerliSayfa - Aralik
intSayfaUstSiniri = intGecerliSayfa + Aralik
intSolGrupSayisi = 1 + Aralik
intSagAltSinir = intSayfaSayisi - Aralik

If (intSayfaUstSiniri > intSayfaSayisi) Then
intSayfaAltSiniri = intSayfaSayisi - (2 * Aralik)
intSayfaUstSiniri = intSayfaSayisi
End If

If (intSayfaAltSiniri <= 0) Then
intSayfaAltSiniri = 1
intSayfaUstSiniri = intSayfaAltSiniri + (2 * Aralik)
If intSayfaUstSiniri >= intSayfaSayisi Then intSayfaUstSiniri = intSayfaSayisi
End If

If intSolGrupSayisi >= intSayfaAltSiniri Then intSolGrupSayisi = intSayfaAltSiniri - 1
If intSagAltSinir <= intSayfaUstSiniri Then intSagAltSinir = intSayfaUstSiniri + 1

If intGecerliSayfa > 1 Then
Response.Write("<a href="""& LinkVer("galeriler", intGecerliSayfa-1, "", strTab) &""" class=""sayfala"">Önceki Sayfa</a> | ")
End If

For intLooper = 1 to intSolGrupSayisi
If CInt(intLooper) = intGecerliSayfa Then
Response.Write "<span class=""arama-gecerli"">"& intLooper &"</span> | "
Else
Response.Write("<a href="""& LinkVer("galeriler", intLooper, "", strTab) &""" class=""sayfala"">"& intLooper &"</a> | ")
End If
Next

If (intSayfaAltSiniri - intSolGrupSayisi > 1 ) Then Response.Write ". . . | "

For intLooper = intSayfaAltSiniri to intSayfaUstSiniri
If CInt(intLooper) = CInt(intGecerliSayfa) Then
Response.Write "<span class=""arama-gecerli"">"& intLooper &"</span> | "
Else
Response.Write("<a href="""& LinkVer("galeriler", intLooper, "", strTab) &""" class=""sayfala"">"& intLooper &"</a> | ")
End If
Next

If (intSagAltSinir - intSayfaUstSiniri > 1) Then Response.Write " . . . | "

For intLooper = intSagAltSinir to intSayfaSayisi
If CInt(intLooper) = CInt(intGecerliSayfa) Then
Response.Write "<span class=""arama-gecerli"">"& intLooper &".</span> | "
Else
Response.Write("<a href="""& LinkVer("galeriler", intLooper, "", strTab) &""" class=""sayfala"">"& intLooper &"</a> | ")
End If
Next

If intGecerliSayfa <> intSayfaSayisi AND intSayfaSayisi > 1 Then
Response.Write("<a href="""& LinkVer("galeriler", intGecerliSayfa+1, "", strTab) &""" class=""sayfala"">Sonraki Sayfa</a> ")
End If

Response.Write "</p></td></tr>"

End If

End If
kdGenel.Close %>
</table>
</td>
</tr>
<tr>
<td colspan="3" id="alt">

<% Call Alt() %>

<%
' Bu kısmı değiştirmek lisans anlaşmasına aykırıdır
Response.Write "<p>Altyapı: <a href=""http://www.mydesign.gen.tr"" target=""_blank"" title=""MyDesign | Kod Arşivi"">MyDesign Haber Sistemi</a></p>"
' Bu kısmı değiştirmek lisans anlaşmasına aykırıdır
%>
</td>
</tr>
</table>
</div>
</body>
</html>


----------------------Buda eklemeye çalıştım galeri -------------------------------------------------------------------------------

<!--#Include file="db.asp"-->
<body text="#FFFFFF" bgcolor="#FFFFFF">

<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
Set Con=Server.CreateObject("ADODB.Connection")
Con.open "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath(""&dburun&"")
Set RSe = Server.CreateObject("ADODB.Recordset")

sqlString = "SELECT * from resimk where alt like '1' order by kate desc"


RSe.ActiveConnection = Con
Rse.Open sqlString,Con,3,3
%><font color="#800000"> </font>
<tr>
<%
for e=1 to 5
if RSe.eof then exit for
response.write "<tr>"
for u=1 to 2
if RSe.eof then exit for
%><font color="#800000">
<%
Set by_iBoSoFT=Server.CreateObject("ADODB.Connection")
by_iBoSoFT.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(""&dburun&"")

lojik5=by_iBoSoFT.execute("select count(fid) as toplam5 from resimd where tur='"&rse("id")&"' ")

toplam5=lojik5("toplam5")
%> </font>
<td><table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="4%">
<font color="#FFFFFF"><img src="http://forum.iyinet.com/images/vokn1.gif" width="7" height="6" /></font></td>
<td width="98%" height="20" colspan="2"><a href="resim_galeri_d.asp?resimid=<%=rse("id")%>&kate=<%=rse("anasek")%>"><%=RSe("kate")%><font color="#800000"> (<%=toplam5%>)</font></a></td>
</tr>
</table></td>
<%RSe.movenext
next
response.write "</tr>"
next
%><font color="#800000"> </font>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="36">
<font color="#800000"><img
src="http://forum.iyinet.com/images/resimler.gif" /></font></td>
</tr>
<tr>
<td><table width="99%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<%

Set Con=Server.CreateObject("ADODB.Connection")
Con.open "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath(""&dburun&"")
Set RSr = Server.CreateObject("ADODB.Recordset")

sqlString = "SELECT * from resimd where tur='"&request("resimid")&"' order by tarih desc"

RSr.ActiveConnection = Con
Rsr.Open sqlString,Con,1,3
Set RSe = Server.CreateObject("ADODB.Recordset")

sqlString = "SELECT * from resimk where id="&request("resimid")&" order by kate desc"

RSe.ActiveConnection = Con
Rse.Open sqlString,Con,3,3
%><font color="#800000">
<%if rsr.eof then%>
</font>
<tr>
<td><div align="center">
<font color="#800000">Kayıtlı Galeri Yok...</div></td>
</tr>
<%else%> </font>
<tr>
<%
for t=1 to 1
if rsr.eof or rsr.bof then exit for
response.write "<tr>"
for j=1 to 1
if rsr.eof or rsr.bof then exit for%><font color="#800000">
</font>
<td width="16%"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25"><div align="center"><%=left(rse("kate"),30)%></div></td>
</tr>
<tr>
<td height="10"><table width="100%" border="0" align="center">
<%
sira = Request("sira")%><font color="#800000">
<%
Set Con=Server.CreateObject("ADODB.Connection")
Con.open "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath(""&dburun&"")
Set RS = Server.CreateObject("ADODB.Recordset")
sqlString = "select * from resimd where tur= '"&request("resimid")&"' order by fid"
RS.ActiveConnection = Con
Rs.Open sqlString,Con,1,3
%>
<%git = Request.QueryString("git")
if git="" then
git=1
end if %> </font>
<tr >
<td><%
KayitSayisi=1



Set Con=Server.CreateObject("ADODB.Connection")
Con.open "DRIVER={Microsoft Access Driver (*.mdb)};" & _
"DBQ=" & Server.MapPath(""&dburun&"")
Set RS1 = Server.CreateObject("ADODB.Recordset")
sqlString = "select * from resimd where tur= '"&request("resimid")&"' order by fid"
RS1.ActiveConnection = Con
Rs1.Open sqlString,Con,1,3


%><font color="#800000"> </font>
<tr>
<td> </td>
</tr>
<%if rs.eof then%><font color="#800000">
</font>
<tr>
<td bgcolor="#FFCC99">
<font color="#800000"><strong>Resim Kaydi Yok</strong></td>
</tr>
<%else%>
</font>

<tr >
<%
for o=1 to 10
if rs.eof or rs.bof then exit for
response.write "<tr>"
for p=1 to 4
if rs.eof or rs.bof then exit for%><font color="#800000">
</font>
<td><center>
<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><table width="100" border="0" cellpadding="2" cellspacing="5" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#F9DA4E"><div align="center"><a href="http://forum.iyinet.com/images/galeri/<%=rs("resimid")%>" rel="lightbox[sushi]"><font color="#800000"><img src="http://forum.iyinet.com/images/galeri/<%=rs("resimid")%>" width="90" border="0" /></font></a><font color="#800000"><br />
</font>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="10"></td>
</tr>
</table>
</center></td>
<%rs.movenext
next
response.write "</tr>"
next

rs.close
%><font color="#800000"> </font> </tr>

<tr>
<td><tr>
<td> </td>
</tr>
</table></td>
</tr>
</table></td>
<%end if%><font color="#800000"> <%rsr.movenext
next
response.write "</tr>"
next

rsr.close
%>

<%end if%> </font>
</tr>
</table>
<font color="#800000"><</font>
------------
şimdiden yazan herkeze sonsuz teşekkür ederim
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Backlink ve Tanıtım Yazısı için iletişime geçmek için Skype Adresimiz: .cid.1580508955483fe5

Üst