XPressME Integration Kit

Trac

Changeset 19 for trunk/wp-content


Ignore:
Timestamp:
Dec 8, 2008, 5:22:30 PM (16 years ago)
Author:
toemon
Message:

プラグインの設定画面サンプル
プラグインをクラス化して設定テスト画面を配置(まだ設定値書き込みは出来ていない)

Location:
trunk/wp-content/plugins/xpressme
Files:
4 added
1 edited

Legend:

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

    r18 r19  
    88Author URI: http://www.toemon.com 
    99*/ 
     10require_once('xpressme_class.php'); 
     11$xpessme = new XPressME_Class(); 
    1012 
    11 add_filter("upload_dir","xpress_upload_filter", 1);             // Change wp-include/wp_upload_dir() 
    12 function xpress_upload_filter($uploads) 
    13 { 
    14         if (1){         // Select XPressME Configlation 
    15                 $wordpress_dir = ABSPATH ; 
    16                 $xoops_dir = XOOPS_UPLOAD_PATH . '/'; 
    17                 $wordpress_base_url = get_option( 'siteurl' ); 
    18                 $xoops_upload_url = XOOPS_UPLOAD_URL; 
    19                  
    20                 $uploads[path] =  str_replace ($wordpress_dir, $xoops_dir, $uploads[path]); 
    21                 $uploads[basedir] = str_replace ($wordpress_dir, $xoops_dir, $uploads[basedir]); 
    22                 $uploads[url] = str_replace ($wordpress_base_url, $xoops_upload_url, $uploads[url]); 
    23                 $uploads[baseurl] = str_replace ($wordpress_base_url, $xoops_upload_url, $uploads[baseurl]); 
    24         } 
    25         return $uploads; 
    26 } 
     13add_action('admin_menu', array(&$xpessme, 'add_option_page')); 
     14add_action('admin_head', array(&$xpessme, 'add_admin_head')); 
     15add_filter("upload_dir",array(&$xpessme, 'xpress_upload_filter'),       1);             // Change wp-include/wp_upload_dir() 
     16 
    2717?> 
Note: See TracChangeset for help on using the changeset viewer.