XPressME Integration Kit

Trac

Changeset 95 for trunk/include


Ignore:
Timestamp:
Mar 3, 2009, 8:33:23 PM (15 years ago)
Author:
toemon
Message:

XOOPS mainfile.phpのdefine文を事前に読み取りwp-config.phpのDB接続関係を生成することにより、XOOPSシステムを必要なときだけ呼び出す仕組みを作る。
およびイベント通知関係の修正(まだゲストのアクセス権限がないと駄目)

Location:
trunk/include
Files:
3 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/config_from_xoops.class.php

    r92 r95  
    2626        var $module_path; 
    2727        var $module_url; 
     28        var $module_db_prefix; 
     29        var $xoops_upload_path; 
     30        var $xoops_upload_url; 
     31         
    2832         
    2933        function __constructor()        //for PHP5 
    3034    { 
    3135        $this->ConfigFromXoops(); 
     36        
    3237    } 
    3338 
     
    8994                        } 
    9095                } 
     96                 
     97                //  define from /settings/definition.inc.php (XCL)  or /include/common.php(2016a-JP) 
     98                $this->xoops_upload_path = $this->xoops_root_path .'/uploads'; 
     99                $this->xoops_upload_url = $this->xoops_url . '/uploads'; 
     100                 
     101                if ($this->module_name == 'wordpress') 
     102                        $this->module_db_prefix =  $this->xoops_db_prefix  . '_wp_'; 
     103                else 
     104                        $this->module_db_prefix =  $this->xoops_db_prefix  . '_' . $this->module_name . '_'; 
     105                 
    91106    } 
    92107     
  • trunk/include/notification.inc.php

    r61 r95  
    11<?php 
    2  
    3 function xpress_notify_info( $category , $item_id ) 
     2function xpress_notify( $category , $item_id ) 
    43{ 
    5         $db =& Database::getInstance() ; 
    64        $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ; 
    7  
    8  
    9 //      $module_handler =& xoops_gethandler( 'module' ) ; 
    10 //      $module =& $module_handler->getByDirname( $mydirname ) ; 
    115 
    126        if( $category == 'global' ) { 
  • trunk/include/set_cash_cookie_path.php

    r92 r95  
    5050 */ 
    5151if ( !defined('COOKIEPATH') ) 
    52         define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', XOOPS_URL . '/' ) ); 
     52        define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', $xoops_config->xoops_url . '/' ) ); 
    5353 
    5454/** 
     
    5757 */ 
    5858if ( !defined('SITECOOKIEPATH') ) 
    59         define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', XOOPS_URL . '/' ) ); 
     59        define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', $xoops_config->xoops_url . '/' ) ); 
    6060 
    6161/** 
  • trunk/include/xpress_block_render.php

    r89 r95  
    6262        function get_block_stylesheet_url($mydirname) 
    6363        { 
    64                 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 
     64                global $xoops_config; 
     65                $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
    6566                $select_theme = get_xpress_theme_name($mydirname); 
    6667                $style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/style.css'; 
    6768                if (file_exists($style_file)) 
    68                         return XOOPS_URL . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/blocks/style.css'; 
     69                        return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/' . $select_theme . '/blocks/style.css'; 
    6970                else     
    70                         return XOOPS_URL . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/style.css'; 
     71                        return $xoops_config->xoops_url . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/style.css'; 
    7172        } 
    7273 
     
    8889        function get_block_file_path($mydirname,$file_name) 
    8990        { 
    90                 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 
     91                global $xoops_config; 
     92                $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 
    9193                $select_theme = get_xpress_theme_name($mydirname); 
    9294                $block_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/' . $file_name; 
    9395 
    9496                if (!file_exists($block_file)) 
    95                         $block_file =  XOOPS_ROOT_PATH . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/' . $file_name; 
     97                        $block_file =  $xoops_config->xoops_root_path . '/modules/' .$mydirname . '/wp-content/themes/xpress_default/blocks/' . $file_name; 
    9698                return $block_file; 
    9799        } 
  • trunk/include/xpress_cache.php

    r36 r95  
    44    function xpress_cache_read($mydirname,$collation_key) 
    55    { 
    6                 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 
     6        global $xoops_config; 
     7                $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 
    78                $cache_time = 0; 
    89        $filename = $cache_dir .$mydirname . '_' . $collation_key; 
     
    1920    function xpress_cache_write($mydirname,$collation_key,$content) 
    2021    { 
    21                 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 
     22                global $xoops_config; 
     23                $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 
    2224                $cache_time = 0; 
    2325 
     
    3537    function xpress_cache_clear($mydirname) 
    3638    { 
    37                 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 
     39                global $xoops_config; 
     40                $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 
    3841                $cache_time = 0; 
    3942        if ($dh = opendir($cache_dir)) { 
Note: See TracChangeset for help on using the changeset viewer.