adapt to services_linkback
authorChristian Weiske <cweiske@cweiske.de>
Mon, 21 Oct 2013 18:20:05 +0000 (20:20 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Mon, 21 Oct 2013 18:25:25 +0000 (20:25 +0200)
data/tables.sql
src/stapibas/Content/Extractor.php
src/stapibas/Content/Fetcher.php
src/stapibas/Feed/PingUrls.php
src/stapibas/Linkback/DbStorage.php [moved from src/stapibas/Pingback/DbStorage.php with 67% similarity]
src/stapibas/Linkback/Mailer.php [moved from src/stapibas/Pingback/Mailer.php with 64% similarity]
src/stapibas/Renderer/Html.php
www/xmlrpc.php

index 096199f82516d40888ff1ef10d0cb16790024eca..bf7974557bf0435a50ccbe74c00d18136531098e 100644 (file)
@@ -8,7 +8,7 @@ CREATE TABLE `feedentries` (
   `fe_needs_update` tinyint(1) NOT NULL,
   PRIMARY KEY (`fe_id`),
   UNIQUE KEY `fe_id` (`fe_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=latin1;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 
 CREATE TABLE `feedentryurls` (
@@ -25,7 +25,7 @@ CREATE TABLE `feedentryurls` (
   `feu_retry` tinyint(1) NOT NULL,
   PRIMARY KEY (`feu_id`),
   UNIQUE KEY `feu_id` (`feu_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=latin1;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 
 CREATE TABLE `feeds` (
@@ -35,61 +35,61 @@ CREATE TABLE `feeds` (
   `f_needs_update` tinyint(1) NOT NULL,
   PRIMARY KEY (`f_id`),
   UNIQUE KEY `f_id` (`f_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=latin1;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 
-CREATE TABLE `pingbackcontent` (
-  `pc_id` int(11) NOT NULL AUTO_INCREMENT,
-  `pc_p_id` int(11) NOT NULL,
-  `pc_mime_type` varchar(32) NOT NULL,
-  `pc_fulltext` text NOT NULL,
-  `pc_detected_type` varchar(16) NOT NULL,
-  PRIMARY KEY (`pc_id`),
-  UNIQUE KEY `pc_id` (`pc_id`)
+CREATE TABLE `linkbackcontent` (
+  `lc_id` int(11) NOT NULL AUTO_INCREMENT,
+  `lc_l_id` int(11) NOT NULL,
+  `lc_mime_type` varchar(32) NOT NULL,
+  `lc_fulltext` text NOT NULL,
+  `lc_detected_type` varchar(16) NOT NULL,
+  PRIMARY KEY (`lc_id`),
+  UNIQUE KEY `lc_id` (`lc_id`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 
-CREATE TABLE `pingbacks` (
-  `p_id` int(11) NOT NULL AUTO_INCREMENT,
-  `p_source` varchar(1024) CHARACTER SET latin1 NOT NULL,
-  `p_target` varchar(1024) CHARACTER SET latin1 NOT NULL,
-  `p_time` datetime NOT NULL,
-  `p_client_ip` varchar(40) CHARACTER SET latin1 NOT NULL,
-  `p_client_agent` varchar(128) CHARACTER SET latin1 NOT NULL,
-  `p_client_referer` varchar(1024) CHARACTER SET latin1 NOT NULL,
-  `p_needs_review` tinyint(1) NOT NULL,
-  `p_use` tinyint(1) NOT NULL,
-  `p_needs_update` tinyint(1) NOT NULL,
-  PRIMARY KEY (`p_id`),
-  UNIQUE KEY `p_id` (`p_id`)
+CREATE TABLE `linkbacks` (
+  `l_id` int(11) NOT NULL AUTO_INCREMENT,
+  `l_source` varchar(1024) CHARACTER SET utf8 NOT NULL,
+  `l_target` varchar(1024) CHARACTER SET utf8 NOT NULL,
+  `l_time` datetime NOT NULL,
+  `l_client_ip` varchar(40) CHARACTER SET utf8 NOT NULL,
+  `l_client_agent` varchar(128) CHARACTER SET utf8 NOT NULL,
+  `l_client_referer` varchar(1024) CHARACTER SET utf8 NOT NULL,
+  `l_needs_review` tinyint(1) NOT NULL,
+  `l_use` tinyint(1) NOT NULL,
+  `l_needs_update` tinyint(1) NOT NULL,
+  PRIMARY KEY (`l_id`),
+  UNIQUE KEY `l_id` (`l_id`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
 
 
-CREATE TABLE `pingbacktargets` (
-  `pt_id` int(11) NOT NULL AUTO_INCREMENT,
-  `pt_url` varchar(2048) NOT NULL,
-  PRIMARY KEY (`pt_id`),
-  UNIQUE KEY `pt_id` (`pt_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='List of pages that may receive pingbacks';
+CREATE TABLE `linkbacktargets` (
+  `lt_id` int(11) NOT NULL AUTO_INCREMENT,
+  `lt_url` varchar(2048) NOT NULL,
+  PRIMARY KEY (`lt_id`),
+  UNIQUE KEY `lt_id` (`lt_id`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='List of pages that may receive linkbacks';
 
 
 CREATE TABLE `rbookmarks` (
   `rb_id` int(11) NOT NULL AUTO_INCREMENT,
-  `rb_p_id` int(11) NOT NULL,
-  `rb_pc_id` int(11) NOT NULL,
+  `rb_l_id` int(11) NOT NULL,
+  `rb_lc_id` int(11) NOT NULL,
   `rb_target` varchar(2048) NOT NULL,
   `rb_source` varchar(2048) NOT NULL,
   `rb_source_title` varchar(256) NOT NULL,
   `rb_count` int(11) NOT NULL,
   PRIMARY KEY (`rb_id`),
   UNIQUE KEY `rb_id` (`rb_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bookmarks, extracted from pingbackcontent';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bookmarks, extracted from linkbackcontent';
 
 
 CREATE TABLE `rcomments` (
   `rc_id` int(11) NOT NULL AUTO_INCREMENT,
-  `rc_p_id` int(11) NOT NULL,
-  `rc_pc_id` int(11) NOT NULL,
+  `rc_l_id` int(11) NOT NULL,
+  `rc_lc_id` int(11) NOT NULL,
   `rc_target` varchar(2048) NOT NULL,
   `rc_source` varchar(2048) NOT NULL,
   `rc_title` varchar(256) NOT NULL,
@@ -100,13 +100,13 @@ CREATE TABLE `rcomments` (
   `rc_content` text NOT NULL,
   PRIMARY KEY (`rc_id`),
   UNIQUE KEY `rb_id` (`rc_id`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bookmarks, extracted from pingbackcontent';
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bookmarks, extracted from linkbackcontent';
 
 
 CREATE TABLE `rlinks` (
   `rl_id` int(11) NOT NULL AUTO_INCREMENT,
-  `rl_p_id` int(11) NOT NULL,
-  `rl_pc_id` int(11) NOT NULL,
+  `rl_l_id` int(11) NOT NULL,
+  `rl_lc_id` int(11) NOT NULL,
   `rl_target` varchar(2048) NOT NULL,
   `rl_source` varchar(2048) NOT NULL,
   `rl_title` varchar(256) NOT NULL,
@@ -116,6 +116,6 @@ CREATE TABLE `rlinks` (
   `rl_author_image` varchar(2048) NOT NULL,
   PRIMARY KEY (`rl_id`),
   UNIQUE KEY `rb_id` (`rl_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Bookmarks, extracted from pingbackcontent';
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COMMENT='Bookmarks, extracted from linkbackcontent';
 
 
index af035b9879053f19c5c50d2ad62b5c22391a535b..50d791561d138ea17aef25143f82735e80be7f61 100644 (file)
@@ -19,58 +19,58 @@ class Content_Extractor
      */
     public function updateAll()
     {
-        $this->log->info('Extracting pingback content..');
+        $this->log->info('Extracting linkback content..');
         $res = $this->db->query(
-            'SELECT * FROM pingbackcontent, pingbacks'
-            . ' WHERE p_id = pc_p_id' . $this->sqlNeedsUpdate()
+            'SELECT * FROM linkbackcontent, linkbacks'
+            . ' WHERE l_id = lc_l_id' . $this->sqlNeedsUpdate()
         );
         $items = 0;
         while ($contentRow = $res->fetch(\PDO::FETCH_OBJ)) {
             ++$items;
             $this->extractContent($contentRow);
         }
-        $this->log->info('Finished extracting %d pingback contents.', $items);
+        $this->log->info('Finished extracting %d linkback contents.', $items);
     }
 
     protected function extractContent($contentRow)
     {
         $doc = new \DOMDocument();
-        $typeParts = explode(';', $contentRow->pc_mime_type);
+        $typeParts = explode(';', $contentRow->lc_mime_type);
         $type = $typeParts[0];
         if ($type == 'application/xhtml+xml'
             || $type == 'application/xml'
             || $type == 'text/xml'
         ) {
-            $doc->loadXML($contentRow->pc_fulltext);
+            $doc->loadXML($contentRow->lc_fulltext);
         } else { 
-            $doc->loadHTML($contentRow->pc_fulltext);
+            $doc->loadHTML($contentRow->lc_fulltext);
         }
 
         //delete old content
         $this->db->exec(
             'DELETE FROM rbookmarks WHERE'
-            . ' rb_pc_id = ' . $this->db->quote($contentRow->pc_id)
+            . ' rb_lc_id = ' . $this->db->quote($contentRow->lc_id)
         );
         $this->db->exec(
             'DELETE FROM rcomments WHERE'
-            . ' rc_pc_id = ' . $this->db->quote($contentRow->pc_id)
+            . ' rc_lc_id = ' . $this->db->quote($contentRow->lc_id)
         );
         $this->db->exec(
             'DELETE FROM rlinks WHERE'
-            . ' rl_pc_id = ' . $this->db->quote($contentRow->pc_id)
+            . ' rl_lc_id = ' . $this->db->quote($contentRow->lc_id)
         );
 
         $ce = new Content_Extractor_Comment($this->deps->log);
-        $data = $ce->extract($doc, $contentRow->p_source, $contentRow->p_target);
+        $data = $ce->extract($doc, $contentRow->l_source, $contentRow->l_target);
         if ($data !== null) {
             $this->log->info('Comment found');
             var_dump($data);
             $this->db->exec(
                 'INSERT INTO rcomments SET'
-                . '  rc_p_id = ' . $this->db->quote($contentRow->p_id)
-                . ', rc_pc_id = ' . $this->db->quote($contentRow->pc_id)
-                . ', rc_source = ' . $this->db->quote($contentRow->p_source)
-                . ', rc_target = ' . $this->db->quote($contentRow->p_target)
+                . '  rc_l_id = ' . $this->db->quote($contentRow->l_id)
+                . ', rc_lc_id = ' . $this->db->quote($contentRow->lc_id)
+                . ', rc_source = ' . $this->db->quote($contentRow->l_source)
+                . ', rc_target = ' . $this->db->quote($contentRow->l_target)
                 . ', rc_title = ' . $this->db->quote($data['title'])
                 . ', rc_author_name = ' . $this->db->quote($data['author_name'])
                 . ', rc_author_url = ' . $this->db->quote($data['author_url'])
@@ -85,15 +85,15 @@ class Content_Extractor
         //FIXME: bookmark
 
         $ce = new Content_Extractor_Link($this->deps->log);
-        $data = $ce->extract($doc, $contentRow->p_source, $contentRow->p_target);
+        $data = $ce->extract($doc, $contentRow->l_source, $contentRow->l_target);
         if ($data !== null) {
             $this->log->info('Link found');
             $this->db->exec(
                 'INSERT INTO rlinks SET'
-                . '  rl_p_id = ' . $this->db->quote($contentRow->p_id)
-                . ', rl_pc_id = ' . $this->db->quote($contentRow->pc_id)
-                . ', rl_source = ' . $this->db->quote($contentRow->p_source)
-                . ', rl_target = ' . $this->db->quote($contentRow->p_target)
+                . '  rl_l_id = ' . $this->db->quote($contentRow->l_id)
+                . ', rl_lc_id = ' . $this->db->quote($contentRow->lc_id)
+                . ', rl_source = ' . $this->db->quote($contentRow->l_source)
+                . ', rl_target = ' . $this->db->quote($contentRow->l_target)
                 . ', rl_title = ' . $this->db->quote($data['title'])
                 . ', rl_author_name = ' . $this->db->quote($data['author_name'])
                 . ', rl_author_url = ' . $this->db->quote($data['author_url'])
@@ -111,9 +111,9 @@ class Content_Extractor
     protected function setDetectedType($contentRow, $type)
     {
         $this->db->exec(
-            'UPDATE pingbackcontent'
-            . ' SET pc_detected_type = ' . $this->db->quote($type)
-            . ' WHERE pc_id = ' . $this->db->quote($contentRow->pc_id)
+            'UPDATE linkbackcontent'
+            . ' SET lc_detected_type = ' . $this->db->quote($type)
+            . ' WHERE lc_id = ' . $this->db->quote($contentRow->lc_id)
         );
     }
 
@@ -123,7 +123,7 @@ class Content_Extractor
         if ($this->deps->options['force']) {
             return '';
         }
-        return ' AND pc_detected_type = ""';
+        return ' AND lc_detected_type = ""';
     }
 
 }
index de912c1c5b22d21d9d311e39aa8f4ad77009ba0d..e1706f06ddb5c225ec594943f9fa40fbbd831f78 100644 (file)
@@ -14,39 +14,36 @@ class Content_Fetcher
     }
 
     /**
-     * Fetches HTML content of all pingbacks that are marked as "needs update"
+     * Fetches HTML content of all linkbacks that are marked as "needs update"
      */
     public function updateAll()
     {
-        $this->log->info('Fetching pingback content..');
+        $this->log->info('Fetching linkback content..');
         $res = $this->db->query(
-            'SELECT * FROM pingbacks'
-            . ' WHERE p_use = 1' . $this->sqlNeedsUpdate()
+            'SELECT * FROM linkbacks'
+            . ' WHERE l_use = 1' . $this->sqlNeedsUpdate()
         );
         $items = 0;
         while ($pingbackRow = $res->fetch(\PDO::FETCH_OBJ)) {
             ++$items;
             $this->updateContent($pingbackRow);
         }
-        $this->log->info('Finished fetching %d pingback sources.', $items);
+        $this->log->info('Finished fetching %d linkback sources.', $items);
     }
 
     protected function updateContent($pingbackRow)
     {
         $this->log->info(
             'Fetching pingback source #%d: %s',
-            $pingbackRow->p_id, $pingbackRow->p_source
+            $pingbackRow->l_id, $pingbackRow->l_source
         );
 
-        $req = new \HTTP_Request2($pingbackRow->p_source);
+        $req = new \HTTP_Request2($pingbackRow->l_source);
         $req->setHeader('User-Agent', 'stapibas');
         $req->setHeader(
             'Accept',
             'application/xhtml+xml; q=1'
-            . ', application/xml; q=0.9'
-            . ', text/xml; q=0.9'
             . ', text/html; q=0.5'
-            . ', */*; q=0.1'
         );
 
         $res = $req->send();
@@ -56,23 +53,23 @@ class Content_Fetcher
             return;
         }
 
-        $qPid = $this->db->quote($pingbackRow->p_id);
-        $this->db->exec('DELETE FROM pingbackcontent WHERE pc_p_id = ' . $qPid);
-        $this->db->exec('DELETE FROM rbookmarks WHERE rb_p_id = ' . $qPid);
-        $this->db->exec('DELETE FROM rcomments  WHERE rc_p_id = ' . $qPid);
-        $this->db->exec('DELETE FROM rlinks     WHERE rl_p_id = ' . $qPid);
+        $qLid = $this->db->quote($pingbackRow->l_id);
+        $this->db->exec('DELETE FROM linkbackcontent WHERE lc_l_id = ' . $qLid);
+        $this->db->exec('DELETE FROM rbookmarks WHERE rb_l_id = ' . $qLid);
+        $this->db->exec('DELETE FROM rcomments  WHERE rc_l_id = ' . $qLid);
+        $this->db->exec('DELETE FROM rlinks     WHERE rl_l_id = ' . $qLid);
 
         $this->db->exec(
-            'INSERT INTO pingbackcontent SET'
-            . '  pc_p_id = ' . $qPid
-            . ', pc_mime_type = '
+            'INSERT INTO linkbackcontent SET'
+            . '  lc_l_id = ' . $qLid
+            . ', lc_mime_type = '
             . $this->db->quote($res->getHeader('content-type'))
-            . ', pc_fulltext = ' . $this->db->quote($res->getBody())
+            . ', lc_fulltext = ' . $this->db->quote($res->getBody())
         );
         $this->db->exec(
-            'UPDATE pingbacks'
-            . ' SET p_needs_update = 0'
-            . ' WHERE p_id = ' . $this->db->quote($pingbackRow->p_id)
+            'UPDATE linkbacks'
+            . ' SET l_needs_update = 0'
+            . ' WHERE l_id = ' . $this->db->quote($pingbackRow->l_id)
         );
     }
 
@@ -82,7 +79,7 @@ class Content_Fetcher
         if ($this->deps->options['force']) {
             return '';
         }
-        return ' AND p_needs_update = 1';
+        return ' AND l_needs_update = 1';
     }
 
 }
index 69045b521fb467bb5e9b93c095d78d5e00c5fb4e..0812f0fe11c9f85e50c7f168ff80b1db64ed6c35 100644 (file)
@@ -16,7 +16,7 @@ class Feed_PingUrls
         $this->db   = $deps->db;
         $this->log  = $deps->log;
 
-        $this->pbc = new \PEAR2\Services\Pingback\Client();
+        $this->pbc = new \PEAR2\Services\Linkback\Client();
 
         $req = new \HTTP_Request2();
         $req->setConfig(
similarity index 67%
rename from src/stapibas/Pingback/DbStorage.php
rename to src/stapibas/Linkback/DbStorage.php
index 4fa45a6ef66bf303daf701eb89fbe418b05810b8..36b7c061eceb45953e49edc3bf8f4b985363cbda 100644 (file)
@@ -1,10 +1,10 @@
 <?php
 namespace stapibas;
 
-class Pingback_DbStorage
-    implements \PEAR2\Services\Pingback\Server\Callback\IStorage,
-    \PEAR2\Services\Pingback\Server\Callback\ILink,
-    \PEAR2\Services\Pingback\Server\Callback\ITarget
+class Linkback_DbStorage
+    implements \PEAR2\Services\Linkback\Server\Callback\IStorage,
+    \PEAR2\Services\Linkback\Server\Callback\ILink,
+    \PEAR2\Services\Linkback\Server\Callback\ITarget
 {
     public function __construct(PDO $db)
     {
@@ -23,13 +23,13 @@ class Pingback_DbStorage
     public function verifyTargetExists($target)
     {
         $res = $this->db->query(
-            'SELECT COUNT(*) as count FROM pingbacktargets'
-            . ' WHERE ' . $this->db->quote($target) . ' LIKE pt_url'
+            'SELECT COUNT(*) as count FROM linkbacktargets'
+            . ' WHERE ' . $this->db->quote($target) . ' LIKE lt_url'
         );
         $answer = $res->fetch(\PDO::FETCH_OBJ);
         if ($answer->count == 0) {
             throw new \Exception(
-                'The specified target URI cannot be used as a target.',
+                'The specified target URI is not allowed as target.',
                 33
             );
         }
@@ -37,27 +37,27 @@ class Pingback_DbStorage
         return true;
     }
 
-    public function storePingback(
+    public function storeLinkback(
         $target, $source, $sourceBody, \HTTP_Request2_Response $res
     ) {
         if ($this->alreadyExists($target, $source)) {
             throw new \Exception(
-                'Pingback from ' . $source . ' to ' . $target
+                'Linkback from ' . $source . ' to ' . $target
                 . ' has already been registered.',
                 48
             );
         }
         $stmt = $this->db->prepare(
-            'INSERT INTO pingbacks SET'
-            . '  p_source = :source'
-            . ', p_target = :target'
-            . ', p_time = NOW()'
-            . ', p_client_ip = :ip'
-            . ', p_client_agent = :agent'
-            . ', p_client_referer = :referer'
-            . ', p_needs_review = 1'
-            . ', p_use = 1'
-            . ', p_needs_update = 1'
+            'INSERT INTO linkbacks SET'
+            . '  l_source = :source'
+            . ', l_target = :target'
+            . ', l_time = NOW()'
+            . ', l_client_ip = :ip'
+            . ', l_client_agent = :agent'
+            . ', l_client_referer = :referer'
+            . ', l_needs_review = 1'
+            . ', l_use = 1'
+            . ', l_needs_update = 1'
         );
         $stmt->execute(
             array(
@@ -76,9 +76,9 @@ class Pingback_DbStorage
     protected function alreadyExists($target, $source)
     {
         $res = $this->db->query(
-            'SELECT COUNT(*) as count FROM pingbacks'
-            . ' WHERE p_source = ' . $this->db->quote($source)
-            . ' AND p_target = ' . $this->db->quote($target)
+            'SELECT COUNT(*) as count FROM linkbacks'
+            . ' WHERE l_source = ' . $this->db->quote($source)
+            . ' AND l_target = ' . $this->db->quote($target)
         );
         $answer = $res->fetch(\PDO::FETCH_OBJ);
         return $answer->count > 0;
@@ -88,7 +88,7 @@ class Pingback_DbStorage
      * Verifies that a link from $source to $target exists.
      *
      * @param string $target     Target URI that should be linked in $source
-     * @param string $source     Pingback source URI that should link to target
+     * @param string $source     Linkback source URI that should link to target
      * @param string $sourceBody Content of $source URI
      * @param object $res        HTTP response from fetching $source
      *
similarity index 64%
rename from src/stapibas/Pingback/Mailer.php
rename to src/stapibas/Linkback/Mailer.php
index 3b9e3ff68478fc709172c5b429ea98b1e2a5f2de..9a628f0b8f67bf38bda8f9e2bde71885cc593146 100644 (file)
@@ -1,16 +1,16 @@
 <?php
 namespace stapibas;
 
-class Pingback_Mailer
-    implements \PEAR2\Services\Pingback\Server\Callback\IStorage
+class Linkback_Mailer
+    implements \PEAR2\Services\Linkback\Server\Callback\IStorage
 {
-    public function storePingback(
+    public function storeLinkback(
         $target, $source, $sourceBody, \HTTP_Request2_Response $res
     ) {
         mail(
             'cweiske@cweiske.de',
-            'New pingback',
-            "A pingback just came in, for\n"
+            'New linkback',
+            "A linkback just came in, for\n"
             . '> '  . $target . "\n"
             . "from\n"
             . '> ' . $source . "\n"
index ca26584cf5bc39e6fe39d3ca6039a0fa9167027b..620cad02f15c5b6662c0b202699290dcd8a37c26 100644 (file)
@@ -42,26 +42,26 @@ class Renderer_Html
         );
 
         $stmt = $this->db->query(
-            'SELECT * FROM pingbacks, rbookmarks'
-            . ' WHERE p_id = rb_p_id AND p_use = 1'
-            . ' AND p_target = ' . $this->db->quote($url)
-            . ' ORDER BY p_time ASC'
+            'SELECT * FROM linkbacks, rbookmarks'
+            . ' WHERE l_id = rb_l_id AND l_use = 1'
+            . ' AND l_target = ' . $this->db->quote($url)
+            . ' ORDER BY l_time ASC'
         );
         $arData['bookmarks'] = $stmt->fetchAll();
 
         $stmt = $this->db->query(
-            'SELECT * FROM pingbacks, rcomments'
-            . ' WHERE p_id = rc_p_id AND p_use = 1'
-            . ' AND p_target = ' . $this->db->quote($url)
-            . ' ORDER BY p_time ASC'
+            'SELECT * FROM linkbacks, rcomments'
+            . ' WHERE l_id = rc_l_id AND l_use = 1'
+            . ' AND l_target = ' . $this->db->quote($url)
+            . ' ORDER BY l_time ASC'
         );
         $arData['comments'] = $stmt->fetchAll();
 
         $stmt = $this->db->query(
-            'SELECT * FROM pingbacks, rlinks'
-            . ' WHERE p_id = rl_p_id AND p_use = 1'
-            . ' AND p_target = ' . $this->db->quote($url)
-            . ' ORDER BY p_time ASC'
+            'SELECT * FROM linkbacks, rlinks'
+            . ' WHERE l_id = rl_l_id AND l_use = 1'
+            . ' AND l_target = ' . $this->db->quote($url)
+            . ' ORDER BY l_time ASC'
         );
         $arData['links'] = $stmt->fetchAll();
 
index 2a2c67477e3af1da210ed99c7b222b5251c169dd..e5c2755c5dc9526cdc2d93dc14d2960abcc70802 100644 (file)
@@ -12,8 +12,8 @@ require_once 'stapibas/autoloader.php';
 $db = new PDO($dbdsn, $dbuser, $dbpass);
 $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 
-$s = new \PEAR2\Services\Pingback\Server();
-$s->addCallback(new Pingback_DbStorage($db));
-$s->addCallback(new Pingback_Mailer());
+$s = new \PEAR2\Services\Linkback\Server();
+$s->addCallback(new Linkback_DbStorage($db));
+$s->addCallback(new Linkback_Mailer());
 $s->run();
 ?>