} else {
     if (getPost('action_id') === 'profile_edit_complete') {
         // todo: プロフィール更新処理
         $edit_user_name = entity_str(getPost('edit_user_name'));
         if (!isExist($edit_user_name)) {
             $errors[] = 'ユーザネームを入力してください';
         } else {
             if (!isOverText($edit_user_name, 20)) {
                 $errors[] = '文字数は20文字以内で入力してください';
             }
         }
         $edit_user_profile = entity_str(getPost('edit_user_profile'));
         if (!isExist($edit_user_profile)) {
             $errors[] = 'プロフィールを入力してください';
         } else {
             if (!isOvertext($edit_user_profile, 200)) {
                 $errors[] = '文字数は200文字以内にしてください';
             }
         }
         if (isset($_FILES['edit_user_profile_photo'])) {
             // todo: 画像アップロード入力チェック
             if (!checkPostMaxSize()) {
                 $errors[] = 'ファイルサイズは100KB以下にしてください';
             }
             // アップロードファイルチェック
             list($result, $ext, $error_msg) = checkUpdateFile();
             $errors = array_merge($errors, $error_msg);
             if ($result) {
                 $name = $_FILES['edit_user_profile_photo']['name'];
                 $tmp_name = $_FILES['edit_user_profile_photo']['tmp_name'];
                 // 画像保存先ファイルパス
Beispiel #2
0
 if (getPost('action_id') === 'post_create') {
     $color_id = entity_str(getPost('color_id'));
     echo $color_id;
     $post_body = entity_str(getPost('post_body'));
     // 入力チェック
     if (isExist($color_id) !== true) {
         $errors[] = '色を選択してください';
     } else {
         if (preg_match('/^[1-5]$/', $color_id) !== 1) {
             $errors[] = '正しい色を選択してください';
         }
     }
     if (isExist($post_body) !== true) {
         $errors[] = 'つぶやきを入力してください';
     } else {
         if (isOvertext($post_body, 140) !== true) {
             $erros[] = 'つぶやきは140文字以内で入力してください';
         }
     }
     if (count($errors) === 0) {
         $post->postCreate($db, $login_id, $color_id, $post_body);
         include_once '../include/common/goto_main.php';
     }
     // フォロー処理
 } else {
     if (getPost('action_id') === 'follow') {
         $follower_user_id = getPost('follower_user_id');
         $follow->createFollow($db, $login_id, $follower_user_id);
         include_once '../include/common/goto_main.php';
         // アンフォロー処理
     } else {