@@ -1766,16 +1766,16 @@ discard block |
||
1766 | 1766 | return true; |
1767 | 1767 | } |
1768 | 1768 | |
1769 | - /** |
|
1770 | - * Returns the visibility of a question. |
|
1771 | - * |
|
1772 | - * @param int $questionId |
|
1773 | - * |
|
1774 | - * @return string |
|
1775 | - */ |
|
1776 | - public function getVisibilityOfQuestion($questionId) |
|
1777 | - { |
|
1778 | - $query = sprintf(" |
|
1769 | + /** |
|
1770 | + * Returns the visibility of a question. |
|
1771 | + * |
|
1772 | + * @param int $questionId |
|
1773 | + * |
|
1774 | + * @return string |
|
1775 | + */ |
|
1776 | + public function getVisibilityOfQuestion($questionId) |
|
1777 | + { |
|
1778 | + $query = sprintf(" |
|
1779 | 1779 | SELECT |
1780 | 1780 | is_visible |
1781 | 1781 | FROM |
@@ -1789,15 +1789,15 @@ discard block |
||
1789 | 1789 | $this->_config->getLanguage()->getLanguage() |
1790 | 1790 | ); |
1791 | 1791 | |
1792 | - $result = $this->_config->getDb()->query($query); |
|
1793 | - if ($this->_config->getDb()->numRows($result) > 0) { |
|
1794 | - $row = $this->_config->getDb()->fetchObject($result); |
|
1792 | + $result = $this->_config->getDb()->query($query); |
|
1793 | + if ($this->_config->getDb()->numRows($result) > 0) { |
|
1794 | + $row = $this->_config->getDb()->fetchObject($result); |
|
1795 | 1795 | |
1796 | - return $row->is_visible; |
|
1797 | - } |
|
1796 | + return $row->is_visible; |
|
1797 | + } |
|
1798 | 1798 | |
1799 | - return; |
|
1800 | - } |
|
1799 | + return; |
|
1800 | + } |
|
1801 | 1801 | |
1802 | 1802 | /** |
1803 | 1803 | * Sets the visibilty of a question. |
@@ -2318,18 +2318,18 @@ discard block |
||
2318 | 2318 | return $question; |
2319 | 2319 | } |
2320 | 2320 | |
2321 | - /** |
|
2322 | - * Returns all open questions. |
|
2323 | - * |
|
2324 | - * @param $all boolean If true, then return visible and unvisble questions; otherwise only visible ones |
|
2325 | - * |
|
2326 | - * @return array |
|
2327 | - */ |
|
2328 | - public function getAllOpenQuestions($all = true) |
|
2329 | - { |
|
2330 | - $questions = []; |
|
2331 | - |
|
2332 | - $query = sprintf(" |
|
2321 | + /** |
|
2322 | + * Returns all open questions. |
|
2323 | + * |
|
2324 | + * @param $all boolean If true, then return visible and unvisble questions; otherwise only visible ones |
|
2325 | + * |
|
2326 | + * @return array |
|
2327 | + */ |
|
2328 | + public function getAllOpenQuestions($all = true) |
|
2329 | + { |
|
2330 | + $questions = []; |
|
2331 | + |
|
2332 | + $query = sprintf(" |
|
2333 | 2333 | SELECT |
2334 | 2334 | id, lang, username, email, category_id, question, created, answer_id, is_visible |
2335 | 2335 | FROM |
@@ -2344,9 +2344,9 @@ discard block |
||
2344 | 2344 | ($all == false ? " AND is_visible = 'Y'" : '') |
2345 | 2345 | ); |
2346 | 2346 | |
2347 | - if ($result = $this->_config->getDb()->query($query)) { |
|
2348 | - while ($row = $this->_config->getDb()->fetchObject($result)) { |
|
2349 | - $questions[] = array( |
|
2347 | + if ($result = $this->_config->getDb()->query($query)) { |
|
2348 | + while ($row = $this->_config->getDb()->fetchObject($result)) { |
|
2349 | + $questions[] = array( |
|
2350 | 2350 | 'id' => $row->id, |
2351 | 2351 | 'lang' => $row->lang, |
2352 | 2352 | 'username' => $row->username, |
@@ -2357,11 +2357,11 @@ discard block |
||
2357 | 2357 | 'answer_id' => $row->answer_id, |
2358 | 2358 | 'is_visible' => $row->is_visible, |
2359 | 2359 | ); |
2360 | - } |
|
2361 | - } |
|
2360 | + } |
|
2361 | + } |
|
2362 | 2362 | |
2363 | - return $questions; |
|
2364 | - } |
|
2363 | + return $questions; |
|
2364 | + } |
|
2365 | 2365 | |
2366 | 2366 | /** |
2367 | 2367 | * Updates an existing voting record. |
@@ -1,20 +1,20 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * Linkverifier Helper class for phpMyFAQ. |
|
4 | - * |
|
5 | - * PHP Version 5.5 |
|
6 | - * |
|
7 | - * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | - * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | - * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | - * |
|
11 | - * @category phpMyFAQ |
|
12 | - * @author Thorsten Rinne <[email protected]> |
|
13 | - * @copyright 2012-2015 phpMyFAQ Team |
|
14 | - * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
15 | - * @link http://www.phpmyfaq.de |
|
16 | - * @since 2012-09-03 |
|
17 | - */ |
|
3 | + * Linkverifier Helper class for phpMyFAQ. |
|
4 | + * |
|
5 | + * PHP Version 5.5 |
|
6 | + * |
|
7 | + * This Source Code Form is subject to the terms of the Mozilla Public License, |
|
8 | + * v. 2.0. If a copy of the MPL was not distributed with this file, You can |
|
9 | + * obtain one at http://mozilla.org/MPL/2.0/. |
|
10 | + * |
|
11 | + * @category phpMyFAQ |
|
12 | + * @author Thorsten Rinne <[email protected]> |
|
13 | + * @copyright 2012-2015 phpMyFAQ Team |
|
14 | + * @license http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0 |
|
15 | + * @link http://www.phpmyfaq.de |
|
16 | + * @since 2012-09-03 |
|
17 | + */ |
|
18 | 18 | if (!defined('IS_VALID_PHPMYFAQ')) { |
19 | 19 | exit(); |
20 | 20 | } |