/*************************************************************
ファイル名:cont_cook.php
--------------------------------------------------------------
内 容:レシピ作り方投稿画面
--------------------------------------------------------------
作成者:亘
作成日:2005.01.31
--------------------------------------------------------------
備 考:
**************************************************************/
require_once('../prepare.php');
require_once('../config.php');
require_once('./lib/config_bbs.php');
require_once('./lib/bbs_function.php');
//- メンバーチェック
/*
if("e" == $p['carrier']){
chdir(dirname(__FILE__) . "/authcheck");
require_once("../authcheck/authcheck.php");
chdir(dirname(__FILE__));
}
*/
$db = u4user_open();
if(!($user_prof = get_UserDetail_uid($db, $p['uid'], '0', '1')) && MEMBER_CHECK ){
header("Location: " . MEMBER_REGIST_URL . "?p[contents]=" . substr(strrchr(dirname( __FILE__ ) , '/'), 1));
exit;
}
if($user_prof['mem_nick_nm']==""){
$arg = "?contents=bbs";
switch($p['carrier']){
case "i":
$arg .= "&uid=NULLGWDOCOMO";
break;
}
header("Location: ".KTY_BASE_URL."/signup/prof_input.php".$arg);
exit;
}
/*
//- 会員登録チェック開始
$db_member = u4user_open();
$user_prof = bsc_get_user_profile($db_member,$p['uid'],'0');
u4user_close($db_member);
if(!$user_prof){
header("Location: ".BSC_BASE_URL."signup/free_reg_top.php?uid=NULLGWDOCOMO&p[contents]=bbs");
exit;
}
//- 会員登録チェック終了
*/
function bbs_post3($p)
{
$template =& loadTemplate( $p );
bsc_session();
if(constant('BBS_DEBUG_MODE')){
print "
--- bbs_post3 Top SESSION ---
";
print "
"; print_r($_SESSION); //print_r($p); print ""; } $_SESSION['page']['pre'] = $_SESSION['page']['now']; $_SESSION['page']['now'] = 'bbs_post3.php'; // 通常の遷移のみパラメータをセッションにいれ、チェックする if(preg_match('/bbs_post2_1.php/',$_SESSION['page']['pre']) or preg_match('/bbs_post2.php/',$_SESSION['page']['pre'])){ // パラメータを一度すべてセッションに foreach($p as $key => $val){ $_SESSION['param'][$key] = $val; } for($i=6;$i<=10;$i++){ if($p['material'.$i] != ""){ if(($p['amount'.$i] == "") or ($p['unit'.$i] == "") or (!preg_match("/^[0-9]{1}$/", $p['unit'.$i]))){ $message = "入力項目が足りません。"; bsc_error($message,$p); exit; } } } } // 材料のステップを1段階のとき、または2段階目まで踏んだとき両方ともデフォルト値をセット if((preg_match('/bbs_post2_1.php/',$_SESSION['page']['pre'])) or (preg_match('/bbs_post2.php/',$_SESSION['page']['pre']))) { for($i=1;$i<=5;$i++){ // 画面遷移が通常であり、なおかつ配列が存在しない場合 if(!array_key_exists('method'.$i,$_SESSION['param'])){ $_SESSION['param']['method'.$i] = ""; } } } // 作り方についてデフォルト値をセット for($i=1;$i<=5;$i++){ $template->setVariable('method'.$i,$_SESSION['param']['method'.$i]); } $template->setVariable('contents_top',BBS_NAME); $template->setVariable('site_top_url',SITE_TOP_URL); $template->setVariable('second_button',SUBMIT_COOK_CHAR_SECOND); $template->setVariable('next_button',SUBMIT_COOK_CHAR_NEXT); $template->show(); //cs4_close($this->db); if(constant('BBS_DEBUG_MODE')){ print "
"; print_r($_SESSION); print ""; } } bbs_post3($p); ?>