<?php

defined('MBQ_IN_IT') or exit;
/**
 * This file is not needed by default!
 * Run this first before call MbqMain::initAppEnv() when you need!

 */
/* Please write any codes you need in the following area before call MbqMain::initAppEnv()! */


function TT_GetKunenaVersion()
{
    $kunenaVersion = KunenaForum::version();
    if(version_compare($kunenaVersion, '5.0.0', '>='))
    {
        return 5;
    }
    elseif(version_compare($kunenaVersion, '4.0.0', '>='))
    {
        return 4;
    }
    else
    {
        return 3;
    }
}
function TT_forumIsIgnored($forumId)
{
    $plugin = JPluginHelper::getPlugin('system', 'tapatalk');
    $pluginParams = new JRegistry($plugin->params);
    $hideForums = $pluginParams->get('tapatalk_hide_forums');
    if(!is_array($hideForums)) {
        $hideForums = explode(',', $hideForums);
    }
    if(in_array($forumId, $hideForums))
    {
        return true;
    }
    return false;

}
