Changeset 590
- Timestamp:
- Apr 28, 2010, 4:20:08 PM (15 years ago)
- Location:
- trunk/xpressme_integration_kit
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/class/xpressD3commentContent.class.php
r583 r590 9 9 { 10 10 // include_once dirname(dirname(__FILE__)).'/include/common_functions.php' ; 11 11 global $forum_id; 12 12 13 $db =& Database::getInstance() ; 13 14 $myts =& MyTextsanitizer::getInstance() ; … … 23 24 24 25 $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); 25 26 $blog_info = $this->get_comment_blog_info($forum_id); 26 27 // query 27 $post_row = $db->fetchArray( $db->query( "SELECT * FROM ".$ db->prefix($xpress_prefix."_posts")."WHERE ID=$post_id AND comment_status ='open'" ) ) ;28 $post_row = $db->fetchArray( $db->query( "SELECT * FROM ".$blog_info['mb_table_prefix']."posts WHERE ID=$post_id AND comment_status ='open'" ) ) ; 28 29 if( empty( $post_row ) ) return '' ; 29 30 30 31 // dare to convert it irregularly 31 32 $summary = str_replace( '&' , '&' , htmlspecialchars( xoops_substr( strip_tags( $post_row['post_content'] ) , 0 , 255 ) , ENT_QUOTES ) ) ; 32 33 $uri = preg_replace('/\/$/','',$blog_info['home']); 34 $uri .= '/?p='.$post_row['ID']; 33 35 return array( 34 'dirname' => $mydirname ,35 'module_name' => $ module->getVar( 'name' ),36 'dirname' => $mydirname. $blog_info['sub_dir'] , 37 'module_name' => $blog_info['blogname'] , 36 38 'subject' => $post_row['post_title'] , 37 'uri' => XOOPS_URL.'/modules/'.$mydirname.'/?p='.$post_row['ID'],39 'uri' => $uri , 38 40 'summary' => $summary , 39 41 ) ; … … 61 63 function canAddComment($external_link_id) 62 64 { 65 global $forum_id; 66 global $post; 67 68 if (is_object($post)){ // in wordpress 69 if ($post->ID == $external_link_id){ 70 if($post->comment_status == 'open'){ 71 return true; 72 } else { 73 return false; 74 } 75 } 76 } 63 77 $db =& Database::getInstance() ; 64 78 $myts =& MyTextsanitizer::getInstance() ; … … 73 87 if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ; 74 88 89 $blog_info = $this->get_comment_blog_info($forum_id); 75 90 $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); 76 91 77 92 // query 78 $sql = "SELECT * FROM ".$ db->prefix($xpress_prefix."_posts")."WHERE ID=$post_id";93 $sql = "SELECT * FROM ".$blog_info['mb_table_prefix']."posts WHERE ID=$post_id"; 79 94 $post_row = $db->fetchArray( $db->query( $sql ) ) ; 80 95 if( empty( $post_row ) ) return false ; … … 156 171 function validate_id( $link_id ) 157 172 { 173 global $forum_id; 158 174 $post_id = intval( $link_id ) ; 159 175 $mydirname = $this->mydirname ; 160 176 $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); 161 177 $blog_info = $this->get_comment_blog_info($forum_id); 162 178 $db =& Database::getInstance() ; 163 179 164 list( $count ) = $db->fetchRow( $db->query( "SELECT COUNT(*) FROM ".$ db->prefix($xpress_prefix."_posts")."WHERE ID=$post_id AND comment_status ='open'" ) ) ;180 list( $count ) = $db->fetchRow( $db->query( "SELECT COUNT(*) FROM ".$blog_info['mb_table_prefix'] ."posts WHERE ID=$post_id AND comment_status ='open'" ) ) ; 165 181 166 182 if( $count <= 0 ) return false ; … … 185 201 function processCommentNotifications( $mode , $link_id , $forum_id , $topic_id , $post_id ) 186 202 { 203 $blog_info = $this->get_comment_blog_info($forum_id); 204 $wp_full_prefix = $blog_info['mb_table_prefix']; 205 187 206 $db =& Database::getInstance() ; 188 207 $myts =& MyTextsanitizer::getInstance() ; … … 198 217 $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); 199 218 200 $table_term_relationships = $ db->prefix($xpress_prefix."_term_relationships");201 $table_term_taxonomy = $ db->prefix($xpress_prefix."_term_taxonomy");202 $table_terms = $ db->prefix($xpress_prefix."_terms");219 $table_term_relationships = $wp_full_prefix ."term_relationships"; 220 $table_term_taxonomy = $wp_full_prefix."term_taxonomy"; 221 $table_terms = $wp_full_prefix."terms"; 203 222 $table_categories = $db->prefix($xpress_prefix."_categories"); 204 223 $table_post2cat = $db->prefix($xpress_prefix."_post2cat"); 205 $wp_post = $ db->prefix($xpress_prefix."_posts");206 $wp_options = $ db->prefix($xpress_prefix."_options");224 $wp_post = $wp_full_prefix."posts"; 225 $wp_options = $wp_full_prefix."options"; 207 226 $wp_users = $db->prefix($xpress_prefix."_users"); 208 227 … … 268 287 function sync_to_wp_comment( $mode , $link_id , $forum_id , $topic_id , $post_id = 0 ){ 269 288 289 $blog_info = $this->get_comment_blog_info($forum_id); 290 $wp_full_prefix = $blog_info['mb_table_prefix']; 291 $blog_id = $blog_info['blog_id']; 292 $target_db_prefix = $blog_info['mb_table_prefix']; 270 293 $mydirname = $this->mydirname ; 271 294 $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); … … 276 299 $xoopsDB =& Database::getInstance(); 277 300 278 $wp_comments = $ xoopsDB->prefix($xpress_prefix . '_comments');279 $wp_posts = $ xoopsDB->prefix($xpress_prefix . '_posts');301 $wp_comments = $wp_full_prefix . 'comments'; 302 $wp_posts = $wp_full_prefix . 'posts'; 280 303 $wp_d3forum_link = $xoopsDB->prefix($xpress_prefix . '_d3forum_link'); 281 304 $d3f_posts = $xoopsDB->prefix($d3f_prefix . '_posts'); … … 355 378 356 379 $wp_sql = "INSERT INTO $wp_d3forum_link "; 357 $wp_sql .= "(comment_ID , post_id ) ";380 $wp_sql .= "(comment_ID , post_id, forum_id,blog_id) "; 358 381 $wp_sql .= "VALUES "; 359 $wp_sql .= "($comment_ID, $post_id )";382 $wp_sql .= "($comment_ID, $post_id ,$forum_id,$blog_id)"; 360 383 $wp_res = $xoopsDB->queryF($wp_sql, 0, 0); 361 384 } … … 370 393 break; 371 394 case 'edit': 372 $wp_sql = "SELECT comment_ID FROM $wp_d3forum_link WHERE post_id = $post_id ";395 $wp_sql = "SELECT comment_ID FROM $wp_d3forum_link WHERE post_id = $post_id "; 373 396 $wp_res = $xoopsDB->query($wp_sql, 0, 0); 374 397 if ($wp_res === false){ … … 427 450 } 428 451 return $ret; 429 } 452 } 430 453 431 } 454 function get_comment_blog_info($d3forum_forum_id){ 455 $xoopsDB =& Database::getInstance(); 456 $xp_prefix = $wpdirname = basename( dirname( dirname( __FILE__ ) ) ) ; 457 $xp_prefix = preg_replace('/wordpress/','wp',$xp_prefix); 458 $xp_prefix = $xoopsDB->prefix($xp_prefix); 459 $table_name = 'options'; 460 $options_array = array(); 461 462 463 $sql = "SHOW TABLES LIKE '" . $xp_prefix . '%' . $table_name . "'"; 464 if($result = $xoopsDB->queryF($sql)){ 465 while($row = $xoopsDB->fetchRow($result)){ 466 $wp_option_table = $row[0]; 467 $pattern = '/'. $table_name . '/'; 468 $option['mb_table_prefix'] = preg_replace($pattern,'',$wp_option_table); 469 if (preg_match('/'. $xp_prefix . '_([0-9]*)_/',$option['mb_table_prefix'],$matchs)){ 470 $option['blog_id'] = $matchs[1]; 471 } else { 472 $option['blog_id'] = 1; 473 } 474 475 $option_sql = "SELECT option_name, option_value FROM $wp_option_table WHERE option_name IN ('home','siteurl','blogname','xpressme_option')"; 476 if($option_result = $xoopsDB->query($option_sql, 0, 0)){ 477 while($option_row = $xoopsDB->fetchArray($option_result)){ 478 $name = $option_row['option_name']; 479 $value = $option_row['option_value']; 480 if ($name == 'xpressme_option'){ 481 $value = @unserialize( $value ); 482 } 483 $option[$name] = $value; 484 } 485 $option['siteurl'] = preg_replace('/\/$/','',$option['siteurl']); 486 $option['home'] = preg_replace('/\/$/','',$option['home']); 487 488 if ($option['blog_id'] === 1){ 489 $option['sub_dir'] = ''; 490 } else { 491 $xoops_url = str_replace('/','\\/',XOOPS_URL); 492 if (preg_match('/'. $xoops_url . '.*' . $wpdirname . '(.*)/',$option['home'],$matchs)){ 493 $option['sub_dir'] = $matchs[1]; 494 } else { 495 $option['sub_dir'] = ''; 496 } 497 } 498 if ($option['xpressme_option']['d3forum_forum_id'] == $d3forum_forum_id){ 499 return $option; 500 } 501 } 502 } 503 return null; 504 } 505 } 506 function repair_d3forum_link($comment_ID, $post_id ,$forum_id,$blog_id,$target_db_prefix){ 507 } 508 509 } // class 432 510 } 433 511 ?> -
trunk/xpressme_integration_kit/include/oninstall.php
r583 r590 110 110 post_id int(10) unsigned NOT NULL default '0' , 111 111 wp_post_ID bigint(20) unsigned NOT NULL default '0', 112 forum_id bigint(20) unsigned NOT NULL default '0', 113 blog_id bigint(20) unsigned NOT NULL default '0', 112 114 KEY post_id (post_id) 113 115 )$charset_collate;"; -
trunk/xpressme_integration_kit/include/onupdate.php
r583 r590 223 223 } 224 224 225 $d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ; 225 226 if (! enhanced_table_check($mydirname,'d3forum_link')){ 226 $d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ;227 227 $queries ="CREATE TABLE $d3forum_link ( 228 228 comment_ID bigint(20) unsigned NOT NULL default '0', 229 229 post_id int(10) unsigned NOT NULL default '0' , 230 230 wp_post_ID bigint(20) unsigned NOT NULL default '0', 231 forum_id bigint(20) unsigned NOT NULL default '0', 232 blog_id bigint(20) unsigned NOT NULL default '0', 231 233 KEY post_id (post_id) 232 234 )TYPE=MyISAM"; 233 235 $db->queryF( $queries ) ; 234 236 $msgs[] = "$d3forum_link table of XPressME was made."; 237 } else { 238 if (!is_found_table_column($d3forum_link,'forum_id')){ 239 $queries ="ALTER TABLE $d3forum_link ADD forum_id bigint(20) unsigned NOT NULL default '0' AFTER wp_post_ID"; 240 $db->queryF( $queries ) ; 241 $msgs[] = "$d3forum_link ADD forum_id ."; 242 // The table is repaired. 243 // $update_sql = "UPDATE $d3forum_link SET forum_id = 1 WHERE(forum_id IS NULL OR forum_id < 1)"; 244 // $db->queryF( $update_sql ) ; 245 } 246 if (!is_found_table_column($d3forum_link,'blog_id')){ 247 $queries ="ALTER TABLE $d3forum_link ADD blog_id bigint(20) unsigned NOT NULL default '0' AFTER forum_id"; 248 $db->queryF( $queries ) ; 249 $msgs[] = "$d3forum_link ADD blog_id ."; 250 // The table is repaired. 251 $update_sql = "UPDATE $d3forum_link SET blog_id = 1 WHERE(blog_id IS NULL OR blog_id < 1)"; 252 $db->queryF( $update_sql ) ; 253 } 235 254 } 236 255 -
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php
r264 r590 115 115 116 116 function get_d3forum_post_ID($wp_comment_ID){ 117 global $xoops_db; 117 global $xoops_db,$blog_id; 118 119 if (empty($blog_id)) $blog_id =1; 118 120 119 121 $wp_d3forum_link = get_wp_prefix() . 'd3forum_link'; 120 122 121 $sql = "SELECT post_id FROM $wp_d3forum_link WHERE comment_ID = $wp_comment_ID ";123 $sql = "SELECT post_id FROM $wp_d3forum_link WHERE comment_ID = $wp_comment_ID AND blog_id = $blog_id"; 122 124 $post_id = $xoops_db->get_var($sql); 123 125 return $post_id; … … 125 127 126 128 function get_wp_comment_ID($d3forum_post_ID){ 127 global $xoops_db; 129 global $xoops_db,$blog_id; 130 131 if (empty($blog_id)) $blog_id =1; 128 132 129 133 $wp_d3forum_link = get_wp_prefix() . 'd3forum_link'; 130 134 131 $sql = "SELECT comment_ID FROM $wp_d3forum_link WHERE post_id = $d3forum_post_ID ";135 $sql = "SELECT comment_ID FROM $wp_d3forum_link WHERE post_id = $d3forum_post_ID AND blog_id = $blog_id"; 132 136 $comment_ID = $xoops_db->get_var($sql); 133 137 return $comment_ID; … … 167 171 global $xpress_config,$xoops_db; 168 172 173 $d3f_forum_id = $xpress_config->d3forum_forum_id; 174 169 175 if (!is_d3forum_setting()) die('The setting of the D3Forum comment integration is wrong. '); 170 176 $d3f_forum_dir = $xpress_config->d3forum_module_dir; … … 174 180 $sql = "UPDATE $d3f_topic "; 175 181 $sql .= "SET topic_locked = $lock "; 176 $sql .= "WHERE topic_external_link_id = $wp_post_id " ;182 $sql .= "WHERE topic_external_link_id = $wp_post_id AND forum_id = $d3f_forum_id" ; 177 183 $xoops_db->query($sql); 178 184 } … … 180 186 // All comments of WordPress are exported to the D3Forum comment. 181 187 function wp_to_d3forum($forum_id = 1, $d3f_prefix = 'd3forum'){ 182 global $xpress_config,$xoops_db ;188 global $xpress_config,$xoops_db,$wpdb; 183 189 184 190 if (!is_d3forum_setting()) die('The setting of the D3Forum comment integration is wrong. '); … … 187 193 $xpress_prefix = get_wp_prefix(); 188 194 189 $wp_comments = $ xpress_prefix . 'comments';195 $wp_comments = $wpdb->comments; 190 196 $wp_d3forum_link = $xpress_prefix . 'd3forum_link'; 191 $wp_posts = $ xpress_prefix . 'posts';197 $wp_posts = $wpdb->posts; 192 198 $d3f_topic = $d3forum_prefix . 'topics'; // delete key forum_id 193 199 $d3f_forums = $d3forum_prefix . 'forums'; // delete key forum_id … … 239 245 240 246 $comment_count = 0; 241 $comments = $ xoops_db->get_results($sql);247 $comments = $wpdb->get_results($sql); 242 248 foreach($comments as $comment){ 243 249 $comment_ID = $comment->comment_ID; … … 254 260 // All comments of D3Forum are import to the WordPress comment. 255 261 function d3forum_to_wp($forum_id = 1, $d3f_prefix = 'd3forum'){ 256 global $xpress_config,$xoops_db ;262 global $xpress_config,$xoops_db,$wpdb; 257 263 if (!is_d3forum_setting()) die('The setting of the D3Forum comment integration is wrong. '); 258 264 … … 260 266 $xpress_prefix = get_wp_prefix() ; 261 267 262 $wp_comments = $ xpress_prefix . 'comments';268 $wp_comments = $wpdb->comments; 263 269 $wp_d3forum_link = $xpress_prefix . 'd3forum_link'; 264 270 $wp_dummy = $xpress_prefix . 'dummy'; 265 $wp_d3forum_link = $xpress_prefix . 'd3forum_link';266 271 267 272 $d3f_topic = $d3forum_prefix . 'topics'; … … 287 292 288 293 //All wp post comment count clear 289 $wp_posts = $ xpress_prefix . 'posts';294 $wp_posts = $wpdb->posts; 290 295 $xoops_db->query("UPDATE $wp_posts SET comment_count = 0 WHERE 1 "); 291 296 … … 327 332 $d3forum_dirname = $xpress_config->d3forum_module_dir; 328 333 $d3forum_prefix = get_xoops_prefix() . $d3forum_dirname . '_'; 334 $d3forum_forum_id = $xpress_config->d3forum_forum_id; 329 335 330 336 $post_id = intval( $post_id ) ; … … 332 338 $d3f_topics = $d3forum_prefix . 'topics'; 333 339 334 $sql = "SELECT topic_id,topic_first_post_id FROM $d3f_topics WHERE topic_external_link_id = $post_id ";340 $sql = "SELECT topic_id,topic_first_post_id FROM $d3f_topics WHERE topic_external_link_id = $post_id AND forum_id = $d3forum_forum_id"; 335 341 $row = $xoops_db->get_row($sql) ; 336 342 … … 346 352 347 353 function d3forum_sync_to_wp_comment( $mode , $link_id , $forum_id , $topic_id , $post_id = 0 ){ 348 global $xpress_config,$xoops_db ;354 global $xpress_config,$xoops_db,$wpdb,$blog_id; 349 355 350 356 if (!is_d3forum_setting()) die('The setting of the D3Forum comment integration is wrong. '); 357 358 if (empty($blog_id)) $blog_id =1; 359 $d3f_forum_id = $xpress_config->d3forum_forum_id; 360 351 361 $d3forum_prefix = get_xoops_prefix() . $xpress_config->d3forum_module_dir . '_'; 352 362 $xpress_prefix = get_wp_prefix(); 353 363 354 $wp_comments = $ xpress_prefix . 'comments';355 $wp_posts = $ xpress_prefix . 'posts';364 $wp_comments = $wpdb->comments; 365 $wp_posts = $wpdb->posts; 356 366 $wp_d3forum_link = $xpress_prefix . 'd3forum_link'; 357 367 … … 424 434 $xoops_db->query($wp_sql); 425 435 $wp_sql = "INSERT INTO $wp_d3forum_link "; 426 $wp_sql .= "(comment_ID , post_id ) ";436 $wp_sql .= "(comment_ID , post_id, wp_post_ID, forum_id, blog_id) "; 427 437 $wp_sql .= "VALUES "; 428 $wp_sql .= "($comment_ID, $post_id )";438 $wp_sql .= "($comment_ID, $post_id, $link_id, $d3f_forum_id, $blog_id)"; 429 439 $xoops_db->query($wp_sql); 430 440 if ($comment_approved ==0) do_CommentWaiting($comment_ID, $post_id); … … 458 468 // The content is reflected in the D3Forum comment when there is a change in the WordPress comment. 459 469 function wp_comment_sync_to_d3forum($comment_ID = 0,$sync_mode){ 460 global $xpress_config,$xoops_db,$xoops_config; 470 global $xpress_config,$xoops_db,$xoops_config,$wpdb,$blog_id; 471 472 if (empty($blog_id)) $blog_id =1; 461 473 462 474 if (!is_d3forum_setting()) die('The setting of the D3Forum comment integration is wrong. '); … … 468 480 $d3forum_prefix = get_xoops_prefix() . $d3f_forum_dir . '_'; 469 481 $xpress_prefix = get_wp_prefix(); 470 $wp_comments = $xpress_prefix . 'comments'; 471 $wp_posts = $xpress_prefix . 'posts'; 482 $wp_comments = $wpdb->comments; 483 // $wp_comments = $xpress_prefix . 'comments'; 484 $wp_posts = $wpdb->posts; 485 // $wp_posts = $xpress_prefix . 'posts'; 472 486 $wp_d3forum_link = $xpress_prefix . 'd3forum_link'; 473 487 $d3f_topic = $d3forum_prefix . 'topics'; … … 484 498 $sql .= "WHERE (comment_ID = $comment_ID) AND ($wp_comments.comment_approved NOT LIKE 'spam') "; 485 499 486 $row = $xoops_db->get_row($sql) ; 500 // $row = $xoops_db->get_row($sql) ; 501 $row = $wpdb->get_row($sql) ; 487 502 if(empty($row)) die( 'READ ' . $wp_comments . '_NG...' .$sql); 488 503 if (! empty($row->comment_type)) return; … … 513 528 if ($sync_mode == 'delete'){ 514 529 $mode = 'delete'; 515 $delete_post_id = $xoops_db->get_var("SELECT post_id FROM $wp_d3forum_link WHERE comment_ID = $comment_ID ");530 $delete_post_id = $xoops_db->get_var("SELECT post_id FROM $wp_d3forum_link WHERE comment_ID = $comment_ID AND blog_id = $blog_id"); 516 531 if (empty($delete_post_id)) return; 517 532 $topic_id = $xoops_db->get_var("SELECT topic_id FROM $d3f_topic WHERE topic_external_link_id = $topic_external_link_id AND forum_id = $forum_id"); … … 528 543 529 544 // if comment on same ID exists then edits comment else reply comment 530 $row = $xoops_db->get_row("SELECT * FROM $wp_d3forum_link WHERE comment_ID = $comment_ID ") ;545 $row = $xoops_db->get_row("SELECT * FROM $wp_d3forum_link WHERE comment_ID = $comment_ID AND blog_id = $blog_id" ) ; 531 546 532 547 if (!empty($row)){ … … 629 644 630 645 $wp_sql = "INSERT INTO $wp_d3forum_link "; 631 $wp_sql .= "(comment_ID , post_id ) ";646 $wp_sql .= "(comment_ID , post_id, wp_post_ID, forum_id, blog_id) "; 632 647 $wp_sql .= "VALUES "; 633 $wp_sql .= "($comment_ID, $post_id )";648 $wp_sql .= "($comment_ID, $post_id, $topic_external_link_id, $d3f_forum_id, $blog_id)"; 634 649 $xoops_db->query($wp_sql); 635 650 … … 666 681 667 682 $wp_sql = "INSERT INTO $wp_d3forum_link "; 668 $wp_sql .= "(comment_ID , post_id , wp_post_ID ) ";683 $wp_sql .= "(comment_ID , post_id , wp_post_ID, forum_id, blog_id) "; 669 684 $wp_sql .= "VALUES "; 670 $wp_sql .= "($comment_ID, $post_id, $topic_external_link_id )";685 $wp_sql .= "($comment_ID, $post_id, $topic_external_link_id, $d3f_forum_id, $blog_id)"; 671 686 $xoops_db->query($wp_sql); 672 687 … … 701 716 function wp_d3forum_delete_post_recursive( $d3forum_dirname , $post_id ,$isChild = false) 702 717 { 718 global $wpdb,$blog_id; 719 global $xpress_config,$xoops_db; 703 720 $post_id = intval( $post_id ) ; // post_id is d3forum post(comments) id. 704 global $xpress_config,$xoops_db; 721 if (empty($blog_id)) $blog_id =1; 722 723 705 724 $d3forum_prefix = get_xoops_prefix() . $d3forum_dirname . '_'; 706 725 $xpress_prefix = get_wp_prefix(); … … 718 737 $xoops_db->query( "DELETE FROM ".$d3forum_prefix."post_votes WHERE post_id=$post_id" ) ; 719 738 720 $wp_comments = $ xpress_prefix . 'comments';721 $wp_posts = $ xpress_prefix . 'posts';739 $wp_comments = $wpdb->comments; 740 $wp_posts = $wpdb->posts; 722 741 $wp_d3forum_link = $xpress_prefix . 'd3forum_link'; 723 742 724 743 $comment_ID = get_wp_comment_ID($post_id); // get wordpress comment ID 725 744 if ($comment_ID > 0){ 726 $comment_post_ID = $ xoops_db->get_var("SELECT comment_post_ID FROM $wp_comments WHERE comment_ID = $comment_ID");745 $comment_post_ID = $wpdb->get_var("SELECT comment_post_ID FROM $wp_comments WHERE comment_ID = $comment_ID"); 727 746 if ($isChild){ //The first comment is deleted on the WordPress side. 728 $ xoops_db->query("DELETE FROM $wp_comments WHERE comment_ID = $comment_ID");747 $wpdb->query("DELETE FROM $wp_comments WHERE comment_ID = $comment_ID"); 729 748 if (!empty($comment_post_ID)){ 730 $ xoops_db->query("UPDATE $wp_posts SET comment_count = comment_count -1 WHERE ID = $comment_post_ID");749 $wpdb->query("UPDATE $wp_posts SET comment_count = comment_count -1 WHERE ID = $comment_post_ID"); 731 750 } 732 751 } 733 $xoops_db->query("DELETE FROM $wp_d3forum_link WHERE post_id = $post_id ");752 $xoops_db->query("DELETE FROM $wp_d3forum_link WHERE post_id = $post_id AND blog_id = $blog_id"); 734 753 } 735 754 } … … 741 760 global $xpress_config,$xoops_db; 742 761 $d3forum_prefix = get_xoops_prefix() . $d3forum_dirname . '_'; 743 $xpress_prefix = get_wp_prefix();744 762 745 763 $topic_id = intval( $topic_id ) ; -
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php
r578 r590 644 644 global $xoops_db,$xoops_config; 645 645 646 $multi_blog_use_d3forum = true; 647 646 648 $d3frum_list = array(); 647 649 $module_dir_path = get_xoops_root_path(); … … 654 656 $selected = ''; 655 657 656 if (xpress_is_multiblog() ) {658 if (xpress_is_multiblog() && $multi_blog_use_d3forum) { 657 659 $forum_list .= '<option value="none"' . $selected . '>' . __('WordPress MultiBlog cannot integrate the comments.', 'xpressme') . "</option>\n"; 658 660 } else {
Note: See TracChangeset
for help on using the changeset viewer.