[ASK] how to import common.php language

Current Version: 1.0.2
Released: 04/25/2010
Post Reply
peney
Mitglied / Member
Mitglied / Member
Posts: 5
Joined: Fri 6. Jul 2012, 03:10
phpbb.com: peney

[ASK] how to import common.php language

Post by peney »

Hi.. i am trying to make this mod add on. i was wondering, can we use common.php language in function load_stats() ? i tried $user->lang['Jan'] $user->lang['Feb'] etc but it returns nothing. i also tried $user->setup('common') and $user->add_lang but the result still nothing. sorry if the answer is too obvious or trivial :(


anyone can help me ? :)
thanks !!
User avatar
Marc
Administrator
Administrator
Posts: 620
Joined: Tue 2. Sep 2008, 22:48
phpbb.com: Marc
Location: Munich
Contact:

Re: [ASK] how to import common.php language

Post by Marc »

Did you globalize $user?

Code: Select all

global $user;
Image
peney
Mitglied / Member
Mitglied / Member
Posts: 5
Joined: Fri 6. Jul 2012, 03:10
phpbb.com: peney

Re: [ASK] how to import common.php language

Post by peney »

yes i did... :roll:
User avatar
Marc
Administrator
Administrator
Posts: 620
Joined: Tue 2. Sep 2008, 22:48
phpbb.com: Marc
Location: Munich
Contact:

Re: [ASK] how to import common.php language

Post by Marc »

Do you have debug mode enabled in config.php?
Image
peney
Mitglied / Member
Mitglied / Member
Posts: 5
Joined: Fri 6. Jul 2012, 03:10
phpbb.com: peney

Re: [ASK] how to import common.php language

Post by peney »

i never change config.php. isn't that auto generated ? but i find this code :

Code: Select all

@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
User avatar
Marc
Administrator
Administrator
Posts: 620
Joined: Tue 2. Sep 2008, 22:48
phpbb.com: Marc
Location: Munich
Contact:

Re: [ASK] how to import common.php language

Post by Marc »

Please remove the 2 slashes in front of the debug constant in order for it to look like this:

Code: Select all

@define('PHPBB_INSTALLED', true);
@define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
Image
peney
Mitglied / Member
Mitglied / Member
Posts: 5
Joined: Fri 6. Jul 2012, 03:10
phpbb.com: peney

Re: [ASK] how to import common.php language

Post by peney »

it gives me a lot of errors and warnings
[+] debug
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 111: Undefined variable: forum_id
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 114: Undefined index: Jan
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 115: Undefined index: Feb
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 116: Undefined index: Mar
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 117: Undefined index: Apr
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 118: Undefined index: May_short
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 119: Undefined index: Jun
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 120: Undefined index: Jul
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 121: Undefined index: Aug
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 122: Undefined index: Sep
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 123: Undefined index: Oct
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 124: Undefined index: Nov
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 125: Undefined index: Dec
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined variable: month_option
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 130: Undefined index: STAT_CHART
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 136: Undefined variable: day_option
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Notice: in file [ROOT]/statistics/addons/stats_chart.php on line 135: Undefined variable: now
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4678: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4680: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4681: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4682: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
what should i do ? :shock:
peney
Mitglied / Member
Mitglied / Member
Posts: 5
Joined: Fri 6. Jul 2012, 03:10
phpbb.com: peney

Re: [ASK] how to import common.php language

Post by peney »

ah nvm, :-D after all this time i ve realized that i did stupid mistake. Months are located in datetime array. Yes, it is a multidimensional array. So i use $user->lang['datetime']['Jan'] instead and it works perfectly. Btw thanks Marc, you can lock this topic now :lol:
User avatar
Marc
Administrator
Administrator
Posts: 620
Joined: Tue 2. Sep 2008, 22:48
phpbb.com: Marc
Location: Munich
Contact:

Re: [ASK] how to import common.php language

Post by Marc »

That would explain it. :lol:
Image
adina728
Newbie
Newbie
Posts: 1
Joined: Tue 24. Jul 2012, 11:01

Re: [ASK] how to import common.php language

Post by adina728 »

After all this time i ve realized that i did stupid mistake. Months are located in datetime array. Yes, it is a multidimensional array. So i use $user->lang['datetime']['Jan'] instead and it works perfectly. Btw thanks Marc, you can lock this topic now :-P
Post Reply