Recent Topics

1 Jun 18, 2009 15:08    

My b2evolution Version: 2.4.6

Hello I have such a problem:

in index.main.php I have such part:

<?php
// -------------- MAIN CONTENT TEMPLATE INCLUDED HERE (Based on $disp) --------------
skin_include( '$disp$', array(
'disp_posts' => '', // We already handled this case above
'disp_single' => '', // We already handled this case above
'disp_page' => '', // We already handled this case above
'disp_laivas' => '_about.laivas.php', // apie laivą
'disp_kodeksas' => '_about.kodeksas.php', // apie kodeksą
'disp_igula' => '_about.igula.php', // apie igulą
) );
// Note: you can customize any of the sub templates included here by
// copying the matching php file into your skin directory.
// ------------------------- END OF MAIN CONTENT TEMPLATE ---------------------------
?>

and therefore If i'm accessing the path

http://stultifera.navis.lt/index.php?disp=laivas

I'm getting the content of the page inside the Main Content area. But the encoding is wrong. I'm using UTF-8 everywhere else.

Maybe the source of php page I have prepared to be static content should be modified somehow?

Here it is:

_about.laivas.php

<?php

//Check page isn't being accessed directly
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
{
//Show About page
?>
<h2 class="bTitle"><?php echo T_('name : some text') ?></h2>
<div class="bPost"><div class="bText">
<p>
content text here<br>
</p>
</div></div>
<?php
}
?>

should something be added before the content of the last php?

thanx,

Ben

2 Jun 18, 2009 15:56

In your index or posts or single or page.main.php file look for a little bit that says something like "change_post_locale_temp()" or something like that. Typically there is a comment saying it is changing the locale for the current post. There will also be a thing saying it is changing it back after the "post loop" completes each post. I'm only guessing here, but maybe you might need that before (and after) the content of each of your custom pages.

3 Jun 18, 2009 16:07

Hi

thanks, found the switching on and off parts of code in index.main.php:

<?php
$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)
?>

<?php
locale_restore_previous(); // Restore previous locale (Blog locale)
?>

But when I'm adding it to my static page, it comes with a message:

Fatal error: Call to a member function locale_temp_switch() on a non-object in /home/stent/domains/navis.lt/public_html/stultifera/skins/custom/_about.laivas.php on line 9

The line 9 contains:

$Item->locale_temp_switch(); // Temporarily switch to post locale (useful for multilingual blogs)

any ideas what's wrong, or why it is so?

Ben

4 Jun 18, 2009 16:13

Okay my bad. I took a totally random guess which was obviously wrong.

The problem with my guess is that there is no item for it to find the locale of ... and heck I'm not even sure why I think it would matter. Is your blog's main locale a UTF-8 locale? Oh and your locale in your profile. The thing is "locale" first uses the installation's locale, then the user's locale, then finally the post's locale for all the "localizable" bits.

Check that your Global Settings -> regional subtab shows your locale as something using UTF-8. Then check each blog's Blog settings -> general subtab for the same locale, then finally your profile under the Users tab.

This, by the way, is a more carefully constructed guess.

5 Jun 18, 2009 16:30

Well, I've tried all that and all that's correct. I guess you were right in the first answer just the question is where and what should be added to these pages.

you see, the other parts of the pages - the posts, the comments are in correct encoding. So there should be something with exactly these pages. I gues...

6 Jun 18, 2009 18:21

Might be worth checking your default locale, blog locale, post locale and user locale in admin area ;)

¥

7 Jun 18, 2009 18:29

2Yabba: I've done everything. Just how to check post locale?

Ben

8 Jun 19, 2009 08:42

Default Locale : admin > global settings > locales
User Locale : admin > users > [user]
Blog Locale : admin > blog settings > general
Post Locale : admin > write

It's more likely to be one of the first 3 as post locale only affects your actual post

¥

9 Jun 19, 2009 15:00

Hello,

well, all four locales are the same - LT (Lithaunian). The only place where I don't have encoding is these static pages...

there should be something with the file itself, or am I wrong?

10 Jun 19, 2009 15:11

@¥åßßå: what about the database encoding? Given that all user-settable bits are in the correct locale is it possible that the database is the culprit in not displaying this correctly?

11 Jun 19, 2009 15:14

I wouldn't have thought so ... more chance of the file not being saved as UTF-8 .... now there's a thought ;)

¥

12 Jun 19, 2009 15:33

Goddamit! :)))) I'm sorry guys, that was the most stupid mistake I've ever made :)

The files - all of them - are saved in ANSI...

13 Jun 19, 2009 15:37

I was gonna suggest that but wanted to give ¥åßßå a chance to get one right :roll:

14 Jun 19, 2009 15:49

BenasPlentas wrote:

Goddamit! :))))

Muppet :P

EdB wrote:

I was gonna suggest that but wanted to give ¥åßßå a chance to get one right :roll:

*salutes* thank you for the great opportunity Sir :D

¥


Form is loading...