Hi there, i have a website i am working on and i want to be able to let users use smiles but i cant get them to work. Any ideas here is my main body -
<%function smilify(chatText)
-
dim smileys(10)
-
dim smileyGraphics(10)
-
smileys(0) = ":)"
-
smileys(1) = ":S"
-
smileys(2) = ";)"
-
smileyGraphics(0) = "<img src='smiley0.gif'>"
-
smileyGraphics(1) = "<img src='smiley1.gif'>"
-
smileyGraphics(2) = "<img src='smiley2.gif'>"
-
dim fixedText
-
for x = 0 to 9
-
fixedText = replace(chatText, smileys(x), smileyGraphics(x))
-
next
-
response.write fixed text
-
end function
-
%>
-
<% smilify(RSsb("RSmsg")) %>
-
Sorry, I should have caught this way earlier. Change all references of fixedText to chatText. You are replacing your fixedText value every time without keeping the results.
16 2152
That looks like it should work fine. What are you seeing instead of the smilies?
I am getting this error
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/test.asp, line 38
response.write fixed text
---------------------^
I know there are data in the database, and :) in posts in random places as people post the messages
You have a space in your variable [fixed text]
I have tried removing that but now it displays the page with no icons or any red cross. it shows it with out any emote :(
Are the smiley#.gif files in the same directory as the page?
-Frinny
they are but they are not displaying. i am not even getting the icon for a missing icon
Right click on your page in the browser.
Find the HTML generated for the smiley's <img> tag and post it here so we can take a look.
Did you try a fully qualified path?
Have you tried using the full path?
Sadly its not working at all. i did try that, I even checked the images are there. The shout box it’s for is automatically updating but even on the static feed it calls from the images are not there.
Can you repost your current code? You can leave out the connection info if you want.
Here is my Current Code as it stands. - <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
-
<!--#include file="../Connections/******.asp" -->
-
<%
-
Dim RSsb
-
Dim RSsb_numRows
-
-
Set RSsb = Server.CreateObject("ADODB.Recordset")
-
RSsb.ActiveConnection = MM_production_STRING
-
RSsb.Source = "SELECT * FROM dbo.RSshoutbox ORDER BY ID DESC"
-
RSsb.CursorType = 0
-
RSsb.CursorLocation = 2
-
RSsb.LockType = 1
-
RSsb.Open()
-
-
RSsb_numRows = 0
-
%>
-
<%
-
Dim Repeat1__numRows
-
Dim Repeat1__index
-
-
Repeat1__numRows = -1
-
Repeat1__index = 0
-
RSsb_numRows = RSsb_numRows + Repeat1__numRows
-
%>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-
<title>Untitled Document</title>
-
<style type="text/css">
-
<!--
-
body,td,th {
-
font-size: 12px;
-
}
-
body {
-
margin-left: 0px;
-
margin-top: 0px;
-
margin-right: 0px;
-
margin-bottom: 0px;
-
}
-
.style2 {
-
font-size: 16px;
-
font-family: Arial, Helvetica, sans-serif;
-
}
-
.style3 {
-
color: #FF00FF;
-
font-weight: bold;
-
}
-
-->
-
</style></head>
-
-
<body>
-
<div align="left" class="style2"><span class="style3"><%=(RSsb.Fields.Item("RSname").Value)%>:</span>
-
<%function smilify(chatText)
-
dim smileys(10)
-
dim smileyGraphics(10)
-
smileys(0) = ":)"
-
smileys(1) = ":S"
-
smileys(2) = ";)"
-
smileys(3) = ":p"
-
smileys(4) = ":("
-
smileys(5) = ";("
-
smileys(6) = ":o"
-
smileys(7) = ":D"
-
smileys(8) = ":$"
-
smileyGraphics(0) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley0.png'>"
-
smileyGraphics(1) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley1.png>"
-
smileyGraphics(2) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley2.png'>"
-
smileyGraphics(3) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley3.png'>"
-
smileyGraphics(4) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley4.png'>"
-
smileyGraphics(5) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley5.png'>"
-
smileyGraphics(6) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley6.png'>"
-
smileyGraphics(7) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley7.png'>"
-
smileyGraphics(8) = "<img src='http://www.cullinan.myep.co.uk/shoutbox/smiley8.png'>"
-
dim fixedText
-
for x = 0 to 9
-
fixedText = replace(chatText, smileys(x), smileyGraphics(x))
-
next
-
response.write fixedtext
-
end function
-
%>
-
<%
-
While ((Repeat1__numRows <> 0) AND (NOT RSsb.EOF))
-
%>
-
<% smilify(RSsb("RSmsg")) %>
-
<br />
-
<%
-
Repeat1__index=Repeat1__index+1
-
Repeat1__numRows=Repeat1__numRows-1
-
RSsb.MoveNext()
-
Wend
-
%>
-
</div>
-
</body>
-
</html>
-
<%
-
RSsb.Close()
-
Set RSsb = Nothing
-
%>
-
Sorry, I should have caught this way earlier. Change all references of fixedText to chatText. You are replacing your fixedText value every time without keeping the results.
Wow did the trick. only other thing i am having trouble with that code is how to make the images smaller like using the width="16" height="16" style tags
Since that is a new question, please post it in a new thread.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Cherrish Vaidiyan |
last post by:
sir,
The following are the steps that i followed in setting up standby
database on Red hat Linux 9. i am using Oracle 9i.
i have followed the steps in this site :
...
|
by: Marvin Libson |
last post by:
Hi All:
I am running DB2 UDB V7.2 with FP11. Platform is Windows 2000. I
have created a java UDF and trigger. When I update my database I get
the following error:
SQL1224N A database...
|
by: Kamlesh |
last post by:
Hi,
How do I know the physical database path of a database. When I goto
the DB2INSTANCE users's directory (/home/db2inst1), I see following
folders:
/db2inst1/NODE0000/SQL00001...
|
by: pintur |
last post by:
The message is:
SQL1036C Errore di I/O durante l' accesso al
database. SQLSTATE=58030
what is the proble?
what for restore tables?
thanks
|
by: Killer42 |
last post by:
Hi all.
Where can I find a list of the smilies supported by the vb code syntax? The "list" provided in the FAQ just contains a message describing briefly what a smiley is.
|
by: omerbutt |
last post by:
hi there i am making a scrap book application in which i have to populate the smilies as soon as they are written now i am using the textarea to write the input text for the scrap currently i am...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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,...
| |