Jump to content

[SOLVED] Two languages and TemplateSet.class problem


Recommended Posts

Posted

Hi,

Firstly, I should like to apologise for my English ! I wanted to propose my Virtual airline's website in different languages so with forum's explanation I did like this : http://forum.phpvms....ins/#entry22043

I started to translate and after a bit a problem occured, I tried to resolve it by myself without solution and I searched an alternative on forum where the same problem is exposed but the solution isn't published.

See you here :http://forum.phpvms....-two-languages/

My issue :

Notice: The template file "/home/airlibva/www//lib/skins/ocean_blue/action.php/acars/data/header.tpl" doesn't exist in /home/airlibva/www/core/classes/TemplateSet.class.php on line 248

Maybe the problem is here :

/home/airlibva/www//lib/skins/ocean_blue/action.php/acars/data/header.tpl

Please, Do You've any idea where is the trouble ?

Thanks a lot

Posted

Hi Tom, thank's for your answer, no I didn't to. I just added in /core/codon.config.php this :

session_start();

if(isset($_GET['template']) && $_GET['template'] != ''){

$_SESSION['template'] = $_GET['template'];

define('CURRENT_SKIN',$_GET['template']);

}

if(isset($_SESSION['template']) && $_SESSION['template'] != '')

{

define('CURRENT_SKIN',$_SESSION['template']);

}

Then I created a second skin's folder and make link to there in my core_navigation.php like this :

Posted

I added it like this and it works :

session_start();

if(isset($_GET['template']) && $_GET['template'] != ''){

$_SESSION['template'] = $_GET['template'];

define('CURRENT_SKIN',$_GET['template']);

}

if(isset($_SESSION['template']) && $_SESSION['template'] != '')

{

define('CURRENT_SKIN',$_SESSION['template']);

}

print_r(CURRENT_SKIN);

Thanks a lot !

Can you explain me why the first time was failed ?

Posted

That wasn't supposed to fix it, only reveal what CURRENT_SKIN was set to... strange.

You shouldn't really be printing things like that on a live site, especially not permanently.

Posted

Ok and can you name the folders you're using that work?

print_r(CURRENT_SKIN) should output the value of CURRENT_SKIN, allowing you to see what's being set (and perhaps where it's going wrong)

Posted

I did it and same result with the "?=template"

EDIT : I've issues cause my website appears without www. ! With www. behind the adress no problem, how to force www. to be present ?

Posted

Inside .htaccess in the root of your public folder:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^airnationalva.fr [NC]
RewriteRule ^(.*)$ http://www.airnationalva.fr/$1 [L,R=301]

Posted

Thanks Tom ! Now I've www behind my website adress but... now the issues is come with "www"...

I don't understand really, yesterday with website adress and www it worked...

I must be inactive by comment this code in order to use the VA, really don't understand

if(isset($_GET['template']) && $_GET ['template'] != ''){

$_SESSION['template'] = $_GET['template'];

define('CURRENT_SKIN',$_GET['template']);

}

if(isset($_SESSION['template']) && $_SESSION['template'] != '')

{

define('CURRENT_SKIN',$_SESSION['template']);

}

print_r(CURRENT_SKIN);

print_r($_SESSION['template']);

already this error with the precedent code uncomment :

Notice: The template file "/home/airlibva/www//lib/skins/ocean_blue_french/action.php/acars/data/header.tpl" doesn't exist in /home/airlibva/www/core/classes/TemplateSet.class.php on line 248

EDIT : I delete our actual skin, we have an other problem more important to corrige...

EDIT: Login problem solved, always the skin problem.

  • Members
Posted

Step 1 add the this code on the top of your local.config.php

<?php
session_start();
if(isset($_GET['template']) && $_GET['template'] != ''){
		    $_SESSION['template'] = $_GET['template'];
		    define('CURRENT_SKIN',$_GET['template']);
}
if(isset($_SESSION['template']) && $_SESSION['template'] != '')
{
		    define('CURRENT_SKIN',$_SESSION['template']);
}
?>

Step 2 Create 2 folders

WIth the names

ocean_blueEn

and

ocean_blueFR

In the admin section make 1 of the 2 default template

Make sure your links are correct.

If you want to open your website in english your link should be

www.yourlink.com/index.php/acars/?template=ocean_blueEn

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...