XStandard knowledge base: Can I use XStandard version 2 and version 3 in the same CMS?

The XHTML WYSIWYG Editor For Desktop & Web Applications

Can I use XStandard version 2 and version 3 in the same CMS?

Yes, but versions 1, 2 and 3 use different license files, so you need to serve the appropriate license file to each version. To do this, create a script that will read the HTTP User-Agent header. If this header contains the sub-string "XStandard 3", redirect to version 3 license file. If this HTTP header contains the sub-string "XStandard 2", redirect to version 2 license file. Otherwise, redirect to version 1 license file. Then point the editor to this script like this:

  1. <param name="License" value="http://yourserver/license.asp" />

The following are 3 examples of how to do this using ASP, ASP.NET and PHP.

ASP example

  1. <%
  2. If InStr(1, Request.ServerVariables("HTTP_USER_AGENT").Item, "XStandard 3") > 0 Then
  3. Response.Redirect "license3.txt"
  4. Response.End
  5. ElseIf InStr(1, Request.ServerVariables("HTTP_USER_AGENT").Item, "XStandard 2") > 0 Then
  6. Response.Redirect "license2.txt"
  7. Response.End
  8. Else
  9. Response.Redirect "license1.txt"
  10. Response.End
  11. End If
  12. %>

Download ASP example

ASP.NET example

  1. <%@Page language="C#" AutoEventWireup="false" ValidateRequest="false" Debug="false"%>
  2. <%
  3. if (Request.ServerVariables["HTTP_USER_AGENT"] != null)
  4. {
  5. if (Request.ServerVariables["HTTP_USER_AGENT"].IndexOf("XStandard 3") >= 0)
  6. {
  7. Response.Redirect("license3.txt", false);
  8. }
  9. else if (Request.ServerVariables["HTTP_USER_AGENT"].IndexOf("XStandard 2") >= 0)
  10. {
  11. Response.Redirect("license2.txt", false);
  12. }
  13. else
  14. {
  15. Response.Redirect("license1.txt", false);
  16. }
  17. }
  18. %>

Download ASP.NET example

PHP example

  1. <?php
  2. if (isset($_SERVER["HTTP_USER_AGENT"])) {
  3. if (strpos($_SERVER["HTTP_USER_AGENT"], "XStandard 3") !== false) {
  4. header("Location: license3.txt");
  5. die();
  6. } elseif (strpos($_SERVER["HTTP_USER_AGENT"], "XStandard 2") !== false) {
  7. header("Location: license2.txt");
  8. die();
  9. } else {
  10. header("Location: license1.txt");
  11. die();
  12. }
  13. }
  14. ?>

Download PHP example