Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter dingeman

    (@dingeman)

    OK I have solved the problem by using Shortcode.

    I created the following functions.php in my theme directory:

    <?php
      function processing_object($atts, $content = null) {
        extract(shortcode_atts(array('jar' => '', 'class' => '',
            'width' => 700, 'height' => '800'), $atts));
        if ($jar == '' || $class == '') return '<p>Syntax error</p>';
        $result = <<<EOD
    <div id="processing_container">
      <!--[if !IE]> -->
        <object classid="java:$class.class"
            type="application/x-java-applet"
            archive="$jar"
            width="$width" height="$height"
            standby="Loading Processing software..." >
          <param name="archive" value="$jar" />
          <param name="mayscript" value="true" />
          <param name="scriptable" value="true" />
          <param name="image" value="loading.gif" />
          <param name="boxmessage" value="Loading Processing software..." />
          <param name="boxbgcolor" value="#FFFFFF" />
          <param name="test_string" value="outer" />
      <!--<![endif]-->
        <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
            codebase="http://java.sun.com/update/1.5.0/jinstall-1_5_0_15-windows-i586.cab"
            width="$width" height="$height"
            standby="Loading Processing software..."  >
          <param name="code" value="$class" />
          <param name="archive" value="$jar" />
          <param name="mayscript" value="true" />
          <param name="scriptable" value="true" />
          <param name="image" value="loading.gif" />
          <param name="boxmessage" value="Loading Processing software..." />
          <param name="boxbgcolor" value="#FFFFFF" />
          <param name="test_string" value="inner" />
          <p><strong>This browser does not have a Java Plug-in.<br />
            <a href="http://www.java.com/getjava" title="Download Java Plug-in">Get the latest Java Plug-in here.</a></strong>
          </p>
        </object>
      <!--[if !IE]> -->
        </object>
      <!--<![endif]-->
    </div>
    EOD;
        return $result;
      }
    
      add_shortcode('processing', 'processing_object');
    ?>

    And could then include the java object by using

    [processing jar="test.jar" class="test"]

    in my post.

    Regards,
    Jan

Viewing 1 replies (of 1 total)