mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 20:58:30 +01:00
Fixes #1136 - Sitelink with "everyone but not" userclass
This commit is contained in:
parent
c5554898c2
commit
edf00641d2
@ -22,10 +22,11 @@ class sitelinks
|
||||
|
||||
function getlinks($cat=1)
|
||||
{
|
||||
|
||||
$this->eLinkList = array(); // clear the array in case getlinks is called 2x on the same page.
|
||||
$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 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))
|
||||
{
|
||||
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');
|
||||
$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();
|
||||
$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";
|
||||
|
||||
$outArray = array();
|
||||
$data = $sql->retrieve($query,true);
|
||||
|
||||
|
||||
return $this->compile($data, $outArray);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user