Welcome Guest, Not a member yet? Register   Sign In
Something messed up with foreach as $item
#3

[eluser]Lockzi[/eluser]
Sure, here you go...

Code:
function index()
    {
        $this->load->helper('url');
        
        $this->load->model('rss_model');
        $this->load->library('simplepie');
        
        $feeds = $this->rss_model->getAllFeeds()->result();
        
        $data['feeds'] = $feeds;
        
        foreach ($feeds as $item)
        {
            $this->simplepie->set_feed_url($item->url);
            $this->simplepie->init();
            $feedName = $item->name;
            
        foreach ($this->simplepie->get_items() as $item) {
            $href    = $item->get_link();
            $title    = $item->get_title();
            $descr    = $item->get_description();
            
            
            if($this->rss_model->checkNewFeed($href))
            {
                $this->rss_model->insertNewFeed($feedName, $title, $href, $descr);
            }
        }
            
            $data[$feedName] = $this->simplepie;
            
        }
        
        $this->load->view('startup_view', $data);
    }


Messages In This Thread
Something messed up with foreach as $item - by El Forum - 09-13-2007, 05:05 PM
Something messed up with foreach as $item - by El Forum - 09-13-2007, 06:27 PM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 01:08 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 01:16 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 01:23 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 04:27 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 04:31 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 08:28 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 10:30 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 11:38 AM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 12:41 PM
Something messed up with foreach as $item - by El Forum - 09-14-2007, 01:30 PM



Theme © iAndrew 2016 - Forum software by © MyBB