Hi,
Maybe some other people can use my work-around for avoiding that Simpleviewer pro opens a HTML page if no (or no recent version) of Flash player is detected, and open instead of that your own non-flash page if needed or wanted. I inserted the code before but I clean it up a little and removed some unneeded error-things. Therefore I inserted here a better version again.
How it works:
Instead of opening your Simpleviewer index page you open first the page with the given code.
This code does some checking about the existing of Flash player, if this Flash Player Is detect and have the right version then it automatic redirect (opens) your Simpleviewer index page
If no right version of Flash player is installed then it automatic opens (redirect) to a other non-flash page of your choice.
It also checks or scripting in the browser is available and you can decide what to do then. (For example you can show a text to inform your users)
The only thing you have to do is to customize the given code where it points to the Simpleviewer-index and alternate pages so that de code can redirect to that pages on your website. See therefore the comment in de code under “CUSTOMIZE” . You find this, and have to chance it there, on 4 locations.
If you want to see how it works, see:
www.dickpieter.nl (in Dutch)
www.dickpieter.com
www.dionpascalle.com
or
www.danielpartielle.com
(There are some problems what that last domain record, so maybe there could be a temporally error with that one, but that has nothing to do with this code.)
Anyhow, all links open the same website, but primarily with their one Simpleview gallery. If no Flash player is detected it shows a simplified mixed gallery HTML-page of my own.
If scripting is disabled in the browser its shows a msg.
Is there a drawback by using this method? So far I found one. Windows Explorers back-button does not work correct anymore. (if someone knows a solution for that I like to hear it :-). Firefox and Chrome having no problems with it. A little other problem is maybe that you have to understand my bad Englisch, haha.
As last thing to say: be aware this is not a “official” solution, and it is given how it is.
Good luck, and bug reports about my refrest Simpleviewer website are welcome :-)).
Dirk.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Check and Redirect page </title>
<style type="text/css">
body {
background-color: #999999;
}
.style3 {color: #666666}
</style>
<script type="text/javascript">
<!--
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return -1;
}
// -->
</script>
<script type="text/javascript">
<!--
var startImg = getQueryVariable("startImg");
//alert(startImg);
// -->
</script>
<!-- Flash Detection Script Block -->
<script type="text/javascript">
<!--
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Globals
// Major version of Flash required
var requiredMajorVersion = 9;
// Minor version of Flash required
var requiredMinorVersion = 0;
// Minor version of Flash required
var requiredRevision = 124;
// the version of javascript supported
var jsVersion = 1.0;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// -->
</script>
<script 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>
<script type="text/javascript">
<!-- // Detect Client Browser type
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
jsVersion = 1.1;
// JavaScript helper required to detect Flash Player PlugIn version information
function JSGetSwfVer(i){
// NS/Opera version >= 3 check for Flash plugin in plugin array
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
descArray = flashDescription.split(" ");
tempArrayMajor = descArray[2].split(".");
versionMajor = tempArrayMajor[0];
versionMinor = tempArrayMajor[1];
if ( descArray[3] != "" ) {
tempArrayMinor = descArray[3].split("r");
} else {
tempArrayMinor = descArray[4].split("r");
}
versionRevision = tempArrayMinor[1] > 0 ? tempArrayMinor[1] : 0;
flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
} else {
flashVer = -1;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
// Can't detect in all other cases
else {
flashVer = -1;
}
return flashVer;
}
// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
{
reqVer = parseFloat(reqMajorVer + "." + reqRevision);
// loop backwards through the versions until we find the newest version
for (i=25;i>0;i = i - 1) {
if (isIE && isWin && !isOpera) {
versionStr = VBGetSwfVer(i);
} else {
versionStr = JSGetSwfVer(i);
}
if (versionStr == -1 ) {
return false;
} else if (versionStr != 0) {
if(isIE && isWin && !isOpera) {
tempArray = versionStr.split(" ");
tempString = tempArray[1];
versionArray = tempString .split(",");
} else {
versionArray = versionStr.split(".");
}
versionMajor = versionArray[0];
versionMinor = versionArray[1];
versionRevision = versionArray[2];
versionString = versionMajor + "." + versionRevision; // 7.0r24 == 7.24
versionNum = parseFloat(versionString);
// is the major.revision >= requested major.revision AND the minor version >= requested minor
if ( (versionMajor > reqMajorVer) && (versionNum >= reqVer) ) {
return true;
} else {
return ((versionNum >= reqVer && versionMinor >= reqMinorVer) ? true : false );
}
}
}
}
// -->
</script>
</head>
<body>
<script type="text/javascript">
<!--
// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
var hasProductInstall = DetectFlashVer(6, 0, 65);
// Version check based upon the values entered above in "Globals"
var hasReqestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
if ( hasProductInstall && !hasReqestedVersion ) {
var productInstallOETags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
//CUSTOMIZE!!!! Point here to your alternate non-flash Content page (becouse there is no or not the right version of flash)
self.location.href = "YourPath/YourAlterNateHTMlpage.html"
} else if (hasReqestedVersion) { // if we've detected an acceptable version
//CUSTOMIZE!!!! Point here to your SimpleViewer index Page
self.location.href = "PathToYourSimpleViewerpage/index.html";
} else { // flash is too old or we can't detect the plugin
//CUSTOMIZE!!!! Point here again to your alternate non-flash Content page
self.location.href = "YourPath/YourAlterNateHTMLindex.html"
// insert non-flash content!
}
// -->
</script>
<noscript>
<!-- Provide alternate content for browsers that do not support scripting
or for those that have scripting disabled. -->
<p>
<!--
//CUSTOMIZE! the text below if you like. This text will be show wen needed, but maybe you can point to an existing non-script AND non-flash page to. -->
Sorry, the requested Gallery webpage requires that scripting be enabled on your web browser and that prefereble the Adobe Flash Player be installed.
As soon you enabled the scripting on your browser the Gallery pages are available. </p>
</noscript>
</body>
</html>