1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-07 07:06:30 +02:00

Fix for $sql->retrieve when full query used. (gen() mode)

Sitelinks initData() updated to use it.
This commit is contained in:
Cameron
2012-12-15 04:42:13 -08:00
parent b411a35bcb
commit 550754029e
2 changed files with 10 additions and 22 deletions

View File

@@ -429,7 +429,7 @@ class e_db_mysql
{
return null;
}
elseif(!$select && $this->gen($table, $debug))
elseif(!$select && !$this->gen($table, $debug))
{
return null;
}
@@ -441,7 +441,7 @@ class e_db_mysql
{
return array();
}
elseif(!$select && $this->gen($table, $debug))
elseif(!$select && !$this->gen($table, $debug))
{
return array();
}
@@ -453,7 +453,7 @@ class e_db_mysql
{
return array();
}
elseif(!$select && $this->gen($table, $debug))
elseif(!$select && !$this->gen($table, $debug))
{
return array();
}

View File

@@ -1422,29 +1422,17 @@ class e_navigation
/**
* --------------- CODE-EFFICIENT APPROACH -------------------------
* Less than 10 lines of code (once retrieve() is working)
* FIXME syscache
*/
public function initData($cat=1)
{
$sql = e107::getDb('sqlSiteLinks');
$ins = ($cat > 0) ? "link_category = ".intval($cat)." AND " : "";
$query = "SELECT * FROM #links WHERE ".$ins." link_class IN (".USERCLASS_LIST.") ORDER BY link_order,link_parent ASC";
$ret = array();
$data = array();
// $data = $sql->retrieve($query,true); // FIXME $sql->retrieve() fails.
if($sql->gen($query))
{
while ($row = $sql->db_Fetch())
{
$id = $row['link_id'];
$data [$id] = $row;
}
}
$outArray = array();
$sql = e107::getDb('sqlSiteLinks');
$ins = ($cat > 0) ? "link_category = ".intval($cat)." AND " : "";
$query = "SELECT * FROM #links WHERE ".$ins." link_class IN (".USERCLASS_LIST.") ORDER BY link_order,link_parent ASC";
$ret = array();
$outArray = array();
$data = $sql->retrieve($query,true); // FIXME $sql->retrieve() fails.
return $this->compile($data, $outArray);
}