Completed
Branch master (1b2f30)
by Michael
06:29 queued 03:22
created

blocks/faqs_random_how.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
/**
4
 * Module: SmartFAQ
5
 * Author: The SmartFactory <www.smartfactory.ca>
6
 * Licence: GNU
7
 */
8
// defined('XOOPS_ROOT_PATH') || exit('XOOPS root path not defined');
0 ignored issues
show
Unused Code Comprehensibility introduced by
70% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
9
10 View Code Duplication
function b_faqs_random_how_show()
11
{
12
    include_once(XOOPS_ROOT_PATH . '/modules/smartfaq/include/functions.php');
13
14
    $block = array();
15
16
    // Creating the faq handler object
17
    $faqHandler = sf_gethandler('faq');
18
19
    // creating the FAQ object
20
    $faqsObj = $faqHandler->getRandomFaq('howdoi', array(_SF_STATUS_PUBLISHED, _SF_STATUS_NEW_ANSWER));
21
22
    if ($faqsObj) {
23
        $block['content']     = $faqsObj->howdoi();
24
        $block['id']          = $faqsObj->faqid();
25
        $block['lang_answer'] = _MB_SF_ANSWERHERE;
26
    }
27
28
    return $block;
29
}
30