XPressME Integration Kit

Trac


Ignore:
Timestamp:
Jun 15, 2016, 9:52:13 AM (8 years ago)
Author:
toemon
Message:

PHP7 対応 Fix #431
thx nao-pon

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/class/xpressD3commentContent.class.php

    r835 r860  
    99                { 
    1010                //      include_once dirname(dirname(__FILE__)).'/include/common_functions.php' ; 
    11                         global $forum_id; 
    12                          
     11                        if ( empty( $this->forum_id ) ) { 
     12                                global $forum_id; 
     13                                if ( !empty( $forum_id ) ) { 
     14                                        $this->forum_id = $forum_id; 
     15                                } else { 
     16                                        return parent::fetchSummary( $external_link_id ); 
     17                                } 
     18                        } 
     19 
    1320                        $db =& XoopsDatabaseFactory::getDatabaseConnection() ; 
    14                         $myts =& MyTextsanitizer::getInstance() ; 
     21                        (method_exists('MyTextsanitizer', 'sGetInstance') && ($myts =& MyTextsanitizer::sGetInstance())) || ($myts =& MyTextsanitizer::getInstance()) ; 
    1522 
    1623                        $module_handler =& xoops_gethandler( 'module' ) ; 
     
    2431                         
    2532                        $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); 
    26                         $blog_info = $this->get_comment_blog_info($forum_id); 
     33                        $blog_info = $this->get_comment_blog_info($this->forum_id); 
    2734                        // query 
    2835                        $post_row = $db->fetchArray( $db->query( "SELECT * FROM ".$blog_info['mb_table_prefix']."posts WHERE ID=$post_id" ) ) ; 
     
    6875                function canAddComment($external_link_id) 
    6976                { 
    70                         global $forum_id; 
    7177                        global $post; 
     78 
     79                        if ( empty( $this->forum_id ) ) { 
     80                                global $forum_id; 
     81                                if ( !empty( $forum_id ) ) { 
     82                                        $this->forum_id = $forum_id; 
     83                                } else { 
     84                                        return false; 
     85                                } 
     86                        } 
    7287                         
    7388                        if (is_object($post)){  // in wordpress  
     
    92107                                        if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ; 
    93108                                         
    94                                         $blog_info = $this->get_comment_blog_info($forum_id); 
     109                                        $blog_info = $this->get_comment_blog_info($this->forum_id); 
    95110                                        $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); 
    96111 
     
    176191                function validate_id( $link_id ) 
    177192                { 
    178                         global $forum_id; 
     193                        if ( empty( $this->forum_id ) ) { 
     194                                global $forum_id; 
     195                                if ( !empty( $forum_id ) ) { 
     196                                        $this->forum_id = $forum_id; 
     197                                } else { 
     198                                        return false; 
     199                                } 
     200                        } 
    179201                        $post_id = intval( $link_id ) ; 
    180202                        $mydirname = $this->mydirname ; 
    181203                        $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); 
    182                         $blog_info = $this->get_comment_blog_info($forum_id);            
     204                        $blog_info = $this->get_comment_blog_info($this->forum_id); 
    183205                        $db =& XoopsDatabaseFactory::getDatabaseConnection() ; 
    184206                         
Note: See TracChangeset for help on using the changeset viewer.