mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Fixes #1136 - Sitelink with "everyone but not" userclass
This commit is contained in:
parent
c5554898c2
commit
edf00641d2
@ -159,7 +159,7 @@ elseif(isset($_POST['fp_dec']))
|
||||
if (isset($_POST))
|
||||
{
|
||||
|
||||
// avoid endless loop.
|
||||
// avoid endless loop.
|
||||
if($_POST['frontpage'] == 'other' && (trim($_POST['frontpage_other']) == 'index.php' || trim($_POST['frontpage_other']) == '{e_BASE}index.php'))
|
||||
{
|
||||
$_POST['frontpage'] = 'wmessage';
|
||||
|
@ -411,7 +411,7 @@ class news_admin_ui extends e_admin_ui
|
||||
'news_category' => array('title' => NWSLAN_6, 'type' => 'dropdown', 'tab'=>0, 'data' => 'int', 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_start' => array('title' => LAN_START, 'type' => 'datestamp', 'tab'=>2, 'writeParms'=>'type=datetime', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
|
||||
'news_end' => array('title' => LAN_END, 'type' => 'datestamp', 'tab'=>2, 'writeParms'=>'type=datetime', 'width' => 'auto', 'thclass' => '', 'class' => null, 'nosort' => false, 'parms' => 'mask=%A %d %B %Y'),
|
||||
'news_class' => array('title' => LAN_VISIBILITY, 'type' => 'userclass','tab'=>2, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'batch'=>true, 'filter'=>true),
|
||||
'news_class' => array('title' => LAN_VISIBILITY, 'type' => 'userclass', 'tab'=>2, 'inline'=>true, 'width' => 'auto', 'thclass' => '', 'class' => null, 'batch'=>true, 'filter'=>true),
|
||||
'news_render_type' => array('title' => LAN_TEMPLATE, 'type' => 'dropdown', 'tab'=>0, 'data'=> 'str', 'inline'=>false, 'width' => 'auto', 'thclass' => 'left', 'class' => 'left', 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_sticky' => array('title' => LAN_NEWS_28, 'type' => 'boolean', 'tab'=>2, 'data' => 'int' , 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false, 'batch'=>true, 'filter'=>true),
|
||||
'news_allow_comments' => array('title' => LAN_COMMENTS, 'type' => 'boolean', 'tab'=>2, 'writeParms'=>'inverse=1', 'data' => 'int', 'width' => 'auto', 'thclass' => 'center', 'class' => 'center', 'nosort' => false,'batch'=>true, 'filter'=>true,'readParms'=>'reverse=1'),
|
||||
|
@ -21,11 +21,12 @@ class sitelinks
|
||||
var $sefList = array();
|
||||
|
||||
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,10 +1484,11 @@ 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);
|
||||
$data = $sql->retrieve($query,true);
|
||||
|
||||
|
||||
return $this->compile($data, $outArray);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user