// Remove bad _SQL_USE_SLAVE_ uses + normalize Db->executeS(), Db->execute() and Db->numRows() names

This commit is contained in:
rMalie
2011-10-10 12:18:56 +00:00
parent 149c814a45
commit 9510337b1d
280 changed files with 1971 additions and 1966 deletions
+7 -7
View File
@@ -64,7 +64,7 @@ class SEKeywords extends ModuleGraph
return false;
Configuration::updateValue('SEK_MIN_OCCURENCES', 1);
Configuration::updateValue('SEK_FILTER_KW', '');
return Db::getInstance()->Execute('
return Db::getInstance()->execute('
CREATE TABLE `'._DB_PREFIX_.'sekeyword` (
id_sekeyword INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
id_shop INTEGER UNSIGNED NOT NULL DEFAULT \'1\',
@@ -79,7 +79,7 @@ class SEKeywords extends ModuleGraph
{
if (!parent::uninstall())
return false;
return (Db::getInstance()->Execute('DROP TABLE `'._DB_PREFIX_.'sekeyword`'));
return (Db::getInstance()->execute('DROP TABLE `'._DB_PREFIX_.'sekeyword`'));
}
public function hookTop($params)
@@ -88,7 +88,7 @@ class SEKeywords extends ModuleGraph
return;
if ($keywords = $this->getKeywords($_SERVER['HTTP_REFERER']))
Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'sekeyword` (`keyword`, `date_add`, `id_shop`, `id_group_shop`)
Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'sekeyword` (`keyword`, `date_add`, `id_shop`, `id_group_shop`)
VALUES (\''.pSQL(Tools::strtolower(trim($keywords))).'\', NOW(), '.$this->context->shop->getID().', '.$this->context->shop->getGroupID().')');
}
@@ -103,7 +103,7 @@ class SEKeywords extends ModuleGraph
if (Tools::getValue('export'))
$this->csvExport(array('type' => 'pie'));
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.ModuleGraph::getDateBetween().$this->_query2);
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query.ModuleGraph::getDateBetween().$this->_query2);
$total = count($result);
$this->_html = '<fieldset class="width3"><legend><img src="../modules/'.$this->name.'/logo.gif" /> '.$this->displayName.'</legend>
'.$total.' '.($total == 1 ? $this->l('keyword matches your query.') : $this->l('keywords match your query.')).'<div class="clear">&nbsp;</div>';
@@ -157,7 +157,7 @@ class SEKeywords extends ModuleGraph
if (!isset($parsedUrl['query']))
return false;
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT `server`, `getvar` FROM `'._DB_PREFIX_.'search_engine`');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT `server`, `getvar` FROM `'._DB_PREFIX_.'search_engine`');
foreach ($result as $index => $row)
{
$host =& $row['server'];
@@ -179,12 +179,12 @@ class SEKeywords extends ModuleGraph
protected function getData($layers)
{
$this->_titles['main'] = $this->l('10 first keywords');
$totalResult = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2);
$totalResult = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query.$this->getDate().$this->_query2);
$total = 0;
$total2 = 0;
foreach ($totalResult as $totalRow)
$total += $totalRow['occurences'];
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS($this->_query.$this->getDate().$this->_query2.' LIMIT 9');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->_query.$this->getDate().$this->_query2.' LIMIT 9');
foreach ($result as $row)
{
$this->_legend[] = $row['keyword'];