XPressME Integration Kit

Trac


Ignore:
Timestamp:
Mar 30, 2010, 4:41:07 PM (14 years ago)
Author:
toemon
Message:

MultiBlogのカレントブログIDを1からBLOG_ID_CURRENT_SITEに変更 Fixes #325

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php

    r563 r567  
    158158                global $xoops_db, $blog_id; 
    159159                 
    160                 if (empty($blog_id)) $blog_id = 1; 
     160                if (empty($blog_id)) { 
     161                        if (defined(BLOG_ID_CURRENT_SITE)){ 
     162                                $blog_id = BLOG_ID_CURRENT_SITE; 
     163                        } else { 
     164                                $blog_id = 1; 
     165                        } 
     166                } 
    161167                $table = get_wp_prefix() . 'group_role'; 
    162168                 
     
    165171        } 
    166172 
    167         function GroupeRoleCheck($blog_id = 1) { 
     173        function GroupeRoleCheck($blog_id = 0) { 
    168174                global $xoops_db; 
    169175                 
    170                 if (empty($blog_id)) $blog_id = 1; 
     176                if (empty($blog_id)) { 
     177                        if (defined(BLOG_ID_CURRENT_SITE)){ 
     178                                $blog_id = BLOG_ID_CURRENT_SITE; 
     179                        } else { 
     180                                $blog_id = 1; 
     181                        } 
     182                } 
    171183                 
    172184                $module_id = get_xpress_modid(); 
     
    256268                global $xoops_db, $blog_id; 
    257269                 
    258                 if (empty($blog_id)) $blog_id = 1; 
     270                if (empty($blog_id)) { 
     271                        if (defined(BLOG_ID_CURRENT_SITE)){ 
     272                                $blog_id = BLOG_ID_CURRENT_SITE; 
     273                        } else { 
     274                                $blog_id = 1; 
     275                        } 
     276                } 
    259277                foreach ( (array) $post_data as $index_key => $value ){ 
    260278                        if (preg_match('/^ch_/',$index_key)){  // case ch_ 
     
    829847                        $wordpress_dir = ABSPATH ; 
    830848                        $xoops_dir = $xoops_config->xoops_upload_path . '/'; 
    831                         if (xpress_is_multiblog() && $blog_id <> 1){ 
     849                        if (xpress_is_multiblog() && $blog_id <> BLOG_ID_CURRENT_SITE){ 
    832850                                $wordpress_base_url = $xoops_config->module_url; 
    833851                        } else { 
     
    842860                        $uploads[baseurl] = str_replace ($wordpress_base_url, $xoops_upload_url, $uploads[baseurl]); 
    843861                         
    844                         if (xpress_is_multiblog() && $blog_id <> 1){ 
     862                        if (xpress_is_multiblog() && $blog_id <> BLOG_ID_CURRENT_SITE){ 
    845863                                $pat = str_replace ($xoops_dir, '', $uploads[path]); 
    846864                                $pat = preg_replace('/files.*/', '', $pat); 
Note: See TracChangeset for help on using the changeset viewer.