Page 1 of 1

[ASK] how to import common.php language

Posted: Fri 6. Jul 2012, 03:39
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 !!

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

Posted: Fri 6. Jul 2012, 20:15
by Marc
Did you globalize $user?

Code: Select all

global $user;

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

Posted: Sat 7. Jul 2012, 00:40
by peney
yes i did... :roll:

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

Posted: Sun 8. Jul 2012, 00:11
by Marc
Do you have debug mode enabled in config.php?

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

Posted: Sun 8. Jul 2012, 13:48
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);

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

Posted: Sun 8. Jul 2012, 14:58
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);

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

Posted: Mon 9. Jul 2012, 03:20
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:

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

Posted: Tue 10. Jul 2012, 03:22
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:

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

Posted: Tue 10. Jul 2012, 10:30
by Marc
That would explain it. :lol:

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

Posted: Tue 24. Jul 2012, 11:09
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