Gestione News

jan267

Utente Attivo
6 Mar 2003
1.950
2
38
35
Milano
twitter.com
Ciao a tutti,
volevo dire che sta sera ho fatto uno scriptino molto semplice per la gestione delle news.

E` veramente molto, ma molto, semplice... se può interessarvi, ve lo mando.. :)
Saluti, Jacopo :)
 

lukeonweb

Utente Attivo
5 Mar 2003
5.175
13
38
46
Napoli
www.lucaruggiero.it
(Jacopo ti ho risposto in pvt, thanx!)

Ma le tabelle di questo forum sono relazionate o no???

Perchè la discussione nell'elenco è a nome jacoz e nel post compare jan267?

:confused:
 

jan267

Utente Attivo
6 Mar 2003
1.950
2
38
35
Milano
twitter.com
Luca, e` colpa della mia di indecisione :°
Non preoccuparti :p e` tutto apposto :)

Allora incomincio a mandarlo anche a te questo script ?
Mando per email :)
CiauZ :)
 

jan267

Utente Attivo
6 Mar 2003
1.950
2
38
35
Milano
twitter.com
:eek: Grazie :)
le avrai trovate le querystring presumo..! :p
Comunque poi boh... magari metto il link al "Login"...
Si vedra` :)
Ri-grazie ciauz ;)
 

andreathedove

Utente Attivo
17 Mar 2003
175
0
0
46
www.allinonenet.it
Anca mi la news per piaser hi hi !!!

Ciao ragazzi,
sono nuovo del forum e spero di nn disturbare...

Volevo chiederti se anch'io posso avere lo script asp per la news, molto stupenda ma molto molto bella..

la mia email [email protected]

Vi ringrazio ragazzi, e se volete scambiare un link testuale o banner ocn il mio sito venitemi a trovare http://www.allinonenet.it , e scrivetemi a [email protected].

cipe e ciapetela ragazzi ve vojo ben...
:D
 

grottafelix

Utente Attivo
5 Mar 2003
2.410
2
38
45
Parco chiuso -
www.girsms.com
Jan vorrei che ci fosse anche l'ora d'immissione a fianco di ogo news oltre che alla data.
e' possibile??
posto il codice per chi non lo conoscesse

P.S. COME VEDI HO GIA' INSERITO IL REFRESH AUTOMATICO
code:



<% Response.Buffer = True %>
<link rel="stylesheet" href="style.css" type="text/css">
<body onload="setTimeout('location.reload()',20000)" bgcolor="#C0C0C0">

<div align="center">
<% If Request.QueryString("act") = "ShowNews" OR Request.QueryString("act") = "" Then %>
<table cellspacing="1" cellpadding="0" width="430" bgcolor="#0099FF" border="0" height="12">



<tr>
<td bgcolor="#FFFFFF" height="18">
<table cellspacing="1" cellpadding="1" width="406" bgcolor="#FFFFFF" border="0" height="1">
</table>
<table cellspacing="1" cellpadding="1" width="430" bgcolor="#FFFFFF" border="0" height="8">
<td bgcolor="#FFFFFF" height="2" colspan="2">
<table cellspacing="1" cellpadding="1" width="430" bgcolor="#FFFFFF" border="0" height="8">
<tr>
<td bgcolor="#FFFFFF" height="2">
<!-- #INCLUDE file="adovbs.inc" -->
<%
Dim iPageSize
Dim iPageCount
Dim iPageCurrent
Dim RS2
Dim iRecordsShown

iPageSize = 5
If Request.QueryString("PageNews") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("PageNews"))
End If

Dim Conn2
Set Conn2 = Server.CreateObject("ADODB.Connection")
conn2.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("mdb-database/news.mdb")

Set rs2 = Server.CreateObject("ADODB.Recordset")
sql2 = "SELECT * FROM news ORDER BY id DESC"
RS2.Open sql2, conn2, adOpenKeyset
RS2.PageSize = iPageSize
RS2.CacheSize = iPageSize
iPageCount = RS2.PageCount

Dim totale
totale = rs2.recordcount
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount

If iPageCurrent < 1 Then iPageCurrent = 1
If iPageCount = 0 Then
Response.Redirect("default.asp")
Else
RS2.AbsolutePage = iPageCurrent
%>
<table align="center" width="417" cellpadding="0" cellspacing="0" height="19">
<%
iRecordsShown = 0
Do While iRecordsShown < iPageSize And Not RS2.EOF
%>
<tr>
<td width="10">
<li>
&nbsp;</td>
<td width="398"><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#000099"><b><%= rs2("data")%></b></font>
<font face="Verdana, Arial, Helvetica, sans-serif" size="1">-
<%= rs2("messaggio")%></font></td>
</tr>
<%
iRecordsShown = iRecordsShown + 1
RS2.MoveNext
Loop
End If

RS2.Close
Set RS2 = Nothing
Conn2.Close
Set Conn2= Nothing
%>
</table>
<table align="center" width="404" cellpadding="0" cellspacing="0" height="19">
<tr>
<td width="50%"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<%
If iPageCurrent <> 1 Then
%>
<a href="news.asp?act=ShowNews&PageNews=<%= iPageCurrent - 1 %>">&laquo;
Precedente</a>
<% End If %>
</font></td>
<td width="50%" align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<%
If iPageCurrent < iPageCount Then
%>
<a href="news.asp?act=ShowNews&PageNews=<%= iPageCurrent + 1 %>">Successivo
&raquo; </a>
<% End If %>
</font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
If Session("sicuro") <> "si" Then
Response.Write "<br><a href=""news.asp?act=ShowForm""><font size=""1"" face=""Verdana, Arial, Helvetica, sans-serif"">Aggiungi una news.</font></a><br>"
Else
Response.Write "<br><a href=""news.asp?act=Logout""><font size=""1"" face=""Verdana, Arial, Helvetica, sans-serif"">Logout.</font></a><br>"
End If
%>
<% End If %>
<%
If Request.QueryString("act") = "ShowForm" Then
If Session("sicuro") <> "si" Then Response.Redirect "news.asp?act=Login"
Response.Write " <table align=""center"" cellpadding=""1"" cellspacing=""0"" width=""430"" bgcolor=""#0099FF"">" &_
" <tr> " &_
" <td colspan=""2"" align=""right"" bgcolor=""#FFFFFF"">" &_
" <table align=""center"" width=""430"" cellpadding=""0"" cellspacing=""2"" height=""19"">" &_
" <form method=""post"" action=""news.asp?act=PostNews"">" &_
" <tr> " &_
" <td>" &_
" <div align=""center""><b><font face=""Verdana, Arial, Helvetica, sans-serif"" size=""2"">Messaggio</font></b></div>" &_
" </td>" &_
" </tr>" &_
" <tr> " &_
" <td> " &_
" <div align=""center"">" &_
" <textarea name=""messaggio"" rows=""5"" cols=""30""></textarea>" &_
" </div>" &_
" </td>" &_
" </tr>" &_
" <tr> " &_
" <td> " &_
" <div align=""center"">" &_
" <input type=""submit"" value="" Posta "" name=""submit"">" &_
" <input type=""reset"" value="" Cancella "" name=""reset"">" &_
" </div>" &_
" </td>" &_
" </tr>" &_
" </form>" &_
" </table>" &_
" </td>" &_
" </tr>" &_
" </table>"
Response.End
End If
%>
<%
If Request.QueryString("act") = "PostNews" Then
If Session("sicuro") <> "si" Then Response.Redirect "news.asp?act=Login"
Dim messaggio
Dim data
messaggio=Request.Form("messaggio")
data=DateSerial(Year(Now),Month(Now),Day(Now))

If messaggio="" Then
Response.Write"<font face=""verdana"" size=""1"">Inserire un messaggio<br><a href=""javascript:history.back(-1)"">Indietro!</a></font>"
Response.End
End If

Dim conn
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("mdb-database/news.mdb")
Sql = "SELECT * FROM news"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn, 3, 3
RS.AddNew
rs.Fields("messaggio")=messaggio
rs.Fields("data")=data
rs.update
RS.Close

Set RS=Nothing
conn.Close

Set conn=Nothing
response.redirect("news.asp?act=ShowNews")
End If
%>
<%If Request.QueryString("act") = "Logout" Then
Session.Abandon()
Response.Redirect "news.asp?act=ShowNews"
Response.End
End If
%>
<%If Request.QueryString("act") = "Login" Then
Dim username
username=Request.Form("username")
Dim pass
pass=Request.Form("password")
user = Replace(Request.Form("username"),"'","''")
pwd = Replace(Request.Form("password"),"'","''")
If user="prova" AND pwd="prova" Then
Session("sicuro")="si"
Session.Timeout=20
Response.Redirect("news.asp?act=ShowForm")
Response.End
Else
Response.Write "<font face=""Verdana"" size=""2"" color=""red"">Errore: Username o Password errati !</font><br><br>" &_
" <table align=""center"" cellpadding=""1"" cellspacing=""0"" width=""430"" bgcolor=""#0099FF"">" &_
" <tr> " &_
" <td colspan=""2"" align=""right"" bgcolor=""#FFFFFF"">" &_
" <table align=""center"" width=""430"" cellpadding=""0"" cellspacing=""2"" height=""19"">" &_
" <form method=""post"" action=""news.asp?act=Login"">" &_
" <tr> " &_
" <td>" &_
" <div align=""center""><b><font face=""Verdana, Arial, Helvetica, sans-serif"" size=""2"">Login</font></b></div>" &_
" </td>" &_
" </tr>" &_
" <tr> " &_
" <td> " &_
" <div align=""center"">" &_
" <font face=""Verdana, Arial, Helvetica, sans-serif"" size=""1"">Username:</font><br><input type=""text"" name=""username""><br>" &_
" <font face=""Verdana, Arial, Helvetica, sans-serif"" size=""1"">Password:</font><br><input type=""text"" name=""password""><br>" &_
" <input type=""submit"" value="" Login "">" &_
" </div>" &_
" </td>" &_
" </tr>" &_
" </form>" &_
" </table>" &_
" </td>" &_
" </tr>" &_
" </table>"
Response.End
End If
%>
<% End If %>
</div>
 

jan267

Utente Attivo
6 Mar 2003
1.950
2
38
35
Milano
twitter.com
semplice, cambia:
data=DateSerial(Year(Now),Month(Now),Day(Now))
e metti:
data=DateSerial(Year(Now),Month(Now),Day(Now)) & " " & Hour(Now) & ":" & Minute(Now) & ":" & Second(Now) !!
ciauz :D
 

andreathedove

Utente Attivo
17 Mar 2003
175
0
0
46
www.allinonenet.it
Aiutino smepre se nn disturbo !!!

come posso dire allo script di mandarmi a capo le frasi cioe il mitico "<br>" e quando fare tanti spezi quando lo dico io cioe il mitco "-&nbsp;-" naturalmente senza il -
 
Discussioni simili
Autore Titolo Forum Risposte Data
C Cerco partner per gestione portale google news Offerte e Richieste di Lavoro e/o Collaborazione 0
L Gestione news in xml PHP 5
F Sistema gestione news in Flash Flash 4
G script per gestione news PHP 13
G Script gestione news PHP 3
H script x gestione news PHP 0
A Gestione array multidimensionale PHP 6
andreas88 Gestione Profilo OnlyFans Leggi, Normative e Fisco 0
A Creazione cookie e gestione accessi PHP 0
B form gestione input PHP 2
sbolde91 Consiglio gestione Hosting Hosting 2
E Gestione profilo utente tramite Form PHP 3
S cerco esperto gestione ecommerce Offerte e Richieste di Lavoro e/o Collaborazione 0
P Curiosità su grandi aziende e la gestione delle grafiche. Discussioni Varie 1
M Consiglio sulla gestione di Gerarchie Database 0
A attributo "min" per input gestione date PHP 8
L Gestione DB ASP.NET 2
L Consiglio SEO gestione dominio + free hosting SEO e Posizionamento 6
avalon95 [WordPress] Gestione database annunci WordPress 0
G [PHP] gestione mouse PHP 2
B Gestione Prenotazioni con Mysql Database 21
D CREAZIONE E GESTIONE SITO E-COMMERCE Offerte e Richieste di Lavoro e/o Collaborazione 2
P (Cerco) Collaboratori per gestione social media Offerte e Richieste di Lavoro e/o Collaborazione 5
psicomia Gestione funzione in javascript in tabella richiamare"textarea" valori preimpostati in "select" Javascript 2
brasoft2019 [PHP] Sistema di gestione presenze PHP 29
W Preventivo gestione ecommerce Discussioni Varie 1
E Cerco partner / socio per gestione sito di annunci incontri Offerte e Richieste di Lavoro e/o Collaborazione 0
K e-commerce per distribuzione e dettaglio con gestione magazzino E-Commerce 0
G [MS Access] Gestione biglietti [RISOLTO] MS Access 2
Jonn [WordPress] Gestione categorie e tags per sito eventi WordPress 2
felino Gestione dispositivi e Altri dispositivi Windows e Software 4
D Software per gestione account facebook? Social Media Marketing 1
D Cero Software Facebook gestione account Vendere e Acquistare pubblicita' online 0
M Offro servizio Incremento Follower e Gestione Profili Istagram Offerte e Richieste di Lavoro e/o Collaborazione 0
S elementi statistici - Matrice e Gestione Array PHP o Javascript Javascript 0
J [offro] hosting / installazione certificati ssl / gestione server Offerte e Richieste di Lavoro e/o Collaborazione 0
F [PHP] gestione meteo manuale per un gioco di ruolo PHP 1
bianca_dimulescu Gestione tabella e MySQL PHP 4
T Servizio gestione pagina Instagram Offerte e Richieste di Lavoro e/o Collaborazione 0
G Gestione e/o vendita hosting come libero professionista Leggi, Normative e Fisco 4
MatMac System [PHP] Gestione dinamica select-option PHP 3
xone [Vendo] Script gestionale php-mysql gestione pratiche Altri Annunci 0
S [PHP] Gestione coupon PHP 3
lxella [PHP] Aree riservate e gestione utenti PHP 1
D Gestione punteggi php PHP 1
B Cercasi socio per gestione sito web Offerte e Richieste di Lavoro e/o Collaborazione 0
G gestione pagina facebook Social Media Marketing 0
Cavalinho08 [Offro gestione pagine instagram, prezzo bassissimo] Annunci servizi di Social Media Marketing 3
D [VENDO] Gestione account instagram Annunci servizi di Social Media Marketing 2
N [VENDO] Gestione pagine FB Annunci servizi di Social Media Marketing 2

Discussioni simili