Expanding the displaying topics on external page!? 2 for 1

All web design discussion, including Ultimate Quiz MOD support.

Moderator: CricketMX Forum Moderators

Post Reply
User avatar
TheGiftedApe
Greenhorn
Greenhorn
Posts: 16
Joined: Mon Nov 07, 2011 5:41 am

Ok so I'm back! :D

I have successfully integrated phpbb in my website(http://forums.cricketmx.com/viewtopic.php?f=63&t=5036), and I'm wondering if there is anyway I can embed two instances of the script on the same page.

ie I want a main section that is already setup, pulling from a certain area of the forum (News), and then a second that pulls from a different part of the forums(Events) that is displayed in a small box on the side(like an event display, while the other displays current news). I thought I might be able to just run two instances of the script at the same time, but I get an error: Fatal error: Cannot redeclare create_where_clauses() (previously declared in /home/thegif15/public_html/xo/tester2.php:24) in /home/thegif15/public_html/xo/cwpull.php on line 100
the area around line 100 on both files looks like this(starting at line 94):

Code: Select all

if( $out_where == '' && $size_gen_id > 0 )
    {
        trigger_error('A list of topics/forums has not been created');
    }

    return $out_where;
}

$search_limit = 5;

    $forum_id = array(3);
    $forum_id_where = create_where_clauses($forum_id, 'forum');

    $topic_id = array();
    $topic_id_where = create_where_clauses($topic_id, 'topic');
$posts_ary = array(
        'SELECT'    => 'p.*, t.*',
    
        'FROM'      => array(
            POSTS_TABLE     => 'p',
        ),
    
        'LEFT_JOIN' => array(
            array(
                'FROM'  => array(TOPICS_TABLE => 't'),
                'ON'    => 't.topic_first_post_id = p.post_id'
            )
        ),
    
        'WHERE'     => str_replace( array('WHERE ', 'forum_id'), array('', 't.forum_id'), $forum_id_where) . '
                        AND t.topic_status <> ' . ITEM_MOVED . '
                        AND t.topic_approved = 1',
    
        'ORDER_BY'  => 'p.post_id DESC',
    );
line 100 is the $search_limit = 5;

obviously trying to declare the forum array twice is screwing it up.

I understand that the fact that its telling the same page to do the same thing twice from 2 different places is causing an error, But I am not sure how to fix it. Trying to pull the second php file in via different methods still causes errors, is there some way I can fix this. I understand if you don't have any idea how to do this, neither do I!!

thx -ape
Post Reply