public function delete_group($group_id)
 {
     global $vbulletin;
     $indexer = vBSphinxSearch_Core::get_instance()->get_core_indexer();
     $sql = "SELECT\n                    " . $this->get_contenttypeid() . " AS contenttypeid,\n                    blog_text.blogtextid AS primaryid\n                FROM\n                    " . TABLE_PREFIX . "blog_text AS blog_text\n                LEFT JOIN\n                    " . TABLE_PREFIX . "blog AS blog ON blog.firstblogtextid = blog_text.blogtextid\n            \tWHERE\n                    blog_text.blogid = " . intval($group_id) . "\n                    AND blog.blogid IS NULL";
     $res = $vbulletin->db->query_read_slave($sql);
     while ($row = $vbulletin->db->fetch_array($res)) {
         $indexer->delete($row['contenttypeid'], $row['primaryid']);
     }
     return true;
 }
Beispiel #2
0
 /**
  * Called on thread hard-delete. Remove all posts from index.
  *
  * @param int $id the thread id
  */
 public function delete_thread($id)
 {
     global $vbulletin;
     $indexer = vBSphinxSearch_Core::get_instance()->get_core_indexer();
     $sql = "SELECT\r\n                    " . $this->get_contenttypeid() . " AS contenttypeid,\r\n                    post.postid AS primaryid\r\n                FROM\r\n                    " . TABLE_PREFIX . "post as post\r\n            \tWHERE\r\n                    post.threadid = " . intval($id);
     $res = $vbulletin->db->query_read_slave($sql);
     while ($row = $vbulletin->db->fetch_array($res)) {
         $indexer->delete($row['contenttypeid'], $row['primaryid']);
     }
     return true;
 }