Error on CMS page in Code Igniter

Asked

Viewed 70 times

1

I’m having an error with a CMS developed by someone else in Codeigniter, the error is as follows

Fatal error: Call to undefined function get_instance() in /home/msinai/public_html/application/errors/error_404.php on line 1

Detail: This page is a CMS administration page, so it should only be shown when logged in, but anyone can see the error by logging in:

http://www.meusonhodechacara.com.br/cms/andamentos/index

I am VERY layman in back end programming, and tried to make some modifications to some files, which apparently were successful, I did not touch this 404 error file and this error is there. Follow the code of the error_404.php page

<?php $ci =& get_instance(); ?>
<?php $ci->fixed_content->header(); ?>
<?php $settings = $ci->fixed_content->settings; ?>
<section class="pages contact" style="background-image: url(<?php echo upload_url($settings['banner']); ?>);">
<div class="container">
    <div class="row">
        <h1>Página não encontrada</h1>
        <div class="wrap">

        </div>
    </div>
</div>
</section>
<?php $ci->fixed_content->footer(); ?>

Controller page code for this page: http://pastebin.com/Py7Yf24U

PHP version: 5.3.29

Version of Codeigniter: 1

I just don’t know where this mistake came from nor how to solve it, I appreciate if you help me. Thank you.

  • Unless there’s a different map, "$this->load->view('movements', $this->data)" your controller is calling the script '/application/views/andaments/index.php'. This script is where it should be?

  • Yes, it follows Pastebin from this archive http://pastebin.com/mgDRJYr3

  • Your controller stops right here: "if(Empty($page)) show_404();". It is not even loading the VIEW because of this error. Check why this ARRAY is empty.

  • Can you help me in how I do it? I don’t know that

  • Don’t know PHP or Codeigniter? Look, I think this here: $this->pages->get(); is a method (possibly of a model) trying to pick up values based on the configuration item $this->fixed_content->Settings['pagina_andamento']. But by far it is difficult... You will have to look calmly and find out why this operation did not work leaving the array $page empty and causing the program to stop.

  • The error you reported in the question is generated by show_404();, and it is only being shown because the array $pagina is empty...

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.