| @@ 2259-2283 (lines=25) @@ | ||
| 2256 | * |
|
| 2257 | * @return string |
|
| 2258 | */ |
|
| 2259 | public function getVisibilityOfQuestion($questionId) |
|
| 2260 | { |
|
| 2261 | $query = sprintf(" |
|
| 2262 | SELECT |
|
| 2263 | is_visible |
|
| 2264 | FROM |
|
| 2265 | %sfaqquestions |
|
| 2266 | WHERE |
|
| 2267 | id = %d |
|
| 2268 | AND |
|
| 2269 | lang = '%s'", |
|
| 2270 | Db::getTablePrefix(), |
|
| 2271 | $questionId, |
|
| 2272 | $this->config->getLanguage()->getLanguage() |
|
| 2273 | ); |
|
| 2274 | ||
| 2275 | $result = $this->config->getDb()->query($query); |
|
| 2276 | if ($this->config->getDb()->numRows($result) > 0) { |
|
| 2277 | $row = $this->config->getDb()->fetchObject($result); |
|
| 2278 | ||
| 2279 | return $row->is_visible; |
|
| 2280 | } |
|
| 2281 | ||
| 2282 | return; |
|
| 2283 | } |
|
| 2284 | ||
| 2285 | /** |
|
| 2286 | * Sets the visibility of a question. |
|
| @@ 116-138 (lines=23) @@ | ||
| 113 | * @param string $value |
|
| 114 | * @return string|null |
|
| 115 | */ |
|
| 116 | public function fetch($key, $value) |
|
| 117 | { |
|
| 118 | $select = sprintf(" |
|
| 119 | SELECT |
|
| 120 | %s |
|
| 121 | FROM |
|
| 122 | %sfaquserdata |
|
| 123 | WHERE |
|
| 124 | %s = '%s'", |
|
| 125 | $key, |
|
| 126 | Db::getTablePrefix(), |
|
| 127 | $key, |
|
| 128 | $this->config->getDb()->escape($value) |
|
| 129 | ); |
|
| 130 | ||
| 131 | $res = $this->config->getDb()->query($select); |
|
| 132 | ||
| 133 | if (0 === $this->config->getDb()->numRows($res)) { |
|
| 134 | return null; |
|
| 135 | } else { |
|
| 136 | return $this->config->getDb()->fetchObject($res)->$key; |
|
| 137 | } |
|
| 138 | } |
|
| 139 | ||
| 140 | /** |
|
| 141 | * Sets the user data given by $field and $value. If $field |
|