Welcome Guest, Not a member yet? Register   Sign In
SharpEdge CMS 3.36.50 Launched!
#21

[eluser]Altazar[/eluser]
Controller flags.php
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Flags extends MY_Controller {

function index()
{
  parent::MY_Controller();
  $this->load->view('flags');
}
}
View flags.php
Code:
<?php
$put = "assets/images/flags/";
echo anchor($this->lang->switch_uri('en'), img($put.'en.png'));
echo anchor($this->lang->switch_uri('de'), img($put.'de.png'));
echo anchor($this->lang->switch_uri('es'), img($put.'es.png'));
echo anchor($this->lang->switch_uri('fi'), img($put.'fi.png'));
echo anchor($this->lang->switch_uri('fr'), img($put.'fr.png'));
echo anchor($this->lang->switch_uri('gr'), img($put.'gr.png'));
echo anchor($this->lang->switch_uri('hr'), img($put.'hr.png'));
echo anchor($this->lang->switch_uri('bg'), img($put.'bg.png'));
echo anchor($this->lang->switch_uri('ba'), img($put.'ba.png'));
echo anchor($this->lang->switch_uri('cz'), img($put.'cz.png'));
echo anchor($this->lang->switch_uri('hu'), img($put.'hu.png'));
echo anchor($this->lang->switch_uri('ie'), img($put.'ie.png'));
echo anchor($this->lang->switch_uri('is'), img($put.'is.png'));
echo anchor($this->lang->switch_uri('al'), img($put.'al.png'));
echo anchor($this->lang->switch_uri('it'), img($put.'it.png'));
echo anchor($this->lang->switch_uri('me'), img($put.'me.png'));
echo anchor($this->lang->switch_uri('mk'), img($put.'mk.png'));
echo anchor($this->lang->switch_uri('nl'), img($put.'nl.png'));
echo anchor($this->lang->switch_uri('no'), img($put.'no.png'));
echo anchor($this->lang->switch_uri('pl'), img($put.'pl.png'));
echo anchor($this->lang->switch_uri('pt'), img($put.'pt.png'));
echo anchor($this->lang->switch_uri('rs'), img($put.'rs.png'));
echo anchor($this->lang->switch_uri('ro'), img($put.'ro.png'));
echo anchor($this->lang->switch_uri('ru'), img($put.'ru.png'));
echo anchor($this->lang->switch_uri('se'), img($put.'se.png'));
echo anchor($this->lang->switch_uri('si'), img($put.'si.png'));
echo anchor($this->lang->switch_uri('sk'), img($put.'sk.png'));
echo anchor($this->lang->switch_uri('tr'), img($put.'tr.png'));
echo anchor($this->lang->switch_uri('ua'), img($put.'ua.png'));
?>
Why the View is not loaded?
"put" = "path" and flags are there but nothing shows up.
#22

[eluser]Altazar[/eluser]
Now the login is gone from the front page.
I get no error messages, only blank screens.
There was no logs folder, I've created it and a file appeared which says only things like this:
Quote:Severity: Warning --&gt; date() [<a href='function.date'>function.date</a>]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/Berlin' for 'CET/1.0/no DST' instead /var/www/vhosts/.../httpdocs/framework_2_1_3/libraries/Log.php 86
$config['log_threshold'] = 4;
#23

[eluser]srpurdy[/eluser]
This error has to do with php.ini you can also set the timezone in the index.php of codeigniter. So really it's just PHP complaining.

As for your view file, where is the flags.php file ? do you have this in your modules/flags/views folder?

Also you shouldn't need parent::MY_Controller(); in the index() function

You should make a function above index() call it flags()

Like this

Code:
function flags()
{
parent::__construct();
}

"Edit" I also added the logs folder to the github repo.

From yuor screenshot above apache is loading php5 and fcgid. So you need to actually choose which handler to use. I think in plesk if you click on your domain to edit settings for it. It should have a drop down that you can select which php mode to use. fcgid isn't exactly the same as fastcgi but it does the samething basically. So should work fine.
#24

[eluser]Altazar[/eluser]
First I tried to put Flags views in Flags module's Views folder.
Than I saw that you don't have any Views folders in Modules.

I've moved it to my theme under Flags, but still getting a blank page.
Code:
&lt;?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Flags extends MY_Controller {

function Flags()
{
  parent::__construct();
}

function index()
{
  $this->load->view(['theme_path'] . 'flags/flags_content');
}
}
This is the actual Flags view, with sprite image.
Code:
&lt;?php
$put = "style/flags/blank.png";
echo anchor($this->lang->switch_uri('en'), img(array($put, 'class' => 'flag flag-en', 'alt' => 'English'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('de'), img(array($put, 'class' => 'flag flag-de', 'alt' => 'Deutsch'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('hr'), img(array($put, 'class' => 'flag flag-hr', 'alt' => 'Hrvatski'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('ba'), img(array($put, 'class' => 'flag flag-ba', 'alt' => 'Bosanski'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('bg'), img(array($put, 'class' => 'flag flag-bg', 'alt' => 'Българският'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('cz'), img(array($put, 'class' => 'flag flag-cz', 'alt' => 'Český'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('dk'), img(array($put, 'class' => 'flag flag-dk', 'alt' => 'Dansk'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('es'), img(array($put, 'class' => 'flag flag-es', 'alt' => 'Español'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('fi'), img(array($put, 'class' => 'flag flag-fi', 'alt' => 'Suomi'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('fr'), img(array($put, 'class' => 'flag flag-fr', 'alt' => 'Français'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('gr'), img(array($put, 'class' => 'flag flag-gr', 'alt' => 'Ελληνικά'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('al'), img(array($put, 'class' => 'flag flag-al', 'alt' => 'Shqip'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('hu'), img(array($put, 'class' => 'flag flag-hu', 'alt' => 'Magyar'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('ie'), img(array($put, 'class' => 'flag flag-ie', 'alt' => 'Gaeilge'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('is'), img(array($put, 'class' => 'flag flag-is', 'alt' => 'Íslenska'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('it'), img(array($put, 'class' => 'flag flag-it', 'alt' => 'Italiano'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('me'), img(array($put, 'class' => 'flag flag-me', 'alt' => 'Црногорски'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('mk'), img(array($put, 'class' => 'flag flag-mk', 'alt' => 'Македонски'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('nl'), img(array($put, 'class' => 'flag flag-nl', 'alt' => 'Nederlands'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('no'), img(array($put, 'class' => 'flag flag-no', 'alt' => 'Norsk'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('pl'), img(array($put, 'class' => 'flag flag-pl', 'alt' => 'Polski'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('pt'), img(array($put, 'class' => 'flag flag-pt', 'alt' => 'Português'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('ro'), img(array($put, 'class' => 'flag flag-ro', 'alt' => 'Română'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('rs'), img(array($put, 'class' => 'flag flag-rs', 'alt' => 'Српски'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('ru'), img(array($put, 'class' => 'flag flag-ru', 'alt' => 'Русский'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('se'), img(array($put, 'class' => 'flag flag-se', 'alt' => 'Svenska'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('si'), img(array($put, 'class' => 'flag flag-si', 'alt' => 'Slovénščina'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('sk'), img(array($put, 'class' => 'flag flag-sk', 'alt' => 'Slovenský'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('tr'), img(array($put, 'class' => 'flag flag-tr', 'alt' => 'Türkçe'))) . PHP_EOL;
echo anchor($this->lang->switch_uri('ua'), img(array($put, 'class' => 'flag flag-ua', 'alt' => 'Українська'))) . PHP_EOL;
?&gt;
Even if I'd make a flags library (I don't know how), where should I put flags view?
And also I have many static multilingual pages, each is a module with Controllers, Languages and Views folders, I just don't know how to integrate them with SharpEdge CMS. :roll:
#25

[eluser]srpurdy[/eluser]
change this
Code:
function index()
{
  $this->load->view(['theme_path'] . 'flags/flags_content');
}

to this
Code:
function index()
{
$template_path = $this->config->item('template_page');
$this->load->view($template_path . '/flags/flags_content');
}

make sure your file in the themes/flags/ folder is called flags_content.php
#26

[eluser]Altazar[/eluser]
Thanks, but it's still not working and the problem must be in flags_content.php (view file). When I echo something, view works. The problem is "anchor" or "switch_uri". I've had the same issue before, when moving to HMVC. It was in core/MY_Lang. Class MY_Lang should extend MX_Lang, not CI_Lang. I've changed it in SharpCMS, but it didn't help.

I switched off php5 in Apache Modules, and I see PHP code in browser.
Should I switch off "fcgid" instead?
#27

[eluser]srpurdy[/eluser]
http://kb.mediatemple.net/questions/1890...CGI?#dv_40

Should be the same for you. So you should re-enable php5 in the modules, but follow this to make your domain use fcgid.

if you want to email me your module files. I can see if I can get it to work.

Shawn
#28

[eluser]Altazar[/eluser]
Thanks, I'll study it.

I've sent you an email over SharpEdge contact form.

Here's CSS and flags sprite image.
Code:
.flag {
width: 30px;
height: 22px;
background:url(flags/sprite.png) no-repeat;
margin: 1px;
}

.flag-en {background-position:0 0;}
.flag-de {background-position:-31px 0;}
.flag-hr {background-position:-62px 0;}
.flag-ba {background-position:-93px 0;}
.flag-bg {background-position:-124px 0;}
.flag-cz {background-position:-155px 0;}
.flag-dk {background-position:-186px 0;}
.flag-es {background-position:-217px 0;}
.flag-fi {background-position:-248px 0;}
.flag-fr {background-position:-279px 0;}

.flag-gr {background-position:0 -23px;}
.flag-al {background-position:-31px -23px;}
.flag-hu {background-position:-62px -23px;}
.flag-ie {background-position:-93px -23px;}
.flag-is {background-position:-124px -23px;}
.flag-it {background-position:-155px -23px;}
.flag-me {background-position:-186px -23px;}
.flag-mk {background-position:-217px -23px;}
.flag-nl {background-position:-248px -23px;}
.flag-no {background-position:-279px -23px;}

.flag-pl {background-position:0 -46px;}
.flag-pt {background-position:-31px -46px;}
.flag-ro {background-position:-62px -46px;}
.flag-rs {background-position:-93px -46px;}
.flag-ru {background-position:-124px -46px;}
.flag-se {background-position:-155px -46px;}
.flag-si {background-position:-186px -46px;}
.flag-sk {background-position:-217px -46px;}
.flag-tr {background-position:-248px -46px;}
.flag-ua {background-position:-279px -46px;}
#29

[eluser]Altazar[/eluser]
I've successfully made server change as you suggested, following the link you sent me. FastCGI is active now.
I've removed old installation and emptied the database, than installed fresh copy of SharpEdge. There were no errors during installation, no need to change write permissions on any file or folder. Everything is fine.
#30

[eluser]srpurdy[/eluser]
[quote author="Altazar" date="1361876475"]I've successfully made server change as you suggested, following the link you sent me. FastCGI is active now.
I've removed old installation and emptied the database, than installed fresh copy of SharpEdge. There were no errors during installation, no need to change write permissions on any file or folder. Everything is fine.[/quote]

Cool yeah, much more secure way to run any php application. Smile

I sent you a fix for anchor() and switch_uri() these will be included in an updated once I'm sure they are stable. Making sure there is no side effects.

Shawn




Theme © iAndrew 2016 - Forum software by © MyBB