diff --git a/e107_handlers/sitelinks_class.php b/e107_handlers/sitelinks_class.php index 7328b83f9..9e9b9ce72 100644 --- a/e107_handlers/sitelinks_class.php +++ b/e107_handlers/sitelinks_class.php @@ -34,7 +34,7 @@ class sitelinks $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 >= 0 AND link_class IN (".USERCLASS_LIST.")) OR (link_class < 0 AND link_class NOT 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 ABS(link_class) NOT IN (".USERCLASS_LIST.")) ) ORDER BY link_order ASC"; if($sql->gen($query)) { while ($row = $sql->fetch())