Merhaba
Asp ilan modulumde bir hata var çözemedim.
------------
02.2008
03.2008
04.2008
05.2008
06.2008
07.2008
08.2008
09.2008
010.2008
---------------
yukarıda gördüğünüz gibi 10. aya kadar bir sorun yok ama 10. ayda 010 diye yazdığı için ilanları göstermiyor.
Bu hata neyle alakalıdır ve nasıl çözülür bir akıl verirseniz memnunolurum.
Asp ay ve tarihe göre ilan Listeleme hatası
7
●1.162
- 11-10-2008, 13:25:58
<SCRIPT RUNAT=SERVER LANGUAGE=VBSCRIPT> function DoTrimProperly(str, nNamedFormat, properly, pointed, points) dim strRet strRet = Server.HTMLEncode(str) strRet = replace(strRet, vbcrlf,"") strRet = replace(strRet, vbtab,"") If (LEN(strRet) > nNamedFormat) Then strRet = LEFT(strRet, nNamedFormat) If (properly = 1) Then Dim TempArray TempArray = split(strRet, " ") Dim n strRet = "" for n = 0 to Ubound(TempArray) - 1 strRet = strRet & " " & TempArray(n) next End If If (pointed = 1) Then strRet = strRet & points End If End If DoTrimProperly = strRet End Function </SCRIPT> <!-- #include file=connections.asp --> <% ay = month(date) ay1 = "0"& ay & "."&"2008" 'ay2 = "1"& ay & "."&"2008" Set rs= server. CreateObject("ADODB.Recordset") SQL="select * from notice where notice_tarih like '%"&ay1&"' order by notice_tarih asc " rs.Open SQL, conn, 1, 3 %> <html> <head> <meta http-equiv="Content-Language" content="tr"> <meta http-equiv="Content-Type" content="text/html; charset=windows-1254"> <title>New Page 1</title> </head> <body> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td height="25" background="ihale/back(1).jpg"> <font face="Verdana" style="font-size: 11pt; font-weight: 700" color="#EFEFEF"> İlanlar İlan İçeriği</font></td> </tr> <tr> <td><font face="Verdana" style="font-size: 2pt"> </font></td> </tr> <tr> <td height="20" width="20%"> <table border="0" width="100%" cellspacing="0" cellpadding="0" style="border-bottom-width: 0px"> <%do while not rs.eof%> <tr onmouseover="this.style.backgroundColor='#F0E2FB'" onmouseout="this.style.backgroundColor='#FFFFFF'"> <td height="25" width="11%" bordercolor="#E1E1E1" style="border-top-style: solid; border-top-width: 1px; border-bottom-style: none; border-bottom-width: medium"> <font face="Verdana" style="font-size: 9pt" color="#0F0F0F"> <%=rs("notice_tarih")%></font></td> <td height="25" width="86%" bordercolor="#E1E1E1" style="border-top-style: solid; border-top-width: 1px; border-bottom-style: none; border-bottom-width: medium"> <font style="font-size: 9pt" color="#0F0F0F" face="Verdana"> </font><font style="font-size: 9pt" color="#5F155F" face="Verdana"><a class=linkBlack href="notice_detail.asp?not_id=<%=rs("not_id")%>"><font color="#0F0F0F"><span style="text-decoration: none"><% =(DoTrimProperly((rs.Fields.Item("notice_title").Value), 80, 1, 0, " "))%></span></font></a></font></td> <td height="25" width="3%" bordercolor="#E1E1E1" style="border-top-style: solid; border-top-width: 1px; border-bottom-style: none; border-bottom-width: medium"> <p align="center"> <a href="notice_detail.asp?not_id=<%=rs("not_id")%>"> <img border="0" src="sag_ok.gif" width="15" height="11"></a></td> </tr> <% rs.movenext loop rs.close set rs = nothing %> </table> </td> </tr> </table> <p align="center"> </p> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td bgcolor="#F0E2FB" height="20"> <font face="Verdana" style="font-size: 9pt"> Arşiv İlanları</font></td> </tr> <% for x = 2000 to 2010 for i = 1 to 12 ay1 = "0"& i & "."& x Set rss= server. CreateObject("ADODB.Recordset") SQL="select DISTINCT(right(notice_tarih,7)) from notice where right(notice_tarih,7) = '"& right(ay1,7) &"' " rss.Open SQL, conn, 1, 3 do while not rss.eof if rss.recordcount<>0 then %> <tr> <td height="20"> <a href="notice_archive.asp?trh=<%=ay1%>"><%end if response.write ay1 response.write "<br>" %></a> </td> </tr> <% rss.movenext loop rss.close set rss= nothing next next %> </table> </body> </html>
diğeride bu
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1254"> <title>ilan ekle</title> </head> <SCRIPT type=text/javascript> function textCounter (field, countfield, maxlimit) { if (field.value.length > maxlimit) field.value = field.value.substring(0, maxlimit); else countfield.value = maxlimit - field.value.length; } function newWindow (mypage,myname,w,h,features) { if(screen.width) { var winl = (screen.width-w)/2; var wint = (screen.height-h)/2; } else { winl = 0;wint =0; } if (winl < 0) winl = 0; if (wint < 0) wint = 0; var settings = 'height=' + h + ','; settings += 'width=' + w + ','; settings += 'top=' + wint + ','; settings += 'left=' + winl + ','; settings += features; settings += ' scrollbars=yes '; win = window.open(mypage,myname,settings); win.window.focus(); } function addOption(selectId, val, txt) { var objOption = new Option(txt, val); document.getElementById(selectId).options.add(objOption); } function search_delay(element, type) { // Create a function to get the search results var func = function() { xajax_getSearchRecords(element.value,type); }; // Check to see if there is already a timeout and if so... // ...cancel it and create a new one if ( element.zid ) { clearTimeout(element.zid); } element.zid = setTimeout(func,500); } function addBookmark(title, url) { if (window.sidebar) { // mozilla/firefox window.sidebar.addPanel(title, url,""); } else if( window.external ) { // IE window.external.AddFavorite( url, title); } else if(window.opera && window.print) { // Opera var bookmark = document.createElement('a'); bookmark.setAttribute('href',url); bookmark.setAttribute('title',title); bookmark.setAttribute('rel','sidebar'); bookmark.click(); } } </SCRIPT> <body > <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td height="22" valign="top"> Tüm İlanlarınız İçin Lütfen Tıklayınız. <a href="admin_total_notice.asp"> <img border="0" src="../firma/image/sag_ok.gif" width="15" height="11"></a></td> </tr> </table> <table border="0" width="100%" id="table14" cellspacing="0" cellpadding="0" style="border-bottom-width: 0px"> <tr> <td width="77%" style="border-style:solid; border-width:1px; " bgcolor="#F0E2FB" height="20" bordercolor="#5F155F"> <p align="center"> <b> <font face="Tahoma" style="font-size: 8pt" color="#5F155F"> YENİ İLAN EKLE</font></b></td> </tr> <tr> <td width="77%" style="border-bottom-style:none; border-bottom-width:medium" background="../oto-ilan/s660.gif"> <span style="font-size: 2pt"> </span></td> </tr> <SCRIPT language=javascript type=text/javascript> function submitbutton_reg() { var form = document.mform; var r = new RegExp("[\<|\>|\"|\'|\%|\;|\(|\)|\&|\+|\-]", "i"); if (form.not_title.value == "") { alert( "İlanınız için Bir Başlık Girmelisiniz." ); } else if (form.not_detail.value == "") { alert( "İlan Detay Bölümünü Boş Geçemezsiniz." ); } else { form.submit(); } } </SCRIPT> <tr> <form method="POST" action="024_06_post.asp" name="mform"> <td width="89%" style="border-bottom-style:none; border-bottom-width:medium" background="s660.gif"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td width="25%"> </td> <td width="16%"> </td> <td width="1%"> </td> <td width="58%" colspan="2"> </td> </tr> <td width="25%"> </td> <td width="16%"> </td> <td width="1%"> </td> <td width="58%" colspan="2"> </td> </tr> <tr> <td width="25%"> </td> <td width="16%"> <span style="font-weight: 700"> <font face="Verdana" style="font-size: 9pt" color="#5F155F"> İlan Başlığı</font></span></td> <td width="1%"> <font color="#5F155F" face="Verdana" style="font-size: 9pt; font-weight: 700">:</font></td> <td width="27%"> <input class=inputbox type="text" name="notice_title" size="48" style="font-family: Tahoma; font-size: 8pt" maxlength="25"></td> <td width="32%"> </td> </tr> <tr> <td width="25%"> </td> <td width="16%"> </td> <td width="1%"> </td> <td width="58%" colspan="2"> </td> </tr> <tr> <td width="25%" height="57"> </td> <td width="16%" height="57"> <span style="font-weight: 700"> <font face="Verdana" style="font-size: 9pt" color="#5F155F"> İlan Açıklaması</font></span></td> <td width="1%" height="57"> <font color="#5F155F" face="Verdana" style="font-size: 9pt; font-weight: 700">:</font></td> <td width="58%" colspan="2" height="57"><font face="Tahoma"> <span style="font-size: 8pt"> <script language="Javascript1.2"><!-- // load htmlarea _editor_url = ""; // URL to htmlarea files var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]); if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; } if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; } if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; } if (win_ie_ver >= 5.5) { document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"'); document.write(' language="Javascript1.2"></scr' + 'ipt>'); } else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); } // --></script> <script language="JavaScript1.2" defer>editor_generate('notice_detail');</script> <textarea class=inputbox rows="16" name="notice_detail" cols="89" style="font-family: Tahoma; font-size: 8pt"></textarea></span></font></td> </tr> <tr> <td width="25%"> </td> <td width="16%"> </td> <td width="1%"> </td> <td width="58%" colspan="2"> <p align="left"> </td> </tr> <tr> <td width="25%"> </td> <td width="16%"> </td> <td width="1%"> </td> <td width="58%" colspan="2"> </td> </tr> <tr> <td width="25%"> </td> <td width="16%"> </td> <td width="1%"> </td> <td width="58%" colspan="2"> <input class=button onclick=submitbutton_reg() type="submit" value="ILANIMI EKLE" style="font-family: Tahoma; font-size: 8pt; color: #FFFFFF; height: 30; width: 147; font-weight: bold; border: 1px solid #F0E2FB; background-color: #5F155F"></td> </tr> <tr> <td width="25%"> </td> <td width="16%"> </td> <td width="1%"> </td> <td width="58%" colspan="2"> </td> </tr> </table> </td> </form> </tr> </table> <table border="0" width="100%" id="table18" cellpadding="0" cellspacing="1"> <tr> <td bgcolor="#5F155F"><font face="Tahoma" style="font-size: 2pt"> </font></td> </tr> </table> <p align="center"> <!-- #include file=admin_total_notice.asp --></p> </body> </html> - 11-10-2008, 19:32:50iyide 010.2008 diye bir tarih olmaz ki. sen büyük bir olasılıkla bunları access kullanıyorsan metin olarak kayıt ediyorsun. Yapman gereken bunları tarih/saat olarak kayıt edip. Date ile veya now ile o anki tarihi/saati çekmen olacak. Bu sayede listelerken sorun yaşamazsın. Listelerkende basit bir parçalama kodu kullanırsın işlem biter.