mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 22:57:14 +02:00
Fix for $sql->retrieve when full query used. (gen() mode)
Sitelinks initData() updated to use it.
This commit is contained in:
@@ -429,7 +429,7 @@ class e_db_mysql
|
|||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
elseif(!$select && $this->gen($table, $debug))
|
elseif(!$select && !$this->gen($table, $debug))
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -441,7 +441,7 @@ class e_db_mysql
|
|||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
elseif(!$select && $this->gen($table, $debug))
|
elseif(!$select && !$this->gen($table, $debug))
|
||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
@@ -453,7 +453,7 @@ class e_db_mysql
|
|||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
elseif(!$select && $this->gen($table, $debug))
|
elseif(!$select && !$this->gen($table, $debug))
|
||||||
{
|
{
|
||||||
return array();
|
return array();
|
||||||
}
|
}
|
||||||
|
@@ -1422,29 +1422,17 @@ class e_navigation
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* --------------- CODE-EFFICIENT APPROACH -------------------------
|
* --------------- CODE-EFFICIENT APPROACH -------------------------
|
||||||
* Less than 10 lines of code (once retrieve() is working)
|
|
||||||
* FIXME syscache
|
* FIXME syscache
|
||||||
*/
|
*/
|
||||||
public function initData($cat=1)
|
public function initData($cat=1)
|
||||||
{
|
{
|
||||||
$sql = e107::getDb('sqlSiteLinks');
|
$sql = e107::getDb('sqlSiteLinks');
|
||||||
$ins = ($cat > 0) ? "link_category = ".intval($cat)." AND " : "";
|
$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";
|
$query = "SELECT * FROM #links WHERE ".$ins." link_class IN (".USERCLASS_LIST.") ORDER BY link_order,link_parent ASC";
|
||||||
|
$ret = array();
|
||||||
$ret = array();
|
$outArray = array();
|
||||||
$data = array();
|
$data = $sql->retrieve($query,true); // FIXME $sql->retrieve() fails.
|
||||||
|
|
||||||
// $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();
|
|
||||||
return $this->compile($data, $outArray);
|
return $this->compile($data, $outArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user