migrated and improved two functions regarding PDO stuff, refs #1287

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2013-11-06 17:21:56 +01:00
parent f2643103b3
commit 3e4697eb51
2 changed files with 13 additions and 12 deletions

View File

@@ -26,17 +26,19 @@
*
* @return boolean
*/
function domainHasApsInstances($domainid = 0)
{
global $db, $settings, $theme;
function domainHasApsInstances($domainid = 0) {
global $settings, $theme;
if($settings['aps']['aps_active'] == '1')
{
if($domainid > 0)
{
$instances = $db->query_first("SELECT COUNT(`ID`) AS `count` FROM `" . TABLE_APS_SETTINGS . "` WHERE `Name`='main_domain' AND `Value`='" . (int)$domainid . "'");
if((int)$instances['count'] != 0)
{
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;
}
}