The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
VBScript in vBulletin
Hi,
I'm using a VBScript to detect Flash Player on IE and some how it won't work properly. Unfortunately, the Javascript version used to detect Flash Player in other browsers don't work for IE, so I'm stuck with VBScript. The VBScript does not seem to be running in vBulletin (I'm on 3.5.1). Can VBScript run in vBulletin? Or is it disabled? The code extracts are below. The VBScript Code:
<script language="VBScript" type="text/vbscript"> <!-- // Visual basic helper required to detect Flash Player ActiveX control version information Function VBGetSwfVer(i) on error resume next Dim swControl, swVersion swVersion = 0 set swControl = CreateObject("ShockwaveFlash.ShockwaveFlash." + CStr(i)) if (IsObject(swControl)) then swVersion = swControl.GetVariable("$version") end if VBGetSwfVer = swVersion End Function // --> </script> Code:
for (i=25;i>0;i--) { if (isIE && isWin && !isOpera) { versionStr = VBGetSwfVer(i); } else { versionStr = JSGetSwfVer(i); } . . . (Edit: Seems that I was talking to myself, so vBulletin automerged my followup posts here...) I did more troubleshooting and found the the VBScript is running. CreateControl works but GetVariable is not returning the correct value. On a clean HTML file it works fine. Any one has any idea why the GetVariable fails? Thanks. (Edit: here...) I found the problem... PHP tried to replace $version in the line swVersion = swControl.GetVariable("$version"). The final source displayed on the browser is swVersion = swControl.GetVariable("") Now all I have to do is find out how to prevent that. (Edit: and here...) Hmmm... how come my post got automerged. Anyway, in case anyone has this problem in the future, the solution is to escape the "$" with a backslash. so it becomes: swVersion = swControl.GetVariable("\$version") Works perfectly now. |
#2
|
|||
|
|||
I have the exact same problem, same code same everything. Unfortunately, escaping it does not solve it. A view source shows
Quote:
I am at 3.07 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|