Forum 

Forum AspNuke.it - Il tuo Portale OpenSource in ASP

Modulo ultimo aggiornamento

Autore Messaggio
pierin

Esperto
Esperto
317 Discussioni



Profilo - pierin
10 agosto 2006 alle 23:05:00 Profilo - pierinInvia un messaggio privato valchisone@hotmail.com Rispondi quotando
Modificato il 10 agosto 2006 alle 23:10:28

Ciao, il blocco
che trasmette l'ultimo aggiornamento è
Sub Displaylastupdate()
' IMPORTANTISSIMO!! inserite sempre nel vostro nuovo blocco la riga Sub Display() per poi richiamare il file nell'xml

CreateTopTable "Aggiornamenti", GetTranslation("LANG_UPDATE")
Dim oCn, oRs,rSQL , xDate, aDate, arDate, cDate, diDate, doDate, iDate, mlDate, pDate, nDate, uDate, xSezione

xDate = DateValue("01/01/1900")
xSezione = ""

Set oCn = DBConnexion(DB_MAIN)

rSQL = "SELECT arDate FROM Articles ORDER BY arDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
arDate = DateValue(Mid(oRs("arDate"),7,2) & "/" & Mid(oRs("arDate"),5,2) & "/" & Mid(oRs("arDate"),1,4))
If arDate > xDate Then
xDate = arDate
xSezione = "Articoli"
End if
End If

rSQL = "SELECT cDate FROM Comments ORDER BY cDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
cDate = DateValue(Mid(oRs("cDate"),7,2) & "/" & Mid(oRs("cDate"),5,2) & "/" & Mid(oRs("cDate"),1,4))
If doDate > xDate Then
xDate = cDate
xSezione = "Commenti"
End if
End If

rSQL = "SELECT dDate FROM Directory ORDER BY dDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
diDate = DateValue(Mid(oRs("dDate"),7,2) & "/" & Mid(oRs("dDate"),5,2) & "/" & Mid(oRs("dDate"),1,4))
If doDate > xDate Then
xDate = diDate
xSezione = "Segnala un sito"
End if
End If

rSQL = "SELECT dDate FROM Downloads ORDER BY dDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
doDate = DateValue(Mid(oRs("dDate"),7,2) & "/" & Mid(oRs("dDate"),5,2) & "/" & Mid(oRs("dDate"),1,4))
If doDate > xDate Then
xDate = doDate
xSezione = "Materiale"
End if
End If

rSQL = "SELECT iDate FROM Images ORDER BY iDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
iDate = DateValue(Mid(oRs("iDate"),7,2) & "/" & Mid(oRs("iDate"),5,2) & "/" & Mid(oRs("iDate"),1,4))
If iDate > xDate Then
xDate = iDate
xSezione = "Immagini"
End if
End If

rSQL = "SELECT mlDate FROM Messageslist ORDER BY mlDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
mlDate = DateValue(Mid(oRs("mlDate"),7,2) & "/" & Mid(oRs("mlDate"),5,2) & "/" & Mid(oRs("mlDate"),1,4))
If mlDate > xDate Then
xDate = mlDate
xSezione = "Messaggi Privati"
End if
End If

rSQL = "SELECT pDateBegin FROM Polls ORDER BY pDateBegin Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
pDate = DateValue(Mid(oRs("pDateBegin"),7,2) & "/" & Mid(oRs("pDateBegin"),5,2) & "/" & Mid(oRs("pDateBegin"),1,4))
If pDate > xDate Then
xDate = pDate
xSezione = "Sondaggi"
End if
End If

rSQL = "SELECT nDate FROM News ORDER BY nDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
nDate = DateValue(Mid(oRs("nDate"),7,2) & "/" & Mid(oRs("nDate"),5,2) & "/" & Mid(oRs("nDate"),1,4))
If nDate > xDate Then
xDate = nDate
xSezione = "News"
End if
End If

rSQL = "SELECT uDate FROM Users ORDER BY uDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
uDate = DateValue(Mid(oRs("uDate"),7,2) & "/" & Mid(oRs("uDate"),5,2) & "/" & Mid(oRs("uDate"),1,4))
If uDate > xDate Then
xDate = uDate
xSezione = "Nuovi Utenti"
End if
End If

Response.Write ("<br>")
'Response.Write ("<_div align=""center"" class=""MyStQuote"">")
Response.Write ("<_div align=""center"" class="""">")
Response.Write ("L'ultimo aggiornamento di Valchisone.it é stato effettuato in data ")
Response.Write ("<span class=""Mycell"">" & xDate & "</span>")
Response.Write ("<br>")
Response.Write ("nella sezione ")
Response.Write ("<span class=""MyTop"">" & xSezione & "</span>")
Response.Write ("</_div>")

oCn.Close
Set oCn = Nothing
Set oRs = Nothing

CreateBottomTable ""

End Sub

Come si legge nelle prime righe ci si connette al db main, per fare dei select cronolgici, ma se volessi tenere sotto controllo i nuovi post nel db forum come posso fare?
Io avevo provato...ma non funge
CreateTopTable "Aggiornamenti", GetTranslation("LANG_UPDATE")
Dim oCn, oRs,rSQL, oCn2 , xDate, aDate, arDate, cDate, diDate, doDate, iDate, mlDate, pDate, nDate, uDate, xSezione

xDate = DateValue("01/01/1900")
xSezione = ""

Set oCn = DBConnexion(DB_MAIN)
Set oCn2 = DBConnexion(DB_FORUM)

rSQL = "SELECT arDate FROM Articles ORDER BY arDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
arDate = DateValue(Mid(oRs("arDate"),7,2) & "/" & Mid(oRs("arDate"),5,2) & "/" & Mid(oRs("arDate"),1,4))
If arDate > xDate Then
xDate = arDate
xSezione = "Articoli"
End if
End If

rSQL = "SELECT cDate FROM Comments ORDER BY cDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
cDate = DateValue(Mid(oRs("cDate"),7,2) & "/" & Mid(oRs("cDate"),5,2) & "/" & Mid(oRs("cDate"),1,4))
If doDate > xDate Then
xDate = cDate
xSezione = "Commenti"
End if
End If

rSQL = "SELECT dDate FROM Directory ORDER BY dDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
diDate = DateValue(Mid(oRs("dDate"),7,2) & "/" & Mid(oRs("dDate"),5,2) & "/" & Mid(oRs("dDate"),1,4))
If doDate > xDate Then
xDate = diDate
xSezione = "Segnala un sito"
End if
End If

rSQL = "SELECT dDate FROM Downloads ORDER BY dDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
doDate = DateValue(Mid(oRs("dDate"),7,2) & "/" & Mid(oRs("dDate"),5,2) & "/" & Mid(oRs("dDate"),1,4))
If doDate > xDate Then
xDate = doDate
xSezione = "Downloads"
End if
End If

rSQL = "SELECT iDate FROM Images ORDER BY iDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
iDate = DateValue(Mid(oRs("iDate"),7,2) & "/" & Mid(oRs("iDate"),5,2) & "/" & Mid(oRs("iDate"),1,4))
If iDate > xDate Then
xDate = iDate
xSezione = "Immagini"
End if
End If

rSQL = "SELECT Id FROM Posts ORDER BY mlDate Desc"
Set oRs = DBRecordSet(oCn2, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
mlDate = DateValue(Mid(oRs("mlDate"),7,2) & "/" & Mid(oRs("mlDate"),5,2) & "/" & Mid(oRs("mlDate"),1,4))
If mlDate > xDate Then
xDate = mlDate
xSezione = "Post Forum"

End if
End If

rSQL = "SELECT pDateBegin FROM Polls ORDER BY pDateBegin Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
pDate = DateValue(Mid(oRs("pDateBegin"),7,2) & "/" & Mid(oRs("pDateBegin"),5,2) & "/" & Mid(oRs("pDateBegin"),1,4))
If pDate > xDate Then
xDate = pDate
xSezione = "Sondaggi"
End if
End If

rSQL = "SELECT nDate FROM News ORDER BY nDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
nDate = DateValue(Mid(oRs("nDate"),7,2) & "/" & Mid(oRs("nDate"),5,2) & "/" & Mid(oRs("nDate"),1,4))
If nDate > xDate Then
xDate = nDate
xSezione = "News"
End if
End If

rSQL = "SELECT uDate FROM Users ORDER BY uDate Desc"
Set oRs = DBRecordSet(oCn, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
uDate = DateValue(Mid(oRs("uDate"),7,2) & "/" & Mid(oRs("uDate"),5,2) & "/" & Mid(oRs("uDate"),1,4))
If uDate > xDate Then
xDate = uDate
xSezione = "Nuovi Utenti"
End if
End If

Response.Write ("<br>")
'Response.Write ("<_div align=""center"" class=""MyStQuote"">")
Response.Write ("<_div align=""center"" class="""">")
Response.Write ("L'ultimo aggiornamento di Valchisone.it é stato effettuato in data ")
Response.Write ("<span class=""Mycell"">" & xDate & "</span>")
Response.Write ("<br>")
Response.Write ("nella sezione ")
Response.Write ("<span class=""MyTop"">" & xSezione & "</span>")
Response.Write ("</_div>")

oCn.Close
Set oCn = Nothing
Set oRs = Nothing

CreateBottomTable ""

End Sub
[b]
---------------
Portale Valchisone e Germanasca
http://www.valchisone.it/web
piosky_to2003

Esperto
Esperto
2291 Discussioni



Profilo - piosky_to2003
11 agosto 2006 alle 09:04:19 Profilo - piosky_to2003Invia un messaggio privato chat_silvio@hotmail.com Rispondi quotando
Modificato il 11 agosto 2006 alle 17:09:39

Che modulo e'?

Se usi il forum di Aspnuke la query SQL e' sbagliata , anche il codice

rSQL = "SELECT PostDate FROM Posts ORDER BY PostDate Desc"
Set oRs = DBRecordSet(oCn2, rSQL)
If Not oRs.EOF Then
oRs.MoveFirst
mlDate = DateValue(Mid(oRs("PostDate"),7,2) & "/" & Mid(oRs("PostDate"),5,2) & "/" & Mid(oRs("PostDate"),1,4))
If mlDate > xDate Then
xDate = mlDate
xSezione = "Post Forum"
End if
End If

---------------
Silvio Andrighetti Formaggini (Piosky) [lo]

http://www.roadrunners.to.it
Sito Prove
http://www.piosky.somee.com
msn : chat_silvio@hotmail.com
pierin

Esperto
Esperto
317 Discussioni



Profilo - pierin
11 agosto 2006 alle 13:38:12 Profilo - pierinInvia un messaggio privato valchisone@hotmail.com Rispondi quotando
Ciao Silvio,
è un modulo "fatto in casa" l'idea è di avere assieme alle altre segnalazioni di aggiornamenti compiuti nel sito dal db main.mdb anche quando viene introdotto un post nuovo nel forum.
Come va corretto il codice? GRAZIE
---------------
Portale Valchisone e Germanasca
http://www.valchisone.it/web
piosky_to2003

Esperto
Esperto
2291 Discussioni



Profilo - piosky_to2003
11 agosto 2006 alle 16:50:42 Profilo - piosky_to2003Invia un messaggio privato chat_silvio@hotmail.com Rispondi quotando
Modificato il 11 agosto 2006 alle 17:08:13

l'ho scritto nel post precedente , devi testarlo cosa che io non ho fatto, non avendo il modulo, ovviamente aprendo la connessione ocn2 sul db forum.mdb non main.mdb
Set oCn2 = DBConnexion(DB_FORUM)

---------------
Silvio Andrighetti Formaggini (Piosky) [lo]

http://www.roadrunners.to.it
Sito Prove
http://www.piosky.somee.com
msn : chat_silvio@hotmail.com

Log in

Login
Password
Memorizza i tuoi dati:

Cerca

 

Sostieni AspNuke

Un piccolo gesto per aiutarci a mantenere AspNuke.it online

Promo

MusicWebItalia.it
Video Testi Traduzioni Spot Colonne sonore Accordi e Spartiti gratis.

Visitatori

Visitatori Correnti : 170
Membri : 0 offline Anna

Iscritti

 Utenti: 18940
Ultimo iscritto : glauco
Lista iscritti
Messaggi privati: 3373 Commenti: 2210 Immagini: 39 Downloads: 144 Articoli: 49 Pagine: 101 Siti web: 558 Notizie: 180 Sondaggi: 11 Preferiti: 5685298 Post sui forum: 51195 Libro degli ospiti: 4 Eventi: 7

Versioni

Temi