Skip to content

Commit

Permalink
Update taghandlers.php
Browse files Browse the repository at this point in the history
  • Loading branch information
bloatware committed Jan 25, 2023
1 parent 7a99bef commit 37dbe76
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions textpattern/publish/taghandlers.php
Expand Up @@ -1449,37 +1449,37 @@ function section_list($atts, $thing = null)
}

if ($sections === true) {
$sql['page'] = '1';
$sql['page'] = '';
} elseif ($sections) {
if ($include_default) {
$sections .= ', default';
}

$sections = quote_list(do_list_unique($sections), ',');
$sql[] = "name IN ($sections)";
$sql[] = " AND name IN ($sections)";

if (!$sql_sort) {
$sql_sort = "FIELD(name, $sections)";
}
} else {
$sql['page'] = '1'.filterFrontPage('', 'page');
$sql['page'] = filterFrontPage('', 'page');
}

if ($filter) {
foreach(do_list($filter) as $f) {
$sql[$f] = '1'.filterFrontPage('', $f);
$sql[$f] = filterFrontPage('', $f);
}
}

if ($exclude === true) {
$sql['searchable'] = "searchable";
$sql['searchable'] = " AND searchable";
} elseif ($exclude) {
$exclude = quote_list(do_list_unique($exclude), ',');
$sql[] = "name NOT IN ($exclude)";
$sql[] = " AND name NOT IN ($exclude)";
}

if (!$include_default) {
$sql[] = "name != 'default'";
$sql[] = " AND name != 'default'";
}

if (!$sql_sort) {
Expand All @@ -1493,7 +1493,7 @@ function section_list($atts, $thing = null)
$rs = safe_rows_start(
"name, title, description",
'txp_section',
join(" AND ", $sql)." ORDER BY ".$sql_sort.$sql_limit
'1'.join('', $sql)." ORDER BY ".$sql_sort.$sql_limit
);

if ($rs && $last = numRows($rs)) {
Expand Down

0 comments on commit 37dbe76

Please sign in to comment.