//delete old content
$this->db->exec(
- 'DELETE FROM rboomarks WHERE'
+ 'DELETE FROM rbookmarks WHERE'
. ' rb_pc_id = ' . $this->db->quote($contentRow->pc_id)
);
$this->db->exec(
var_dump($data);
$this->db->exec(
'INSERT INTO rcomments SET'
- . ' rc_pc_id = ' . $this->db->quote($contentRow->pc_id)
+ . ' 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_title = ' . $this->db->quote($data['title'])
. ', rc_content = ' . $this->db->quote($data['content'])
. ', rc_updated = NOW()'
);
+ $this->setDetectedType($contentRow, 'comment');
return;
}
$data = $ce->extract($doc, $contentRow->p_source, $contentRow->p_target);
if ($data !== null) {
$this->log->info('Link found');
- var_dump($data);
$this->db->exec(
'INSERT INTO rlinks SET'
- . ' rl_pc_id = ' . $this->db->quote($contentRow->pc_id)
+ . ' 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_title = ' . $this->db->quote($data['title'])
. ', rl_author_name = ' . $this->db->quote($data['author_name'])
. ', rl_author_url = ' . $this->db->quote($data['author_url'])
. ', rl_author_image = ' . $this->db->quote($data['author_image'])
- . ', rc_updated = NOW()'
+ . ', rl_updated = NOW()'
);
+ $this->setDetectedType($contentRow, 'link');
return;
}
+ $this->setDetectedType($contentRow, 'nothing');
$this->log->info('Nothing found');
}
+ 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)
+ );
+ }
+
protected function sqlNeedsUpdate()
{