public function translate($value) { $value = trim($value); $db = JO_Db::getDefaultAdapter(); $check_query = $db->select()->from('language_keywords', 'COUNT(language_keywords_id)')->where('`key` = ?', new JO_Db_Expr("MD5(" . $db->quote($value) . ")"))->where('module = ?', JO_Request::getInstance()->getModule()); $check = $db->fetchOne($check_query); if ($check < 1) { $db->insert('language_keywords', array('keyword' => $value, 'key' => new JO_Db_Expr("MD5(" . $db->quote($value) . ")"), 'module' => JO_Request::getInstance()->getModule())); } return parent::translate($value, $value); }
public function translate($key, $value = null) { $key = trim($key); // $db = JO_Db::getDefaultAdapter(); // // $check_query = $db->select() // ->from('language_keywords', 'COUNT(language_keywords_id)') // ->where('`key` = ?', /* new JO_Db_Expr("MD5(".$db->quote($key).")") */ md5($key)) // ->where('module = ?', JO_Request::getInstance()->getModule()); // // $check = $db->fetchOne($check_query); // // if ($check < 1) { $check = isset(self::$data[$key]); if (!$check) { Helper_Db::insert('language_keywords', array('keyword' => $key, 'key' => md5($key), 'module' => JO_Request::getInstance()->getModule())); } return parent::translate($key, $key); }