home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / CMS / xoops-2.0.18.1.exe / xoops-2.0.18.1 / htdocs / header.php < prev    next >
Encoding:
PHP Script  |  2007-12-08  |  5.1 KB  |  108 lines

  1. <?php
  2. // $Id: header.php 1157 2007-12-08 05:08:53Z phppp $
  3. //  ------------------------------------------------------------------------ //
  4. //                XOOPS - PHP Content Management System                      //
  5. //                    Copyright (c) 2000 XOOPS.org                           //
  6. //                       <http://www.xoops.org/>                             //
  7. //  ------------------------------------------------------------------------ //
  8. //  This program is free software; you can redistribute it and/or modify     //
  9. //  it under the terms of the GNU General Public License as published by     //
  10. //  the Free Software Foundation; either version 2 of the License, or        //
  11. //  (at your option) any later version.                                      //
  12. //                                                                           //
  13. //  You may not change or alter any portion of this comment or credits       //
  14. //  of supporting developers from this source code or any supporting         //
  15. //  source code which is considered copyrighted (c) material of the          //
  16. //  original comment or credit authors.                                      //
  17. //                                                                           //
  18. //  This program is distributed in the hope that it will be useful,          //
  19. //  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
  20. //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
  21. //  GNU General Public License for more details.                             //
  22. //                                                                           //
  23. //  You should have received a copy of the GNU General Public License        //
  24. //  along with this program; if not, write to the Free Software              //
  25. //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
  26. //  ------------------------------------------------------------------------ //
  27. defined("XOOPS_ROOT_PATH") or die( 'XOOPS root path not defined' );
  28.  
  29. include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
  30.  
  31. //global $xoopsLogger;
  32.  
  33. if ( !isset( $xoopsLogger ) ) {        $xoopsLogger =& $GLOBALS['xoopsLogger'];    }
  34.  
  35. $xoopsLogger->stopTime( 'Module init' );
  36. $xoopsLogger->startTime( 'XOOPS output init' );
  37.  
  38.  
  39. if ($xoopsConfig['theme_set'] != 'default' && file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php')) {
  40.     require_once XOOPS_ROOT_PATH . '/include/xoops13_header.php';
  41. } else {
  42.     global $xoopsOption, $xoopsConfig, $xoopsModule;
  43.  
  44.     $xoopsOption['theme_use_smarty'] = 1;
  45.  
  46.     // include Smarty template engine and initialize it
  47.     require_once XOOPS_ROOT_PATH . '/class/template.php';
  48.     require_once XOOPS_ROOT_PATH . '/class/theme.php';
  49.     require_once XOOPS_ROOT_PATH . '/class/theme_blocks.php';
  50.  
  51.     if ( @$xoopsOption['template_main'] ) {
  52.         if ( false === strpos( $xoopsOption['template_main'], ':' ) ) {
  53.             $xoopsOption['template_main'] = 'db:' . $xoopsOption['template_main'];
  54.         }
  55.     }
  56.     $xoopsThemeFactory =& new xos_opal_ThemeFactory();
  57.     $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
  58.     $xoopsThemeFactory->defaultTheme = $xoopsConfig['theme_set'];
  59.  
  60.     /**
  61.      * @var xos_opal_Theme
  62.      */
  63.     $xoTheme =& $xoopsThemeFactory->createInstance( array(
  64.         'contentTemplate' => @$xoopsOption['template_main'],
  65.     ) );
  66.     $xoopsTpl =& $xoTheme->template;
  67.  
  68.     $xoTheme->addScript( '/include/xoops.js', array( 'type' => 'text/javascript' ) );
  69.  
  70.     if ( @is_object( $xoTheme->plugins['xos_logos_PageBuilder'] ) ) {
  71.         $aggreg =& $xoTheme->plugins['xos_logos_PageBuilder'];
  72.  
  73.         $xoopsTpl->assign_by_ref( 'xoBlocks', $aggreg->blocks );
  74.  
  75.         // Backward compatibility code for pre 2.0.14 themes
  76.         $xoopsTpl->assign_by_ref( 'xoops_lblocks', $aggreg->blocks['canvas_left'] );
  77.         $xoopsTpl->assign_by_ref( 'xoops_rblocks', $aggreg->blocks['canvas_right'] );
  78.         $xoopsTpl->assign_by_ref( 'xoops_ccblocks', $aggreg->blocks['page_topcenter'] );
  79.         $xoopsTpl->assign_by_ref( 'xoops_clblocks', $aggreg->blocks['page_topleft'] );
  80.         $xoopsTpl->assign_by_ref( 'xoops_crblocks', $aggreg->blocks['page_topright'] );
  81.  
  82.         $xoopsTpl->assign( 'xoops_showlblock', !empty($aggreg->blocks['canvas_left']) );
  83.         $xoopsTpl->assign( 'xoops_showrblock', !empty($aggreg->blocks['canvas_right']) );
  84.         $xoopsTpl->assign( 'xoops_showcblock', !empty($aggreg->blocks['page_topcenter']) || !empty($aggreg->blocks['page_topleft']) || !empty($aggreg->blocks['page_topright']) );
  85.     }
  86.  
  87.     if ( $xoopsModule ) {
  88.         $xoTheme->contentCacheLifetime = @$xoopsConfig['module_cache'][ $xoopsModule->getVar('mid', 'n') ];
  89.     }
  90.     if ( $xoTheme->checkCache() ) {
  91.         exit();
  92.     }
  93.  
  94.     if ( !isset($xoopsOption['template_main']) && $xoopsModule ) {
  95.         // new themes using Smarty does not have old functions that are required in old modules, so include them now
  96.         include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
  97.         // need this also
  98.         $xoopsTheme['thename'] = $xoopsConfig['theme_set'];
  99.         ob_start();
  100.     }
  101.  
  102. $xoopsLogger->stopTime( 'XOOPS output init' );
  103. $xoopsLogger->startTime( 'Module display' );
  104.  
  105.  
  106. }
  107.  
  108. ?>