Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 announcements-3407-3407
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 10 June 2010 :  12:10:18  Show Profile
I have a problem where I set up a test announcement and it worked well, scrolling away happily. I went into the admin options and deleted the test message and tried to put another up. The table is there but no scrolling announcement. I have checked the database and the details are in there. I am also getting IE throwing up an error..

Message: Unterminated string constant
Line: 207
Char: 206
Code: 0
URI: http://www.kdaf.co.uk/Forum/default.asp

when I delete the announcement the table goes away as it should and the error goes away

Line 207 in my default.asp is an "end if"


if recModCount <> "" then
for x = 0 to recModCount
if x = 0 then
ModOfForums = allModData(0,x)
else
ModOfForums = ModOfForums & "," & allModData(0,x)
end if
next
else
ModOfForums = ""
end if
else
ModOfForums = ""
end if

'## Forum_SQL - Build SQL to get forums via category
strSql = "SELECT F.FORUM_ID, F.F_STATUS, F.CAT_ID, F.F_SUBJECT, F.F_URL, F.F_TOPICS, " &_
"F.F_COUNT, F.F_LAST_POST, F.F_LAST_POST_TOPIC_ID, F.F_LAST_POST_REPLY_ID, F.F_TYPE, " & _
"F.F_ORDER, F.F_A_COUNT, F.F_SUBSCRIPTION, F_PRIVATEFORUMS, F_PASSWORD_NEW, " & _
"M.MEMBER_ID, M.M_NAME, " & _
"T.T_REPLIES, T.T_UREPLIES, " & _
"F.F_DESCRIPTION " & _
"FROM ((" & strTablePrefix & "FORUM F " &_
"LEFT JOIN " & strMemberTablePrefix & "MEMBERS M ON " &_
"F.F_LAST_POST_AUTHOR = M.MEMBER_ID) " & _
"LEFT JOIN " & strTablePrefix & "TOPICS T ON " & _
"F.F_LAST_POST_TOPIC_ID = T.TOPIC_ID) "


any ideas what could be wrong??

Dave

No good at coding, but I can plough a field !!

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 June 2010 :  04:47:35  Show Profile
I'm not familiar with the mod, but, at a guess, I'd say the JavaScript was choking on a character (e.g., " or ') in your announcement that isn't being escaped before being passed to it.

Incidentally, that error is a JS error, not an ASP error so you need to refer to the generated HTML to find the error. For a more detailed error message, use Firefox's error console.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 11 June 2010 :  09:09:47  Show Profile
Thanks Shaggy

the error is showing as an unterminated string literal
document.write('<Div align="center"><View_announcements.asp><strong>........

I have found a matching piece of code in inc_announce lines 80-87

<SCRIPT LANGUAGE="JavaScript">
document.write('<font size="<%= strHeaderFontSize %>" face="<%= strdefaultFontFace %>" color="<%= strDefaultFontColor %>">')
document.write('<Div align="center"><View_announcements.asp><strong><%= replace(formatstr(rsAnnounce("A_SUBJECT")),"'","#39;") %></strong></font><br><br><view_announcements.asp><%= rsAnnounce("A_message") %><br></div><br>');
document.write('</font>');
</script>
<% rsAnnounce.movenext
loop %>
<SCRIPT LANGUAGE="JavaScript">


but I'm unsure what I should do to cure my error as I do seem to have an ' at each end within the brackets.

Dave

Edit for typo

No good at coding, but I can plough a field !!

Edited by - thermal_seeker on 11 June 2010 09:10:59
Go to Top of Page

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 11 June 2010 :  10:11:43  Show Profile
If you have a ' in the A_MESSAGE field, it's going to throw that error as it's not being escaped. Have a look at what's being done with the A_SUBJECT field and you'll notice that all 's are being replaced with #39;. On a side note, I find it much easier to escape the 's with a backslash, makes it easier to read back at a later date - so, instead of replacing them with #39;, you'd replace them with \'.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 11 June 2010 :  12:59:58  Show Profile
Thanks Shaggy, The #39; only appears if a ' is in the subject field if it is in the message field there is a blank table, no scrolling text.........In the message field I changed my text and replaced Kazzy's with Kazzy"s and the text appeared and scrolled away. I have been playing around and found it doesn't like : or ) or even a return put in for a new line. If you put in 5 spaces after a piece of text it will display as one space.(all in the subject field) : , ) and spaces all display in the subject field ok

This looks as though it is way beyond my capabilities to sort.

Dave

No good at coding, but I can plough a field !!

Edited by - thermal_seeker on 11 June 2010 13:01:52
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 11 June 2010 :  13:20:30  Show Profile
In an addition... I changed "#39:" in inc_announce to "\'" and in the subject field the ' now displays correctly.

Does this mean that an extra line has to be put in somewhere so that the message box displays correctly??

sorry for my ignorance here but I am trying to learn....

Dave

No good at coding, but I can plough a field !!
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20600 Posts

Posted - 11 June 2010 :  14:47:08  Show Profile  Visit HuwR's Homepage
if you want a return try \n

MVC .net dev/test site | MVC .net running on Raspberry Pi
Go to Top of Page

thermal_seeker
Junior Member

United Kingdom
430 Posts

Posted - 11 June 2010 :  16:21:25  Show Profile
Thanks Huw, I have the ' working in the message field now by adding in the code in red..

document.write('<Div align="center"><View_announcements.asp><strong><%= replace(formatstr(rsAnnounce("A_SUBJECT")),"'","\'") %></strong></font><br><br><view_announcements.asp><%=replace(formatstr( rsAnnounce("A_message")),"'","\'") %><br></div><br>');

How do I add a further replace?? Is there a seperator between "'","\'" and ":","\:" or do I add an extra replace(formatstr (..... in

geez I hope you understood that...


well I'm not sure why but just adding that code in and everything is displaying as it should..... even the new lines......


Dave

edit for typo

No good at coding, but I can plough a field !!

Edited by - thermal_seeker on 11 June 2010 17:23:58
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.4 seconds. Powered By: Snitz Forums 2000 Version 3.4.07