Commit 2131f7d2 authored by Chris Graham's avatar Chris Graham
Browse files

Fixed MANTIS-4207 (Forum blocks not working with comma-delimited forum names)

parent 04ef48e6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@

{| 60%:37% wide floats
| [block]main_staff_checklist[/block]
| [block]main_staff_new_version[/block]{+START,IF,{$CNS}}[block="Reported posts forum,Staff" title="Staff forum" limit="3" failsafe="1"]main_forum_topics[/block]{+END}[block]main_staff_tips[/block]{+START,IF,{$ADDON_INSTALLED,syndication_blocks}}{$BLOCK,block=side_rss,param={$BRAND_BASE_URL}/backend.php?mode=news&type=rss&select=1-10&days=100,title=Composr news,cache=1,defer=1}{+END}
| [block]main_staff_new_version[/block]{+START,IF,{$CNS}}[block="Reported posts forum,Staff" title="Staff forums" limit="3" failsafe="1"]main_forum_topics[/block]{+END}[block]main_staff_tips[/block]{+START,IF,{$ADDON_INSTALLED,syndication_blocks}}{$BLOCK,block=side_rss,param={$BRAND_BASE_URL}/backend.php?mode=news&type=rss&select=1-10&days=100,title=Composr news,cache=1,defer=1}{+END}
|}

[title="2"]Latest activity [size="0.8"]([page="adminzone:admin_actionlog"]more[/page])[/size][/title]
+1 −1
Original line number Diff line number Diff line
@@ -83,7 +83,7 @@ class Block_main_forum_news
        $submit_url = new Tempcode();

        $forum_ids = array();
        if ((get_forum_type() == 'cns') && ((strpos($forum_name, ',') !== false) || (preg_match('#\d[-\*\+]#', $forum_name) != 0) || (is_numeric($forum_name)))) {
        if ((get_forum_type() == 'cns') && (preg_match('#^[\d\-\*,]*$#', $forum_name) != 0)) {
            require_code('selectcode');
            $forum_names = selectcode_to_idlist_using_db($forum_name, 'id', 'f_forums', 'f_forums', 'f_parent_forum', 'f_parent_forum', 'id', true, true, $GLOBALS['FORUM_DB']);
        } else {
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ class Block_main_forum_topics

        // Work out exactly what forums we're reading
        $forum_ids = array();
        if ((get_forum_type() == 'cns') && ((strpos($forum_name, ',') !== false) || (strpos($forum_name, '*') !== false) || (preg_match('#\d[-\*\+]#', $forum_name) != 0) || (is_numeric($forum_name)))) {
        if ((get_forum_type() == 'cns') && (preg_match('#^[\d\-\*,]*$#', $forum_name) != 0)) {
            require_code('selectcode');
            $forum_names = selectcode_to_idlist_using_db($forum_name, 'id', 'f_forums', 'f_forums', 'f_parent_forum', 'f_parent_forum', 'id', true, true, $GLOBALS['FORUM_DB']);
        } else {
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ class Block_side_forum_news
        $submit_url = new Tempcode();

        $forum_ids = array();
        if ((get_forum_type() == 'cns') && ((strpos($forum_name, ',') !== false) || (preg_match('#\d[-\*\+]#', $forum_name) != 0) || (is_numeric($forum_name)))) {
        if ((get_forum_type() == 'cns') && (preg_match('#^[\d\-\*,]*$#', $forum_name) != 0)) {
            require_code('selectcode');
            $forum_names = array_map('strval', selectcode_to_idlist_using_db($forum_name, 'id', 'f_forums', 'f_forums', 'f_parent_forum', 'f_parent_forum', 'id', true, true, $GLOBALS['FORUM_DB']));
        } else {