10-09-07, 04:21 PM
Newbie Coder
Join Date: Aug 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Testimonial Page Help
Hey everyone,
need some help its proberly simple but i cant seem to figure it out... here is a link to my page :
http://www.mobiletyres4u.co.uk/viewguestbook.asp
How do i make the color of the date change to Red???
Here is the asp
PHP Code:
<! DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
< html >< head >< title > Testimonials </ title >
< style type = "text/css" >
<!--
a { text - decoration : none }
a : hover { font - family : Verdana ; font - size : 15 ; color : #ff0000; text-decoration: underline;}
a : link { font - family : Verdana ; font - size : 15 ; color : #3333ff; text-decoration: none;}
td , th , select , text { font - family : Verdana ; font - size : 11 ; color : #ffffff;}
body { font - family : Verdana ; font - size : 15 ; color : #ffff33;}
//-->
</ style >
</ head >
< body topmargin = "0" bottommargin = "0" rightmargin = "0" leftmargin = "0" marginheight = "0" marginwidth = "0" bgcolor = #000000>
<!-- webbot bot = "Include" U -Include= "BANNER.HTM" TAG = "BODY" startspan -->
< p align = "center" >
< img border = "0" src = "tyrelogo1.jpg" width = "771" height = "112" ></ p >
< p align = "center" >
< a href = "http://www.mobiletyres4u.co.uk/index.htm" >
< font color = "#FFFFFF" > Home </ font ></ a >< font color = "#FFFFFF" > |
< a href = "http://www.mobiletyres4u.co.uk/postcode.htm" >< font color = "#FFFFFF" > Tyre
Quotation </ font ></ a ></ font ></ a >< font color = "#FFFFFF" > |
< a href = "http://www.mobiletyres4u.co.uk/bookingpage.htm" >
< font color = "#FFFFFF" >< blink > Arrange a Fitment </ blink ></ font ></ a > |
< a href = "http://www.mobiletyres4u.co.uk/aboutus.htm" >
< font color = "#FFFFFF" > about us </ font ></ a >
|
< a href = "http://www.mobiletyres4u.co.uk/contactus.htm" >< font color = "#FFFFFF" > contact us </ font ></ a ></ font ></ p >
<!-- webbot bot = "Include" i - checksum = "4922" endspan -->< p align = "center" >
& nbsp ;</ p >
< p align = "center" >
< font style = "font-size: 22pt; color: #ffffff; text-decoration: underline; font-weight: 700" >
Customer Testimonials </ font ></ p >
< br />< br />
<%
Const ForReading = 1 , ForWriting = 2 , ForAppending = 8
Dim ThisLine , PrintLine
Set FileObject = Server . CreateObject ( "Scripting.FileSystemObject" )
GuestBookFile = Server . MapPath ( "guestbook.txt" )
Set InputStream = FileObject . OpenTextFile ( GuestBookFile , ForReading , False )
Do While Not InputStream . AtEndOfStream
ThisLine = split ( InputStream . ReadLine , "vbCrLf " )
For x = LBound ( ThisLine ) To UBound ( ThisLine )
If x = UBound ( ThisLine ) + 1 Then
PrintLint = ThisLine ( x ) + "<br/>" + PrintLine
Else
PrintLine = ThisLine ( x ) + "<br/>" + PrintLine
End If
Next
PrintLine = "<br/>" + PrintLine
Loop
InputStream . Close
Set OutputStream = Nothing
Set FileObject = Nothing
Response . Write replace ( PrintLine , "//vbReturn//" , " <br> " )
%>
< br />< br />< center >< b >< a href = "default.asp" > Add Your Comments </ a ></ b ></ center >< br />< br />
</ body >
</ html >
or how would i altenate each submission, say red, yellow, red, yellow
hope this makes sense
cheers
10-10-07, 01:21 PM
Newbie Coder
Join Date: Aug 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
or if that cant be done how about putting each comment in a box to separate them. it just looks a bit tatty, and i want to tidy it up, maybe a table and centralize it
any ideas??
Last edited by Nico; 10-10-07 at 01:45 PM .
Reason: Please don't bold the whole post.
10-10-07, 07:57 PM
the easiest way is css and add a variable that you check on the display of each record. if var =1 then style1 else style2
it would be something like this
asp Code:
dim varStyle
varStyle =1
do while not eof
if varStyle = 1 then
response .write ( "<div class=style1>" )
varstyle = 2
else
response .write ( "<div class=style2>" )
varstyle = 1
end if
'display record
loop
thats not all real code, most is but it should give you an idea on how to do this. (tables would work, but i would try to avoid them to keep your design flexible)
10-11-07, 02:18 AM
Newbie Coder
Join Date: Aug 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
how would i put this into my code?? im not that good at coding and dont want to mess up what i already have
10-11-07, 05:31 AM
Community Liaison
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
Maybe like this:
ASP Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html><head><title>Testimonials</title>
<style type="text/css" >
<!--
a{ text-decoration:none}
a:hover { font-family: Verdana; font-size: 15 ; color: #ff0000; text-decoration: underline;}
a:link { font-family: Verdana; font-size: 15 ; color: #3333ff; text-decoration: none;}
td, th, select , text { font-family: Verdana; font-size: 11 ; color: #ffffff;}
body { font-family: Verdana; font-size: 15 ; color: #ffff33;}
.style1 { border:1px solid #ffffff;padding:5px;color:#ff0000;}
.style2 { border:1px solid #ffffff;padding:5px;color:#ffff33;
}
//-->
</style>
</head>
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor=#000000>
<!--webbot bot="Include" U-Include ="BANNER.HTM" TAG="BODY" startspan -->
<p align="center" >
<img border="0" src="tyrelogo1.jpg" width="771" height="112" ></p>
<p align="center" >
<a href="http://www.mobiletyres4u.co.uk/index.htm" >
<font color="#FFFFFF" >Home</font></a><font color="#FFFFFF" > |
<a href="http://www.mobiletyres4u.co.uk/postcode.htm" ><font color="#FFFFFF" >Tyre
Quotation</font></a></font></a><font color="#FFFFFF" > |
<a href="http://www.mobiletyres4u.co.uk/bookingpage.htm" >
<font color="#FFFFFF" ><blink>Arrange a Fitment</blink></font></a> |
<a href="http://www.mobiletyres4u.co.uk/aboutus.htm" >
<font color="#FFFFFF" >about us</font></a>
|
<a href="http://www.mobiletyres4u.co.uk/contactus.htm" ><font color="#FFFFFF" >contact us</font></a></font></p>
<!--webbot bot="Include" i-checksum="4922" endspan --><p align="center" >
</p>
<p align="center" >
<font style="font-size: 22pt; color: #ffffff; text-decoration: underline; font-weight: 700" >
Customer Testimonials</font></p>
<br/><br/>
<%
Const ForReading = 1 , ForWriting = 2 , ForAppending = 8
Dim ThisLine, PrintLine, varStyle
varStyle = 1
Set FileObject = Server .CreateObject ( "Scripting.FileSystemObject" )
GuestBookFile = Server .MapPath ( "guestbook.txt" )
Set InputStream = FileObject.OpenTextFile ( GuestBookFile, ForReading, False )
Do While Not InputStream.AtEndOfStream
ThisLine = split( InputStream.ReadLine , "vbCrLf " )
For x = LBound ( ThisLine) To UBound ( ThisLine)
If x = UBound ( ThisLine) + 1 Then
PrintLine = ThisLine( x) + "<br/>" + PrintLine
Else
PrintLine = ThisLine( x) + "<br/>" + PrintLine
End If
Next
if varStyle = 1 then
PrintLine = "<br/><div class='style1'>" + PrintLine + "</div>"
varStyle = 2
else
PrintLine = "<br/><div class='style2'>" + PrintLine + "</div>"
varStyle = 1
end if
Loop
InputStream.Close
Set OutputStream = Nothing
Set FileObject = Nothing
Response .Write replace ( PrintLine, "//vbReturn//" , " <br> " )
%>
<br/><br/><center><b><a href="default.asp" >Add Your Comments</a></b></center><br/><br/>
</body>
</html>
I am assuming that the first
PrintLint is supposed to be PrintLine.
In this code, is there a reason the If and else do the same thing?
ASP Code:
For x = LBound ( ThisLine) To UBound ( ThisLine)
If x = UBound ( ThisLine) + 1 Then
PrintLine = ThisLine( x) + "<br/>" + PrintLine
Else
PrintLine = ThisLine( x) + "<br/>" + PrintLine
End If
Or is it really supposed to be:
ASP Code:
For x = LBound ( ThisLine) To UBound ( ThisLine)
If x = UBound ( ThisLine) + 1 Then
PrintLint = ThisLine( x) + "<br/>" + PrintLine
Else
PrintLine = ThisLine( x) + "<br/>" + PrintLine
End If
__________________
Jerry Broughton
Last edited by job0107; 10-11-07 at 05:41 AM .
10-11-07, 12:17 PM
Newbie Coder
Join Date: Aug 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
ok iv added the code... looks really good thanks...this is it changed :
www.mobiletyres4u.co.uk/viewguestbook.asp just one thing, how can i made it display pages, e.g. 10 comments a page
Really really appreciate all ya help folks, Any idea how to do it????
10-11-07, 12:26 PM
Community Liaison
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
That wasn't the results I was expecting. Can you post your code as it is now?
__________________
Jerry Broughton
10-11-07, 12:49 PM
Newbie Coder
Join Date: Aug 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
still looks good thou
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Testimonials</title>
<style type="text/css">
<!--
/*Created by Guestbook Generator - Freeware - http://support.it-mate.co.uk/?mode=P...tbookgenerator */
a{text-decoration:none}
a:hover {font-family: Verdana; font-size: 15; color: #ff0000; text-decoration: underline;}
a:link {font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none;}
td, th, select, text {font-family: Verdana; font-size: 11; color: #ffffff;}
body {font-family: Verdana; font-size: 15; color: #ffff33;}
.style1 {border:1px solid #ffffff;padding:5px;color:#ff0000;}
.style2 {border:1px solid #ffffff;padding:5px;color:#ffff33;
}
//-->
</style>
</head>
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor=#000000>
<p align="center">
<img border="0" src="tyrelogo1.jpg"></p>
<p align="center">
<a href="http://www.mobiletyres4u.co.uk/index.htm" style="font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none">
<font color="#FFFFFF" size="3" face="serif">Home</font></a><font color="#FFFFFF"><font size="3" face="serif"> |
</font>
<a href="http://www.mobiletyres4u.co.uk/postcode.htm" style="font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none">
<font color="#FFFFFF" size="3" face="serif">Tyre
Quotation</font></a></font><font size="3" face="serif"></a></font><font color="#FFFFFF"><font size="3" face="serif"> |
</font>
<a href="http://www.mobiletyres4u.co.uk/bookingpage.htm" style="font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none">
<font color="#FFFFFF" size="3" face="serif"><blink>Arrange a Fitment</blink></font></a><font size="3" face="serif"> |
</font>
<a href="http://www.mobiletyres4u.co.uk/aboutus.htm" style="font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none">
<font color="#FFFFFF" size="3" face="serif">about us</font></a><font size="3" face="serif">
| </font>
<a href="http://www.mobiletyres4u.co.uk/contactus.htm" style="font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none">
<font color="#FFFFFF" size="3" face="serif">contact us</font></a></font></p>
<p align="center">
</p>
<p align="center">
<font style="font-size: 22pt; color: #ffffff; text-decoration: underline; font-weight: 700">
Customer Testimonials</font></p>
<br/><br/><left><b><a href="gbook.asp">Add Your Comments</a></b></center><br/><br/>
<%
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim ThisLine, PrintLine, varStyle
varStyle = 1
Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
GuestBookFile = Server.MapPath("guestbook.txt")
Set InputStream = FileObject.OpenTextFile(GuestBookFile, ForReading, False)
Do While Not InputStream.AtEndOfStream
ThisLine = split(InputStream.ReadLine, "vbCrLf ")
For x = LBound(ThisLine) To UBound(ThisLine)
If x = UBound(ThisLine) + 1 Then
PrintLine = ThisLine(x) + "<br/>" + PrintLine
Else
PrintLine = ThisLine(x) + "<br/>" + PrintLine
End If
Next
if varStyle = 1 then
PrintLine = "<br/><div class='style1'>" + PrintLine + "</div>"
varStyle = 2
else
PrintLine = "<br/><div class='style2'>" + PrintLine + "</div>"
varStyle = 1
end if
Loop
InputStream.Close
Set OutputStream = Nothing
Set FileObject = Nothing
Response.Write replace(PrintLine, "//vbReturn//", " <br> ")
%>
</body>
</html>
if you could do it soo it lists 10 comments and then say <<next page>> or something like that... it a be great
10-11-07, 01:12 PM
Community Liaison
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
In order to implement a "next page" feature, that would require coding a page navigation system. I'll have to think about it. Right now I am trying to figure out how to write the code so each comment is in it's own div instead of embedded div's.
Tyr it like this:
ASP Code:
</BODY>
</HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html><head><title>Testimonials</title>
<style type="text/css" >
<!--
a{ text-decoration:none}
a:hover { font-family: Verdana; font-size: 15 ; color: #ff0000; text-decoration: underline;}
a:link { font-family: Verdana; font-size: 15 ; color: #3333ff; text-decoration: none;}
td, th, select , text { font-family: Verdana; font-size: 11 ; color: #ffffff;}
body { font-family: Verdana; font-size: 15 ; color: #ffff33;}
.style1 { border:1px solid #ffffff;padding:10px;color:#ff0000;}
.style2 { border:1px solid #ffffff;padding:10px;color:#ffff33;
}
//-->
</style>
</head>
<body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor=#000000>
<!--webbot bot="Include" U-Include ="BANNER.HTM" TAG="BODY" startspan -->
<p align="center" >
<img border="0" src="tyrelogo1.jpg" width="771" height="112" ></p>
<p align="center" >
<a href="http://www.mobiletyres4u.co.uk/index.htm" >
<font color="#FFFFFF" >Home</font></a><font color="#FFFFFF" > |
<a href="http://www.mobiletyres4u.co.uk/postcode.htm" ><font color="#FFFFFF" >Tyre
Quotation</font></a></font></a><font color="#FFFFFF" > |
<a href="http://www.mobiletyres4u.co.uk/bookingpage.htm" >
<font color="#FFFFFF" ><blink>Arrange a Fitment</blink></font></a> |
<a href="http://www.mobiletyres4u.co.uk/aboutus.htm" >
<font color="#FFFFFF" >about us</font></a>
|
<a href="http://www.mobiletyres4u.co.uk/contactus.htm" ><font color="#FFFFFF" >contact us</font></a></font></p>
<!--webbot bot="Include" i-checksum="4922" endspan --><p align="center" >
</p>
<p align="center" >
<font style="font-size: 22pt; color: #ffffff; text-decoration: underline; font-weight: 700" >
Customer Testimonials</font></p>
<br/><br/>
<%
Const ForReading = 1 , ForWriting = 2 , ForAppending = 8
Dim ThisLine, PrintLine, varStyle
varStyle = 1
Set FileObject = Server .CreateObject ( "Scripting.FileSystemObject" )
GuestBookFile = Server .MapPath ( "guestbook.txt" )
Set InputStream = FileObject.OpenTextFile ( GuestBookFile, ForReading, False )
Do While Not InputStream.AtEndOfStream
ThisLine = split( InputStream.ReadLine , "vbCrLf " )
if varStyle = 1 then
PrintLine = PrintLine + "<div class='style1'>"
varStyle = 2
else
PrintLine = PrintLine + "<div class='style2'>"
varStyle = 1
end if
For x = LBound ( ThisLine) To UBound ( ThisLine)
If x = UBound ( ThisLine) + 1 Then
PrintLine = ThisLine( x) + "<br/>" + PrintLine
Else
PrintLine = ThisLine( x) + "<br/>" + PrintLine
End If
Next
PrintLine = PrintLine + "</div><br/>"
Loop
InputStream.Close
Set OutputStream = Nothing
Set FileObject = Nothing
Response .Write replace ( PrintLine, "//vbReturn//" , " <br/> " )
%>
<br/><br/><center><b><a href="default.asp" >Add Your Comments</a></b></center><br/><br/>
</body>
</html>
__________________
Jerry Broughton
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes
Linear Mode
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off