function generate_last_post_urls($lastpost_id = null)
 {
     $objBranch = new Forumbranch();
     App::import('Model', 'Forumpost');
     $objPost = new Forumpost();
     $objPost->contain('Forumtopic');
     $lastpost = $objPost->read(null, $lastpost_id);
     $forum_id = $lastpost['Forumtopic']['forumbranch_id'];
     $forum_path = $objBranch->getpath($forum_id);
     if (empty($forum_path)) {
         return "";
     }
     $slugs = array();
     foreach ($forum_path as $index => $branch) {
         $slugs[$index] = $branch['Forumbranch']['slug'];
     }
     array_push($slugs, $lastpost['Forumtopic']['slug']);
     return implode("/", $slugs);
 }