diff -r -u xpressme_integration_kit/admin/index.php php7_patch/admin/index.php
old
|
new
|
|
164 | 164 | global $xoopsModule; |
165 | 165 | include(dirname(__FILE__) . '/../wp-includes/version.php'); |
166 | 166 | require_once dirname(dirname( __FILE__ )).'/include/memory_limit.php' ; |
| 167 | $db =& XoopsDatabaseFactory::getDatabaseConnection(); |
167 | 168 | |
168 | 169 | if ($is_report) { |
169 | 170 | echo "******** " . _AM_XP2_SYSTEM_INFO . "********" . "<br />\n"; |
… |
… |
|
172 | 173 | echo 'libxml Version: '; |
173 | 174 | if (defined('LIBXML_DOTTED_VERSION')) echo LIBXML_DOTTED_VERSION ; else echo "Can't detect."; |
174 | 175 | echo "<br />\n";; |
175 | | echo "MySQL Version: " . mysql_get_server_info() . "</text><br />"; |
| 176 | echo "MySQL Version: " . mysqli_get_server_info($db->conn) . "</text><br />"; |
176 | 177 | echo "XOOPS Version: " . XOOPS_VERSION . "</text><br />"; |
177 | 178 | echo "XPressME Version: " . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "<br />\n"; |
178 | 179 | echo "WordPress Version: " . $wp_version . "<br />\n"; |
… |
… |
|
246 | 247 | echo "<label>" . "<strong>libxml Version:</strong>" . ":</label><text>"; |
247 | 248 | if (defined('LIBXML_DOTTED_VERSION')) echo LIBXML_DOTTED_VERSION ; else echo "Can't detect."; |
248 | 249 | echo "</text><br />"; |
249 | | echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysql_get_server_info() . "</text><br />"; |
| 250 | echo "<label>" . "<strong>MySQL Version:</strong>" . ":</label><text>" . mysqli_get_server_info($db->conn) . "</text><br />"; |
250 | 251 | echo "<label>" . "<strong>XOOPS Version:</strong>" . ":</label><text>" . XOOPS_VERSION . "</text><br />"; |
251 | 252 | echo "<label>" . "<strong>XPressME Version:</strong>" . ":</label><text>" . $xoopsModule->getInfo('version') . ' ' . $xoopsModule->getInfo('codename') . "</text><br />"; |
252 | 253 | echo "<label>" . "<strong>WordPress Version:</strong>" . ":</label><text>" . $wp_version . "</text><br />"; |
diff -r -u xpressme_integration_kit/class/xpressD3commentContent.class.php php7_patch/class/xpressD3commentContent.class.php
old
|
new
|
|
8 | 8 | function fetchSummary( $external_link_id ) |
9 | 9 | { |
10 | 10 | // 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 | |
13 | 20 | $db =& XoopsDatabaseFactory::getDatabaseConnection() ; |
14 | | $myts =& MyTextsanitizer::getInstance() ; |
| 21 | (method_exists('MyTextsanitizer', 'sGetInstance') && ($myts =& MyTextsanitizer::sGetInstance())) || ($myts =& MyTextsanitizer::getInstance()) ; |
15 | 22 | |
16 | 23 | $module_handler =& xoops_gethandler( 'module' ) ; |
17 | 24 | $module =& $module_handler->getByDirname( $this->mydirname ) ; |
… |
… |
|
23 | 30 | if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ; |
24 | 31 | |
25 | 32 | $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); |
27 | 34 | // query |
28 | 35 | $post_row = $db->fetchArray( $db->query( "SELECT * FROM ".$blog_info['mb_table_prefix']."posts WHERE ID=$post_id" ) ) ; |
29 | 36 | if( empty( $post_row ) ) return '' ; |
… |
… |
|
67 | 74 | //private for XPressME |
68 | 75 | function canAddComment($external_link_id) |
69 | 76 | { |
70 | | global $forum_id; |
71 | 77 | 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 | } |
72 | 87 | |
73 | 88 | if (is_object($post)){ // in wordpress |
74 | 89 | if ($post->ID == $external_link_id){ |
… |
… |
|
91 | 106 | $mydirname = $this->mydirname ; |
92 | 107 | if( preg_match( '/[^0-9a-zA-Z_-]/' , $mydirname ) ) die( 'Invalid mydirname' ) ; |
93 | 108 | |
94 | | $blog_info = $this->get_comment_blog_info($forum_id); |
| 109 | $blog_info = $this->get_comment_blog_info($this->forum_id); |
95 | 110 | $xpress_prefix = preg_replace('/wordpress/','wp',$mydirname); |
96 | 111 | |
97 | 112 | // query |
… |
… |
|
175 | 190 | |
176 | 191 | function validate_id( $link_id ) |
177 | 192 | { |
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 | } |
179 | 201 | $post_id = intval( $link_id ) ; |
180 | 202 | $mydirname = $this->mydirname ; |
181 | 203 | $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); |
183 | 205 | $db =& XoopsDatabaseFactory::getDatabaseConnection() ; |
184 | 206 | |
185 | 207 | list( $count ) = $db->fetchRow( $db->query( "SELECT COUNT(*) FROM ".$blog_info['mb_table_prefix'] ."posts WHERE ID=$post_id AND comment_status ='open'" ) ) ; |
diff -r -u xpressme_integration_kit/include/memory_limit.php php7_patch/include/memory_limit.php
old
|
new
|
|
14 | 14 | |
15 | 15 | $has_xoops_db = (!empty($xoopsDB)); |
16 | 16 | if (!$has_xoops_db) { |
17 | | $cn = mysql_connect($xoops_config->xoops_db_host, $xoops_config->xoops_db_user, $xoops_config->xoops_db_pass); |
| 17 | $cn = mysqli_connect($xoops_config->xoops_db_host, $xoops_config->xoops_db_user, $xoops_config->xoops_db_pass); |
18 | 18 | if ($cn){ |
19 | | $db_selected = mysql_select_db($xoops_config->xoops_db_name, $cn); |
| 19 | $db_selected = mysqli_select_db($cn, $xoops_config->xoops_db_name); |
20 | 20 | } |
21 | 21 | } |
22 | 22 | |
… |
… |
|
30 | 30 | } |
31 | 31 | } else { |
32 | 32 | if ($db_selected){ |
33 | | if($result = mysql_query($module_sql)){ |
34 | | $row = mysql_fetch_assoc($result); |
| 33 | if($result = mysqli_query($cn, $module_sql)){ |
| 34 | $row = mysqli_fetch_assoc($result); |
35 | 35 | $module_id = $row['mid']; |
36 | 36 | } |
37 | 37 | } |
… |
… |
|
47 | 47 | } |
48 | 48 | } else { |
49 | 49 | if ($db_selected){ |
50 | | if($result = mysql_query($config_sql)){ |
51 | | $row = mysql_fetch_assoc($result); |
| 50 | if($result = mysqli_query($cn, $config_sql)){ |
| 51 | $row = mysqli_fetch_assoc($result); |
52 | 52 | $memory = $row['conf_value']; |
53 | 53 | } |
54 | 54 | } |
55 | 55 | } |
56 | 56 | } |
57 | 57 | if (!$has_xoops_db) { |
58 | | mysql_close($cn); |
| 58 | mysqli_close($cn); |
59 | 59 | } |
60 | 60 | |
61 | 61 | if (empty($memory)) return; |
diff -r -u xpressme_integration_kit/include/oninstall.php php7_patch/include/oninstall.php
old
|
new
|
|
89 | 89 | $views_table = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_views' ; |
90 | 90 | |
91 | 91 | $charset_collate = ''; |
92 | | if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) { |
| 92 | if ( version_compare($wpdb->get_var('SELECT VERSION()'), '4.1.0', '>=') ) { |
93 | 93 | if ( ! empty($wpdb->charset) ) |
94 | 94 | $charset_collate = "DEFAULT CHARACTER SET $wpdb->charset"; |
95 | 95 | if ( ! empty($wpdb->collate) ) |
diff -r -u xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_disp.php php7_patch/wp-content/plugins/xpressme/include/d3forum_comment_disp.php
old
|
new
|
|
33 | 33 | // force UPDATE forums.forum_external_link_format "(dirname)::(classname)::(trustdirname)" |
34 | 34 | $xoops_db->query( "UPDATE ".get_xoops_prefix() . $dir_name."_forums SET forum_external_link_format='".$external_link_format."' WHERE forum_id= $forum_id" ) ; |
35 | 35 | |
36 | | $d3comment =& new xpressD3commentContent( $dir_name , $xpress_dirname ) ; |
| 36 | $d3comment = new xpressD3commentContent( $dir_name , $xpress_dirname ) ; |
37 | 37 | |
38 | 38 | $post_title = get_the_title(); |
39 | 39 | if (function_exists('get_the_ID')){ // upper wordpress 2.1 |
diff -r -u xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php php7_patch/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php
old
|
new
|
|
485 | 485 | |
486 | 486 | $wp_res = $xoops_db->query($wp_sql); |
487 | 487 | if ($wp_res === false) die( '...Err. INSERT' . $wp_comments . '(' . $wp_sql . ')'); |
488 | | $comment_ID = mysql_insert_id(); |
| 488 | $comment_ID = $xoops_db->insert_id; |
489 | 489 | $wp_sql = "UPDATE $wp_posts SET comment_count = comment_count +1 WHERE ID = $comment_post_ID"; |
490 | 490 | $xoops_db->query($wp_sql); |
491 | 491 | $wp_sql = "INSERT INTO $wp_d3forum_link "; |
… |
… |
|
695 | 695 | // create post under specified post_id |
696 | 696 | $sql = "INSERT INTO ".$d3f_posts." SET $set4sql,pid=$reply_pid,topic_id=$topic_id,post_time=$post_time,poster_ip=$poster_ip"; |
697 | 697 | $xoops_db->query($sql) ; |
698 | | $post_id = mysql_insert_id(); |
| 698 | $post_id = $xoops_db->insert_id; |
699 | 699 | wp_d3forum_sync_topic( $d3forum_dirname , $topic_id ) ; |
700 | 700 | |
701 | 701 | $wp_sql = "INSERT INTO $wp_d3forum_link "; |
… |
… |
|
728 | 728 | // create topic and get a new topic_id |
729 | 729 | $sql = "INSERT INTO ".$d3f_topic." SET forum_id=$forum_id,topic_invisible=$topic_invisible,topic_external_link_id='".addslashes($topic_external_link_id)."'"; |
730 | 730 | $xoops_db->query($sql) ; |
731 | | $topic_id = mysql_insert_id(); |
| 731 | $topic_id = $xoops_db->insert_id; |
732 | 732 | // create post in the topic |
733 | 733 | $sql = "INSERT INTO ".$d3f_posts." SET $set4sql,topic_id=$topic_id,post_time=$post_time,poster_ip=$poster_ip"; |
734 | 734 | $xoops_db->query($sql) ; |
735 | | $post_id = mysql_insert_id(); |
| 735 | $post_id = $xoops_db->insert_id; |
736 | 736 | wp_d3forum_sync_topic( $d3forum_dirname , $topic_id , true , true ) ; |
737 | 737 | |
738 | 738 | $wp_sql = "INSERT INTO $wp_d3forum_link "; |
… |
… |
|
1053 | 1053 | if( $old_data == $data ) return ; |
1054 | 1054 | } |
1055 | 1055 | |
1056 | | $xoops_db->query( "INSERT INTO ".$d3forum_prefix."post_histories SET post_id=$post_id, history_time=UNIX_TIMESTAMP(), data='".mysql_real_escape_string( serialize( $data ) )."'" ) ; |
| 1056 | $xoops_db->query( $xoops_db->prepare( "INSERT INTO ".$d3forum_prefix."post_histories SET post_id=$post_id, history_time=UNIX_TIMESTAMP(), data=%s", serialize( $data ) ) ) ; |
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | ?> |
| 1060 | ファイル末尾に改行がありません |
diff -r -u xpressme_integration_kit/wp-content/plugins/xpressme/include/user_sync_xoops.php php7_patch/wp-content/plugins/xpressme/include/user_sync_xoops.php
old
|
new
|
|
266 | 266 | $wu_sql .= "('$xoops_user->uname', '$xoops_user->pass', '$xoops_user->email', '$xoops_user->url', '$xoops_user->uname' "; |
267 | 267 | $wu_sql .= " , '$user_regist_time', $user_status, '$user_display_name')"; |
268 | 268 | $xoops_db->query($wu_sql); |
269 | | $wp_user_id = mysql_insert_id(); |
| 269 | $wp_user_id = $xoops_db->insert_id; |
270 | 270 | } else { // WP User ID has not been used yet. |
271 | 271 | $wu_sql = "INSERT INTO $db_xpress_users "; |
272 | 272 | $wu_sql .= "(ID , user_login , user_pass ,user_email , user_url , user_nicename " ; |
diff -r -u xpressme_integration_kit/wp-content/plugins/xpressme/xpressme_class.php php7_patch/wp-content/plugins/xpressme/xpressme_class.php
old
|
new
|
|
366 | 366 | $sql .= "VALUES "; |
367 | 367 | $sql .= "('$cat_id', '', '$title','a:0:{}')"; |
368 | 368 | $xoops_db->query($sql); |
369 | | $insert_forum_id = mysql_insert_id(); |
| 369 | $insert_forum_id = $xoops_db->insert_id; |
370 | 370 | $sql = "INSERT INTO $d3forum_forum_access_tbl "; |
371 | 371 | $sql .= "(forum_id, groupid, can_post, can_edit, can_delete, post_auto_approved, is_moderator) "; |
372 | 372 | $sql .= "VALUES "; |