Welcome Guest, Not a member yet? Register   Sign In
*RECURSION* ????
#1

[eluser]truman_truman[/eluser]
Hello I do not speak English, sorry.
I have a problem * RECURSION *.
Anyone know why?


print_r($rows);
...
...
[post] => stdClass Object
*RECURSION*
)...
...
...
...

Code:
public function getAutores($uid = false, $limit = false) {


        $this->CI->load->library('lib_noticias');
        $rows = $this->CI->Blogs_model->getAutores($limit);
        foreach ($rows as $c => $v) {
            $rows[$c]->autor = $this->CI->lib_users->format_data_autor($v->uid);
            $rows[$c]->dataAutor = $this->getDataAutor($v->uid);

            if ($v->type == 'post') {
                $rows[$c]->post = $this->format_post_blog_min($v);
            } else {
                $rows[$c]->post = $this->format_not_min($v);
            }
        }

                /*
                * =============================================
                *
                *
                *
                *           print_r($rows);
                * ...
                * ...
                * [post] => stdClass Object
                * *RECURSION*
                *     )...
                * ...
                * ...
                * ...
                *
                *
                * ==============================================
                */

        return $rows;
    }

    public function format_not_min($row) {

        $categoria = $this->CI->Noticias_model->getCategory($row->id_categoria)->categoria;
        $row->url = base_url() . "noticias/" . $row->id_categoria . "-" . convertUrl(utf8_decode($categoria)) . "/" . $row->id_post . "-" . convertUrl(utf8_decode($row->title)) . "/";

        $row->fecha3 = date_encode_bbdd($row->date, true);
        $row->descripcion_min2 = character_limiter($row->description, 90);
        $row->count_comentarios = count($this->CI->lib_noticias->get_comments_noticia($row->id_post));
        return $row;
    }

    public function format_post_blog_min($row) {


        if (!$row) {
            return false;
        }
        $blog = $this->CI->Blogs_model->getBlog($row->id_blog);
        if ($blog->type == 'columna' && isset($row->id_post)) {
            $blog->autor = $this->CI->lib_users->format_data_autor($blog->id_user);
            $row->url = base_url() . "columnas-de-opinion/" . $blog->id_blog . "-" . convertUrl($blog->autor->fullname) . "/" . $row->id_post . "-" . convertUrl($row->title) . "/";
        } else {
            $row->url = base_url() . "blogs/" . convertUrl($blog->name) . "/" . convertUrl($row->title) . "/" . $row->id_post;
        }
        if (isset($row->date) && !empty($row->date)) {
            $row->fecha3 = date_encode_bbdd($row->date, true);
        }
        $row->descripcion_min2 = character_limiter(strip_tags($row->description), 80);
        $row->count_comentarios = count($this->get_comments($row->id_post));
        return $row;
    }
#2

[eluser]rip_pit[/eluser]
it seems like of fail in a recursive function somewhere. an infinite recursive loop , too many iterations and breaks.

To debug, enable error logging in CI or read php_error.log file from your php install to trace the error.




Theme © iAndrew 2016 - Forum software by © MyBB