@@ -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. |
@@ -28,17 +28,17 @@ discard block |
||
28 | 28 | * SQL constants definitions |
29 | 29 | */ |
30 | 30 | define('FAQ_SQL_ACTIVE_YES', 'yes'); |
31 | -define('FAQ_SQL_ACTIVE_NO', 'no'); |
|
31 | +define('FAQ_SQL_ACTIVE_NO', 'no'); |
|
32 | 32 | |
33 | 33 | /* |
34 | 34 | * Query type definitions |
35 | 35 | */ |
36 | -define('FAQ_QUERY_TYPE_DEFAULT', 'faq_default'); |
|
37 | -define('FAQ_QUERY_TYPE_APPROVAL', 'faq_approval'); |
|
38 | -define('FAQ_QUERY_TYPE_EXPORT_PDF', 'faq_export_pdf'); |
|
36 | +define('FAQ_QUERY_TYPE_DEFAULT', 'faq_default'); |
|
37 | +define('FAQ_QUERY_TYPE_APPROVAL', 'faq_approval'); |
|
38 | +define('FAQ_QUERY_TYPE_EXPORT_PDF', 'faq_export_pdf'); |
|
39 | 39 | define('FAQ_QUERY_TYPE_EXPORT_XHTML', 'faq_export_xhtml'); |
40 | -define('FAQ_QUERY_TYPE_EXPORT_XML', 'faq_export_xml'); |
|
41 | -define('FAQ_QUERY_TYPE_RSS_LATEST', 'faq_rss_latest'); |
|
40 | +define('FAQ_QUERY_TYPE_EXPORT_XML', 'faq_export_xml'); |
|
41 | +define('FAQ_QUERY_TYPE_RSS_LATEST', 'faq_rss_latest'); |
|
42 | 42 | |
43 | 43 | /* |
44 | 44 | * Sorting type definitions |
@@ -384,12 +384,12 @@ discard block |
||
384 | 384 | |
385 | 385 | $result = $this->_config->getDb()->query($query); |
386 | 386 | $num = $this->_config->getDb()->numRows($result); |
387 | - $pages = (int) ceil($num / $numPerPage); |
|
387 | + $pages = (int)ceil($num/$numPerPage); |
|
388 | 388 | |
389 | 389 | if ($page == 1) { |
390 | 390 | $first = 0; |
391 | 391 | } else { |
392 | - $first = $page * $numPerPage - $numPerPage; |
|
392 | + $first = $page*$numPerPage - $numPerPage; |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | if ($num > 0) { |
@@ -570,12 +570,12 @@ discard block |
||
570 | 570 | $result = $this->_config->getDb()->query($query); |
571 | 571 | |
572 | 572 | $num = $this->_config->getDb()->numRows($result); |
573 | - $pages = ceil($num / $this->_config->get('records.numberOfRecordsPerPage')); |
|
573 | + $pages = ceil($num/$this->_config->get('records.numberOfRecordsPerPage')); |
|
574 | 574 | |
575 | 575 | if ($page == 1) { |
576 | 576 | $first = 0; |
577 | 577 | } else { |
578 | - $first = ($page * $this->_config->get('records.numberOfRecordsPerPage')) - $this->_config->get('records.numberOfRecordsPerPage'); |
|
578 | + $first = ($page*$this->_config->get('records.numberOfRecordsPerPage')) - $this->_config->get('records.numberOfRecordsPerPage'); |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | if ($num > 0) { |
@@ -1258,7 +1258,7 @@ discard block |
||
1258 | 1258 | AND |
1259 | 1259 | lang = '%s'", |
1260 | 1260 | PMF_Db::getTablePrefix(), |
1261 | - (int) $faqId, |
|
1261 | + (int)$faqId, |
|
1262 | 1262 | $this->_config->getDb()->escape($faqLang) |
1263 | 1263 | ); |
1264 | 1264 | |
@@ -2311,7 +2311,7 @@ discard block |
||
2311 | 2311 | 'category_id' => $row->category_id, |
2312 | 2312 | 'question' => $row->question, |
2313 | 2313 | 'created' => $row->created, |
2314 | - 'is_visible' => $row->is_visible, ); |
|
2314 | + 'is_visible' => $row->is_visible,); |
|
2315 | 2315 | } |
2316 | 2316 | } |
2317 | 2317 | |
@@ -2479,7 +2479,7 @@ discard block |
||
2479 | 2479 | 'revision_id' => $row->revision_id, |
2480 | 2480 | 'user' => $row->usr, |
2481 | 2481 | 'date' => $row->datum, |
2482 | - 'changelog' => $row->what, ); |
|
2482 | + 'changelog' => $row->what,); |
|
2483 | 2483 | } |
2484 | 2484 | } |
2485 | 2485 | |
@@ -2790,13 +2790,13 @@ discard block |
||
2790 | 2790 | $mode, |
2791 | 2791 | PMF_Db::getTablePrefix(), |
2792 | 2792 | $mode, |
2793 | - (int) $recordId); |
|
2793 | + (int)$recordId); |
|
2794 | 2794 | |
2795 | 2795 | $result = $this->_config->getDb()->query($query); |
2796 | 2796 | |
2797 | 2797 | if ($this->_config->getDb()->numRows($result) > 0) { |
2798 | 2798 | while (($row = $this->_config->getDb()->fetchObject($result))) { |
2799 | - $permissions[] = (int) $row->permission; |
|
2799 | + $permissions[] = (int)$row->permission; |
|
2800 | 2800 | } |
2801 | 2801 | } |
2802 | 2802 | |
@@ -3043,7 +3043,7 @@ discard block |
||
3043 | 3043 | $lang |
3044 | 3044 | ); |
3045 | 3045 | |
3046 | - $retval = (bool) $this->_config->getDb()->query($update); |
|
3046 | + $retval = (bool)$this->_config->getDb()->query($update); |
|
3047 | 3047 | } |
3048 | 3048 | |
3049 | 3049 | return $retval; |
@@ -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 | } |