Joomla模板1.5到2.5 / 3.x升级

时间:2015-06-02 01:37:39

标签: php joomla upgrade

将以下代码从1.5转换为2.5 / 3.x有多难?我已尝试多个指南将其转换为2.5但未成功。我注意到的大部分代码都是因为它缺少指南要求你改变的内容。显然,最终结果是当我将它上传到Joomla 2.5的全新安装时它不起作用。

<?php
/**
 * @copyright   Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
 * @license     GNU/GPL, see LICENSE.php
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<jdoc:include type="head" />

<?php
    global $templateurl ;
    $templateurl = $this -> baseurl . '/templates/1989_dog_store' ;
    $js = $templateurl.'/js/';
    $css = $templateurl.'/css/';
?>
<meta http-equiv="Content-Type" content="text/html; <?php echo _ISO; ?>" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/general.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $templateurl; ?>/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $templateurl; ?>/css/gallery.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $templateurl; ?>/css/style.css" type="text/css" />
<script src="<?php echo $templateurl; ?>/js/jquery-1.3.2.js" type="text/javascript"></script>
<script src="<?php echo $templateurl; ?>/js/jquery-slide.js" type="text/javascript"></script>
<script src="<?php echo $templateurl; ?>/js/ie.js" type="text/javascript"></script>

        <!-- Header_gallery -->
<script type="text/javascript">
var $j = jQuery.noConflict();
$j('<img />')[0].src = '<?php echo $templateurl; ?>/images/header/1.jpg';
$j('<img />')[0].src = '<?php echo $templateurl; ?>/images/header/2.jpg';
$j('<img />')[0].src = '<?php echo $templateurl; ?>/images/header/3.jpg';
$j('<img />')[0].src = '<?php echo $templateurl; ?>/images/header/4.jpg';
$j('<img />')[0].src = '<?php echo $templateurl; ?>/images/header/19.jpg';

$j(function() {
    var fx, cbox = 1;//$('input:checkbox').click(start)[0];
    //cbox.checked = true;

    var markup = '<div id="slideshow">'
        + '<img src="<?php echo $templateurl; ?>/images/header/1.jpg"><img src="<?php echo $templateurl; ?>/images/header/2.jpg"><img src="<?php echo $templateurl; ?>/images/header/3.jpg"><img src="<?php echo $templateurl; ?>/images/header/4.jpg"><a href="../index.php/wholesale"><img src="<?php echo $templateurl; ?>/images/header/19.jpg"></a>'
        + '</div>';

    function start() {
        $j('#slideshow').cycle('stop').remove();
        $j('#show').append(markup);
        $j('#effect').html(fx);
        $j('#slideshow').cycle({
            fx: fx,
            timeout: 8000,
            delay:  -1000,
            after: onAfter,
            sync: 1
        });
    }

    function onAfter(curr,next,opts) {
        var msg = 'Slide ' + (opts.currSlide + 1) + ' of ' + opts.slideCount;
        $j('#caption').html(msg);
    };

    fx = $j.trim("fade");
    start();
});
</script>
                            <!-- Header_gallery_end -->
<!--[if IE]>
    <link href="<?php echo $templateurl; ?>/css/ieonly.css" rel="stylesheet" type="text/css" />
<![endif]-->

</head>
<body dir="ltr">
<div id="body">
    <div class="outer">
        <div class="topright">
            <?php if ( $this -> countModules ( 'user7' ) ) : ?>
            <div id="menu_top">
                <jdoc:include type="modules" name="user7" />
                <script type="text/javascript">
                    var z_menu = document . getElementById ( 'menu_top' ) ;
                    z_menu = z_menu . getElementsByTagName ( 'li' ) ;
                    z_menu [ z_menu . length - 1 ] . style . backgroundImage = 'none' ;
                    z_menu [ z_menu . length - 1 ] . style . paddingRight = '0' ;
                </script><br>
            </div>
            <?php endif; ?>
            <div class="clear"></div>
            <?php if ( $this -> countModules ( 'user2' ) ) : ?>
            <div id="shopcart">
                <jdoc:include type="modules" name="user2" />
            </div>
            <?php endif; ?>
            <?php if ( $this -> countModules ( 'user1' ) ) : ?>
            <div id="currency"><jdoc:include type="modules" name="user1"  style="top" /><div class="clear"></div></div>
            <?php endif; ?>
            </div>
        <div id="logo">
            <a href="<?php echo $mainframe -> getCfg ( 'live_site' ) ; ?>">
                <img src="<?php echo $templateurl; ?>/images/logo.jpg" alt="<?php echo $mainframe->getCfg('sitename') ; ?>" />
            </a>
        </div>
        <div class="clear"></div>
        <?php if ( $this -> countModules ( 'user3 or user4' ) ) : ?>
        <div id="topmenu">
            <div class="inner">
                <jdoc:include type="modules" name="user3" />
                <script type="text/javascript">
                    var z_menu = document . getElementById ( 'topmenu' ) ;
                    z_menu = z_menu . getElementsByTagName ( 'li' ) ;
                    z_menu [ z_menu . length - 1 ] . style . backgroundImage = 'none' ;
                </script>
                <div id="search"><jdoc:include type="modules" name="user4" /></div>
            </div>
        </div>
        <?php endif; ?>
        <div class="clear"></div>
        <div id="header" class="outer">
            <div class="inner">
                <div id="shop_now">
                    <div id="show">
                        <div style="overflow: hidden; position: relative;" id="slideshow">
                            <img style="position: absolute; top: 0px; left: 0px; display: none; z-index: 9; opacity: 1; width: 915px; height: 334px;" src="<?php echo $templateurl; ?>/images/header/1.jpg">
                            <img style="position: absolute; top: 0px; left: 0px; display: none; z-index: 9; opacity: 1; width: 915px; height: 334px;" src="<?php echo $templateurl; ?>/images/header/2.jpg">
                            <img style="position: absolute; top: 0px; left: 0px; display: none; z-index: 9; opacity: 1; width: 915px; height: 334px;" src="<?php echo $templateurl; ?>/images/header/3.jpg">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?php if ( $this -> countModules ( 'banner' ) ) : ?>
        <div id="banner">
            <jdoc:include type="modules" name="banner" />
        </div>
        <?php endif; ?>
        <div class="clear"></div>
        <?php if ( $this -> countModules ( 'top' ) ) : ?>
        <div id="ps">
            <jdoc:include type="modules" name="top" style="side" />
            <div class="clear"></div>
        </div>
        <?php endif; ?>
        <table id="content" width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
            <?php if ( $this -> countModules ( 'left' ) ) : ?>
                <td width="238">
                    <div id="left"><jdoc:include type="modules" name="left" style="side" /></div>
                </td>
            <?php endif; ?>
                <td>
                    <div id="center">
                    <div id="message"><jdoc:include type="message" /></div>

                    <?php if ( ( $_GET [ 'view' ] == 'frontpage' ) && ( $_POST [ 'option' ] == '' ) || empty($_GET) ) { ?>
                        <div id="fp"><jdoc:include type="modules" name="content" style="side" /></div>
                        <script type="text/javascript">
                            var z_menu = document . getElementById ( 'fp' ) ;
                            z_menu = z_menu . getElementsByTagName ( 'tr' ) ;
                            z_menu [ z_menu . length - 2 ] . style . backgroundImage = 'none' ;

                            var z_menu = document . getElementById ( 'fp' ) ;
                            z_menu = z_menu . getElementsByTagName ( 'td' ) ;
                            for(i=1;i<z_menu.length;i=i+2)z_menu [ i ] . style . backgroundImage = 'none' ;
                        </script>
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <?php if ( $this -> countModules ( 'user5' ) ) : ?>
                                    <td><jdoc:include type="modules" name="user5" /></td>
                                <?php endif; ?>
                                <?php if ( $this -> countModules ( 'user6' ) ) : ?>
                                    <td><jdoc:include type="modules" name="user6" /></td>
                                <?php endif; ?>
                            </tr>
                        </table>
                    <?php } else { ?>
                        <div id="path"><div class="left"><div class="right"><div class="inner">
                            <jdoc:include type="modules" name="breadcrumb" />
                        </div></div></div></div>
                        <div
                            id="component"
                            <?php if ( ( $option == 'com_virtuemart' ) && ( ( !isset ( $_REQUEST [ 'page' ] ) ) || ( $_REQUEST [ 'page' ] == 'shop.browse' ) ) && ( !isset ( $_REQUEST [ 'category_id' ] ) ) ) { ?>
                                class="firstShopPage"
                            <?php } ?>
                        >
                                <div class="inner">
                                    <jdoc:include type="component" />
                                </div>
                        </div>
                    <?php } ?>
                    </div>
                </td>
            <?php if ( ( $this -> countModules ( 'right' ) ) ) : ?>
                <td width="238">
                    <div id="right"><jdoc:include type="modules" name="right" style="side" /></div>
                </td>
            <?php endif; ?>
              </tr>
            </table>
    </div>
    <div id="footer" class="outer">
        <div class="top">
            <div class="left">
                <div class="right">
                    <div class="tl">
                        <div class="tr">
                            <div class="outer">
                                <div class="inner" >
                                    <div id="foot_bg">
                                        <div id="footmenu">
                                            <jdoc:include type="modules" name="user3" />
                                        </div>
                                        <div style="float:left">
                                            <img src="<?php echo $templateurl; ?>/images/cart.gif" alt="cart" />
                                        </div>
                                        <div class="clear"></div>
                                    </div>
                                    <div class="clear"></div>
                                    <div style="float:left;">&copy; All rights reserved. <?php echo  Date( 'Y' ) ;?>.</div>


                                    <div class="clear"></div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<jdoc:include type="modules" name="debug" />
</div>
</body>
</html>

1 个答案:

答案 0 :(得分:-1)