We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8841
    • 42 Posts
    Hi, I have been able to set up MODx for my HTMl, but the .swf flash files in my index.php file does not work in MODx, its not the flash that is the problem as it works fine outside MODx.

    Home page template index.php

    {{thehatshop_header}}

    <div id="divContentWrapper">
    <div id="InnerHolder2">
    <div id="contactleft">

    <div id="content">
    [*content*]


    </div>

    <div id="contactpanelhome">

    [[!SmallFlash?&file=`home.swf`!]]


    <img src="assets/templates/mytemplates/thehatshop/images/hatshopnew3_r4_c3.jpg" alt="phone" width="141" height="151" class="floatright" /><p>The Hat Shop


    8 Bridge Street,

    Lisburn, BT28 1XY




    T: 02892 672110

    E: <a href="mailto:[email protected]">[email protected]</a></p>
    </div>
    </div>
    <div id="contactright">
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="401" height="315" id="FlashID" title="home slideshow">
    <param name="movie" value="assets/flash/home.swf" />
    <param name="quality" value="high" />
    <param name="wmode" value="opaque" />
    <param name="swfversion" value="6.0.65.0" />
    <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
    <param name="expressinstall" value="assets/templates/mytemplates/thehatshop/Scripts/expressInstall.swf" />
    <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
    <!--[if !IE]>-->
    <object type="application/x-shockwave-flash" data="assets/flash/home.swf" width="401" height="315">
    <!--<![endif]-->
    <param name="quality" value="high" />
    <param name="wmode" value="opaque" />
    <param name="swfversion" value="6.0.65.0" />
    <param name="expressinstall" value="assets/templates/mytemplates/thehatshop/Scripts/expressInstall.swf" />
    <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
    <div>
    <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
    <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>
    </div>
    <!--[if !IE]>-->
    </object>
    <!--<![endif]-->
    </object>
    </div>


    </div>
    </div>



    {{thehatshop_footer}}



    This template calls 2 chunks which work fine, header and footer


    I have also added this snippet, smallFlash, which i thought might assist the flash, but it didnt work, and outputs this error when I try to execute

    Flash Snippet

    <?php
    /*
    * ----------------------------------------
    * Snippet Name: SmallFlash
    * Short Desc: Embeds a flash file with minimum html code
    * Version: 1.0
    * Created by: Wim Beerens (http://webesite.nl)
    *
    * Date: May 7, 2008
    *
    * Changelog:
    * May 7th, 2008 -- Initial release
    * ----------------------------------------
    * Usage:
    * Embeds a flash file with minimum validating html code
    * The parameters give some control on how the html code should look
    *
    * Installation:
    * In the Manager create a new snippet called SmallFlash
    * and copy/paste this code into the new snippet
    *
    * Parameters:
    * &folder [string] (optional) (default: assets/flash)
    * Path where to find the flash file
    * &file [string]
    * Name of the flash file
    * &background [string] (optional) (default: transparent)
    * Background color of the flash file
    * &linkAdobe [ 0 | 1 ] (default: 0)
    * If no flash player installation is found, display a link to Adobe install
    * 0 = No; 1 = Yes
    * &tpl [string] (optional)
    * Name of chunk to be used as template
    *
    * Placeholders:
    * [+sf.htmlcode+]
    * Complete html code to display the flash file
    *
    * Examples:
    * [[SmallFlash? &file=`home.swf`]]
    * Default call. Flash file should be in the folder assets/flash
    *
    * [[SmallFlash? &folder=`assets/flash/movies` &file=`home.swf` &tpl=`sfTemplate`]]
    * This one calls a chunk, called sfTemplate to format your output
    *
    * Example of a chunk:
    * <div id="smallFlash">
    * [+sf.htmlcode+]
    * </div> <!-- End smallFlash -->
    * ----------------------------------------
    */

    // Snippet customize settings
    $folder = isset($folder)? $folder:’assets/flash’;
    $file = isset($file)? $file:’’;
    $background = isset($background)? $background:’transparent’;
    $linkAdobe = isset($linkAdobe)? $linkAdobe:’0’;
    $tpl = isset($tpl) ? $modx->getChunk($tpl):’
    <div class="smallFlash">
    [+sf.htmlcode+]
    </div> <!-- End smallFlash -->
    ’;

    // Execution of script
    $output = ’’;

    if (!$file == ’’) {
    $noFlash = ’No flash player installation found.’;
    if ($linkAdobe == ’1’) {
    $noFlash .= ’
    To install flash player, <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">click here</a>’;
    }
    $fileName = $folder . ’/’ . $file;
    $imgSize = getImageSize($fileName);
    $htmlCode = ’
    <object type="application/x-shockwave-flash" data="’ . $fileName . ’" ’ . $imgSize[3] . ’>
    <param name="movie" value="’ . $fileName . ’" />
    <param name="wmode" value="’ . $background . ’" />
    ’ . $noFlash . ’
    </object>
    ’;
    $modx->setPlaceholder(’sf.htmlcode’, $htmlCode);
    $output = $modx->mergePlaceholderContent($modx->mergeChunkContent($tpl));
    } else {
    $output = ’No filename.’;
    }

    return $output;
    ?>
    ?>




    Error

    Warning getimagesize(assets/flash/movies/home.swf) function.getimagesize failed to open stream, no such file or directory






      • 28042 ☆ A M B ☆
      • 24,524 Posts
      An uncached snippet call is [! ... !], not [[! ... !]]
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 8841
        • 42 Posts
        Is the snippet necessary for the flash to be displayed?

        Also, if I use the snippet and call it, does that mean my template should now look like this:

        {{thehatshop_header}}

        <div id="divContentWrapper">
        <div id="InnerHolder2">
        <div id="contactleft">

        <div id="content">
        [*content*]


        </div>

        <div id="contactpanelhome">




        <img src="assets/templates/mytemplates/thehatshop/images/hatshopnew3_r4_c3.jpg" alt="phone" width="141" height="151" class="floatright" /><p>The Hat Shop


        8 Bridge Street,

        Lisburn, BT28 1XY




        T: 02892 672110

        E: <a href="mailto:[email protected]">[email protected]</a></p>
        </div>
        </div>
        <div id="contactright">

        [snippet call here]

        ------> remove everything bold
        <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="401" height="315" id="FlashID" title="home slideshow">
        <param name="movie" value="assets/flash/home.swf" />
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
        <param name="expressinstall" value="assets/templates/mytemplates/thehatshop/Scripts/expressInstall.swf" />
        <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
        <!--[if !IE]>-->
        <object type="application/x-shockwave-flash" data="assets/flash/home.swf" width="401" height="315">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="assets/templates/mytemplates/thehatshop/Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
        <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
        <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></a></p>


        ----->


        </div>
        <!--[if !IE]>-->
        </object>
        <!--<![endif]-->
        </object>
        </div>


        </div>
        </div>



        {{thehatshop_footer}}


          • 8841
          • 42 Posts
          I found the solution, initially I was using a tutorial and I put all my files into the following folder

          assets/templates/mytemplates/thehatshop

          I copied everything bar index.php, as this already existed, into the root directory and then the flash worked.
            • 28625
            • 24 Posts
            Quote from: emmSmyth at May 19, 2009, 10:55 AM

            E: <a href="mailto:[email protected]">[email protected]</a></p>
            I would seriously consider removing your email link from your webpage as that is just asking for Spam. Try replacing the link with a "Contact Us" page or a JPG image of your email address.
            Just passing along some advice that I received and implemented on our site. wink