Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Ignore list as separate table.

  • Loading branch information...
commit c769b336111a65fd67ca5b134a646b03b54c9aa1 1 parent 9fd76fb
@dracos dracos authored
Showing with 6 additions and 2 deletions.
  1. +5 −1 db/schema.sql
  2. +1 −1  www/includes/wikipedia.php
View
6 db/schema.sql
@@ -170,7 +170,11 @@ CREATE TABLE `pbc_members` (
CREATE TABLE `titles` (
`title` varchar(190) NOT NULL default '',
- `ignore` tinyint(1) NOT NULL default 0,
+ PRIMARY KEY (`title`)
+);
+
+CREATE TABLE `titles_ignored` (
+ `title` varchar(190) NOT NULL default '',
PRIMARY KEY (`title`)
);
View
2  www/includes/wikipedia.php
@@ -65,7 +65,7 @@ function wikipedize ($source) {
$matched = array();
$db = new ParlDB;
$source = explode('|||', $source);
- $q = $db->query("SELECT title FROM titles WHERE title IN ('" . join("','", $phrases) . "') AND ignore=0");
+ $q = $db->query("SELECT title FROM titles LEFT JOIN titles_ignored ON titles.title=titles_ignored.title WHERE titles.title IN ('" . join("','", $phrases) . "') AND titles_ignored.title IS NULL");
$phrases = array();
for ($i=0; $i<$q->rows(); $i++) {
$phrases[] = $q->field($i, 'title');
Please sign in to comment.
Something went wrong with that request. Please try again.