- Timestamp:
- Mar 3, 2009, 8:33:23 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 3 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/config_from_xoops.class.php
r92 r95 26 26 var $module_path; 27 27 var $module_url; 28 var $module_db_prefix; 29 var $xoops_upload_path; 30 var $xoops_upload_url; 31 28 32 29 33 function __constructor() //for PHP5 30 34 { 31 35 $this->ConfigFromXoops(); 36 32 37 } 33 38 … … 89 94 } 90 95 } 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 91 106 } 92 107 -
trunk/include/notification.inc.php
r61 r95 1 1 <?php 2 3 function xpress_notify_info( $category , $item_id ) 2 function xpress_notify( $category , $item_id ) 4 3 { 5 $db =& Database::getInstance() ;6 4 $mydirname = basename( dirname( dirname( __FILE__ ) ) ) ; 7 8 9 // $module_handler =& xoops_gethandler( 'module' ) ;10 // $module =& $module_handler->getByDirname( $mydirname ) ;11 5 12 6 if( $category == 'global' ) { -
trunk/include/set_cash_cookie_path.php
r92 r95 50 50 */ 51 51 if ( !defined('COOKIEPATH') ) 52 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', XOOPS_URL. '/' ) );52 define('COOKIEPATH', preg_replace('|https?://[^/]+|i', '', $xoops_config->xoops_url . '/' ) ); 53 53 54 54 /** … … 57 57 */ 58 58 if ( !defined('SITECOOKIEPATH') ) 59 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', XOOPS_URL. '/' ) );59 define('SITECOOKIEPATH', preg_replace('|https?://[^/]+|i', '', $xoops_config->xoops_url . '/' ) ); 60 60 61 61 /** -
trunk/include/xpress_block_render.php
r89 r95 62 62 function get_block_stylesheet_url($mydirname) 63 63 { 64 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 64 global $xoops_config; 65 $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 65 66 $select_theme = get_xpress_theme_name($mydirname); 66 67 $style_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/style.css'; 67 68 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'; 69 70 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'; 71 72 } 72 73 … … 88 89 function get_block_file_path($mydirname,$file_name) 89 90 { 90 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 91 global $xoops_config; 92 $mydirpath = $xoops_config->xoops_root_path . '/modules/' . $mydirname; 91 93 $select_theme = get_xpress_theme_name($mydirname); 92 94 $block_file = $mydirpath . '/wp-content/themes/' . $select_theme . '/blocks/' . $file_name; 93 95 94 96 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; 96 98 return $block_file; 97 99 } -
trunk/include/xpress_cache.php
r36 r95 4 4 function xpress_cache_read($mydirname,$collation_key) 5 5 { 6 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 6 global $xoops_config; 7 $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 7 8 $cache_time = 0; 8 9 $filename = $cache_dir .$mydirname . '_' . $collation_key; … … 19 20 function xpress_cache_write($mydirname,$collation_key,$content) 20 21 { 21 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 22 global $xoops_config; 23 $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 22 24 $cache_time = 0; 23 25 … … 35 37 function xpress_cache_clear($mydirname) 36 38 { 37 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 39 global $xoops_config; 40 $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 38 41 $cache_time = 0; 39 42 if ($dh = opendir($cache_dir)) { -
trunk/wp-config.php
r92 r95 5 5 require_once dirname( __FILE__ ).'/include/set_cash_cookie_path.php' ; 6 6 7 mb_language('Japanese'); 8 mb_internal_encoding('UTF-8'); 7 8 if (function_exists("mb_language")) mb_language('Japanese'); 9 // The setting of mb_internal_encoding might be unnecessary. 10 // Because mb_internal_encoding setting wp-setting.php line 484 11 if (function_exists("mb_internal_encoding")) mb_internal_encoding('UTF-8'); 9 12 10 13 // ** MySQL settings ** // … … 16 19 define('DB_COLLATE', ''); 17 20 21 //define('WP_DEBUG' ,true); 22 18 23 // Change each KEY to a different unique phrase. You won't have to remember the phrases later, 19 24 // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ … … 24 29 25 30 // You can have multiple installations in one database if you give each a unique prefix 26 $xp_prefix = basename(dirname(__FILE__)); 27 if ($xp_prefix == 'wordpress'){ 28 $xp_prefix = 'wp'; 29 } 30 $table_prefix = $xoops_config->xoops_db_prefix . '_' . $xp_prefix . '_'; // Only numbers, letters, and underscores please! 31 $table_prefix = $xoops_config->module_db_prefix; // Only numbers, letters, and underscores please! 31 32 32 33 // Change this to localize WordPress. A corresponding MO file for the … … 40 41 if ( !defined('ABSPATH') ) 41 42 define('ABSPATH', dirname(__FILE__).'/'); 42 require_once(ABSPATH.'wp-settings.php'); 43 require dirname( __FILE__ ).'/include/include_xoops_define.php' ; 44 if (is_xpress_index_page_call()){ 43 44 require_once dirname( __FILE__ ).'/include/request_url.php' ; 45 if (!is_xpress_index_page_call()){ 46 // if ( is_wp_cron_page_call()){ 47 // if ( !defined("XOOPS_ROOT_PATH") ) { 48 // require_once $xoops_config->xoops_mainfile_path; 49 // } 50 // } 51 require_once(ABSPATH.'wp-settings.php'); 52 } else { 53 // If $xoops_config->xoops_mainfile_path is not executed before wp-settings.php is executed, log in cannot be done. 54 require_once $xoops_config->xoops_mainfile_path; 55 require_once(ABSPATH.'wp-settings.php'); 45 56 // The return to wp-blog-header.php is stolen here 46 57 wp(); … … 52 63 xpress_render($wp_output); 53 64 require_once( ABSPATH .'/include/xpress_breadcrumbs.php' ); 54 include XOOPS_ROOT_PATH. '/footer.php';65 include $xoops_config->xoops_root_path . '/footer.php'; 55 66 exit(); 56 67 } -
trunk/wp-content/plugins/xpressme/include/custom_functions.php
r75 r95 148 148 } 149 149 } 150 // xoops db 151 function get_xpress_dir_path() 152 { 153 return ABSPATH; 154 } 155 156 function get_xpress_dir_name() 157 { 158 return basename(ABSPATH); 159 } 160 161 function get_wp_prefix_only() 162 { 163 $dir_name = get_xpress_dir_name(); 164 $prefix = $dir_name; 165 if ($prefix == 'wordpress') $prefix = 'wp'; 166 167 $prefix = $prefix . '_'; 168 return $prefix; 169 } 170 171 function get_xoops_prefix() 172 { 173 $ret =XOOPS_DB_PREFIX . '_'; 174 return $ret; 175 } 176 function get_wp_prefix() 177 { 178 $prefix = get_xoops_prefix() . get_wp_prefix_only(); 179 return $prefix; 180 } 181 182 function get_xpress_modid() 183 { 184 global $xoops_db; 185 186 $modulename = get_xpress_dir_name(); 187 $sql = "SELECT mid FROM " . get_xoops_prefix() . "modules WHERE dirname = '$modulename'"; 188 $mid = $xoops_db->get_var($sql); 189 return $mid; 190 } 191 192 function block_cache_refresh() 193 { 194 global $xoops_db; 195 $mid = get_xpress_modid(); 196 $sql = "SELECT bid,options,func_file FROM " . get_xoops_prefix() . "newblocks WHERE mid = $mid"; 197 $blocks = $xoops_db->get_results($sql); 198 $mydirname = get_xpress_dir_name(); 199 require_once get_xpress_dir_path() . '/include/xpress_block_render.php'; 200 201 202 foreach($blocks as $block){ 203 $func_file = $block->func_file; 204 $call_theme_function_name = str_replace(".php", "", $func_file); 205 $inc_theme_file_name = str_replace(".php", "", $func_file) . '_theme.php'; 206 $cache_title = str_replace(".php", "", $func_file); 207 $blockID = $block->bid; 208 $options = explode("|", $block->options); 209 210 $block_theme_file = get_block_file_path($mydirname,$inc_theme_file_name); 211 require_once $block_theme_file; 212 $block_render = $call_theme_function_name($options); //The block name and the called function name should be assumed to be the same name. 213 $xml['block'] = $block_render; 214 xpress_block_cache_write($mydirname,$cache_title. $blockID, $xml); 215 } 216 } 150 217 151 218 152 // views count -
trunk/wp-content/plugins/xpressme/include/notify_functions.php
r91 r95 1 1 <?php 2 2 3 3 function onaction_publish_post_notify($new_status, $old_status, $post) 4 4 { 5 5 if ($new_status == 'publish'){ 6 include_once dirname(__FILE__) . '/notification.inc.sub.php';7 6 do_PostNotifications($post->ID,'newpost'); 8 7 } … … 11 10 function onaction_edit_post_notify($post_id) 12 11 { 13 include_once ABSPATH . '/include/notification.inc.sub.php';14 12 do_PostNotifications($post_id,'editpost'); 15 13 } … … 21 19 22 20 if ($status ==1){ 23 include_once ABSPATH . '/include/notification.inc.sub.php';24 21 do_CommentNotifications($commentID, $post_id); 25 22 } else { 26 require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ; 27 $notification_handler =& xoops_gethandler( 'notification' ) ; 28 $notification_handler->triggerEvent( 'global' , 0 , 'waiting') ; 23 do_CommentWaiting($commentID, $post_id); 29 24 } 30 25 } … … 35 30 $status = $wpdb->get_var("SELECT comment_approved FROM $wpdb->comments WHERE comment_ID = $commentID"); 36 31 if(is_null($status)) return; 37 // $status = wp_get_comment_status($commentID);38 32 if ($status == 1){ 39 33 onaction_comment_notify($commentID); … … 41 35 } 42 36 37 function Notification_triggerEvent($category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null) 38 { 39 global $xoops_db,$xoops_config; 40 //When notifying by a private message, 41 //it is evaded that the data base becomes read-only as a result of the check on the referrer and the method. 42 if (is_wp_cron_page_call() ){ 43 $_SERVER['HTTP_REFERER'] = 'http://'. $_SERVER[HTTP_HOST] . $_SERVER['PHP_SELF']; 44 $_SERVER['REQUEST_METHOD'] = 'POST'; 45 } 46 if (is_xmlrpc_call() ){ 47 $_SERVER['HTTP_REFERER'] = 'http://'. $_SERVER[HTTP_HOST] . $_SERVER['PHP_SELF']; 48 $_SERVER['REQUEST_METHOD'] = 'POST'; 49 } 50 51 include_once $xoops_config->xoops_mainfile_path; // load XOOPS System 52 include_once $xoops_config->xoops_root_path . '/include/notification_functions.php' ; 53 $module_id = get_xpress_modid() ; 54 $notification_handler =& xoops_gethandler( 'notification' ) ; 55 $notification_handler->triggerEvent($category, $item_id, $event, $extra_tags, $user_list, $module_id, $omit_user_id); 56 } 57 58 function do_CommentWaiting($commentID, $comment_post_ID) 59 { 60 // global $xoops_config; 61 // require_once $xoops_config->xoops_mainfile_path; 62 // xoops_mainfile_path; 63 // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ; 64 // $notification_handler =& xoops_gethandler( 'notification' ) ; 65 Notification_triggerEvent( 'global' , 0 , 'waiting') ; 66 } 67 68 69 function do_CommentNotifications($commentID, $comment_post_ID) 70 { 71 global $xoops_config , $xoops_db; 72 73 $xpress_prefix = get_wp_prefix() ; 74 75 $table_term_relationships = $xpress_prefix .'term_relationships'; 76 $table_term_taxonomy = $xpress_prefix .'term_taxonomy'; 77 $table_terms = $xpress_prefix .'terms'; 78 $table_categories = $xpress_prefix .'categories'; 79 $wp_post = $xpress_prefix .'posts'; 80 $wp_options = $xpress_prefix .'options'; 81 $wp_users = $xpress_prefix .'users'; 82 $wp_comments = $xpress_prefix .'comments'; 83 $post_id = $comment_post_ID; 84 85 $post_title = get_the_title($post_id); 86 $post_url = get_permalink($post_id). '#comment'; 87 $blog_name = get_bloginfo('name'); 88 89 // query 90 $sql = "SELECT post_author FROM ".$wp_post." WHERE ID=$comment_post_ID "; 91 $post_author = $xoops_db->get_var($sql); 92 93 $sql = "SELECT display_name FROM $wp_users WHERE ID ='$post_author'"; 94 $user_name = $xoops_db->get_var($sql); 95 96 $comment_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 97 Notification_triggerEvent('global' , 0 , 'comment' , $comment_tags , false); 98 Notification_triggerEvent('author' , $post_author , 'comment' , $comment_tags , false); 99 Notification_triggerEvent('post' , $comment_post_ID , 'comment' , $comment_tags , false); 100 101 // categorie notification 102 if (get_xpress_db_version() < 6124){ 103 $sql2 = "SELECT c.cat_ID, c.cat_name FROM ".$table_categories." c, ".$table_post2cat." p2c WHERE c.cat_ID = p2c.category_id AND p2c.post_id=".$comment_post_ID; 104 } else { 105 $sql2 = "SELECT $table_term_relationships.object_id, $table_terms.term_id AS cat_ID, $table_terms.name AS cat_name "; 106 $sql2 .= "FROM $table_term_relationships INNER JOIN ($table_term_taxonomy INNER JOIN $table_terms ON $table_term_taxonomy.term_id = $table_terms.term_id) ON $table_term_relationships.term_taxonomy_id = $table_term_taxonomy.term_taxonomy_id "; 107 $sql2 .= "WHERE ($table_term_relationships.object_id =" . $comment_post_ID.") AND ($table_term_taxonomy.taxonomy='category')"; 108 } 109 $categories = $xoops_db->get_results($sql); 110 foreach($categories as $categorie){ 111 $cat_id = $categorie->cat_ID; 112 $cat_name = $categorie->cat_name; 113 $comment_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_CAT_TITLE' => $cat_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 114 Notification_triggerEvent('category' , $cat_id , 'comment' , $comment_tags , false); 115 116 } 117 } 118 119 function do_PostNotifications($post_id,$not_event) 120 { 121 global $xoops_config, $xoops_db; 122 xpress_debug(); 123 124 125 126 // $not_event: newpost,editpost ; $commentID, $comment_post_ID) 127 128 $xpress_prefix = get_wp_prefix() ; 129 130 $table_term_relationships = $xpress_prefix .'term_relationships'; 131 $table_term_taxonomy = $xpress_prefix .'term_taxonomy'; 132 $table_terms = $xpress_prefix .'terms'; 133 $table_categories = $xpress_prefix .'categories'; 134 $wp_post = $xpress_prefix .'posts'; 135 $wp_options = $xpress_prefix .'options'; 136 $wp_users = $xpress_prefix .'users'; 137 $wp_comments = $xpress_prefix .'comments'; 138 139 $post_title = get_the_title($post_id); 140 $post_url = get_permalink($post_id). '#comment'; 141 $blog_name = get_bloginfo('name'); 142 143 // query 144 $sql = "SELECT post_author FROM ".$wp_post." WHERE ID=$post_id "; 145 $post_author = $xoops_db->get_var($sql); 146 147 $sql = "SELECT display_name FROM $wp_users WHERE ID ='$post_author'"; 148 $user_name = $xoops_db->get_var($sql); 149 150 $posts_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 151 152 switch ($not_event) { 153 case 'newpost' : 154 Notification_triggerEvent('global' , 0 , 'newpost' , $posts_tags , false); 155 Notification_triggerEvent('author' , $post_author , 'newpost' , $posts_tags , false); 156 157 // categorie notification 158 if (get_xpress_db_version() < 6124){ 159 $sql2 = "SELECT c.cat_ID, c.cat_name FROM ".$table_categories." c, ".$table_post2cat." p2c WHERE c.cat_ID = p2c.category_id AND p2c.post_id=".$post_id; 160 } else { 161 $sql2 = "SELECT $table_term_relationships.object_id, $table_terms.term_id AS cat_ID, $table_terms.name AS cat_name "; 162 $sql2 .= "FROM $table_term_relationships INNER JOIN ($table_term_taxonomy INNER JOIN $table_terms ON $table_term_taxonomy.term_id = $table_terms.term_id) ON $table_term_relationships.term_taxonomy_id = $table_term_taxonomy.term_taxonomy_id "; 163 $sql2 .= "WHERE ($table_term_relationships.object_id =" . $post_id.") AND ($table_term_taxonomy.taxonomy='category')"; 164 } 165 $categories = $xoops_db->get_results($sql); 166 foreach($categories as $categorie){ 167 $cat_id = $categorie->cat_ID; 168 $cat_name = $categorie->cat_name; 169 $posts_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_CAT_TITLE' => $cat_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 170 Notification_triggerEvent('category' , $cat_id , 'newpost' , $posts_tags , false); 171 } 172 break; 173 case 'editpost' : 174 Notification_triggerEvent('post' , $post_id , 'editpost' , $posts_tags , false); 175 break; 176 default : 177 } 178 } 179 43 180 ?> -
trunk/wp-content/plugins/xpressme/include/user_sync_xoops.php
r87 r95 43 43 $db_groups_users_link = get_xoops_prefix() . 'groups_users_link'; 44 44 $db_group_role = get_wp_prefix() . 'group_role'; 45 $db_groups = get_xoops_prefix() . 'groups'; 45 46 46 47 $sql = "SELECT * "; 47 48 $sql .= "FROM $db_groups_users_link "; 48 49 $sql .= "LEFT JOIN $db_group_role ON $db_groups_users_link.groupid = $db_group_role.groupid "; 50 $sql .= "LEFT JOIN $db_groups ON $db_groups_users_link.groupid = $db_groups.groupid "; 49 51 $sql .= "WHERE uid = $uid"; 50 51 52 $user_groups = $xoops_db->get_results($sql); 52 53 $ans['capabillities'] = ''; … … 54 55 55 56 foreach($user_groups as $user_group){ 57 if ($user_group->group_type == 'Admin'){ 58 $ans['capabillities'] = 'administrator'; 59 $ans['allway_update'] = 0; 60 break; 61 } 56 62 $before_level = get_role_level($ans['capabillities']); 63 57 64 $now_level = get_role_level($user_group->role); 58 65 if ($now_level > $before_level){ … … 80 87 function user_sync_to_wordpress($sync_uid = 0, &$message){ 81 88 global $xoops_db; 82 global $xoopsModule; 83 84 if( is_object($xoopsModule)) { 85 $db_xoops_users = get_xoops_prefix() . 'users'; 86 $db_xpress_users = get_wp_prefix() . 'users'; 87 88 $message = 'Do Sync'; 89 90 if ($sync_uid == 0) { 91 $xu_sql = "SELECT uid ,name ,uname ,pass ,email, url, user_regdate, user_aim, user_yim FROM $db_xoops_users"; 89 90 $db_xoops_users = get_xoops_prefix() . 'users'; 91 $db_xpress_users = get_wp_prefix() . 'users'; 92 93 $message = 'Do Sync'; 94 95 if ($sync_uid == 0) { 96 $xu_sql = "SELECT uid ,name ,uname ,pass ,email, url, user_regdate, user_aim, user_yim FROM $db_xoops_users"; 97 } else { 98 $xu_sql = "SELECT uid ,name ,uname ,pass ,email, url, user_regdate, user_aim, user_yim FROM $db_xoops_users WHERE uid = $sync_uid"; 99 } 100 101 $xoops_users = $xoops_db->get_results($xu_sql); 102 if (empty($xoops_users)){ 103 $message .= '...ERR ('. $xu_sql . ')'; 104 return false; 105 } 106 107 foreach($xoops_users as $xoops_user){ 108 $role = get_xoops_group_role($xoops_user->uid); 109 $capabillities_name = $role['capabillities']; 110 $allway_update = $role['allway_update']; 111 if (empty($capabillities_name)){ 112 $message .= "...PASS '" . $xoops_user->uname ."'[uid=".$xoops_user->uid ."](not xpress user)"; 113 if ($sync_uid != 0){ 114 $message .= '...NOT XPRESS USER ' . $xoops_user->uname; 115 return false; 116 } 92 117 } else { 93 $xu_sql = "SELECT uid ,name ,uname ,pass ,email, url, user_regdate, user_aim, user_yim FROM $db_xoops_users WHERE uid = $sync_uid"; 94 } 95 96 $xoops_users = $xoops_db->get_results($xu_sql); 97 if (empty($xoops_users)){ 98 $message .= '...ERR ('. $xu_sql . ')'; 99 return false; 100 } 101 102 foreach($xoops_users as $xoops_user){ 103 $role = get_xoops_group_role($xoops_user->uid); 104 $capabillities_name = $role['capabillities']; 105 $allway_update = $role['allway_update']; 106 if (empty($capabillities_name)){ 107 $message .= "...PASS '" . $xoops_user->uname ."'[uid=".$xoops_user->uid ."](not xpress user)"; 108 if ($sync_uid != 0){ 109 $message .= '...NOT XPRESS USER ' . $xoops_user->uname; 110 return false; 118 $user_regist_time = date('Y-m-d H:i:s' , $xoops_user->user_regdate); 119 $user_status = 0; 120 $user_display_name =empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ; 121 122 $is_update = false; 123 124 $wp_user_id = get_wp_user_id($xoops_user->uname) ; 125 if ($wp_user_id){ 126 $wu_sql = "UPDATE $db_xpress_users "; 127 $wu_sql .= 'SET '; 128 $wu_sql .= "user_pass = '$xoops_user->pass', "; 129 $wu_sql .= "user_email = '$xoops_user->email', "; 130 $wu_sql .= "user_url = '$xoops_user->url', "; 131 $wu_sql .= "user_nicename = '$xoops_user->uname', "; 132 $wu_sql .= "user_registered = '$user_regist_time', "; 133 $wu_sql .= "user_status = 0 "; 134 $wu_sql .= "WHERE (user_login = '$xoops_user->uname' )"; 135 136 $xoops_db->query($wu_sql); 137 if ($allway_update){ 138 $sycc_user = new WP_User($wp_user_id); 139 $sycc_user->set_role($capabillities_name); 140 $message .= '...UPDATE ' . $user_login_name . '(' . $capabillities_name . ')'; 141 142 } else { 143 $message .= '...UPDATE ' . $user_login_name . '(Level Not Change)'; 111 144 } 112 } else { 113 $user_regist_time = date('Y-m-d H:i:s' , $xoops_user->user_regdate); 114 $user_status = 0; 115 $user_display_name =empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ; 116 117 $is_update = false; 118 119 $wp_user_id = get_wp_user_id($xoops_user->uname) ; 120 if ($wp_user_id){ 121 $wu_sql = "UPDATE $db_xpress_users "; 122 $wu_sql .= 'SET '; 123 $wu_sql .= "user_pass = '$xoops_user->pass', "; 124 $wu_sql .= "user_email = '$xoops_user->email', "; 125 $wu_sql .= "user_url = '$xoops_user->url', "; 126 $wu_sql .= "user_nicename = '$xoops_user->uname', "; 127 $wu_sql .= "user_registered = '$user_regist_time', "; 128 $wu_sql .= "user_status = 0 "; 129 $wu_sql .= "WHERE (user_login = '$xoops_user->uname' )"; 130 131 $xoops_db->query($wu_sql); 132 if ($allway_update){ 133 $sycc_user = new WP_User($wp_user_id); 134 $sycc_user->set_role($capabillities_name); 135 $message .= '...UPDATE ' . $user_login_name . '(' . $capabillities_name . ')'; 136 137 } else { 138 $message .= '...UPDATE ' . $user_login_name . '(Level Not Change)'; 139 } 140 }else{ 141 $wu_sql = "INSERT INTO $db_xpress_users "; 142 $wu_sql .= "(user_login , user_pass ,user_email , user_url , user_nicename " ; 143 $wu_sql .= " , user_registered , user_status , display_name) "; 144 $wu_sql .= "VALUES "; 145 $wu_sql .= "('$xoops_user->uname', '$xoops_user->pass', '$xoops_user->email', '$xoops_user->url', '$xoops_user->uname' "; 146 $wu_sql .= " , '$user_regist_time', $user_status, '$user_display_name')"; 147 $xoops_db->query($wu_sql); 145 }else{ 146 $wu_sql = "INSERT INTO $db_xpress_users "; 147 $wu_sql .= "(user_login , user_pass ,user_email , user_url , user_nicename " ; 148 $wu_sql .= " , user_registered , user_status , display_name) "; 149 $wu_sql .= "VALUES "; 150 $wu_sql .= "('$xoops_user->uname', '$xoops_user->pass', '$xoops_user->email', '$xoops_user->url', '$xoops_user->uname' "; 151 $wu_sql .= " , '$user_regist_time', $user_status, '$user_display_name')"; 152 $xoops_db->query($wu_sql); 148 153 // $wp_user_id = get_wp_user_id($user_login_name) ; 149 $wp_user_id = mysql_insert_id(); 150 $sycc_user = new WP_User($wp_user_id); 151 $sycc_user->set_role($capabillities_name); 152 $message .= '...INSERT ' . $user_login_name . '(' . $capabillities_name . ')'; 153 } 154 155 $user_nickname = empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ; 156 $user_rich_editing = 'true'; 157 $user_first_name = $xoops_user->uname; 158 $user_last_name = ''; 159 $user_description = ''; 160 $user_jabber = ''; 161 162 update_usermeta( $wp_user_id,'nickname',$user_nickname); 163 update_usermeta( $wp_user_id,'first_name',$user_first_name); 164 update_usermeta( $wp_user_id,'last_name',$user_last_name); 165 update_usermeta( $wp_user_id,'description',$user_description); 166 update_usermeta( $wp_user_id,'jabber',$user_jabber); 167 update_usermeta( $wp_user_id,'aim',$xoops_user->user_aim); 168 update_usermeta( $wp_user_id,'yim',$xoops_user->user_yim); 169 if ($is_update === false ) { 170 update_usermeta( $wp_user_id,'rich_editing',$user_rich_editing); 171 } 172 } 173 } 174 $message .= "...END"; 175 return true; 176 } 154 $wp_user_id = mysql_insert_id(); 155 $sycc_user = new WP_User($wp_user_id); 156 $sycc_user->set_role($capabillities_name); 157 $message .= '...INSERT ' . $user_login_name . '(' . $capabillities_name . ')'; 158 } 159 160 $user_nickname = empty($xoops_user->name) ? $xoops_user->uname :$xoops_user->name ; 161 $user_rich_editing = 'true'; 162 $user_first_name = $xoops_user->uname; 163 $user_last_name = ''; 164 $user_description = ''; 165 $user_jabber = ''; 166 167 update_usermeta( $wp_user_id,'nickname',$user_nickname); 168 update_usermeta( $wp_user_id,'first_name',$user_first_name); 169 update_usermeta( $wp_user_id,'last_name',$user_last_name); 170 update_usermeta( $wp_user_id,'description',$user_description); 171 update_usermeta( $wp_user_id,'jabber',$user_jabber); 172 update_usermeta( $wp_user_id,'aim',$xoops_user->user_aim); 173 update_usermeta( $wp_user_id,'yim',$xoops_user->user_yim); 174 if ($is_update === false ) { 175 update_usermeta( $wp_user_id,'rich_editing',$user_rich_editing); 176 } 177 } 178 } 179 $message .= "...END"; 180 return true; 177 181 } 178 182 -
trunk/wp-content/plugins/xpressme/xpressme.php
r91 r95 10 10 require_once('xpressme_class.php'); 11 11 12 require_once dirname( __FILE__ ).'/include/custom_functions.php' ; 12 require_once dirname( __FILE__ ).'/include/custom_functions.php' ; // XPressME functions for themes 13 require_once dirname( __FILE__ ).'/include/xpress_common_functions.php' ; 13 14 14 15 $xoops_db = new wpdb(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST); … … 55 56 add_action('admin_footer', array(&$XPressME, 'displayDebugLog')); 56 57 add_action('get_footer', array(&$XPressME, 'displayDebugLog')); 57 58 58 ?> -
trunk/wp-content/plugins/xpressme/xpressme_class.php
r88 r95 120 120 $insert_sql .= "'" . $groupe->description . "' , "; 121 121 $insert_sql .= "'" . $groupe->group_type . "' , "; 122 $insert_sql .= "'" . $role . "' , ";123 $insert_sql .= $login_all . " )";122 $insert_sql .= "'" . $role . "' , '"; 123 $insert_sql .= $login_all . "')"; 124 124 $xoops_db->query($insert_sql); 125 125 } … … 331 331 function xpress_upload_filter($uploads) 332 332 { 333 global $xoops_config; 333 334 if ($this->is_use_xoops_upload_path){ 334 if (!defined("XOOPS_UPLOAD_PATH"))335 define("XOOPS_UPLOAD_PATH", XOOPS_ROOT_PATH."/uploads");336 if (!defined("XOOPS_UPLOAD_URL"))337 define("XOOPS_UPLOAD_URL", XOOPS_URL."/uploads");338 339 335 $wordpress_dir = ABSPATH ; 340 $xoops_dir = XOOPS_UPLOAD_PATH. '/';336 $xoops_dir = $xoops_config->xoops_upload_path . '/'; 341 337 $wordpress_base_url = get_option( 'siteurl' ); 342 $xoops_upload_url = XOOPS_UPLOAD_URL;338 $xoops_upload_url = $xoops_config->xoops_upload_url; 343 339 344 340 $uploads[path] = str_replace ($wordpress_dir, $xoops_dir, $uploads[path]); … … 355 351 global $current_user; 356 352 353 if (!is_object($current_user)) return false; 357 354 if ($this->is_sql_debug && ($current_user->user_level >= 10)) 358 355 return true; … … 377 374 $content .= '<meta http-equiv="content-language" content="'._LANGCODE.'" />' ; 378 375 $content .= '<title>XPressME SQL DEBUG</title>' ; 379 $content .= '<link rel="stylesheet" type="text/css" media="all" href="'.getcss($GLOBALS['xoopsConfig']['theme_set']).'" />';380 376 $content .= '</head><body>'; 381 377 $content .= $GLOBALS['XPress_SQL_Query']; -
trunk/wp-content/themes/xpress_default/blocks/recent_comments_block_theme.php
r49 r95 1 1 <?php 2 if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;2 //if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ; 3 3 4 4 function recent_comments_block($options) … … 9 9 $selected = array_slice($options,3); // get allowed cats 10 10 $this_template = empty( $options[4] ) ? 'db:'.$mydirname.'_block_comments.html' : trim( $options[4] ); 11 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname;12 11 // $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 12 $mydirpath = get_xpress_dir_path(); 13 13 $this_url = '/modules/'. $mydirname; 14 14 $call_url = $_SERVER['REQUEST_URI']; -
trunk/wp-content/themes/xpress_default/blocks/recent_posts_content_block_theme.php
r58 r95 1 1 <?php 2 if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ;2 //if( ! defined( 'XOOPS_ROOT_PATH' ) ) exit ; 3 3 4 4 function recent_posts_content_block($options) … … 11 11 $selected = array_slice($options,5); // get allowed cats 12 12 $this_template = empty( $options[6] ) ? 'db:'.$mydirname.'_block_content.html' : trim( $options[6] ); 13 $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 13 // $mydirpath = XOOPS_ROOT_PATH . '/modules/' . $mydirname; 14 $mydirpath = get_xpress_dir_path(); 14 15 15 16 $this_url = '/modules/'. $mydirname; -
trunk/xoops_version.php
r94 r95 127 127 $modversion['notification'] = array( 128 128 'lookup_file' => 'include/notification.inc.php' , 129 'lookup_func' => " {$mydirname}_notify_info" ,129 'lookup_func' => "xpress_notify" , 130 130 'category' => array( 131 131 array(
Note: See TracChangeset
for help on using the changeset viewer.