]> git.mjollnir.org Git - s9y.git/commitdiff
Make bblog importer recognize trackbacks. Thanks to hanno!
authorgarvinhicking <garvinhicking>
Sun, 5 Jun 2005 17:53:31 +0000 (17:53 +0000)
committergarvinhicking <garvinhicking>
Sun, 5 Jun 2005 17:53:31 +0000 (17:53 +0000)
include/admin/importers/bblog.inc.php

index ebf971087d481377fe0ad0dadefd2ed1f81f9242..9539d1805e32aa20480e907a8d1048bfd6f34c50 100644 (file)
@@ -220,6 +220,36 @@ class Serendipity_Import_bblog extends Serendipity_Import {
             }
         }
 
+        /* Trackbacks */
+        $res = @$this->nativeQuery("SELECT * FROM {$this->data['prefix']}comments WHERE type = 'trackback';", $bblogdb);
+        if (!$res) {
+            return sprintf(COULDNT_SELECT_COMMENT_INFO, mysql_error($bblogdb));
+        }
+
+        while ($a = mysql_fetch_assoc($res)) {
+            foreach ($entries as $entry) {
+                if ($entry['postid'] == $a['postid'] ) {
+                    $trackback = array('entry_id ' => $entry['entryid'],
+                                     'parent_id' => 0,
+                                     'timestamp' => $a['posttime'],
+                                     'title'     => $a['title'],
+                                     'author'    => $a['postername'],
+                                     'email'     => $a['posteremail'],
+                                     'url'       => $a['posterwebsite'],
+                                     'ip'        => $a['ip'],
+                                     'status'    => 'approved',
+                                     'body'      => $a['commenttext'],
+                                     'subscribed'=> 'false',
+                                     'type'      => 'TRACKBACK');
+
+                    serendipity_db_insert('comments', $this->strtrRecursive($trackback));
+                    $cid = serendipity_db_insert_id('comments', 'id');
+                    serendipity_approveComment($cid, $entry['entryid'], true);
+                }
+            }
+        }
+
+
         $serendipity['noautodiscovery'] = $noautodiscovery;
 
         // That was fun.