XPressME Integration Kit

Trac

Changeset 589


Ignore:
Timestamp:
Apr 27, 2010, 1:40:05 PM (15 years ago)
Author:
toemon
Message:

MultiBlogを構成していないときMultiBlog用のブロックをリストしないようにする。 Fixes#314

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/xoops_version.php

    r586 r589  
    4848                return $role_level; 
    4949        } 
     50} 
     51} 
     52if (!function_exists('is_show_multi_blog_block')){ 
     53function is_show_multi_blog_block($mydirname = ''){ 
     54        if(empty($mydirname)) return false; 
     55        // Before loading xpressme.  
     56        // The multi blog is judged by the presence of the blogs table.          
     57        global $xoopsDB; 
     58        $wp_prefix = preg_replace('/wordpress/','wp',$mydirname); 
     59        $wp_blogs_tbl = $xoopsDB->prefix($wp_prefix) . '_blogs'; 
     60        $sql = "SELECT * FROM " . $wp_blogs_tbl; 
     61        $result = $xoopsDB->query($sql, 0, 0); 
     62        if ($xoopsDB->getRowsNum($result)) return true; 
     63        return false; 
    5064} 
    5165} 
     
    353367        'func_num'              => $b_no,        
    354368); 
    355 if (wp_version_compare($wp_version, '>=','3.0-alpha')){ 
     369if (wp_version_compare($wp_version, '>=','3.0-alpha') && is_show_multi_blog_block($mydirname)){ 
    356370        $b_no++; 
    357371        $modversion['blocks'][$b_no] = array( 
Note: See TracChangeset for help on using the changeset viewer.