Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Aiheen aloitti: gupp - maaliskuu 31, 2010, 09:04:12 IP

Otsikko: language? error using ssi.php
Kirjoitti: gupp - maaliskuu 31, 2010, 09:04:12 IP
I've been hand coding html for a long time but I'm totally lost in php. I'm trying to use ssi.php to start better incorporating smf into the rest of my web site. So I'm starting with my main web site page. I've set up a duplicate test page to try to work things out on it before I try to go live. It seems like it should work out right but I'm getting an error code at the top of the page.

Lainaa
Notice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865

Notice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865

Notice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865

Notice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865

Any idea what I should do here? The test page is here:
http://naturalaquariums.com/testdefault.php
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - maaliskuu 31, 2010, 09:07:01 IP
Sorry I should have maybe explained more. I'm just trying to put the most recent posts from the forum on my main home page of my site right now.
Otsikko: Re: language? error using ssi.php
Kirjoitti: Kays - maaliskuu 31, 2010, 09:41:16 IP
Hi, which language are you using?

Look in index.{language}.php in the default theme folder. Do you see this or something similar towards the top.


$txt['lang_locale'] = 'en_US';
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - maaliskuu 31, 2010, 10:14:42 IP
English, and Yes, I found the line,  sorry it took me a minute to figure out where you meant.
Otsikko: Re: language? error using ssi.php
Kirjoitti: Kays - maaliskuu 31, 2010, 10:35:00 IP
That shouldn't be happening then.

Can you post the code you are using?
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - maaliskuu 31, 2010, 10:44:40 IP
All I've done is added this code and then switched my page from html to php, added
Lainaa<?php require("bb/SSI.php"); ?>
at the top and
Lainaa<?php ssi_recentPosts(); ?>
to show the posts, otherwise I just changed my includes to php.

Could it be from using a changed theme. Would adding the
Lainaaindex.{language}.php
to the same place in the folder of the theme I'm using help in any way. Or is there some way my css would interfere in some way?
Otsikko: Re: language? error using ssi.php
Kirjoitti: Kays - maaliskuu 31, 2010, 10:52:19 IP
Yes, check to see if there's a index.english.php file in the languages for that theme. But normally the language files from the default theme are used.
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - maaliskuu 31, 2010, 11:16:59 IP
There was no language folder in that theme. I added it but it doesn't seem to help. At least if you're stumped I don't feel quite so bad about not being able to figure it out myself. :)
Otsikko: Re: language? error using ssi.php
Kirjoitti: Kays - maaliskuu 31, 2010, 11:46:10 IP
I don't know why it's happening, But one way to clear the error is add that language string before the call to ssi_recentPosts.


<?php
$txt
['lang_locale'] = 'en_US';
ssi_recentPosts(); 
?>

Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 01, 2010, 12:28:29 AP
Amazingly that didn't work either. I may have to finish working on this project in the morning. I'm going to try to pair it down to a test page with nothing but the basic page, and the php require and recent posts and see what that does. At least that will pin it down to either something interfering in the page or something I've messed up somewhere along the way with changing the theme in smf. I can also try to see if changing to the original default theme might help too so at least maybe I can find where to start looking for the problem.
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 01, 2010, 12:40:41 AP
Sigh, well I tried simplifying it. I made a page

http://www.naturalaquariums.com/test.php

with nothing but this on it

Lainaa<?php require("bb/SSI.php"); ?>
<?php
$txt['lang_locale'] = 'en_US';
ssi_recentPosts();
?>

and this was the result

LainaaNotice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865

Notice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865

Notice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865

Notice: Undefined index: lang_locale in /home/natur9/public_html/bb/Sources/Subs.php on line 865
[Announcements]   Re: Another new Gallery Update by EMc/   Today at 07:13:29 PM
[The Think Tank/ DIY]   Re: Vintage 75 Gallon Metaframe Aquarium restoration by austinado16   Today at 01:52:42 PM
[Chitter/ Chatter]   Re: The Adventure of Merlin by gupp   Today at 01:15:17 PM
[The Think Tank/ DIY]   Re: Vintage 75 Gallon Metaframe Aquarium restoration by gupp   Today at 01:13:55 PM
[Announcements]   Re: Another new Gallery Update by gupp   Today at 01:06:02 PM
[The Think Tank/ DIY]   Re: Vintage 75 Gallon Metaframe Aquarium restoration by austinado16   Today at 01:03:08 PM
[Chitter/ Chatter]   Re: How to turn "water" into marbles by gupp   Today at 12:58:43 PM
[The Think Tank/ DIY]   Re: Vintage 75 Gallon Metaframe Aquarium restoration by gupp   Today at 12:56:21 PM

Not sure what's going on. Any other ideas of what to do next. I'm going to have to sleep a bit, getting late here, but I'll start working on it again in the morning.

Thanks,
Rhonda
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 01, 2010, 09:00:07 AP
I'm still getting the error message. Even in a totally cut down page. So it must be somewhere in my version of smf and what's happened to it. I don't even know where to start looking. Does anyone else have any ideas?
Otsikko: Re: language? error using ssi.php
Kirjoitti: Kays - huhtikuu 01, 2010, 10:00:17 AP
If you go to ssi_examples.php does it do it there?
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 01, 2010, 10:26:04 AP
Yes it does.
Otsikko: Re: language? error using ssi.php
Kirjoitti: Kays - huhtikuu 01, 2010, 04:03:25 IP
Can you attach SSI.php to a post?

I wonder if the problem is there.
Otsikko: Re: language? error using ssi.php
Kirjoitti: Arantor - huhtikuu 01, 2010, 05:37:01 IP
Or maybe it's in Subs.php...
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 02, 2010, 10:57:23 AP
Thank you so much for your help. I hope you can find it.
Otsikko: Re: language? error using ssi.php
Kirjoitti: Arantor - huhtikuu 02, 2010, 10:58:13 AP
/me wonders why, when it's calling for an error in Subs.php, everyone wants to look at an unrelated file...
Otsikko: Re: language? error using ssi.php
Kirjoitti: MrPhil - huhtikuu 02, 2010, 11:30:51 AP
Your SSI.php is identical to the one shipped with SMF 1.1.11 (and earlier). How about attaching your Sources/Subs.php file? Maybe that's been corrupted somehow, such that $txt is no longer global in the timeformat() function?
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 02, 2010, 12:33:49 IP
Subs.php. Hopefully it's in there.  Thank you everyone again!
Otsikko: Re: language? error using ssi.php
Kirjoitti: Arantor - huhtikuu 02, 2010, 12:37:35 IP
Hmmm, this is interesting - and weird.

Please can you also attach the index.english.php from Themes/default/languages/ ?
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 02, 2010, 12:44:52 IP
Here it is.
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 02, 2010, 12:48:01 IP
I've had the forum for so long and my theme is really old and then I changed it a bit here and there several times over the years, plus I have a couple volunteers that help, so if there's something funny in one of my files I'm not surprised. Thank you for looking in these for me. I'm pretty lost at where to even start.
Otsikko: Re: language? error using ssi.php
Kirjoitti: Arantor - huhtikuu 02, 2010, 12:53:19 IP
Weird. The file looks right, too.

/me is confused too.
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 02, 2010, 01:24:48 IP
Any other ideas, or files I might look in to?
Otsikko: Re: language? error using ssi.php
Kirjoitti: MrPhil - huhtikuu 02, 2010, 01:59:52 IP
The only thing I see that might possibly be causing problems is the call to loadLanguage('Ads');. Do you have an Ads.<language>.php file in your theme? Could you attach it? I'm wondering if perhaps it's resetting (clearing out) $txt for some reason. In your Sources/Subs.php, try commenting out the line
loadLanguage('Ads');
(change to
//loadLanguage('Ads');
) and see if it stops the error you reported (there might be other errors popping up now).
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 02, 2010, 02:42:10 IP
I'm looking for the line now. I'll tell you how it works when I replace it. Here is the ads.english.php file. I believe these are for a mod that allows us to put space for ads and other little things on the side and bottom of the forum.
Otsikko: Re: language? error using ssi.php
Kirjoitti: gupp - huhtikuu 02, 2010, 02:55:20 IP
I changed the loadLanguage('Ads'); to //loadLanguage('Ads'); and it didn't seem to do anything at all.
Otsikko: Re: language? error using ssi.php
Kirjoitti: MrPhil - huhtikuu 02, 2010, 06:01:36 IP
I don't see anything obvious in Ads.english.php that would be removing any existing elements from $txt. The only thing odd is that it defines $txt['ad_manage_show_credits'] as an absolutely humongous string. I'm wondering if it's overflowing something in PHP or otherwise causing trouble. Anyway, at this point, the last thing I can suggest is first uncommenting loadLanguage('Ads'); and then in Ads.english.php, comment out the existing line and replacing it with something short:
$txt['ad_manage_show_credits'] = '
<p>Thank you!</p>';                                     <=== new
/*                                                      <=== new
<p>Thank you for installing my.....
....electrohome (Jeremy)
';
*/                                                      <=== new


If that improves matters, we'll know the problem is in there. If it doesn't, change it back, and I'm out of ideas.
Otsikko: Re: language? error using ssi.php
Kirjoitti: Kays - huhtikuu 03, 2010, 11:24:10 AP
Lainaus käyttäjältä: Arantor - huhtikuu 02, 2010, 10:58:13 AP
/me wonders why, when it's calling for an error in Subs.php, everyone wants to look at an unrelated file...

My main reasoning for looking in SSI.php is that it looked like something in the ssi_recentPosts function was breaking it. If the problem was in Subs.php with the timeformat function I would expect to see more errors elsewhere. Like in the error log. Which, if the problem persists, would be a good place to look to see if other pages are generating this error.