Seite 1 von 1

Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 02.12.2013 19:59
von oliXon
Erstmal vorweg, die Installation vom Users Choose Displayed Mod verlief problemlos und funktioniert auch alles.

Der Mod bewirkt das User die Kategorien auswählen können, die sie interessiert oder nicht. Das Problem ist das die Beiträge unter "Aktive Themen" und in unserem Portal trotzdem aus der Rubrik noch angezeigt werden. Wäre das möglich diese auch zu verstecken? Weil das würde mehr Sinn machen, damit z.b. die ganzen Offtopics Thread nicht anzeigt werden.

Vielen Dank schonmal!

oliXon

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 02.12.2013 22:21
von HabNurNeFrage
Hi,

im Thread zur Mod wurde das auch 2x gefragt.
Wurde vom Autor verneint, nicht nachgereicht und ist meiner Meinung nach auch nicht einfach zu erreichen.

Wenn es sich bei Dir um bestimmte Foren handelt, die Off-Topic enthalten, würde ich die über das Rechte-System von der Suche ausschließen.
Bei den Forenberechtigungen zu finden unter "bei der Suche berücksichtigen" oder so ähnlich...

Die Suche über die Auswahl der Mod für jeden Einzelnen zu begrenzen, dürfte einiges an Programmieraufwand bedeuten.

LG

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 03.12.2013 00:51
von Miriam
Finde in der search.php:

Code: Alles auswählen

    $not_in_fid =
davor füge ein:

Code: Alles auswählen

    //++++++++++++++++++++++++
    $acl_f_display = array_keys($auth->acl_getf('f_display', true));
    $user_index_array = unserialize($user->data['user_index']);
    foreach($user_index_array as $key=>$value)
    {
        if (!$value)
        {
            if (in_array($key, $acl_f_display))
            {
                $ex_fdisplay_ary[$key] = 1;
            }
        }
    }
    $ex_fid_ary = array_unique(array_merge($ex_fid_ary, array_keys($ex_fdisplay_ary)));
    //+++++++++++++++++++++++++  
Dann sollte die Anzeige der Beiträge aus ausgeblendeten Foren passé sein.

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 03.12.2013 18:21
von oliXon
@ HabNurNeFrage Über das Rechte System wollte ich das nur ungern lösen, da wieder User benachteiligt werden die das sehen wollen.

@ Miriam

Danke erstmal :)

Hab es so eben ausprobiert, das funktioniert zwar problemlos wenn der diejenige die Rubrik, deaktiviert hat. Sollte dieser aber sie sehen wollen steht oben am Rand:

[phpBB Debug] PHP Warning: in file [ROOT]/search.php on line 222: array_keys() expects parameter 1 to be array, null given
[phpBB Debug] PHP Warning: in file [ROOT]/search.php on line 222: array_merge(): Argument #2 is not an array
[phpBB Debug] PHP Warning: in file [ROOT]/search.php on line 222: array_unique() expects parameter 1 to be array, null given
[phpBB Debug] PHP Warning: in file [ROOT]/search.php on line 551: sort() expects parameter 1 to be array, null given

Die Beiträge werden aber soweit angezeigt.

Noch eine kleine extra Frage, wir nutzen ja ein portal (board3 portal) dieses hat ein Modul wo man die letzten z.b. 20 Beiträge sehen kann. Wo müsste ich diesen Code Schnippsel einfügen oder ginge das nicht so einfach und muss das a anders angehen?

Code: Alles auswählen

<?php
/**
*
* @package Board3 Portal v2 - News
* @copyright (c) Board3 Group ( www.board3.de )
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
    exit;
}

/**
* @package News
*/
class portal_news_module
{
    /**
    * Allowed columns: Just sum up your options (Exp: left + right = 10)
    * top        1
    * left        2
    * center    4
    * right        8
    * bottom    16
    */
    public $columns = 21;

    /**
    * Default modulename
    */
    public $name = 'LATEST_NEWS';

    /**
    * Default module-image:
    * file must be in "{T_THEME_PATH}/images/portal/"
    */
    public $image_src = '';

    /**
    * module-language file
    * file must be in "language/{$user->lang}/mods/portal/"
    */
    public $language = 'portal_news_module';

    public function get_template_center($module_id)
    {
        global $config, $template, $db, $user, $auth, $cache, $phpEx, $phpbb_root_path;

        $news = request_var('news', -1);
        $news = ($news > $config['board3_news_length_' . $module_id] -1) ? -1 : $news;
        $user->add_lang('viewforum');
        $start = request_var('np', 0);
        $start = ($start < 0) ? 0 : $start;

        // Fetch news from portal/includes/functions.php with check if "read full" is requested.
        $portal_news_length = ($news < 0) ? $config['board3_news_length_' . $module_id] : 0;
        $fetch_news = phpbb_fetch_posts($module_id, $config['board3_news_forum_' . $module_id], $config['board3_news_permissions_' . $module_id], $config['board3_number_of_news_' . $module_id], $portal_news_length, 0, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news', $start, $config['board3_news_exclude_' . $module_id]);

    

        // Any news present? If not terminate it here.
        if (sizeof($fetch_news) == 0)
        {
            $template->assign_block_vars('news_row', array(
                'S_NO_TOPICS'    => true,
                'S_NOT_LAST'    => false,
            ));
        }
        else
        {
            // Count number of posts for news archive, considering if permission check is dis- or enabled.
            if ($config['board3_news_archive_' . $module_id])
            {
                $permissions = $config['board3_news_permissions_' . $module_id];
                $forum_from = $config['board3_news_forum_' . $module_id];

                $forum_from = (strpos($forum_from, ',') !== false) ? explode(',', $forum_from) : (($forum_from != '') ? array($forum_from) : array());

                $str_where = '';

                if($permissions == true)
                {
                    $disallow_access = array_unique(array_keys($auth->acl_getf('!f_read', true)));
                }
                else
                {
                    $disallow_access = array();
                }
                
                if($config['board3_news_exclude_' . $module_id] == true)
                {
                    $disallow_access = array_merge($disallow_access, $forum_from);
                    $forum_from = array();
                }

                if(sizeof($forum_from))
                {
                    $disallow_access = array_diff($forum_from, $disallow_access);
                    if(!sizeof($disallow_access))
                    {
                        return array();
                    }

                    foreach($disallow_access as $acc_id)
                    {
                        $acc_id = (int) $acc_id;
                        $str_where .= "forum_id = $acc_id OR ";
                    }
                }
                else
                {
                    foreach($disallow_access as $acc_id)
                    {
                        $acc_id = (int) $acc_id;
                        $str_where .= "forum_id <> $acc_id AND ";
                    }
                }

                $str_where = (strlen($str_where) > 0) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';

                $topic_type = ($config['board3_show_all_news_' . $module_id]) ? '(topic_type <> ' . POST_ANNOUNCE . ') AND (topic_type <> ' . POST_GLOBAL . ')' : 'topic_type = ' . POST_NORMAL;

                $sql = 'SELECT COUNT(topic_id) AS num_topics
                    FROM ' . TOPICS_TABLE . '
                    WHERE ' . $topic_type . '
                        AND topic_approved = 1
                        AND topic_moved_id = 0
                        ' . $str_where;
                    $result = $db->sql_query($sql);
                    $total_news = (int) $db->sql_fetchfield('num_topics');
                    $db->sql_freeresult($result);
            }
            
            $topic_tracking_info = get_portal_tracking_info($fetch_news);

            if($news < 0)
            // Show the news overview
            {
                $count = $fetch_news['topic_count'];
                for ($i = 0; $i < $count; $i++)
                {
                    if(isset($fetch_news[$i]['striped']) && $fetch_news[$i]['striped'] == true)
                    {
                        $open_bracket = '[ ';
                        $close_bracket = ' ]';
                        $read_full = $user->lang['READ_FULL'];
                    }
                    else
                    {
                        $open_bracket = '';
                        $close_bracket = '';
                        $read_full = '';
                    }
                    // unread?
                    $forum_id = $fetch_news[$i]['forum_id'];
                    $topic_id = $fetch_news[$i]['topic_id'];
                    $unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
                    
                    $read_full_url = (isset($_GET['np'])) ? 'np='. $start . '&news=' . $i . '#n' . $i : 'news=' . $i . '#n' . $i;
                    $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
                    if ($config['board3_news_archive_' . $module_id])
                    {
                        $pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news_' . $module_id], $start, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news');
                    }

                    $replies = ($auth->acl_get('m_approve', $forum_id)) ? $fetch_news[$i]['topic_replies_real'] : $fetch_news[$i]['topic_replies'];
                    $folder_img = $folder_alt = $topic_type = $folder = $folder_new = '';
                    switch ($fetch_news[$i]['topic_type'])
                    {
                        case POST_STICKY:
                            $folder = 'sticky_read';
                            $folder_new = 'sticky_unread';
                        break;
                        case POST_ANNOUNCE:
                            $folder = 'announce_read';
                            $folder_new = 'announce_unread';
                        break;
                        default:
                            $folder = 'topic_read';
                            $folder_new = 'topic_unread';
                            if ($config['hot_threshold'] && $replies >= $config['hot_threshold'] && $fetch_news[$i]['topic_status'] != ITEM_LOCKED)
                            {
                                $folder .= '_hot';
                                $folder_new .= '_hot';
                            }
                        break;
                    }

                    if ($fetch_news[$i]['topic_status'] == ITEM_LOCKED)
                    {
                        $folder .= '_locked';
                        $folder_new .= '_locked';
                    }
                    if ($fetch_news[$i]['topic_posted'])
                    {
                        $folder .= '_mine';
                        $folder_new .= '_mine';
                    }

                    $folder_img = ($unread_topic) ? $folder_new : $folder;
                    $folder_alt = ($unread_topic) ? 'NEW_POSTS' : (($fetch_news[$i]['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_NEW_POSTS');

                    // Grab icons
                    $icons = $cache->obtain_icons();

                    $template->assign_block_vars('news_row', array(
                        'ATTACH_ICON_IMG'        => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
                        'FORUM_NAME'            => ($forum_id) ? $fetch_news[$i]['forum_name'] : '',
                        'TITLE'                    => $fetch_news[$i]['topic_title'],
                        'POSTER'                => $fetch_news[$i]['username'],
                        'POSTER_FULL'            => $fetch_news[$i]['username_full'],
                        'USERNAME_FULL_LAST'    => $fetch_news[$i]['username_full_last'],    
                        'U_USER_PROFILE'        => (($fetch_news[$i]['user_type'] == USER_NORMAL || $fetch_news[$i]['user_type'] == USER_FOUNDER) && $fetch_news[$i]['user_id'] != ANONYMOUS) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $fetch_news[$i]['user_id']) : '',
                        'TIME'                    => $fetch_news[$i]['topic_time'],
                        'LAST_POST_TIME'        => $user->format_date($fetch_news[$i]['topic_last_post_time']),
                        'TEXT'                    => $fetch_news[$i]['post_text'],
                        'REPLIES'                => $fetch_news[$i]['topic_replies'],
                        'TOPIC_VIEWS'            => $fetch_news[$i]['topic_views'],
                        'N_ID'                    => $i,
                        'TOPIC_FOLDER_IMG'        => $user->img($folder_img, $folder_alt),
                        'TOPIC_FOLDER_IMG_SRC'  => $user->img($folder_img, $folder_alt, false, '', 'src'),
                        'TOPIC_FOLDER_IMG_ALT'  => $user->lang[$folder_alt],
                        'TOPIC_ICON_IMG'        => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['img'] : '',
                        'TOPIC_ICON_IMG_WIDTH'    => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['width'] : '',
                        'TOPIC_ICON_IMG_HEIGHT'    => (!empty($icons[$fetch_news[$i]['icon_id']])) ? $icons[$fetch_news[$i]['icon_id']]['height'] : '',
                        'FOLDER_IMG'            => $user->img('topic_read', 'NO_NEW_POSTS'),
                        'U_VIEWFORUM'            => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
                        'U_LAST_COMMENTS'        => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id'] . '&p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
                        'U_VIEW_COMMENTS'        => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
                        'U_VIEW_UNREAD'            => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id'] . '&view=unread#unread'),
                        'U_POST_COMMENT'        => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
                        'U_READ_FULL'            => append_sid("{$phpbb_root_path}portal.$phpEx", $read_full_url),
                        'L_READ_FULL'            => $read_full,
                        'OPEN'                    => $open_bracket,
                        'CLOSE'                    => $close_bracket,
                        'S_NOT_LAST'            => ($i < sizeof($fetch_news) - 1) ? true : false,
                        'S_POLL'                => $fetch_news[$i]['poll'],
                        'S_UNREAD_INFO'            => $unread_topic,
                        'PAGINATION'            => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
                        'S_HAS_ATTACHMENTS'        => (!empty($fetch_news[$i]['attachments'])) ? true : false,
                    ));

                    if(!empty($fetch_news[$i]['attachments']))
                    {
                        foreach ($fetch_news[$i]['attachments'] as $attachment)
                        {
                            $template->assign_block_vars('news_row.attachment', array(
                                'DISPLAY_ATTACHMENT'    => $attachment)
                            );
                        }
                    }

                    if ($config['board3_number_of_news_' . $module_id] <> 0 && $config['board3_news_archive_' . $module_id])
                    {
                        $template->assign_vars(array(
                            'NP_PAGINATION'        => $pagination,
                            'TOTAL_NEWS'        => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
                            'NP_PAGE_NUMBER'    => on_page($total_news, $config['board3_number_of_news_' . $module_id], $start))
                        );
                    }
                }
            }
            else
            // Show "read full" page
            {
                $i = $news;
                $forum_id = $fetch_news[$i]['forum_id'];
                $topic_id = $fetch_news[$i]['topic_id'];
                $unread_topic = (isset($topic_tracking_info[$topic_id]) && $fetch_news[$i]['topic_last_post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
                $open_bracket = '[ ';
                $close_bracket = ' ]';
                $read_full = $user->lang['BACK'];
                        
                $read_full_url = (isset($_GET['np'])) ? append_sid("{$phpbb_root_path}portal.$phpEx", "np=$start#n$i") : append_sid("{$phpbb_root_path}portal.$phpEx#n$i");
                $view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . (($fetch_news[$i]['forum_id']) ? $fetch_news[$i]['forum_id'] : $forum_id) . '&t=' . $topic_id);
                if ($config['board3_news_archive_' . $module_id])
                {
                    $pagination = generate_portal_pagination(append_sid("{$phpbb_root_path}portal.$phpEx"), $total_news, $config['board3_number_of_news_' . $module_id], $start, ($config['board3_show_all_news_' . $module_id]) ? 'news_all' : 'news');
                }

                $template->assign_block_vars('news_row', array(
                    'ATTACH_ICON_IMG'    => ($fetch_news[$i]['attachment'] && $config['allow_attachments']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
                    'FORUM_NAME'        => ($forum_id) ? $fetch_news[$i]['forum_name'] : '',
                    'TITLE'                => $fetch_news[$i]['topic_title'],
                    'POSTER'            => $fetch_news[$i]['username'],
                    'POSTER_FULL'        => $fetch_news[$i]['username_full'],
                    'TIME'                => $fetch_news[$i]['topic_time'],
                    'TEXT'                => $fetch_news[$i]['post_text'],
                    'REPLIES'            => $fetch_news[$i]['topic_replies'],
                    'TOPIC_VIEWS'        => $fetch_news[$i]['topic_views'],
                    'N_ID'                => $i,
                    'U_VIEWFORUM'        => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $fetch_news[$i]['forum_id']),
                    'U_LAST_COMMENTS'    => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $fetch_news[$i]['topic_last_post_id'] . '#p' . $fetch_news[$i]['topic_last_post_id']),
                    'U_VIEW_COMMENTS'    => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
                    'U_POST_COMMENT'    => append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=reply&f=' . $fetch_news[$i]['forum_id'] . '&t=' . $fetch_news[$i]['topic_id']),
                    'S_POLL'            => $fetch_news[$i]['poll'],
                    'S_UNREAD_INFO'        => $unread_topic,
                    'U_READ_FULL'        => $read_full_url,
                    'L_READ_FULL'        => $read_full,      
                    'OPEN'                => $open_bracket,
                    'CLOSE'                => $close_bracket,
                    'PAGINATION'        => topic_generate_pagination($fetch_news[$i]['topic_replies'], $view_topic_url),
                    'S_HAS_ATTACHMENTS'    => (!empty($fetch_news[$i]['attachments'])) ? true : false,
                ));

                if(!empty($fetch_news[$i]['attachments']))
                {
                    foreach ($fetch_news[$i]['attachments'] as $attachment)
                    {
                        $template->assign_block_vars('news_row.attachment', array(
                            'DISPLAY_ATTACHMENT'    => $attachment)
                        );
                    }
                }

                if ($config['board3_number_of_news_' . $module_id] <> 0 && $config['board3_news_archive_' . $module_id])
                {
                    $template->assign_vars(array(
                        'NP_PAGINATION'        => $pagination,
                        'TOTAL_NEWS'        => ($total_news == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $total_news),
                        'NP_PAGE_NUMBER'    => on_page($total_news, $config['board3_number_of_news_' . $module_id], $start))
                    );
                }
            }
        }

        $topic_icons = false;
        if(!empty($fetch_news['topic_icons']))
        {
            $topic_icons = true;
        }

        $template->assign_vars(array(
            'NEWEST_POST_IMG'            => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
            'READ_POST_IMG'                => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
            'GOTO_PAGE_IMG'                => $user->img('icon_post_target', 'GOTO_PAGE'),
            'S_NEWEST_OR_FIRST'            => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['JUMP_NEWEST'] : $user->lang['JUMP_FIRST'],
            'POSTED_BY_TEXT'            => ($config['board3_news_show_last_' . $module_id]) ? $user->lang['LAST_POST'] : $user->lang['POSTED'],
            'S_DISPLAY_NEWS_RVS'        => ($config['board3_show_news_replies_views_' . $module_id]) ? true : false,
            'S_TOPIC_ICONS'                => $topic_icons,
        ));

        if($config['board3_news_style_' . $module_id])
        {
            return 'news_compact_center.html';
        }
        else
        {
            return 'news_center.html';
        }
    }

    public function get_template_acp($module_id)
    {
        return array(
            'title'    => 'ACP_PORTAL_NEWS_SETTINGS',
            'vars'    => array(
                'legend1'                            => 'ACP_PORTAL_NEWS_SETTINGS',
                'board3_news_style_' . $module_id                    => array('lang' => 'PORTAL_NEWS_STYLE',    'validate' => 'bool',        'type' => 'radio:yes_no',    'explain' => true),
                'board3_show_all_news_' . $module_id                => array('lang' => 'PORTAL_SHOW_ALL_NEWS',    'validate' => 'bool',        'type' => 'radio:yes_no',    'explain' => true),
                'board3_number_of_news_' . $module_id                => array('lang' => 'PORTAL_NUMBER_OF_NEWS',    'validate' => 'int',        'type' => 'text:3:3',         'explain' => true),
                'board3_news_length_' . $module_id                => array('lang' => 'PORTAL_NEWS_LENGTH',    'validate' => 'int',        'type' => 'text:3:3',         'explain' => true),
                'board3_news_forum_' . $module_id                    => array('lang' => 'PORTAL_NEWS_FORUM',        'validate' => 'string',        'type' => 'custom',             'explain' => true,    'method' => 'select_forums', 'submit' => 'store_selected_forums'),
                'board3_news_exclude_' . $module_id                => array('lang' => 'PORTAL_NEWS_EXCLUDE',    'validate' => 'bool',        'type' => 'radio:yes_no',    'explain' => true),
                'board3_news_show_last_' . $module_id             => array('lang' => 'PORTAL_NEWS_SHOW_LAST',        'validate' => 'bool',    'type' => 'radio:yes_no',    'explain' => true),
                'board3_news_archive_' . $module_id               => array('lang' => 'PORTAL_NEWS_ARCHIVE',        'validate' => 'bool',    'type' => 'radio:yes_no',    'explain' => true),
                'board3_news_permissions_' . $module_id            => array('lang' => 'PORTAL_NEWS_PERMISSIONS',    'validate' => 'bool',    'type' => 'radio:yes_no',    'explain' => true),
                'board3_show_news_replies_views_' . $module_id    => array('lang' => 'PORTAL_SHOW_REPLIES_VIEWS',    'validate' => 'bool',    'type' => 'radio:yes_no',    'explain' => true),
            )
        );
    }

    /**
    * API functions
    */
    public function install($module_id)
    {
        set_config('board3_news_length_' . $module_id, 250);
        set_config('board3_news_forum_' . $module_id, '');
        set_config('board3_news_permissions_' . $module_id, 1);
        set_config('board3_number_of_news_' . $module_id, 5);
        set_config('board3_show_all_news_' . $module_id, 1);
        set_config('board3_news_exclude_' . $module_id, 0);
        set_config('board3_news_archive_' . $module_id, 1);
        set_config('board3_news_show_last_' . $module_id, 0);
        set_config('board3_show_news_replies_views_' . $module_id, 1);
        set_config('board3_news_style_' . $module_id, 1);
        return true;
    }

    public function uninstall($module_id)
    {
        global $db;

        $del_config = array(
            'board3_news_length_' . $module_id,
            'board3_news_forum_' . $module_id,
            'board3_news_permissions_' . $module_id,
            'board3_number_of_news_' . $module_id,
            'board3_show_all_news_' . $module_id,
            'board3_news_exclude_' . $module_id,
            'board3_news_archive_' . $module_id,
            'board3_news_show_last_' . $module_id,
            'board3_show_news_replies_views_' . $module_id,
            'board3_news_style_' . $module_id,
        );
        $sql = 'DELETE FROM ' . CONFIG_TABLE . '
            WHERE ' . $db->sql_in_set('config_name', $del_config);
        return $db->sql_query($sql);
    }
    
    // Create forum select box
    public function select_forums($value, $key, $module_id)
    {
        global $user, $config;

        $forum_list = make_forum_select(false, false, true, true, true, false, true);
        
        $selected = array();
        if(isset($config[$key]) && strlen($config[$key]) > 0)
        {
            $selected = explode(',', $config[$key]);
        }
        // Build forum options
        $s_forum_options = '<select id="' . $key . '" name="' . $key . '[]" multiple="multiple">';
        foreach ($forum_list as $f_id => $f_row)
        {
            $s_forum_options .= '<option value="' . $f_id . '"' . ((in_array($f_id, $selected)) ? ' selected="selected"' : '') . (($f_row['disabled']) ? ' disabled="disabled" class="disabled-option"' : '') . '>' . $f_row['padding'] . $f_row['forum_name'] . '</option>';
        }
        $s_forum_options .= '</select>';

        return $s_forum_options;

    }
    
    // Store selected forums
    public function store_selected_forums($key, $module_id)
    {
        global $db, $cache;
        
        // Get selected extensions
        $values = request_var($key, array(0 => ''));
        
        $news = implode(',', $values);
        
        set_config($key, $news);
    
    }
}

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 03.12.2013 18:50
von Miriam
Poste doch mal den nunmehr angepassten Code der search.php.
Am besten via PasteBin.

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 03.12.2013 19:26
von oliXon

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 03.12.2013 23:36
von Miriam
Mein Fehler, ich hatte nicht alle Möglichkeiten getestet ->

Finde also in der search.php davor füge ein:
  • Code: Alles auswählen

        //++++++++++++++++++++++++
        $acl_f_display = array_keys($auth->acl_getf('f_display', true));
        $user_index_array = unserialize($user->data['user_index']);
        $ex_fdisplay_ary = array();
        if (is_array($user_index_array))
        {
            foreach($user_index_array as $key=>$value)
            {
                if (!$value)
                {
                    if (in_array($key, $acl_f_display))
                    {
                        $ex_fdisplay_ary[$key] = 1;
                    }
                }
            }
            $ex_fid_ary = array_unique(array_merge($ex_fid_ary, array_keys($ex_fdisplay_ary)));
        }
        //+++++++++++++++++++++++++   
Zur 2. Frage:

Auf den ersten Blick, würde ich es so machen:
Finde in diesem geposteten Code des Portals:
  • Code: Alles auswählen

                        $disallow_access = array();
                    } 
danach füge ein:
  • Code: Alles auswählen

            //++++++++++++++++++++++++
        $ex_fid_ary = $disallow_access;
    
            $acl_f_display = array_keys($auth->acl_getf('f_display', true));
            $user_index_array = unserialize($user->data['user_index']);
            $ex_fdisplay_ary = array();
            if (is_array($user_index_array))
            {
                foreach($user_index_array as $key=>$value)
                {
                    if (!$value)
                    {
                        if (in_array($key, $acl_f_display))
                        {
                            $ex_fdisplay_ary[$key] = 1;
                        }
                    }
                }
                $ex_fid_ary = array_unique(array_merge($ex_fid_ary, array_keys($ex_fdisplay_ary)));
            }
        //+++++++++++++++++++++++++     
Aber das ist nur geraten, ich habe kein Board3Portal.

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 04.12.2013 21:45
von oliXon
Danke, in Aktive Themen klappt nun alles. :)

In der Portal Übersicht passiert aber leider nichts :/ Schade vll. sollte ich direkt mal bei den Leuten von Board3 fragen. Vll. haben die einen ansatz.

Re: Users Choose Displayed Mod - auch Beiträge ausblenden

Verfasst: 04.12.2013 22:52
von Miriam
Also der Ansatz steht da... Mußt es nur eben checken und ggf. woanders eintragen.