0
votes

I recently moved my companies website to one of our unused web servers in order to update the Joomla backend from 1.5.26 to the latest Joomla 2.5. We couldn't go to 3.x because of modules.I used SP Upgrade, and everything migrated brilliantly once I had my new theme and current modules installed.

We have a customized default theme and an assigned theme to the home page. Within the assigned theme (assigned to the home menu) directory, index.php has a script above the header. I will post this code below.

The old site can be found at the following link and when you first go to the site, you will see the video play. cpmchurchministries.com/old

The new site can be found at the following link and when you first go to the site, you will see only an image. cpmchurchministries.com/new

The code is the same for both sites, index.php:

<head>
    <jdoc:include type="head" />
    <link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css"/>
    <script type="text/javascript" src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/swf/swfobject.js"></script>
    <script type="text/javascript">
        swfobject.embedSWF("<?php echo $this->baseurl ?>/templates/chosenpeople/swf/cpm_logo.swf", "flash_logo", "245", "162", "7");
        window.addEvent('domready', function() {
            if($('default_header')) {
                if(Cookie.get("cpm_movie") != "full") {
                    full_movie();
                } else {
                    small_movie();
                }
            }
        });

        function small_movie() {
            $('default_header').removeClass('full_movie');
            $('default_header').addClass('small_movie');
            swfobject.embedSWF("<?php echo $this->baseurl ?>/templates/cphome/swf/header_home.swf", "flash_header", "696", "157", "7");
        }

    function full_movie() {
        $('default_header').removeClass('small_movie');
        $('default_header').addClass('full_movie');
        Cookie.set("cpm_movie", "full", {duration: 365});
        swfobject.embedSWF("<?php echo $this->baseurl ?>/templates/cphome/swf/video_header.swf", "flash_header", "696", "400", "7");
    }
</script>
<?php if ($editmode) echo '<link rel="stylesheet" href="'.$this->baseurl.'/templates/system/css/general.css" type="text/css" />'."\n"; ?>

Has anyone run into a similar issue? Is it possible to get any help? Thank you. . .

3
You're getting errors in the console; something about Cookie.get(). - Pointy
The old site was off line, it should be accessible now. cpmchurchministries.com/old Let me know if you can see it now. I will look through all your responses, and see what was suggested now. Thank you all so much for responding!! - user3210108

3 Answers

2
votes

The newer version of Joomla that you are using uses a newer version of the MooTools library so you need to make the following two function changes to the code:


OLD

window.addEvent('domready', function() {
    if($('default_header')) {
        if(Cookie.get("cpm_movie") != "full") {
            full_movie();
        } else {
            small_movie();
        }
    }
});


function small_movie() {
    $('default_header').removeClass('full_movie');
    $('default_header').addClass('small_movie');
    swfobject.embedSWF("/new/templates/cphome/swf/header_home.swf", "flash_header", "696", "157", "7");
}

function full_movie() {
    $('default_header').removeClass('small_movie');
    $('default_header').addClass('full_movie');
    Cookie.set("cpm_movie", "full", {duration: 365});
    swfobject.embedSWF("/new/templates/cphome/swf/video_header.swf", "flash_header", "696", "400", "7");
}

NEW

window.addEvent('domready', function() {    
  if($('default_header')) {
            if(Cookie.read("cpm_movie") != "full") {
                full_movie();
            } else {
                small_movie();
            }
        }
    });

function small_movie() {
    $('default_header').removeClass('full_movie');
    $('default_header').addClass('small_movie');
    swfobject.embedSWF("/new/templates/cphome/swf/header_home.swf", "flash_header", "696", "157", "7");
}
function full_movie() {
    $('default_header').removeClass('small_movie');
    $('default_header').addClass('full_movie');
    Cookie.write("cpm_movie", "full", {duration: 365});
    swfobject.embedSWF("/new/templates/cphome/swf/video_header.swf", "flash_header", "696", "400", "7");
}

EDIT for easy copy paste

0
votes

I have this error on your "new site" : GET http://cdn.wibiya.com/Toolbars/dir_0775/Toolbar_775982/Loader_775982.js 403 (Forbidden)

I can't access the "old site", there is a Joomla login page. It would be easier if we could access it to compare both sites.

0
votes

As Pointy said, you are getting some errors in the Javascript console:

  1. Uncaught TypeError: Object function (){e(this);if(g.$prototyping){return this;}this.$caller=null;var i=(this.initialize)?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null; return i;} has no method 'get' (index):27
  2. GET http://cdn.wibiya.com/Toolbars/dir_0775/Toolbar_775982/Loader_775982.js 403 (Forbidden) (index):249
  3. Uncaught ReferenceError: JCaption is not defined (index):17
  4. GET http://cpmchurchministries.com/main/flash/menorah_shine.swf 404 (Not Found)

When there are errors with Javascript, the flow is stopped, so your image on the header is not replaced by the video (is not a "video", it's a flash swf movie).

One of the offending codes are:

  <script type="text/javascript">
window.addEvent('load', function() {
                new JCaption('img.caption');
            });
  </script> 

If you cannot remove this code, Try this link to get rid of the JCaption problem and try again your site.

By the way, to see the errors on the console, try using a Chrome Browser, Tools, Javascript console (a must for every webdev!)