function applyFilters($q, $au)
{
$this->buildDB();
- DB_DataObject::debugLevel(1);
+ //DB_DataObject::debugLevel(1);
if (!empty($q['query']['_with_en'])) {
$this->buildDB(); // ensure we have the full database...
}
}
+
+ if(!empty($q['_with_geoip_count'])) {
+
+ $this->selectAdd("
+ (
+ SELECT
+ COUNT(geoip_division.id)
+ FROM
+ geoip_division
+ WHERE
+ geoip_division.country = i18n.lkey
+ ) AS no_of_division,
+ (
+ SELECT
+ COUNT(geoip_city.id)
+ FROM
+ geoip_city
+ WHERE
+ geoip_city.country = i18n.lkey
+ ) AS no_of_city
+ ");
+
+ }
}
+ function lookupCode($inlang,$ltype,$name)
+ {
+ $x = DB_DataObject::factory('i18n');
+ $x->ltype = $ltype;
+ $x->lval = $name;
+ $x->inlang= $inlang;
+
+ $x->limit(1);
+ if ($x->find(true) && !empty($x->lkey)) {
+ return $x->lkey;
+ }
+ return '';
+
+
+ }
+
+
function translate($inlang,$ltype,$kval)
{