phpBB statestic

Current Version: 1.0.2
Released: 04/25/2010
Post Reply
Fire-Fox
Mitglied / Member
Mitglied / Member
Posts: 6
Joined: Tue 22. Sep 2009, 00:04
phpbb.com: 1015175

phpBB statestic

Post by Fire-Fox »

Hey!

I get this error :
[phpBB Debug] PHP Notice: in file /includes/stats/stats_settings.php on line 80: Undefined index: 1
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4444: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3635)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4446: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3635)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4447: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3635)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4448: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3635)

Code: Select all

//now get the counts
                    $sql = 'SELECT user_style FROM ' . USERS_TABLE . '
                                WHERE user_type <> ' . USER_INACTIVE;
                    $result = $db->sql_query($sql);
                    while ($temp_user = $db->sql_fetchrow($result))
                    {
                        ++$style_users_count[$temp_user['user_style']];
                    }
                    $db->sql_freeresult($result);
                    //send vars to template
                    foreach ($styles_data as $current_style)
                    {
                        $template->assign_block_vars('style_users_count', array(
                            'STYLE_NAME'            => $current_style['style_name'],
                            'STYLE_COPYRIGHT'        => $current_style['style_copyright'],
                            'STYLE_USERS_COUNT'        => $style_users_count[$current_style['style_id']],
                        ));
                    }                    
                } 
User avatar
Marc
Administrator
Administrator
Posts: 620
Joined: Tue 2. Sep 2008, 22:48
phpbb.com: Marc
Location: Munich
Contact:

Re: phpBB statestic

Post by Marc »

It seems like one of your users has his default style set to one that doesn't exist. Make sure all users are set to a style that still exists. For example, if you only have one style, make sure it is set as default for all users.

If you can't find that user, try this:
Open includes/stats/stats_settings.php
Find:

Code: Select all

                        ++$style_users_count[$temp_user['user_style']]; 
Replace with:

Code: Select all

                        /** 
                        * Make sure we don't get an undefined index error
                        * this might happen if a user's default style is set to a style that doesn't exist anymore    
                        */
                        if(isset($style_users_count[$temp_user['user_style']]))
                        {
                            ++$style_users_count[$temp_user['user_style']];
                        } 
Image
Fire-Fox
Mitglied / Member
Mitglied / Member
Posts: 6
Joined: Tue 22. Sep 2009, 00:04
phpbb.com: 1015175

Re: phpBB statestic

Post by Fire-Fox »

Working thanks a million :)
Post Reply