<% '################################################################################# '## Copyright (C) 2000 Michael Anderson '## '## 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 Snitz Forums 2000 '## must remain intact in the scripts and in the outputted HTML '## The "powered by" text/logo with a link back to '## http://forum.snitz.com in the footer of the pages MUST '## remain visible when the pages are viewed on the internet or intranet. '## '## This program is distributed in the hope that it will be useful, '## but WITHOUT ANY WARRANTY; without even the implied warranty of '## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the '## GNU General Public License for more details. '## '## You should have received a copy of the GNU General Public License '## along with this program; if not, write to the Free Software '## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. '## '## Support can be obtained from support forums at: '## http://forum.snitz.com '## '## Correspondence and Marketing Questions can be sent to: '## reinhold@bigfoot.com '## '## or '## '## Snitz Communications '## C/O: Michael Anderson '## PO Box 200 '## Harpswell, ME 04079 '################################################################################# '--------------------------------------------------------------------------------------- 'Nome file : classifieds.asp 'Autore: : Alan Le (alanle2000@hotmail.com) 'Traduttore: : Danny C. (Webmaster@gamescircuits.com) 'Implementato da: : Staff gamescircuits.com (www.gamescircuits.com) 'Descrizione : Mercatino online per Snitz Forum 3.4.03 'Creato : 1/24/2001 'Modificato : 1/07/2004 ' mm/dd/yyyy - : ' 1) : Implementanto per Snitz Ver 3.4.03 ' 2) : '--------------------------------------------------------------------------------------- %> <% 'Declare Variables Dim rsClassifieds set rsClassifieds = server.CreateObject("adodb.recordset") 'Set the number of days that ads are to run AdRunLength = 60 datAddLength = dateAdd("D",-AdRunLength,now) 'Delete the old ads first Call DeleteOldAds dim sMode sMode = Request.QueryString("mode") catID = Request.QueryString("ID") if sMode = "delete" and mlev > 0 then sSQL = "" sSQL = sSQL & "DELETE FROM " & strTablePrefix & "ADS_CATEGORY WHERE ID = " & catID my_Conn.Execute(sSQL) Response.Write("

La categoria è stata correttamente cancellata!") end if 'Get the categories strSelectCats = "Select ID, Category_Name, Description FROM " & strTablePrefix & "ADS_CATEGORY ORDER BY Category_Name" set rsClassifieds = my_Conn.Execute(strSelectCats) %>
 Tutti i Forum
 Mercatino online

Nota bene: Tutte le inserzioni più vecchie di 60 gg
verranno automaticamente archiviate nel db!

<% 'displays the existing categories. call DisplayCategories %> <% 'show add category option if the user has admin status. if mlev = 4 then %> <%end if%>
<%= strForumTitle %> mercatino
Aggiungi nuova categoria

<% dim rsAds set rsAds = server.CreateObject("adodb.recordset") 'get the ads for this category strSql = "Select ID, Topic_ID, ad_title, price, image_url, name, added_By, address, city, zip, state, email, date_posted, content, " strSql = strSql & "link FROM " & strTablePrefix & "ADS_CONTENT ORDER BY date_posted desc" strSql = TopSQL(strSql,15) Set rsAds = my_Conn.Execute(strSql) %>
<% If rsAds.eof then%> <% Else iswitch = TRUE Do While Not rsAds.eof %> <% rsAds.MoveNext Loop End If rsAds.Close set rsAds = nothing %>
Ultime 15 inserzioni
Non è presente alcuna inserzione nel database!
Provincia: <%=rsAds("state")%>
Autore: "><%=getMemberName(rsAds("Added_By"))%>
Costo: € <%if rsAds("price") <> "" then Response.write chkstring(rsAds("price"), "display")%>
"><%= rsAds("ad_title")%> <% If mLev = 4 or rsAds("added_by") = getNewMemberNumber() then %> &mode=delete&catID=<%= rsAds("topic_ID") %>"> <% End If if mlev = 4 or rsAds("added_by") = getNewMemberNumber() then%> &mode=delete&catID=<%= rsAds("topic_ID") %>"> <% End If %>
<%= LEFT(rsAds("content"), 125)%>...
  <% WriteFooter Function adCount(catID) caSQL = "SELECT COUNT(*) as Total FROM " & strTablePrefix & "ADS_CONTENT WHERE Topic_ID = " & catID dim rsCount set rsCount = server.CreateObject("adodb.recordset") Set rsCount = my_Conn.Execute(caSQL) adCount = rsCount.Fields("Total") rsCount.Close Set rsCount = Nothing End Function Sub DeleteOldAds strSql = "DELETE FROM " & strTablePrefix & "ADS_CONTENT WHERE date_posted < '" & datetostr(datAddLength) & "'" my_Conn.Execute(strSql) End Sub Sub DisplayCategories Do While Not rsClassifieds.eof %>

"><%= rsClassifieds("Category_Name")%> (<%= adCount(rsClassifieds("ID"))%>) <%If mlev = 4 Then%> "> "> <%End If%>
<%= rsClassifieds("Description")%>

<% rsClassifieds.MoveNext If rsClassifieds.eof Then%>   <%Else%>

"><%= rsClassifieds("Category_Name")%> (<%= adCount(rsClassifieds("ID"))%>) <%If mlev = 4 Then%> "> "> <%End If%>
<%= rsClassifieds("Description")%>

<% rsClassifieds.MoveNext End If Loop End Sub %>