the-art-of-joomla-archive /exchange/code/trunk/administrator/components/com_exchange/helpers/catalog.php

Language PHP Lines 38
MD5 Hash 8f1072d98288dcef136cbd02c7353454 Estimated Cost $468 (why?)
Repository https://bitbucket.org/eddieajau/the-art-of-joomla-archive View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
 * @version		$Id: catalog.php 280 2010-09-18 02:14:15Z eddieajau $
 * @package		NewLifeInIT
 * @subpackage	com_exchange
 * @copyright	Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
 * @license		GNU General Public License version 2 or later.
 * @link		http://www.theartofjoomla.com
 */

// no direct access
defined('_JEXEC') or die;

/**
 * @package		NewLifeInIT
 * @subpackage	com_exchange
 */
function lookupTaxonId($value, $typeId, $log = false)
{
	if (($value != '') and ($typeId != ''))
	{
		$db		= JFactory::getDBO();
		$clean	= trim(strtolower($value));
		$query	= 'SELECT id' .
				' FROM #__jxcatalog_taxa' .
				' WHERE title = '.$db->Quote($clean) .
				'  AND type_id = '.(int) $typeId;
		$db->setQuery($query);
		$data	= $db->loadResult();
		if ($log) {
			ExchangeLog::add(200, $db->getQuery());
		}
		return $data;
	}
	else {
		return null;
	}
}
Back to Top