Please Review My Code... - Joomla! Forum - community, help and support


first, i'd i'm not coder. i'm learning go i'm wondering if can spare time kindly review index.php code see if it's ok use in joomla 3.0 or if there code needed or not required.

thanking in advance!!

here is:

code: select all

<?php
/**
 * @copyright copyright (c) 2005 - 2007 open source matters. rights reserved.
 * @license gnu/gpl, see license.php
 * joomla! free software. version may have been modified pursuant
 * gnu general public license, , distributed includes or
 * derivative of works licensed under gnu general public license or
 * other free or open source software licenses.
 * see copyright.php copyright notices , 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; ?>" dir="<?php echo $this->direction; ?>" >

<?php
$menu =& jsite::getmenu();
$active = $menu->getactive();
$params = $menu->getparams( $active->id );
$class = $params->get( 'pageclass_sfx' );
?>

<?php
// site title
$app = jfactory::getapplication();

// open image or page in modal window
jhtml::_('behavior.modal');

// following line loads mootools javascript library
jhtml::_('behavior.framework', true);
?>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="../media/jui/js/jquery.js"></script>
  <script src="../media/jui/js/bootstrap.min.js"></script>
  <script src="../media/jui/js/chosen.jquery.min.js"></script>
  <script type="text/javascript">
    jquery.noconflict();
   </script>

<jdoc:include type="head" />

<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/system/css/template.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 $this->baseurl ?>/templates/<?php echo $this->template ?>/css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/lbno_bg.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/css/lbyes_bg.css" type="text/css" />
<link rel="shortcut icon" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template?>/favicon.png" />

<?php
// if right-to-left
if ($this->direction == 'rtl') :
    $doc->addstylesheet('../media/jui/css/bootstrap-rtl.css');
endif;
 
// load specific language related css
$file = 'language/' . $lang->gettag() . '/' . $lang->gettag() . '.css';
if (jfile::exists($file)) :
    $doc->addstylesheet($file);
endif;
 
$doc->addstylesheet('../media/jui/css/chosen.css');
?>

<?php
if($this->countmodules('mira-left , mira-right') == 0) $contentwidth = "full";
if($this->countmodules('mira-left or mira-right') == 1) $contentwidth = "half";
if($this->countmodules('mira-left , mira-right') == 1) $contentwidth = "narrow";
?>

<?php
$shelf = 0;
if ($this->countmodules('mira-user1')) $shelf++;
if ($this->countmodules('mira-user2')) $shelf++;
if ($this->countmodules('mira-user3')) $shelf++;

if ( $shelf == 3 ) {       // if 3 modules published - each module width 33%
    $shelfwidth = '33%';
} if ( $shelf == 2 ) {     // if 2 modules published - each module width 50%
    $shelfwidth = '50%';   
} else if ($shelf == 1) {  // if 1 module published - module width 100%
    $shelfwidth = '100%';   
}
?>

<?php
$shelf2 = 0;
if ($this->countmodules('mira-user4')) $shelf2++;
if ($this->countmodules('mira-user5')) $shelf2++;
if ($this->countmodules('mira-user6')) $shelf2++;

if ( $shelf2 == 3 ) {       // if 3 modules published - each module width 33%
    $shelfwidth2 = '33%';
} if ( $shelf2 == 2 ) {     // if 2 modules published - each module width 50%
    $shelfwidth2 = '50%';       
} else if ($shelf2 == 1) {  // if 1 module published - module width 100%
    $shelfwidth2 = '100%';   
}
?>

<?php
$shelf3 = 0;
if ($this->countmodules('mira-footer-left')) $shelf3++;
if ($this->countmodules('mira-footer-right')) $shelf3++;

if ( $shelf3 == 2 ) {       // if 2 modules published - each module width 50%
    $shelfwidth3 = '48%';       
} else if ($shelf3 == 1) {  // if 1 module published - module width 100%
    $shelfwidth3 = '100%';   
}
?>
</head>

<body<?php if ($class) echo ' class="' . $class . '"'; ?>>

<div id="mira-wrap-container">

   <div id="mira-wrap">
      <div id="mira-wrap-inside">

      <!-- start mira main content -->
      <div id="mira-wrap-content">
      
      <!-- start header -->
      <div id="mira-header-container">

      <?php if ($this->countmodules( 'mira-topmenu or mira-cart' )) : ?>
        <div id="mira-header-top">
          <div id="mira-header-topmenu"><jdoc:include type="modules" name="mira-topmenu" /></div>
          <div id="mira-header-cart"><jdoc:include type="modules" name="mira-cart" /></div>
        </div>
      <?php endif; ?>   
      
      <?php if ($this->countmodules( 'mira-logo or mira-social' )) : ?>
        <div id="mira-header-middle">
           <div id="mira-header-logo"><jdoc:include type="modules" name="mira-logo" /></div>
           <div id="mira-header-social"><jdoc:include type="modules" name="mira-social" /></div>
        </div>
      <?php endif; ?>   


      <?php if($this->countmodules('mira-menu')) : ?>
        <div id="mira-header-menu">
           <div id="mira-menu"><jdoc:include type="modules" name="mira-menu" /></div>
        </div>
      <?php endif; ?>   

      </div>

      <!-- pathway -->
      <?php if ($this->countmodules( 'mira-breadcrumb or mira-date' )) : ?>
      <div id="mira-pathway">
          <div id="mira-pathway-breadcrumb"><jdoc:include type="modules" name="mira-breadcrumb" /></div>
          <div id="mira-pathway-date"><jdoc:include type="modules" name="mira-date" /></div>
      </div>
      <?php endif; ?>   

        <!-- section below header -->
        <?php if($this->countmodules('mira-spotlight')) : ?>
             <div id="mira-spotlight-container"><jdoc:include type="modules" name="mira-spotlight" /></div>
      <?php endif; ?>   
        <!-- ####### -->
      
      <?php if($this->countmodules('mira-left')) : ?>   
         <div id="mira-content-left">
            <jdoc:include type="modules" name="mira-left" style="xhtml" />
         </div>
         <?php endif; ?>   
         
         <?php if($this->countmodules('mira-right')) : ?>   
         <div id="mira-content-right">
            <jdoc:include type="modules" name="mira-right" style="xhtml" />
         </div>
      <?php endif; ?>
      
      <div id="mira-content<?php echo $contentwidth; ?>">
         <?php if (count(jfactory::getapplication()->getmessagequeue())) : ?>
         <div class="error">
            <h2><?php echo jtext::_('message'); ?></h2>
            <jdoc:include type="message" />
         </div>
         <?php endif; ?>

      <jdoc:include type="component" />

      </div> <!-- end mira content -->   
   </div> <!-- end mira wrap content -->   

       <!-- start mira-user1, mira-user2 , mira-user3 -->
      <?php if ($this->countmodules( 'mira-user1 or mira-user2 or mira-user3' )) : ?>
            <div id="myshelf">
               <?php if ($this->countmodules('mira-user1')) : ?>
                       <div id="mira-mod-user1" style="width:<?php echo $shelfwidth ?>;" >
                         <jdoc:include type="modules" name="mira-user1" style="xhtml" />
                       </div>
               <?php endif; ?>

               <?php if ($this->countmodules('mira-user2')) : ?>
                       <div id="mira-mod-user2" style="width:<?php echo $shelfwidth ?>;" >
                         <jdoc:include type="modules" name="mira-user2" style="xhtml" />
                       </div>
               <?php endif; ?>

               <?php if ($this->countmodules('mira-user3')) : ?>
                       <div id="mira-mod-user3" style="width:<?php echo $shelfwidth ?>;" >
                         <jdoc:include type="modules" name="mira-user3" style="xhtml" />
                       </div>
               <?php endif; ?>
            </div>
      <?php endif; ?>
      <br style="clear:both;" />
      <!-- end mira-user1, mira-user2 , mira-user3 -->
      
      <!-- start mira-user4, mira-user5 , mira-user6 -->
      <?php if ($this->countmodules( 'mira-user4 or mira-user5 or mira-user6' )) : ?>
            <div id="myshelf2">
               <?php if ($this->countmodules('mira-user4')) : ?>
                       <div id="mira-mod-user4" style="width:<?php echo $shelfwidth2 ?>;" >
                         <jdoc:include type="modules" name="mira-user4" style="xhtml" />
                       </div>
               <?php endif; ?>

               <?php if ($this->countmodules('mira-user5')) : ?>
                       <div id="mira-mod-user5" style="width:<?php echo $shelfwidth2 ?>;" >
                         <jdoc:include type="modules" name="mira-user5" style="xhtml" />
                       </div>
               <?php endif; ?>

               <?php if ($this->countmodules('mira-user6')) : ?>
                       <div id="mira-mod-user6" style="width:<?php echo $shelfwidth2 ?>;" >
                         <jdoc:include type="modules" name="mira-user6" style="xhtml" />
                       </div>
               <?php endif; ?>
            </div>
      <?php endif; ?>
      <!-- start mira-user4, mira-user5 , mira-user6 -->

      <?php if($this->countmodules('mira-bottom')) : ?>
        <div id="mira-bottom-content">
             <div id="mira-bottom"><jdoc:include type="modules" name="mira-bottom" /></div>
        </div>
      <?php endif; ?>   

      </div> <!-- end mira wrap inside -->
   </div> <!-- end mira wrap -->

 <!-- start bottom content -->
 <div id="mira-wrap-bottom">
    <div id="mira-footer">
      <!-- start mira-footer-left , mira-footer-right -->
     <?php if ($this->countmodules( 'mira-footer-left or mira-footer-right' )) : ?>

       <div id="myshelf3">
         <?php if ($this->countmodules('mira-footer-left')) : ?>
         <div id="mira-footer-left" style="width:<?php echo $shelfwidth3 ?>;" >
            <jdoc:include type="modules" name="mira-footer-left" style="xhtml" />
         </div>
         <?php endif; ?>
      
        <?php if ($this->countmodules('mira-footer-right')) : ?>
         <div id="mira-footer-right" style="width:<?php echo $shelfwidth3 ?>;" >
            <jdoc:include type="modules" name="mira-footer-right" style="xhtml" />
         </div>
         <?php endif; ?>
        </div>
      <?php endif; ?>
      </div> <!-- end mira footer-->
     <!-- end mira-footer-left , mira-footer-right -->
  </div>  <!-- end mira wrap bottom -->
  <!-- end bottom content -->

</div> <!-- end mira wrap container -->
<jdoc:include type="modules" name="debug" />
</body>
</html>

i tried using template on 3.0 error below. idea need change?

fatal error: call member function gettag() on non-object in /home/.../public_html/templates/.../index.php on line 63

thanks!!





Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support