Welcome Guest, Not a member yet? Register   Sign In
setlocale() Turkish date problem
#1

[eluser]Unknown[/eluser]
Hi,

I am trying to use setlocale() for the dates.

Code:
setlocale(LC_ALL, 'tr_TR.UTF-8');
echo strftime("%e %B %Y %A", mktime(0, 0, 0,$month,$day,$year));

Other languages work fine but when I try to use Turkish (tr_TR.UTF-8 and tr_TR), it gives me this error.

Fatal error: Class 'CI_Base' not found in /domain/html/system/codeigniter/Base5.php on line 50

Does anybody have any idea?

Thanks.
#2

[eluser]Cagri[/eluser]
I have the same problem. I have tr_TR, tr_TR.iso88599 and tr_TR.UTF-8.

Fatal error: Class 'CI_Controller' not found in /var/www/cagri.web.tr/htdocs/ci_system/core/CodeIgniter.php on line 231
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Blog extends CI_Controller {
    public function index($page=1)
    {
        setlocale(LC_ALL, 'tr_TR.UTF-8'); //adding this line results in Fatal Error.
        
        $this->load->model('blog_model','bdb');
        if($this->config->item('blog_cache_enabled'))
            $this->output->cache((int)$this->config->item('blog_cache_duration'));

        $data['blog_entries'] = $this->bdb->get_posts(
                                                    ($page-1) * (int)$this->config->item('blog_page_size')
                                                    ,50//(int)$this->config->item('blog_page_size')
                                                    );

        foreach ($data['blog_entries'] as $post=>$val)
        {

            $data['blog_entries'][$post]->post_date = strftime('%e %B %Y', strtotime($data['blog_entries'][$post]->post_date));
            $data['blog_entries'][$post]->postClasses='post';
        }
        $this->load->library('parser');
        $this->parser->parse('blog', $data);
    }

}




Theme © iAndrew 2016 - Forum software by © MyBB