By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,867 Members | 1,964 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,867 IT Pros & Developers. It's quick & easy.

Error with my smilies code

P: 11
Hi there. i am trying tying to add weight and height to this script of mine.
Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <!--#include file="../Connections/*******.asp" -->
  3. <%
  4. Dim RSsb
  5. Dim RSsb_numRows
  6.  
  7. Set RSsb = Server.CreateObject("ADODB.Recordset")
  8. RSsb.ActiveConnection = MM_production_STRING
  9. RSsb.Source = "SELECT * FROM dbo.RSshoutbox ORDER BY ID DESC"
  10. RSsb.CursorType = 0
  11. RSsb.CursorLocation = 2
  12. RSsb.LockType = 1
  13. RSsb.Open()
  14.  
  15. RSsb_numRows = 0
  16. %>
  17. <%
  18. Dim Repeat1__numRows
  19. Dim Repeat1__index
  20.  
  21. Repeat1__numRows = -1
  22. Repeat1__index = 0
  23. RSsb_numRows = RSsb_numRows + Repeat1__numRows
  24. %>
  25. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  26. <html xmlns="http://www.w3.org/1999/xhtml">
  27. <head>
  28. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  29. <title>Untitled Document</title>
  30. <style type="text/css">
  31. <!--
  32. body,td,th {
  33.     font-size: 12px;
  34. }
  35. body {
  36.     margin-left: 0px;
  37.     margin-top: 0px;
  38.     margin-right: 0px;
  39.     margin-bottom: 0px;
  40. }
  41. .style2 {
  42.     font-size: 16px;
  43.     font-family: Arial, Helvetica, sans-serif;
  44. }
  45. .style3 {
  46.     color: #FF00FF;
  47.     font-weight: bold;
  48. }
  49. .style4 {
  50.     color: #FFFF00;
  51.     font-weight: bold;
  52.     font-style: italic;
  53. }
  54. -->
  55. </style></head>
  56.  
  57. <body>
  58. <div align="left" class="style2">
  59.   <span class="style4">Latest Message:</span> 
  60.   <%function smilify(chatText) 
  61.    dim smileys(10) 
  62.    dim smileyGraphics(10) 
  63.    smileys(0) = ":)" 
  64.    smileys(1) = ":S" 
  65.    smileys(2) = ";)"
  66.    smileys(3) = ":p" 
  67.    smileys(4) = ":("
  68.    smileys(5) = ";("
  69.    smileys(6) = ":o"
  70.    smileys(7) = ":D"
  71.    smileys(8) = ":$"
  72.    smileyGraphics(0) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley0.png'>" 
  73.    smileyGraphics(1) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley1.png'>" 
  74.    smileyGraphics(2) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley2.png'>"
  75.    smileyGraphics(3) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley3.png'>"
  76.    smileyGraphics(4) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley4.png'>"
  77.    smileyGraphics(5) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley5.png'>"
  78.    smileyGraphics(6) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley6.png'>"
  79.    smileyGraphics(7) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley7.png'>"
  80.    smileyGraphics(8) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley8.png'>"
  81.    dim fixedText
  82.    for x = 0 to 9 
  83.       chatText = replace(chatText, smileys(x), smileyGraphics(x)) 
  84.    next 
  85.    response.write chattext 
  86. end function 
  87. %>
  88.   <% 
  89. While ((Repeat1__numRows <> 0) AND (NOT RSsb.EOF)) 
  90. %>
  91.       <span class="style3"><%=(RSsb.Fields.Item("RSname").Value)%>:</span>
  92.     <% smilify(RSsb("RSmsg")) %>
  93.     <br />
  94.     <% 
  95.   Repeat1__index=Repeat1__index+1
  96.   Repeat1__numRows=Repeat1__numRows-1
  97.   RSsb.MoveNext()
  98. Wend
  99. %>
  100. </div>
  101. </body>
  102. </html>
  103. <%
  104. RSsb.Close()
  105. Set RSsb = Nothing
  106. %>
  107.  
Thankies
Aug 11 '11 #1

✓ answered by jhardman

or inline:
Expand|Select|Wrap|Line Numbers
  1. smileyGraphics(0) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley0.png' height='25' width='25'>" 

Share this Question
Share on Google+
2 Replies


Rabbit
Expert Mod 10K+
P: 12,370
You mean width right? You can set the width and height of the images in your <style> section.
Aug 11 '11 #2

jhardman
Expert 2.5K+
P: 3,405
or inline:
Expand|Select|Wrap|Line Numbers
  1. smileyGraphics(0) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley0.png' height='25' width='25'>" 
Aug 11 '11 #3

Post your reply

Sign in to post your reply or Sign up for a free account.