phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

$lang array is losing its data on some phpbb scripts


 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
transm
Board Member



Joined: 28 Jun 2009

Posts: 13


flag
PostPosted: Tue Nov 22, 2011 4:41 am 
Post subject: $lang array is losing its data on some phpbb scripts

In the past months I've had to keep repeating include($phpbb_root_path . 'language/lang_english/whateverlanguagefilethatsneeded.php'); in weird places further down some scripts as it seems like it is losing the data in the middle of the script somewhere so it isn't sufficient to add it just at the start (this has happened in a couple of scripts at least resulting in missing words and links in tables usually). Anyone else found this and have any idea why it's happening (probably something to do with server settings but I didn't change anything and it worked fine for years)?
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 430
Location: Québec


flag
PostPosted: Tue Nov 22, 2011 7:22 am 
Post subject: Re: $lang array is losing its data on some phpbb scripts

Haven't noticed anything like this on my boards, but it might be worth asking your host if they updated PHP or MySQL. Maybe the new version is breaking something in phpBB that "we" will need to fix.

I take it you didn't install any new mods or make any changes shortly before the issue appeared?
Back to top
drathbun
Board Member



Joined: 24 Jul 2008

Posts: 666
Location: Texas


flag
PostPosted: Tue Nov 22, 2011 3:23 pm 
Post subject: Re: $lang array is losing its data on some phpbb scripts

I've not noticed it. Are you sure that you've not installed any new MODs or anything along those lines?
_________________
phpBBDoctor Blog
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Nov 22, 2011 3:54 pm 
Post subject: Re: $lang array is losing its data on some phpbb scripts

I have never experienced this nor heard of anybody else seeing this problem.
_________________
phpBB2 will never die, I hope!
Back to top
transm
Board Member



Joined: 28 Jun 2009

Posts: 13


flag
PostPosted: Tue Nov 22, 2011 4:08 pm 
Post subject: Re: $lang array is losing its data on some phpbb scripts

Well the latest incident happened a couple of months ago...it involves the activity mod.... I only just got around to fixing it. Had to fix both newscore.php and activity.php but not sure why the links and text in tables suddenly disappeared due to this. I'll check with my host. I think I had to fix something similar a bit earlier but I can't remember what it was. It was something to do with reinitialising an array but not sure if it was $lang or something else.
Back to top
dogs and things
Board Member



Joined: 18 Nov 2008

Posts: 621
Location: Spain


flag
PostPosted: Tue Nov 22, 2011 7:02 pm 
Post subject: Re: $lang array is losing its data on some phpbb scripts

Did you check your server's error logs?

It is possible that some error message related to this issue shows up in them. If it does, with a bit of luck, it will help you understand what goes wrong and where.

_________________
phpBB2 will never die, I hope!
Back to top
transm
Board Member



Joined: 28 Jun 2009

Posts: 13


flag
PostPosted: Tue Nov 22, 2011 10:22 pm 
Post subject: Re: $lang array is losing its data on some phpbb scripts

I just had to do it on another script..... I've discovered a bit more now which is that the $lang files have to be included after session management. When it is added before the session management (which was how it was before), the page is missing the text from the language file. It works when I include it afterwards.

Code:
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//

//added after instead of before
include($phpbb_root_path . 'language/lang_' . $board_config['default_lang'] . '/lang_slotmachine.' . $phpEx);


I'll have to look in sessions.php and functions.php for the problem (where those functions are from) it must be doing something to $lang.

P.S. It looks like the session management adds a lot to $lang but seems to be missing the included one (I used print_r to check). Has to be added afterwards. Maybe it's something I did.

EDIT: Well I've given up on this as I can't see any strange references to $lang in sessions.php or functions.php so is there anywhere else I should look? I do remember fixing something before I think related to this but not sure where it was. Actually I checked for modified files and I haven't modified anything in ages in either the forum or the includes folders so I doubt it was something I did.
Back to top
Salvatos
Board Member



Joined: 19 Feb 2009

Posts: 430
Location: Québec


flag
PostPosted: Tue Nov 22, 2011 11:16 pm 
Post subject: Re: $lang array is losing its data on some phpbb scripts

I'm not sure I'm following. First you say that it works ("It works when I include it afterwards."), but then you say you're giving up.

What exactly is missing and where? Is it only in newscore.php and activity.php from your custom language files? If so, can you upload them so we can see what's wrong?
Back to top
transm
Board Member



Joined: 28 Jun 2009

Posts: 13


flag
PostPosted: Wed Nov 23, 2011 12:53 am 
Post subject: Re: $lang array is losing its data on some phpbb scripts

It doesn't work any more where the $lang is included before the session management. I had to move it to after that. I later mentioned another script not working unrelated to activity mod but I'm not sure if it's just some $lang files that don't work before the session management or all of them (don't think it's related to the language file, though). Those scripts used to work before without the changes.
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 1 of 1 All times are GMT
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0271 seconds using 15 queries. (SQL 0.0023 Parse 0.0009 Other 0.0239)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo