Files
Froxlor/lib/functions/aps/function.domainHasApsInstances.php
Michael Kaufmann (d00p) 3e4697eb51 migrated and improved two functions regarding PDO stuff, refs #1287
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
2013-11-06 17:21:56 +01:00

48 lines
1.2 KiB
PHP

<?php
/**
* This file is part of the Froxlor project.
* Copyright (c) 2010 the Froxlor Team (see authors).
*
* For the full copyright and license information, please view the COPYING
* file that was distributed with this source code. You can also view the
* COPYING file online at http://files.froxlor.org/misc/COPYING.txt
*
* @copyright (c) the authors
* @author Froxlor team <team@froxlor.org> (2010-)
* @license GPLv2 http://files.froxlor.org/misc/COPYING.txt
* @package Language
*
*/
/**
* Function domainHasApsInstances
*
* Checks if a given domain id
* is used for APS instances
* (if APS enabled, else always false)
*
* @param int domain-id
*
* @return boolean
*/
function domainHasApsInstances($domainid = 0) {
global $settings, $theme;
if ($settings['aps']['aps_active'] == '1') {
if ($domainid > 0) {
$instances_stmt = Database::prepare("
SELECT COUNT(`ID`) AS `count` FROM `" . TABLE_APS_SETTINGS . "`
WHERE `Name` = 'main_domain' AND `Value` = :domainid"
);
$instances = Database::pexecute_first($instances_stmt, array('domainid' => $domainid));
if ((int)$instances['count'] != 0) {
return true;
}
}
}
return false;
}