Page 1 of 1

News Forum-ID:

Posted: 31. January 2009 09:21
by danny1969
Your Portal Version: 1.0.0RC3
Your phpBB Type: Premodded phpBB
MODs installed: Yes
Your knowledge: Beginner
Boardlink: http://www.gymnasticsforum.be

What have you done before the problem was there?


What have you already tryed to solve the problem?


Description and Message
Hi,

I have a question, on news forum-ID you have to put the numbers where you get the post out. Is it possible to change that to the number where you don’t want post out? I ask this because there is a restriction on the numbers you can put in it. I have about 150 where I want post from in the portal and a few not. And I can’t put all the 150 numbers in it. I hope you understand my question and my English.

Thanks in advance, Danny


O and thanks again for your great portal ;)

Re: News Forum-ID:

Posted: 3. February 2009 16:50
by danny1969
No one??

Re: News Forum-ID:

Posted: 4. February 2009 11:38
by thomas.d
Hi Danny,

I know what you mean and I've suggested this a few weeks ago but I don't know the state of this thing.

Perhaps one of the devs can inform us ...

Re: News Forum-ID:

Posted: 4. February 2009 13:27
by danny1969
Hi Thomas,

thnx for your answer, i will keep my eye on this topic for furder news.

greetings danny ;)

Re: News Forum-ID:

Posted: 10. February 2009 07:33
by japagun
i think that you can set this permissions in ACP......

Re: News Forum-ID:

Posted: 10. February 2009 10:23
by thomas.d
japagun wrote:i think that you can set this permissions in ACP......
This is a misunderstanding.

Example:

Danny has 150 forums. He wants topics to be displayed from forum-ID 1 to forum-ID 147. From forum-ID 148 to 150 he don't want it.

So he must enter all forum-IDs from 1 to 147.

He wants to save time and asks, if it is possible to enter the IDs of forums of which he don't want to have topics displayed from.

Re: News Forum-ID:

Posted: 11. February 2009 01:20
by Mike
Since i altered my Board 10 Minutes ago, im very interested in this feature too ;)

Re: News Forum-ID:

Posted: 12. February 2009 20:39
by danny1969
That is true thomas.d. and it isnt even possible ;)

But this must be simple to resolve as this recent issues ar so in the portall?
Or is this not so simple to solve?
I wait with patience for further news from your super brains ;)

Re: News Forum-ID:

Posted: 12. February 2009 22:11
by Kevin
Just edit this section of code in the functions.php to get it the way you want it: ;)

Code: Select all

    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 .= "t.forum_id = $acc_id OR ";
            if( $type == 'announcements' && $global_f < 1 && $acc_id > 0 )
            {
                $global_f = $acc_id;
            }
        }
    }
    else
    {
        foreach( $disallow_access as $acc_id )
        {
            $acc_id = (int) $acc_id;
            $str_where .= "t.forum_id <> $acc_id AND ";
        }
    }
    
    switch( $type )
    {
        case "announcements":

            $topic_type = '(( t.topic_type = ' . POST_ANNOUNCE . ') OR ( t.topic_type = ' . POST_GLOBAL . '))';
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (t.forum_id = 0 OR (' . trim(substr($str_where, 0, -4)) . '))' : '';
            $user_link = 't.topic_poster = u.user_id';
            $post_link = 't.topic_first_post_id = p.post_id';
            $topic_order = 't.topic_time DESC';

        break;
        case "news":

            $topic_type = 't.topic_type = ' . POST_NORMAL;
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
            $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
            $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
            $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;


        break;
        case "news_all":

            $topic_type = '( t.topic_type <> ' . POST_ANNOUNCE . ' ) AND ( t.topic_type <> ' . POST_GLOBAL . ')';
            $str_where = ( strlen($str_where) > 0 ) ? 'AND (' . trim(substr($str_where, 0, -4)) . ')' : '';
            $user_link = ( $portal_config['portal_news_style'] ) ? 't.topic_poster = u.user_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_poster_id = u.user_id' : 't.topic_poster = u.user_id' ) ;
            $post_link = ( $portal_config['portal_news_style'] ) ? 't.topic_first_post_id = p.post_id' : (( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_id = p.post_id' : 't.topic_first_post_id = p.post_id' ) ;
            $topic_order = ( $portal_config['portal_news_show_last'] ) ? 't.topic_last_post_time DESC' : 't.topic_time DESC' ;

        break;
    }
    
    if( $type == 'announcements' && $global_f < 1 )
    {
        $sql = 'SELECT
                    forum_id
                FROM
                    ' . FORUMS_TABLE . '
                WHERE
                    forum_type = ' . FORUM_POST . '
                    ' . str_replace('t.', '', $str_where) . '
                ORDER BY
                    forum_id';
        $result = $db->sql_query_limit($sql, 1);
        
        
        
        $row = $db->sql_fetchrow($result);
        if( !sizeof( $row ) )
        {
            return array();
        }
        $global_f = $row['forum_id'];
        
    }
    
    $sql_array = array(
        'SELECT' => 't.forum_id,
            t.topic_id,
            t.topic_last_post_id,
            t.topic_last_post_time,
            t.topic_time,
            t.topic_title,
            t.topic_attachment,
            t.topic_views,
            t.poll_title,
            t.topic_replies,
            t.topic_replies_real,
            t.topic_poster,
            t.topic_type,
            t.topic_status,
            t.topic_last_poster_name,
            t.topic_last_poster_id,
            t.topic_last_poster_colour,
            t.icon_id,
            u.username,
            u.user_id,
            u.user_type,
            u.user_colour,
            p.post_id,
            p.poster_id,
            p.post_time,
            p.post_text,
            p.post_attachment,
            p.post_username,
            p.enable_smilies,
            p.enable_bbcode,
            p.enable_magic_url,
            p.bbcode_bitfield,
            p.bbcode_uid,
            f.forum_name,
            f.enable_icons',
            
        'FROM' => array(
            TOPICS_TABLE => 't',
        ),
        
        'LEFT_JOIN' => array(
            array(
                'FROM' => array(USERS_TABLE => 'u'),
                'ON' => $user_link,
            ),
            array(
                'FROM' => array(FORUMS_TABLE => 'f'),
                'ON' => 't.forum_id=f.forum_id',
            ),
            array(
                'FROM' => array(POSTS_TABLE => 'p'),
                'ON' => $post_link,
            ),
        ),
        
        'WHERE' => $topic_type . '
                ' . $post_time . '
                AND t.topic_status <> ' . ITEM_MOVED . '
                AND t.topic_approved = 1
                AND t.topic_moved_id = 0
                ' . $str_where,
                
        'ORDER_BY' => $topic_order,    
    ); 

Re: News Forum-ID:

Posted: 16. February 2009 17:53
by danny1969
:D thnx Kevin

:oops: but i am realy a noob with this, can you tell me what i have to change or do step by step?

Thnx in advance, danny ;)

Re: News Forum-ID:

Posted: 11. March 2009 14:01
by danny1969
:oops:

No one who can give a little more explanation? Because I do not know how I should do it.
I have changed it but it was stil not good. :(

Thnx in advance, danny ;)