473,396 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Error with my smilies code

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'>" 

2 1891
Rabbit
12,516 Expert Mod 8TB
You mean width right? You can set the width and height of the images in your <style> section.
Aug 11 '11 #2
jhardman
3,406 Expert 2GB
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

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

Similar topics

0
by: sql-db2-dba | last post by:
CLI connection failed. SQL0902C. A system error (reason code="6029321") occurred. Subsequent SQL statements cannot be processed. SQLSTATE=58005. Has anyone encountered the above error? We are...
1
by: Tom | last post by:
Suppose you have code structure like this: Option Explicit Dim MyVariable As Single Private Sub CallingProcedure() Call CalledProcedure() ....Do This ... End Sub Private Sub...
13
by: Thelma Lubkin | last post by:
I use code extensively; I probably overuse it. But I've been using error trapping very sparingly, and now I've been trapped by that. A form that works for me on the system I'm using, apparently...
3
by: JPARKER | last post by:
Our DB2 8.2 FixPak9 database running on Win2K crashed with after reporting this message SQL0902C A system error (reason code = 9") ocurred I have searched the DB2 documentation as well as the...
3
by: Mark | last post by:
I'm just starting out in an introductory ASP.Net course, and am trying to run a simple program but keeping getting an error. "http://localhost/day1/listing0104.aspx" is placed in the address line...
1
by: scottrm | last post by:
I want to get the file name, line number etc. in error handling code in an asp.net application. I know how to trap errors in the Global.asax and I read that you can use the stack frame from the...
3
by: jonamukundu | last post by:
Hi everyone out there I have a rather funny problem. Error handling code routines do not seem to work on my laptop. I still get the default error messages when i test. One my desktop the code...
5
by: GaryE | last post by:
Hello: I am having trouble linking a couple of files using the boost::filesystem. I am using MSVC 6.0. Here is an abbreviated version of my problem: foo.h: #ifndef __FOO_ #define...
2
by: globomike | last post by:
Hi, can anybody tell me what the reason code 18 means in combination with a SQL0902 error? It would be helpful to know details about the reason code but I could not find any details about that...
1
by: Forsi | last post by:
Hello I don't know a thing about writing VBA Codes but this forum I was able thas helped me to finally figure out how to link the pictures to a path etc on a form. Everything works fine on the...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.