XPressME Integration Kit

Trac


Ignore:
Timestamp:
Nov 20, 2009, 2:52:16 PM (15 years ago)
Author:
toemon
Message:

MUブランチにVer2.2.0RC1の変更内容をマージ

Location:
branches/XPressMU/xpressme_integration_kit/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/XPressMU/xpressme_integration_kit/include/add_xpress_process.php

    r421 r451  
    1414 
    1515        require_once $xoops_config->xoops_mainfile_path; //It is necessary to execute it for the user attestation before wp-settings.php.  
     16        unset($offset); 
    1617        require_once(ABSPATH.'wp-settings.php'); 
    1718        if (!is_object($xoopsUser)){    // before login auth cookie clear 
  • branches/XPressMU/xpressme_integration_kit/include/xpress_block_render.php

    r406 r451  
    137137        } 
    138138         
    139         function get_block_file_path($mydirname,$file_name) 
    140         { 
    141                 global $xoops_config; 
    142                 $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
    143                 $select_theme = get_xpress_theme_name($mydirname); 
    144                 $block_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/' . $file_name; 
    145  
    146                 if (!file_exists($block_file)) 
    147                         $block_file =  $xoops_config->xoops_root_path . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/' . $file_name; 
    148                 return $block_file; 
    149         } 
    150139         
    151140    function xpress_block_cache_found($mydirname,$block_name) 
     
    184173                if (strstr($call_url,$this_url)){                        
    185174                        $block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name); 
    186                         require_once $block_theme_file; 
     175                        require_once $block_theme_file['file_path']; 
    187176                        $block = $call_theme_function_name($options);           //The block name and the called function name should be assumed to be the same name.  
     177                        if (!empty($block_theme_file['error'])) 
     178                                $block['err_message'] = $block_theme_file['error']; 
    188179                } else { 
    189180                        if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){ 
     
    227218 
    228219                        $block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name); 
    229                         require_once $block_theme_file; 
     220                        require_once $block_theme_file['file_path']; 
    230221                        $render = $call_theme_function_name($options);          //The block name and the called function name should be assumed to be the same name.                     
    231222                        $render_array['block'] = $render; 
    232223                        $render_array['block']['options'] = $block->options; 
     224                        if (!empty($block_theme_file['error'])) 
     225                                $render_array['block']['err_message'] = $block_theme_file['error']; 
    233226                        if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){        
    234227                                $render_serialize = xpress_XML_serialize($render_array); 
     
    295288                } 
    296289        } 
    297  
     290         
    298291}        
    299292?> 
  • branches/XPressMU/xpressme_integration_kit/include/xpress_breadcrumbs.php

    r59 r451  
    11<?php 
     2function get_breadcrumbs(){ 
    23//      $xoops_breadcrumbs[0] = array( 'name' => get_bloginfo('description') , 'url' => get_settings('home')); 
    34        $xoops_breadcrumbs[0] = array( 'name' => get_bloginfo('name') , 'url' => get_settings('home')); 
     
    4647                } 
    4748        } 
    48         $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs); 
     49        return $xoops_breadcrumbs; 
     50} 
    4951?> 
  • branches/XPressMU/xpressme_integration_kit/include/xpress_render.php

    r422 r451  
    1111 
    1212        $pattern = "<head[^>]*?>(.*)<\/head>"; 
    13         preg_match("/".$pattern."/s",  $body_cut, $head_matches); 
    14         $head_str = $head_matches[1]; 
    15          
     13        $head_str = ''; 
     14        if (preg_match("/".$pattern."/s",  $body_cut, $head_matches)){ 
     15                $head_str = $head_matches[1]; 
     16        } 
    1617        $pattern = '<head[^>]*?>'; 
    1718        $head_str = preg_replace("/".$pattern."/s" , '' , $head_str); 
     
    5152{ 
    5253        $pattern = '<title[^>]*?>(.*)<\s*\/\s*title\s*>'; 
    53         preg_match("/".$pattern."/i",  $contents, $head_matches); 
    54         $title_str = $head_matches[1]; 
     54        $title_str = ''; 
     55        if (preg_match("/".$pattern."/i",  $contents, $head_matches)){ 
     56                $title_str = $head_matches[1]; 
     57        } 
    5558        return $title_str; 
    5659} 
     
    5962{ 
    6063        $pattern = '<\s*meta\s+name\s*=\s*["\']' . $name . '["\']\s*content\s*=\s*[\'"](.*)[\'"]\s*\/\s*>'; 
    61         preg_match("/".$pattern."/i",  $contents, $head_matches); 
    62         $meta = $head_matches[1]; 
     64        $meta = ''; 
     65        if (preg_match("/".$pattern."/i",  $contents, $head_matches)){ 
     66                $meta = @$head_matches[1]; 
     67        } 
    6368        return $meta; 
    6469} 
     
    8994        $xpess_config = new XPressME_Class(); 
    9095        $pattern = "<body[^>]*?>(.*)<\/body>"; 
    91         preg_match("/".$pattern."/s",  $contents, $body_matches); 
    92         $body = $body_matches[1]; 
    93  
     96        $body = ''; 
     97        if(preg_match("/".$pattern."/s",  $contents, $body_matches)){ 
     98                $body = $body_matches[1]; 
     99        } 
    94100        if (!$xpess_config->is_theme_sidebar_disp){ 
    95101                $side_panel = get_sidebar_rander(); 
     
    151157         
    152158        require_once( ABSPATH .'/include/xpress_breadcrumbs.php' ); 
    153          
     159        $xoops_breadcrumbs = get_breadcrumbs(); 
     160 
    154161        xpress_remake_global_for_permlink(); 
    155162        $mydirname = basename(dirname(dirname(__FILE__))); 
    156163        include $xoops_config->xoops_root_path ."/header.php"; 
     164        $xoopsTpl->assign('xoops_breadcrumbs', $xoops_breadcrumbs); 
    157165        $xoopsTpl->assign('xoops_module_header', get_xpress_module_header($contents)); 
    158166        $page_title = $GLOBALS["xoopsModule"]->getVar("name"). ' &raquo;'. get_xpress_title($contents); 
     
    216224        $xpress_data['body_contents'] = get_body($contents); 
    217225        // used $GLOBALS. becose xpress_left_arrow_post_link() and xpress_right_arrow_post_link() is other loop in this position 
    218         $xpress_data['left_post_link'] = $GLOBALS['left_arrow_post_link']; 
    219         $xpress_data['right_post_link'] = $GLOBALS['right_arrow_post_link']; 
     226        $xpress_data['left_post_link'] = @$GLOBALS['left_arrow_post_link']; 
     227        $xpress_data['right_post_link'] = @$GLOBALS['right_arrow_post_link']; 
    220228        $xpress_data['left_posts_link'] =  str_replace('&laquo;','',xpress_left_arrow_posts_link('echo=0')); 
    221229        $xpress_data['right_posts_link'] = str_replace('&raquo;','',xpress_right_arrow_posts_link('echo=0')); 
Note: See TracChangeset for help on using the changeset viewer.