Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

xanburzum

[Resolvido] status bar scroller guestbook

Recommended Posts

status bar scroller guestbook populado atraves de um banco de dados

 

index.asp

<%
set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & "PASSWORD=sos; "
DSNtemp=dsntemp & "DBQ=" & server.mappath("scroll24601.mdb")
conn.Open DSNtemp
sqlstmt = "SELECT * from scroller ORDER BY ID DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sqlstmt, conn, 3, 3
TotalRecs = rs.recordcount
For x = 1 to 40
	If rs.eof then
		Exit For
	Else
	  	smessage = rs("smessage")
       ServerWrite = ServerWrite & smessage 
	    rs.MoveNext
	End If
Next%>
<HTML>

<HEAD>
<TITLE>New Page 1</TITLE>

<script language=Javascript>
<!--
var strDatabase="<% =ServerWrite %>";

function scrollit(seed) {
var m1 = "Bem-vindo ao nosso Scroller --- Aqui estão as assinaturas até agora ---------------------.";
var m2 = strDatabase;
var msg=m1+m2;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}
//-->
</SCRIPT>
</HEAD>

<BODY onLoad="scrollit(120)">

<P><BR>
 <BR>
 <IMG border="0" src="sos.jpg" align="right" width="525" height="301"><BR>
 </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P> </P>
<P align="left"> </P>
<P> </P>
<P><FONT face="Verdana" size="2"><A href="sign.asp">Assine o nosso Scroller</A></FONT></P>

</BODY>

</HTML>

SIGN.ASP

<html>

<head>
<title>New Page 1</title>

<script language=Javascript>
<!--
var strDatabase = "<% =ServerWrite %>"


function scrollit(seed) {
var m1 = "Welcome to Save.Our.Scroller --- Here are the signatures so far ---------------------";
var m2 = strDatabase;
var msg=m1+m2;
var out = " ";
var c = 1;
if (seed > 100) {
seed--;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 100 && seed > 0) {
for (c=0 ; c < seed ; c++) {
out+=" ";
}
out+=msg;
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else if (seed <= 0) {
if (-seed < msg.length) {
out+=msg.substring(-seed,msg.length);
seed--;
window.status=out;
cmd="scrollit("+seed+")";
timerTwo=window.setTimeout(cmd,100);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scrollit(100)",75);
}
}
}

// Script to display remaining characters
//Written by one bored NexusJnr September 2000
//www.nexusjnr.co.uk

var intRemain, intPrev, intCurrent, strTxt, intChange
//How many characters to allow
intRemain = 150

intPrev = 0

strTxt = "Characters left"


function display(intCurrent){


// Check if the string.length has increased or decreased

intChange = intCurrent - intPrev

if (intCurrent > intPrev){ 
   intRemain = intRemain - intChange
}else{
   intRemain =  intRemain - intChange
}

//just some messages to put on the page
//when it reaches the amount of characters
//i.e 'case X:'  where x is value remaining

switch(intRemain)
{
case 150:
strTxt = "Characters left"
break
case 100:
strTxt = "characters to fall asleep with"
break
case 50:
strTxt = "characters that people WONT READ"
break
case 10:
strTxt = "ten"
break
case 9:
strTxt = "nine"
break 
case 8:
strTxt = "< nice characters left!!"
break
case 1:
strTxt = "Nearly there"
document.form.cleft.style.color = 'black' 
break
case 0:
strTxt = "STOP"
document.form.cleft.style.color = 'red' 
break
case -1:
strTxt = "character overboard"
break 
case -2:
strTxt = "characters overboard"
break
}

//display how many spaces they have left
document.form.cleft.value = intRemain + " - " + strTxt

intPrev = intCurrent

}

-->
</SCRIPT>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>

<body>

<%
if request.querystring("flag") = 1 then
date1 = date()
sname = Replace(request.form("sname"), "'", "''")
smessage = Replace(request.form("smessage"), "'", "''")
sname = Replace(sname, chr(34), "''")
smessage = Replace(smessage, chr(34), "''")
smessage = " -" & sname & " on " & date1 & " ----- " & smessage 
' Yeah I got quotes praise the lord he he he



set conn = server.createobject("adodb.connection")
DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)}; "
DSNtemp=dsntemp & " PASSWORD=sos;"
DSNtemp=dsntemp & "DBQ=" & server.mappath("scroll24601.mdb")


    conn.Open DSNtemp

   SQLstmt = "INSERT INTO scroller (sname,date1,smessage)"
	SQLstmt = SQLstmt & " VALUES (" 
	SQLstmt = SQLstmt & "'" & sname & "',"
	SQLstmt = SQLstmt & "'" & date1 & "',"
	SQLstmt = SQLstmt & "'" & smessage & "'"
	SQLstmt = SQLstmt & ")"

	Set RS = conn.execute(SQLstmt)
%>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><font face="Verdana">OBRIGADO !</font></p>
<p align="center"> </p>
<p align="center"> </p>
<p align="center"><font face="Verdana"><b>Você será lembrado meu amigo</b><br>
<br>
<a href="index.asp"><font size="2">HOME</font></a></font></p>
<%else%>
<p align="center"><img border="0" src="sign.h1.gif"> </p>
<form name="form" method="POST" action="sign.asp?flag=1">
  <p align="center"><font face="Verdana" size="2">Apresentamos o primeiro 
  scroller assináveis! <br>
  vá em frente que você assinar mensagem (100 caracteres MAX!)</font></p>
  <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" width="668">
      <tr>
        <td width="222">
          <p align="right"></td>
        <td width="221"><font face="Verdana" size="1">NOme:<br>
          <input type="text" name="sname" size="20" maxlength="30"><br>
          MeNsageM:</font><br>
          <input type="text" name="smessage" size="36" onpropertychange="display(this.value.length)" maxlength="150"></td>
        <td width="221"><input type="image" src="sign.h2.gif" value="Submit" name="I1" size="20"></td>
      </tr>
      <tr>
        <td width="166">
          <p align="center"></td>
        <td width="166"></td>
        <td width="332"></td>
      </tr>
    </table>
    </center>
  </div>
  <div align="center">
    <center>
    <table border="0" cellpadding="0" cellspacing="0" width="359">
      <tr>
        <td width="357"><img border="0" src="sign.h3.gif"></td>
      </tr>
      <tr>
        <td width="357"><img border="0" name="picBar" src="sign.h4.gif" width="456" height="1"></td>
      </tr>
      <tr>
        <td width="357"><img border="0" src="sign.h5.gif"></td>
      </tr>
      <tr>
        <td width="357">
          <p align="center"><input type="text" name="cleft" size="64" value="Por favor habilite Java em configurações do seu navegador" style="font-family: Verdana; font-size: 10pt; text-align: Center; letter-spacing: 1pt; border: 1 solid #FFFFFF"></p>
        </td>
      </tr>
    </table>
    </center>
  </div>
  <p align="center"><br>
  <br>
   <br>
  <br>
  </p>
</form>
<script language=Javascript>
<!--
document.form.cleft.value = intRemain + " - " + strTxt
-->
</SCRIPT>

</body>

</html>
<% end if %>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.