|
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Problemer med FCKeditor Fra : Adam Ellesøe |
Dato : 08-02-06 10:09 |
|
Hej.. Jeg har et problem med FCKeditor...
Jeg har "installeret" det på min IIS og her virker det fint.... Men når jeg
uploader til serveren får jeg følgende mystiske fejl:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
FCKeditor/fckeditor.asp, line 24
Public Property Let BasePath( basePathValue )
----------------^Jeg kan ikke lige gennemskue problemet....
Fra linie 21 til 26:
Set oConfig = CreateObject("Scripting.Dictionary")
End Sub
Public Property Let BasePath( basePathValue )
sBasePath = basePathValue
End Property
--
MVH
Adam G. Ellesøe
| |
Erik Ginnerskov (08-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : Erik Ginnerskov |
Dato : 08-02-06 21:50 |
| | |
Adam Ellesøe (08-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : Adam Ellesøe |
Dato : 08-02-06 23:12 |
|
Det tror jeg ikke... for så ville det vel heller ikke virke på ISS...
--
MVH
Adam G. Ellesøe
"Erik Ginnerskov" <erik@donotspammmeplease.invalid> skrev i en meddelelse
news:43ea5985$0$15793$14726298@news.sunsite.dk...
> Adam Ellesøe wrote:
>
>> Public Property Let BasePath( basePathValue )
>> ----------------^Jeg kan ikke lige gennemskue problemet....
>
> Mangler du ikke et par anførselstegn i parentesen?
>
> --
> Med venlig hilsen
> Erik Ginnerskov
> http://hjemmesideskolen.dk - http://ginnerskov.dk
> http://html-faq.dk/
>
>
| |
terje (08-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : terje |
Dato : 08-02-06 22:41 |
|
Se om du får noe ut av denne koden Adam.
Classen (nedenunder) kalles via denne routinen:
'------------------------------------------------------------------------------------------------------------
' Comment: Create an instance of the FCKEditor.
'------------------------------------------------------------------------------------------------------------
Sub CreateEditor()
' On Error Resume Next
Dim oFCK
Dim sBasePath
If IsEmpty(oFCK) Then Set oFCK = New FCKEditor
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left(sBasePath, InStrRev(sBasePath, "/admin")) &
"tools/FCKEditor/"
With oFCK
.BasePath = sBasePath
.ToolbarSet = "Basic"
.Height = "250"
If Request.QueryString("Toolbar") <> "" Then .ToolbarSet =
Request.QueryString("Toolbar")
.Value = m_sText
.Create "FCKeditor1"
End With
Call KillObject(oFCK)
End Sub
<%
'========================================================================
Class FCKeditor
'========================================================================
Private sBasePath
Private sInstanceName
Private sWidth
Private sHeight
Private sToolbarSet
Private sValue
Private oConfig
Public Property Let BasePath(basePathValue)
sBasePath = basePathValue
End Property
Public Property Let instanceName(instanceNameValue)
sInstanceName = instanceNameValue
End Property
Public Property Let Width(widthValue)
sWidth = widthValue
End Property
Public Property Let Height(heightValue)
sHeight = heightValue
End Property
Public Property Let ToolbarSet(toolbarSetValue)
sToolbarSet = toolbarSetValue
End Property
Public Property Let Value(newValue)
If IsNull(newValue) Or IsEmpty(newValue) Then
sValue = ""
Else
sValue = newValue
End If
End Property
Public Property Let Config(configKey, configValue)
On Error Resume Next
oConfig.Add configKey, configValue
End Property
'------------------------------------------------------------------------------------------------------------
' Comment:
'------------------------------------------------------------------------------------------------------------
Private Sub Class_Initialize()
On Error Resume Next
sBasePath = "/FCKeditor/"
sWidth = "100%"
sHeight = "200"
sToolbarSet = "Default"
sValue = ""
Set oConfig = CreateObject("Scripting.Dictionary")
If Err Then Call LogError("fckeditor.asp::Class_Initialize", "", "")
End Sub
'------------------------------------------------------------------------------------------------------------
' Comment:
'------------------------------------------------------------------------------------------------------------
Public Function Create(instanceName)
On Error Resume Next
Dim sFile
Dim sLink
Dim sWidthCSS, sHeightCSS
Response.Write "<div>"
If IsCompatible() Then
If Request.QueryString("fcksource") = "true" Then
sFile = "fckeditor.original.html"
Else
sFile = "fckeditor.html"
End If
sLink = sBasePath & "editor/" & sFile & "?InstanceName=" +
instanceName
If (sToolbarSet & "") <> "" Then sLink = sLink +
"&Toolbar=" & sToolbarSet
' Render the linked hidden field.
Response.Write "<input type=""hidden"" id=""" & instanceName &
""" name=""" & instanceName & """ value=""" & Server.HTMLEncode(sValue)
& """ />"
' Render the configurations hidden field.
Response.Write "<input type=""hidden"" id=""" & instanceName &
"___Config"" value=""" & GetConfigFieldString() & """ />"
' Render the editor IFRAME.
Response.Write "<iframe id=""" & instanceName & "___Frame""
src=""" & sLink & """ width=""" & sWidth & """ height=""" & sHeight &
""" frameborder=""no"" scrolling=""no""></iframe>"
Else
If InStr(sWidth, "%") > 0 Then
sWidthCSS = sWidth
Else
sWidthCSS = sWidth & "px"
End If
If InStr(sHeight, "%") > 0 Then
sHeightCSS = sHeight
Else
sHeightCSS = sHeight & "px"
End If
Response.Write "<textarea name=""" & instanceName & """
rows=""4"" cols=""40"" style=""width: " & sWidthCSS & "; height: " &
sHeightCSS & """ wrap=""virtual"">" & Server.HTMLEncode(sValue) &
"</textarea>"
End If
Response.Write "</div>"
End Function
'------------------------------------------------------------------------------------------------------------
' Comment:
'------------------------------------------------------------------------------------------------------------
Private Function IsCompatible()
On Error Resume Next
Dim sAgent, iVersion
sAgent = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(sAgent, "MSIE") > 0 And InStr(sAgent, "mac") <= 0 And
InStr(sAgent, "Opera") <= 0 Then
iVersion = CInt(ToNumericFormat(Mid(sAgent, InStr(sAgent,
"MSIE") + 5, 3)))
IsCompatible = (iVersion >= 5.5)
ElseIf InStr(sAgent, "Gecko/") > 0 Then
iVersion = CLng(Mid(sAgent, InStr(sAgent, "Gecko/") + 6, 8))
IsCompatible = (iVersion >= 20030210)
Else
IsCompatible = False
End If
End Function
'------------------------------------------------------------------------------------------------------------
' Comment:
'------------------------------------------------------------------------------------------------------------
' By Agrotic
' On ASP, when converting string to numbers, the number decimal
separator is localized
' so 5.5 will not work on systems were the separator is "," and vice versa.
Private Function ToNumericFormat(numberStr)
On Error Resume Next
If IsNumeric("5.5") Then
ToNumericFormat = Replace(numberStr, ",", ".")
Else
ToNumericFormat = Replace(numberStr, ".", ",")
End If
End Function
'------------------------------------------------------------------------------------------------------------
' Comment:
'------------------------------------------------------------------------------------------------------------
Private Function GetConfigFieldString()
On Error Resume Next
Dim sParams
Dim bFirst
Dim sKey
bFirst = True
For Each sKey In oConfig
If bFirst = False Then
sParams = sParams & "&"
Else
bFirst = False
End If
sParams = sParams & EncodeConfig(sKey) & "=" &
EncodeConfig(oConfig(sKey))
Next
GetConfigFieldString = sParams
End Function
'------------------------------------------------------------------------------------------------------------
' Comment:
'------------------------------------------------------------------------------------------------------------
Private Function EncodeConfig(valueToEncode)
On Error Resume Next
EncodeConfig = Replace(valueToEncode, "&", "%26")
EncodeConfig = Replace(EncodeConfig, "=", "%3D")
EncodeConfig = Replace(EncodeConfig, """", "%22")
End Function
'========================================================================
End Class
'========================================================================
%>
| |
terje (08-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : terje |
Dato : 08-02-06 22:44 |
|
Ok, endre denne linjen:
Call KillObject(oFCK)
til
Set oFCK = Nothing
Slett neste linje:
If Err Then Call LogError("fckeditor.asp::Class_Initialize", "", "")
terje :-/
| |
![](/images/tree/0.gif) Adam Ellesøe (08-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : Adam Ellesøe |
Dato : 08-02-06 23:09 |
|
Hmm, hvor?? jeg kan ikke finde den linie i fckeditor.asp
--
MVH
Adam G. Ellesøe
"terje" <late@night.zz> skrev i en meddelelse
news:44v71gF43l21U2@individual.net...
> Ok, endre denne linjen:
>
> Call KillObject(oFCK)
> til
> Set oFCK = Nothing
>
> Slett neste linje:
> If Err Then Call LogError("fckeditor.asp::Class_Initialize", "", "")
>
> terje :-/
| |
![](/images/tree/0.gif) ![](/images/tree/0.gif) terje (09-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : terje |
Dato : 09-02-06 08:20 |
|
Adam Ellesøe wrote:
> Hmm, hvor?? jeg kan ikke finde den linie i fckeditor.asp
Du finner den i den koden jeg postet.
terje
| |
Adam Ellesøe (08-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : Adam Ellesøe |
Dato : 08-02-06 23:11 |
|
Hvad er det helt præcist jeg skal gøre med denne kode?? indsætte den der
hvor jeg vil have editoren??
--
MVH
Adam G. Ellesøe
"terje" <late@night.zz> skrev i en meddelelse
news:44v6qiF43l21U1@individual.net...
> Se om du får noe ut av denne koden Adam.
>
> Classen (nedenunder) kalles via denne routinen:
>
> '------------------------------------------------------------------------------------------------------------
> ' Comment: Create an instance of the FCKEditor.
> '------------------------------------------------------------------------------------------------------------
> Sub CreateEditor()
> ' On Error Resume Next
>
> Dim oFCK
> Dim sBasePath
>
> If IsEmpty(oFCK) Then Set oFCK = New FCKEditor
>
> sBasePath = Request.ServerVariables("PATH_INFO")
> sBasePath = Left(sBasePath, InStrRev(sBasePath, "/admin")) &
> "tools/FCKEditor/"
>
> With oFCK
> .BasePath = sBasePath
> .ToolbarSet = "Basic"
> .Height = "250"
>
> If Request.QueryString("Toolbar") <> "" Then .ToolbarSet =
> Request.QueryString("Toolbar")
> .Value = m_sText
> .Create "FCKeditor1"
> End With
>
> Call KillObject(oFCK)
>
> End Sub
>
>
>
> <%
> '========================================================================
> Class FCKeditor
> '========================================================================
>
> Private sBasePath
> Private sInstanceName
> Private sWidth
> Private sHeight
> Private sToolbarSet
> Private sValue
> Private oConfig
>
> Public Property Let BasePath(basePathValue)
> sBasePath = basePathValue
> End Property
>
> Public Property Let instanceName(instanceNameValue)
> sInstanceName = instanceNameValue
> End Property
>
> Public Property Let Width(widthValue)
> sWidth = widthValue
> End Property
>
> Public Property Let Height(heightValue)
> sHeight = heightValue
> End Property
>
> Public Property Let ToolbarSet(toolbarSetValue)
> sToolbarSet = toolbarSetValue
> End Property
>
> Public Property Let Value(newValue)
>
> If IsNull(newValue) Or IsEmpty(newValue) Then
> sValue = ""
> Else
> sValue = newValue
> End If
>
> End Property
>
> Public Property Let Config(configKey, configValue)
> On Error Resume Next
>
> oConfig.Add configKey, configValue
>
> End Property
>
> '------------------------------------------------------------------------------------------------------------
> ' Comment:
> '------------------------------------------------------------------------------------------------------------
> Private Sub Class_Initialize()
> On Error Resume Next
>
> sBasePath = "/FCKeditor/"
> sWidth = "100%"
> sHeight = "200"
> sToolbarSet = "Default"
> sValue = ""
>
> Set oConfig = CreateObject("Scripting.Dictionary")
>
> If Err Then Call LogError("fckeditor.asp::Class_Initialize", "", "")
> End Sub
>
> '------------------------------------------------------------------------------------------------------------
> ' Comment:
> '------------------------------------------------------------------------------------------------------------
> Public Function Create(instanceName)
> On Error Resume Next
>
> Dim sFile
> Dim sLink
> Dim sWidthCSS, sHeightCSS
>
> Response.Write "<div>"
>
> If IsCompatible() Then
>
> If Request.QueryString("fcksource") = "true" Then
> sFile = "fckeditor.original.html"
> Else
> sFile = "fckeditor.html"
> End If
>
> sLink = sBasePath & "editor/" & sFile & "?InstanceName=" +
> instanceName
>
> If (sToolbarSet & "") <> "" Then sLink = sLink + "&Toolbar=" &
> sToolbarSet
>
> ' Render the linked hidden field.
> Response.Write "<input type=""hidden"" id=""" & instanceName & """
> name=""" & instanceName & """ value=""" & Server.HTMLEncode(sValue) & """
> />"
>
> ' Render the configurations hidden field.
> Response.Write "<input type=""hidden"" id=""" & instanceName &
> "___Config"" value=""" & GetConfigFieldString() & """ />"
>
> ' Render the editor IFRAME.
> Response.Write "<iframe id=""" & instanceName & "___Frame""
> src=""" & sLink & """ width=""" & sWidth & """ height=""" & sHeight & """
> frameborder=""no"" scrolling=""no""></iframe>"
>
> Else
>
> If InStr(sWidth, "%") > 0 Then
> sWidthCSS = sWidth
> Else
> sWidthCSS = sWidth & "px"
> End If
>
> If InStr(sHeight, "%") > 0 Then
> sHeightCSS = sHeight
> Else
> sHeightCSS = sHeight & "px"
> End If
>
> Response.Write "<textarea name=""" & instanceName & """ rows=""4""
> cols=""40"" style=""width: " & sWidthCSS & "; height: " & sHeightCSS & """
> wrap=""virtual"">" & Server.HTMLEncode(sValue) & "</textarea>"
>
> End If
>
> Response.Write "</div>"
>
> End Function
>
> '------------------------------------------------------------------------------------------------------------
> ' Comment:
> '------------------------------------------------------------------------------------------------------------
> Private Function IsCompatible()
> On Error Resume Next
>
> Dim sAgent, iVersion
> sAgent = Request.ServerVariables("HTTP_USER_AGENT")
>
> If InStr(sAgent, "MSIE") > 0 And InStr(sAgent, "mac") <= 0 And
> InStr(sAgent, "Opera") <= 0 Then
> iVersion = CInt(ToNumericFormat(Mid(sAgent, InStr(sAgent, "MSIE")
> + 5, 3)))
> IsCompatible = (iVersion >= 5.5)
> ElseIf InStr(sAgent, "Gecko/") > 0 Then
> iVersion = CLng(Mid(sAgent, InStr(sAgent, "Gecko/") + 6, 8))
> IsCompatible = (iVersion >= 20030210)
> Else
> IsCompatible = False
> End If
>
> End Function
>
> '------------------------------------------------------------------------------------------------------------
> ' Comment:
> '------------------------------------------------------------------------------------------------------------
> ' By Agrotic
> ' On ASP, when converting string to numbers, the number decimal separator
> is localized
> ' so 5.5 will not work on systems were the separator is "," and vice
> versa.
> Private Function ToNumericFormat(numberStr)
> On Error Resume Next
>
> If IsNumeric("5.5") Then
> ToNumericFormat = Replace(numberStr, ",", ".")
> Else
> ToNumericFormat = Replace(numberStr, ".", ",")
> End If
>
> End Function
>
> '------------------------------------------------------------------------------------------------------------
> ' Comment:
> '------------------------------------------------------------------------------------------------------------
> Private Function GetConfigFieldString()
> On Error Resume Next
>
> Dim sParams
> Dim bFirst
> Dim sKey
>
> bFirst = True
>
> For Each sKey In oConfig
>
> If bFirst = False Then
> sParams = sParams & "&"
> Else
> bFirst = False
> End If
>
> sParams = sParams & EncodeConfig(sKey) & "=" &
> EncodeConfig(oConfig(sKey))
>
> Next
>
> GetConfigFieldString = sParams
>
> End Function
>
> '------------------------------------------------------------------------------------------------------------
> ' Comment:
> '------------------------------------------------------------------------------------------------------------
> Private Function EncodeConfig(valueToEncode)
> On Error Resume Next
>
> EncodeConfig = Replace(valueToEncode, "&", "%26")
> EncodeConfig = Replace(EncodeConfig, "=", "%3D")
> EncodeConfig = Replace(EncodeConfig, """", "%22")
>
> End Function
>
> '========================================================================
> End Class
> '========================================================================
> %>
| |
![](/images/tree/0.gif) terje (09-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : terje |
Dato : 09-02-06 08:18 |
|
Adam Ellesøe wrote:
> Hvad er det helt præcist jeg skal gøre med denne kode?? indsætte den der
> hvor jeg vil have editoren??
cCass koden kan du lagre i en egen fil som du inkluderer øverst i den
fil der du vil vise editoren. Samtidig setter du Dim m_sText øverst også
på den siden. m_sText er da den text som editoren skal vise.
Så skriver du: Response.Write CreateEditor der du vil at editoren skal
vises i din html.
terje
| |
![](/images/tree/0.gif) ![](/images/tree/0.gif) Adam Ellesøe (09-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : Adam Ellesøe |
Dato : 09-02-06 20:01 |
|
Jeg har gjort alt hvad du har sagt.... virker fint på IIS.... men på enavns
server....
Microsoft VBScript compilation error '800a0401'
Expected end of statement
fckeditor.asp, line 14
Public Property Let BasePath(basePathValue)
----------------^.....neder.... prøv selv http://www.ofnet.dk/test.asp
--
MVH
Adam G. Ellesøe
"terje" <late@night.zz> skrev i en meddelelse
news:4508keF4b07jU1@individual.net...
> Adam Ellesøe wrote:
>> Hvad er det helt præcist jeg skal gøre med denne kode?? indsætte den der
>> hvor jeg vil have editoren??
>
> cCass koden kan du lagre i en egen fil som du inkluderer øverst i den fil
> der du vil vise editoren. Samtidig setter du Dim m_sText øverst også på
> den siden. m_sText er da den text som editoren skal vise.
>
> Så skriver du: Response.Write CreateEditor der du vil at editoren skal
> vises i din html.
>
> terje
| |
![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) terje (10-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : terje |
Dato : 10-02-06 00:40 |
|
Adam Ellesøe wrote:
> Jeg har gjort alt hvad du har sagt.... virker fint på IIS.... men på enavns
> server....
>
> Microsoft VBScript compilation error '800a0401'
> Expected end of statement
>
> fckeditor.asp, line 14
>
> Public Property Let BasePath(basePathValue)
> ----------------^.....neder.... prøv selv http://www.ofnet.dk/test.asp
Response.Write den variabel som du sender til BasePath. Dette er en
string som du sannsynligvis har glemt å avslutte med et ".
terje
| |
![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) Adam Ellesøe (10-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : Adam Ellesøe |
Dato : 10-02-06 18:26 |
|
> Response.Write den variabel som du sender til BasePath. Dette er en
> string som du sannsynligvis har glemt å avslutte med et ".
Når jeg respons.write (basePathValue) får jeg ingenting det samme gør sig
gældende ved respons.write (basePath)
Men i min kode står:
If IsEmpty(oFCK) Then Set oFCK = New FCKEditor
sBasePath = Request.ServerVariables("PATH_INFO")
sBasePath = Left(sBasePath, InStrRev(sBasePath, "/admin")) &
"FCKEditor/"
Kan du bruge det til noget??
Det undrer mig nu at det kører på IIS.... Så jeg tror ikke jeg mangler en "
--
MVH
Adam G. Ellesøe
| |
![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) terje (10-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : terje |
Dato : 10-02-06 18:35 |
|
Adam Ellesøe wrote:
> Når jeg respons.write (basePathValue) får jeg ingenting det samme gør sig
> gældende ved respons.write (basePath)
> Kan du bruge det til noget??
Nei :-/
Response.Write Request.ServerVariables("PATH_INFO") returnerer ingenting?
terje
| |
![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) ![](/images/tree/0.gif) Adam Ellesøe (13-02-2006)
![](/App_Themes/Normal/images/Window/Backgrounds/news.gif) | Kommentar Fra : Adam Ellesøe |
Dato : 13-02-06 18:01 |
|
> Response.Write Request.ServerVariables("PATH_INFO") returnerer ingenting?
tjo... den retunerer jo bare filens path info... altså på min IIS server,
hvor FCKeditoren virker får jeg følgende:
/ofnet/test.asp ... men... hvad vil du bruge det til??
--
MVH
Adam G. Ellesøe
| |
|
|