mirror of
https://github.com/e107inc/e107.git
synced 2025-07-09 17:16:20 +02:00
Fixes #1136 - Sitelink with "everyone but not" userclass
This commit is contained in:
@ -22,10 +22,11 @@ class sitelinks
|
|||||||
|
|
||||||
function getlinks($cat=1)
|
function getlinks($cat=1)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->eLinkList = array(); // clear the array in case getlinks is called 2x on the same page.
|
$this->eLinkList = array(); // clear the array in case getlinks is called 2x on the same page.
|
||||||
$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 ASC";
|
$query = "SELECT * FROM #links WHERE ".$ins." ((link_class >= 0 AND link_class IN (".USERCLASS_LIST.")) OR (link_class < 0 AND link_class NOT IN (".USERCLASS_LIST.")) ) ORDER BY link_order ASC";
|
||||||
if($sql->gen($query))
|
if($sql->gen($query))
|
||||||
{
|
{
|
||||||
while ($row = $sql->fetch())
|
while ($row = $sql->fetch())
|
||||||
@ -1483,11 +1484,12 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
|
|||||||
{
|
{
|
||||||
$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 >= 0 AND link_class IN (".USERCLASS_LIST.")) OR (link_class < 0 AND link_class NOT IN (".USERCLASS_LIST.")) ) ORDER BY link_order,link_parent ASC";
|
||||||
$ret = array();
|
|
||||||
$outArray = array();
|
$outArray = array();
|
||||||
$data = $sql->retrieve($query,true);
|
$data = $sql->retrieve($query,true);
|
||||||
|
|
||||||
|
|
||||||
return $this->compile($data, $outArray);
|
return $this->compile($data, $outArray);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user