Welcome Guest, Not a member yet? Register   Sign In
Blog system....posts
#3

[eluser]GSV Sleeper Service[/eluser]
I've done exactly that, I save the title using the url_title helper in the database as 'slug'
and my post method looks like this
Code:
function post($slug) {
    $query = $this->db->get_where('posts', array('slug' => $slug));
    if($query->num_rows() > 0) {
        $row = $query->row();
        $this->data['post']['id'] = $row->id;
        $this->data['post']['title'] = $row->title;
        $this->data['post']['body'] = $row->body;
        $this->data['post']['date'] = $row->post_date;
        $this->load->view('blog/post',$this->data);
    } else {
        show_404($slug);
    }
}


Messages In This Thread
Blog system....posts - by El Forum - 05-16-2008, 04:27 AM
Blog system....posts - by El Forum - 05-16-2008, 04:31 AM
Blog system....posts - by El Forum - 05-16-2008, 06:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB