[ASK] how to import common.php language

Current Version: 1.0.2
Released: 04/25/2010
peney
Mitglied / Member
Mitglied / Member
Beiträge: 5
Registriert: Fr 6. Jul 2012, 04:10
phpbb.com: peney

[ASK] how to import common.php language

Beitrag von 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 !!
Benutzeravatar
Marc
Administrator
Administrator
Beiträge: 620
Registriert: Di 2. Sep 2008, 23:48
phpbb.com: Marc
Wohnort: Munich

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

Beitrag von Marc »

Did you globalize $user?

Code: Alles auswählen

global $user;
Bild
peney
Mitglied / Member
Mitglied / Member
Beiträge: 5
Registriert: Fr 6. Jul 2012, 04:10
phpbb.com: peney

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

Beitrag von peney »

yes i did... :roll:
Benutzeravatar
Marc
Administrator
Administrator
Beiträge: 620
Registriert: Di 2. Sep 2008, 23:48
phpbb.com: Marc
Wohnort: Munich

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

Beitrag von Marc »

Do you have debug mode enabled in config.php?
Bild
peney
Mitglied / Member
Mitglied / Member
Beiträge: 5
Registriert: Fr 6. Jul 2012, 04:10
phpbb.com: peney

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

Beitrag von peney »

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

Code: Alles auswählen

@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
Benutzeravatar
Marc
Administrator
Administrator
Beiträge: 620
Registriert: Di 2. Sep 2008, 23:48
phpbb.com: Marc
Wohnort: Munich

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

Beitrag von Marc »

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

Code: Alles auswählen

@define('PHPBB_INSTALLED', true);
@define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
Bild
peney
Mitglied / Member
Mitglied / Member
Beiträge: 5
Registriert: Fr 6. Jul 2012, 04:10
phpbb.com: peney

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

Beitrag von 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
Beiträge: 5
Registriert: Fr 6. Jul 2012, 04:10
phpbb.com: peney

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

Beitrag von 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:
Benutzeravatar
Marc
Administrator
Administrator
Beiträge: 620
Registriert: Di 2. Sep 2008, 23:48
phpbb.com: Marc
Wohnort: Munich

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

Beitrag von Marc »

That would explain it. :lol:
Bild
adina728
Newbie
Newbie
Beiträge: 1
Registriert: Di 24. Jul 2012, 12:01

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

Beitrag von 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