Current location: Hot Scripts Forums » Programming Languages » ASP » Testimonial Page Help


Testimonial Page Help

Reply
  #1 (permalink)  
Old 10-09-07, 04:21 PM
FINESTICE FINESTICE is offline
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-familyVerdanafont-size15color#ff0000; text-decoration: underline;}
a:link    {font-familyVerdanafont-size15color#3333ff; text-decoration: none;}
tdthselecttext     {font-familyVerdanafont-size11color#ffffff;}
body   {font-familyVerdanafont-size15color#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 1ForWriting 2ForAppending 8
   Dim ThisLine
PrintLine
   Set FileObject 
Server.CreateObject("Scripting.FileSystemObject")
   
GuestBookFile Server.MapPath("guestbook.txt")
   
Set InputStream FileObject.OpenTextFile(GuestBookFileForReadingFalse)
   Do While 
Not InputStream.AtEndOfStream
       ThisLine 
split(InputStream.ReadLine"vbCrLf ")
       For 
LBound(ThisLineTo UBound(ThisLine)
           If 
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
Reply With Quote
  #2 (permalink)  
Old 10-10-07, 01:21 PM
FINESTICE FINESTICE is offline
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.
Reply With Quote
  #3 (permalink)  
Old 10-10-07, 07:57 PM
koncept
Guest
 
Posts: n/a
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:
  1. dim varStyle
  2. varStyle =1
  3. do while not eof
  4. if varStyle = 1 then
  5. response.write("<div class=style1>")
  6. varstyle = 2
  7. else
  8. response.write("<div class=style2>")
  9. varstyle = 1
  10. end if
  11. 'display record
  12. 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)
Reply With Quote
  #4 (permalink)  
Old 10-11-07, 02:18 AM
FINESTICE FINESTICE is offline
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
Reply With Quote
  #5 (permalink)  
Old 10-11-07, 05:31 AM
job0107's Avatar
job0107 job0107 is offline
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:
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html><head><title>Testimonials</title>
  3. <style type="text/css">
  4. <!--
  5. a{text-decoration:none}
  6. a:hover   {font-family: Verdana; font-size: 15; color: #ff0000; text-decoration: underline;}
  7. a:link    {font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none;}
  8. td, th, select, text     {font-family: Verdana; font-size: 11; color: #ffffff;}
  9. body   {font-family: Verdana; font-size: 15; color: #ffff33;}
  10. .style1   {border:1px solid #ffffff;padding:5px;color:#ff0000;}
  11. .style2   {border:1px solid #ffffff;padding:5px;color:#ffff33;
  12.  }
  13. //-->
  14. </style>
  15. </head>
  16.  
  17. <body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor=#000000>
  18.  
  19.  
  20. <!--webbot bot="Include" U-Include="BANNER.HTM" TAG="BODY" startspan -->
  21.  
  22. <p align="center">
  23.         <img border="0" src="tyrelogo1.jpg" width="771" height="112"></p>
  24.  
  25. <p align="center">
  26.         <a href="http://www.mobiletyres4u.co.uk/index.htm">
  27. <font color="#FFFFFF">Home</font></a><font color="#FFFFFF"> |
  28. <a href="http://www.mobiletyres4u.co.uk/postcode.htm"><font color="#FFFFFF">Tyre
  29. Quotation</font></a></font></a><font color="#FFFFFF"> |
  30.         <a href="http://www.mobiletyres4u.co.uk/bookingpage.htm">
  31.         <font color="#FFFFFF"><blink>Arrange a Fitment</blink></font></a> |
  32.         <a href="http://www.mobiletyres4u.co.uk/aboutus.htm">
  33.         <font color="#FFFFFF">about us</font></a>
  34.         |
  35. <a href="http://www.mobiletyres4u.co.uk/contactus.htm"><font color="#FFFFFF">contact us</font></a></font></p>
  36.  
  37. <!--webbot bot="Include" i-checksum="4922" endspan --><p align="center">
  38. &nbsp;</p>
  39.  
  40.  
  41. <p align="center">
  42. <font style="font-size: 22pt; color: #ffffff; text-decoration: underline; font-weight: 700">
  43. Customer Testimonials</font></p>
  44. <br/><br/>
  45. <%
  46.    Const ForReading = 1, ForWriting = 2, ForAppending = 8
  47.    Dim ThisLine, PrintLine, varStyle
  48.    varStyle = 1
  49.    Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
  50.    GuestBookFile = Server.MapPath("guestbook.txt")
  51.    Set InputStream = FileObject.OpenTextFile(GuestBookFile, ForReading, False)
  52.    Do While Not InputStream.AtEndOfStream
  53.        ThisLine = split(InputStream.ReadLine, "vbCrLf ")
  54.        For x = LBound(ThisLine) To UBound(ThisLine)
  55.            If x = UBound(ThisLine) + 1 Then
  56.                PrintLine = ThisLine(x) + "<br/>" + PrintLine
  57.            Else
  58.                PrintLine = ThisLine(x) + "<br/>" + PrintLine
  59.            End If
  60.        Next
  61.        if varStyle = 1 then
  62.        PrintLine = "<br/><div class='style1'>" + PrintLine + "</div>"
  63.        varStyle = 2
  64.        else
  65.        PrintLine = "<br/><div class='style2'>" + PrintLine + "</div>"
  66.        varStyle = 1
  67.        end if
  68.    Loop
  69.    InputStream.Close
  70.    Set OutputStream = Nothing
  71.    Set FileObject = Nothing
  72.    Response.Write replace(PrintLine, "//vbReturn//", " <br> ")
  73. %>
  74. <br/><br/><center><b><a href="default.asp">Add Your Comments</a></b></center><br/><br/>
  75. </body>
  76. </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:
  1. For x = LBound(ThisLine) To UBound(ThisLine)
  2.            If x = UBound(ThisLine) + 1 Then
  3.                PrintLine = ThisLine(x) + "<br/>" + PrintLine
  4.            Else
  5.                PrintLine = ThisLine(x) + "<br/>" + PrintLine
  6.            End If

Or is it really supposed to be:
ASP Code:
  1. For x = LBound(ThisLine) To UBound(ThisLine)
  2.            If x = UBound(ThisLine) + 1 Then
  3.                PrintLint = ThisLine(x) + "<br/>" + PrintLine
  4.            Else
  5.                PrintLine = ThisLine(x) + "<br/>" + PrintLine
  6.            End If
__________________
Jerry Broughton

Last edited by job0107; 10-11-07 at 05:41 AM.
Reply With Quote
  #6 (permalink)  
Old 10-11-07, 12:17 PM
FINESTICE FINESTICE is offline
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????
Reply With Quote
  #7 (permalink)  
Old 10-11-07, 12:26 PM
job0107's Avatar
job0107 job0107 is offline
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
Reply With Quote
  #8 (permalink)  
Old 10-11-07, 12:49 PM
FINESTICE FINESTICE is offline
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">
        &nbsp;</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
Reply With Quote
  #9 (permalink)  
Old 10-11-07, 01:12 PM
job0107's Avatar
job0107 job0107 is offline
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:
  1. </BODY>
  2. </HTML>
  3. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  4. <html><head><title>Testimonials</title>
  5. <style type="text/css">
  6. <!--
  7. a{text-decoration:none}
  8. a:hover   {font-family: Verdana; font-size: 15; color: #ff0000; text-decoration: underline;}
  9. a:link    {font-family: Verdana; font-size: 15; color: #3333ff; text-decoration: none;}
  10. td, th, select, text     {font-family: Verdana; font-size: 11; color: #ffffff;}
  11. body   {font-family: Verdana; font-size: 15; color: #ffff33;}
  12. .style1   {border:1px solid #ffffff;padding:10px;color:#ff0000;}
  13. .style2   {border:1px solid #ffffff;padding:10px;color:#ffff33;
  14.  }
  15. //-->
  16. </style>
  17. </head>
  18.  
  19. <body topmargin="0" bottommargin="0" rightmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor=#000000>
  20.  
  21.  
  22. <!--webbot bot="Include" U-Include="BANNER.HTM" TAG="BODY" startspan -->
  23.  
  24. <p align="center">
  25.         <img border="0" src="tyrelogo1.jpg" width="771" height="112"></p>
  26.  
  27. <p align="center">
  28.         <a href="http://www.mobiletyres4u.co.uk/index.htm">
  29. <font color="#FFFFFF">Home</font></a><font color="#FFFFFF"> |
  30. <a href="http://www.mobiletyres4u.co.uk/postcode.htm"><font color="#FFFFFF">Tyre
  31. Quotation</font></a></font></a><font color="#FFFFFF"> |
  32.         <a href="http://www.mobiletyres4u.co.uk/bookingpage.htm">
  33.         <font color="#FFFFFF"><blink>Arrange a Fitment</blink></font></a> |
  34.         <a href="http://www.mobiletyres4u.co.uk/aboutus.htm">
  35.         <font color="#FFFFFF">about us</font></a>
  36.         |
  37. <a href="http://www.mobiletyres4u.co.uk/contactus.htm"><font color="#FFFFFF">contact us</font></a></font></p>
  38.  
  39. <!--webbot bot="Include" i-checksum="4922" endspan --><p align="center">
  40. &nbsp;</p>
  41.  
  42.  
  43. <p align="center">
  44. <font style="font-size: 22pt; color: #ffffff; text-decoration: underline; font-weight: 700">
  45. Customer Testimonials</font></p>
  46. <br/><br/>
  47. <%
  48.    Const ForReading = 1, ForWriting = 2, ForAppending = 8
  49.    Dim ThisLine, PrintLine, varStyle
  50.    varStyle = 1
  51.    Set FileObject = Server.CreateObject("Scripting.FileSystemObject")
  52.    GuestBookFile = Server.MapPath("guestbook.txt")
  53.    Set InputStream = FileObject.OpenTextFile(GuestBookFile, ForReading, False)
  54.    Do While Not InputStream.AtEndOfStream
  55.        ThisLine = split(InputStream.ReadLine, "vbCrLf ")
  56.        if varStyle = 1 then
  57.        PrintLine = PrintLine + "<div class='style1'>"
  58.        varStyle = 2
  59.        else
  60.        PrintLine = PrintLine + "<div class='style2'>"
  61.        varStyle = 1
  62.        end if
  63.        For x = LBound(ThisLine) To UBound(ThisLine)
  64.            If x = UBound(ThisLine) + 1 Then
  65.                PrintLine = ThisLine(x) + "<br/>" + PrintLine
  66.            Else
  67.                PrintLine = ThisLine(x) + "<br/>" + PrintLine
  68.            End If
  69.        Next
  70.        PrintLine = PrintLine + "</div><br/>"
  71.    Loop
  72.    InputStream.Close
  73.    Set OutputStream = Nothing
  74.    Set FileObject = Nothing
  75.    Response.Write replace(PrintLine, "//vbReturn//", " <br/> ")
  76. %>
  77. <br/><br/><center><b><a href="default.asp">Add Your Comments</a></b></center><br/><br/>
  78. </body>
  79. </html>
__________________
Jerry Broughton
Reply With Quote
  #10 (permalink)  
Old 10-11-07, 03:16 PM
FINESTICE FINESTICE is offline
Newbie Coder
 
Join Date: Aug 2007
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Ok iv done it but it looks like this now : www.mobiletyres4u.co.uk/viewguestbook.asp
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[turnkey] Lyrics site - $149 (LEGAL) rightinpoint General Advertisements 0 10-22-06 04:33 AM
Page reload (Another is this possible) chrisrobertson HTML/XHTML/XML 0 07-31-06 07:30 PM
Classified Ads skipper23 Perl 3 11-22-05 02:22 AM
page browsing problem mivec PHP 3 04-17-04 03:43 AM
Classified Ads skipper23 Perl 2 12-30-03 03:43 AM


All times are GMT -5. The time now is 03:59 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.