Page 1 of 1

Wordpress Import Comment Count

Posted: Fri Dec 10, 2004 10:26 pm
by Trench
I found the problem to why s9y doesn't recognize the comment count from the imported wordpress entries but I'm not sure how to fix it.

In the MYSQL database under serendipity_entries all the comments are at 0. I manually input the comment count for one of my entries and that fixed it. However since I have 1000 entries doing it manually would take forever.

Is there an SQL query or command that would sync up the entries with the comment counts?

Posted: Sat Dec 11, 2004 2:45 am
by Guest
Can you please apply this patch and try again? If it works, I'll commit it to CVS.

Code: Select all

Index: wordpress.inc.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/include/admin/importers/wordpress.inc.php,v
retrieving revision 1.7
diff -u -r1.7 wordpress.inc.php
--- wordpress.inc.php   3 Dec 2004 18:47:18 -0000       1.7
+++ wordpress.inc.php   11 Dec 2004 01:42:25 -0000
@@ -226,12 +226,12 @@
                                      'email'     => $a['comment_author_email'],
                                      'url'       => $a['comment_author_url'],
                                      'ip'        => $a['comment_author_IP'],
-                                     'status'    => 'approved',
+                                     'status'    => 'pending',
                                      'body'      => $a['comment_content'],
                                      'type'      => 'NORMAL');
  
                     serendipity_db_insert('comments', $this->strtrRecursive($comment, $trans_table));
-                    serendipity_approveComment($cid, $id, true);
+                    serendipity_approveComment(serendipity_db_insert_id('comments', 'id'), $entry['entryid'], true);
                 }
             }
         }