Index: trunk/extensions/Wikidata/OmegaWiki/WikiDataAPI.php |
— | — | @@ -109,23 +109,21 @@ |
110 | 110 | return str_replace(' ', '_', $spelling); |
111 | 111 | } |
112 | 112 | |
| 113 | + |
113 | 114 | function createPage($namespace, $title) { |
114 | 115 | $dbr = &wfGetDB(DB_MASTER); |
115 | 116 | $title = $dbr->addQuotes($title); |
116 | 117 | $timestamp = $dbr->timestamp(); |
117 | | - |
118 | | - echo "createPage(): namespace = $namespace and title = $title\n"; |
119 | 118 | $sql = "select page_id from page where page_namespace = $namespace and page_title = $title"; |
120 | 119 | $queryResult = $dbr->query($sql); |
121 | 120 | $page = $dbr->fetchObject($queryResult); |
122 | 121 | if (isset($page->page_id) ){ |
123 | 122 | return $page->page_id; |
124 | 123 | } |
125 | | - else{ |
| 124 | + else { |
126 | 125 | $sql = "insert into page(page_namespace,page_title,page_is_new,page_touched) ". |
127 | | - "values($namespace, $title, 1, $timestamp)"; |
| 126 | + "values($namespace, $title, 1, $timestamp)"; |
128 | 127 | $dbr->query($sql); |
129 | | - |
130 | 128 | return $dbr->insertId(); |
131 | 129 | } |
132 | 130 | } |