public static function run() { $stmp = new \vendor\sitemap() - php\Sitemap(BASE); \Fuel\Core\Debug::dump($stmp); $stmp->setPath('../../public/sitemap/'); // $stmp->setFilename("sitemap"); //全掲示板を取得 $boards = \Model_Board::find('all'); if (count($boards) == 0) { die; } foreach ($boards as $board) { //掲示板を追加 // $stmp->addItem('/bbs/index/'.$board->shortName,"1.0","daily",date("Y/m/d H:i:s",$board->updated_at)); } // $stmp->createSitemapIndex(BASE.'/sitemap/', "Today"); }
/** * 掲示板の書き込み修正を確認するコントローラ * @param type $bbsId 掲示板Id * @param type $articleId 書き込みId */ public function action_editConfirm($bbsId = null, $articleId) { $msg = Session::get('errorMsg'); Session::delete('errorMsg'); $ref = Input::referrer(); $validRef1 = Uri::base() . 'bbs/passwordCheck' . DS . $bbsId . DS . $articleId; if ($ref != $validRef1 && $ref != Uri::current()) { $log = new Logging(); $log->writeLog_Warning('Invalid Referrer', __FILE__, __LINE__); return Response::forge('パラメータ異常' . $ref); } if ($bbsId == null || $articleId == null) { $log = new Logging(); $log->writeLog_Warning('Invalid Referrer', __FILE__, __LINE__); return Response::forge('パラメータ異常2'); } //Boardを取得 $board = Model_Board::find($bbsId); if ($bbsId == null) { $log = new Logging(); $log->writeLog_Warning('Board is missing', __FILE__, __LINE__); return Response::forge('パラメータ異常3'); } $this->setBoardTitle($board); $data = array(); $data['board'] = $board; $data['backURL'] = 'bbs/index/' . $board->shortName; //ArticleIdから投稿を得る $ar = Model_Article::find($articleId); if ($ar == null) { $log = new Logging(); $log->writeLog_Warning('Article is missing', __FILE__, __LINE__); return Response::forge('パラメータ異常4'); } //投稿のbbsIdとパラメータのbbsIdが一致しない場合異常 if ($ar->bbsId != $bbsId) { $log = new Logging(); $log->writeLog_Warning('Board not contain Article', __FILE__, __LINE__); return Response::forge('パラメータ異常5'); } //投稿用フォームを取得し、フォームに投稿内容をセット $postFormFieldSet = $this->makePostFormFieldSet($board, $ar); //パスワードを隠しフィールドにする $postFormFieldSet->field('password')->set_type('hidden'); /* //画像送信用フィールド追加 $postFormFieldSet->add('Image1','画像1を変更',array('type'=>'file')); $postFormFieldSet->add('Image2','画像2を変更',array('type'=>'file')); $postFormFieldSet->add('Image3','画像3を変更',array('type'=>'file')); */ //BBSのIDをHiddenでフォームに仕込む(bbsidはModel_Articleに含まれるのでbbsId_にする) $postFormFieldSet->add('shortName_', '', array('type' => 'hidden', 'value' => $board->shortName)); $postFormFieldSet->add('articleId_', '', array('type' => 'hidden', 'value' => $ar->id)); //CSRF対策用 // $postFormFieldSet->add(Config::get('security.csrf_token_key'),'',array('type'=>'hidden','value'=>Security::fetch_token())); $content = View::forge('bbs/editConfirm', $data); $content->set('deleteForm', $postFormFieldSet->build('bbs/edit'), false); //エラーメッセージ $content->set('msg', $msg, false); $content->set_safe('descriptionStyle', 'background-color:Aquamarine'); $content->set_safe('articleStyle', 'background-color:BlanchedAlmond'); $this->template->set_safe('textColor', 'black'); $this->template->set_safe('linkColor', 'red'); $this->template->set_safe('backGroundColor', 'white'); $this->template->content = $content; }