ここの情報は古いです。ご理解頂いた上でお取り扱いください。

Changeset 4279


Ignore:
Timestamp:
Oct 3, 2007, 9:46:57 PM (12 years ago)
Author:
ebihara
Message:

#1216:$target_numberの決定をadd_member_image()にあわせた

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/lib/mail/sns.php

    r4248 r4279  
    398398        }
    399399
    400         if ($c_diary['image_filename_1'] && $c_diary['image_filename_2'] && $c_diary['image_filename_3']) {
    401             $this->error_mail('日記画像の登録は最大三枚までです。');
    402             m_debug_log('mail_sns::add_diary_image() image is full');
    403             return false;
    404         }
    405 
    406400        // 登録する画像番号(1-3)を決める
    407401        $target_number = 0;
    408         if (!$c_diary['image_filename_1']) {
     402        if ($c_diary['image_filename_1'] || $c_diary['image_filename_2'] || $c_diary['image_filename_3']) {
     403            if (!$c_diary['image_filename_1']) {
     404                $target_number = 1;
     405            } elseif (!$c_diary['image_filename_2']) {
     406                $target_number = 2;
     407            } elseif (!$c_diary['image_filename_3']) {
     408                $target_number = 3;
     409            } else {
     410                $this->error_mail('日記画像の登録は最大三枚までです。');
     411                m_debug_log('mail_sns::add_diary_image() image is full');
     412                return false;
     413            }
     414        } else {
    409415            $target_number = 1;
    410         } elseif (!$c_diary['image_filename_2']) {
    411             $target_number = 2;
    412         } elseif (!$c_diary['image_filename_3']) {
    413             $target_number = 3;
    414416        }
    415417
     
    477479        }
    478480
    479         if ($c_topic['image_filename1'] && $c_topic['image_filename2'] && $c_topic['image_filename3']) {
    480             $this->error_mail('トピック・イベント画像の登録は最大三枚までです。');
    481             m_debug_log('mail_sns::add_topic_image() image is full');
    482             return false;
    483         }
    484 
    485         $c_topic_images = array(
    486             'image_filename_1' => $c_topic['image_filename1'],
    487             'image_filename_2' => $c_topic['image_filename2'],
    488             'image_filename_3' => $c_topic['image_filename3'],
    489         );
    490 
    491481        // 登録する画像番号(1-3)を決める
    492482        $target_number = 0;
    493         if (!$c_topic_images['image_filename_1']) {
     483        if ($c_topic['image_filename1'] || $c_topic['image_filename2'] || $c_topic['image_filename3']) {
     484            if (!$c_topic['image_filename1']) {
     485                $target_number = 1;
     486            } elseif (!$c_topic['image_filename2']) {
     487                $target_number = 2;
     488            } elseif (!$c_topic['image_filename3']) {
     489                $target_number = 3;
     490            } else {
     491                $this->error_mail('トピック・イベント画像の登録は最大三枚までです。');
     492                m_debug_log('mail_sns::add_topic_image() image is full');
     493                return false;
     494            }
     495        } else {
    494496            $target_number = 1;
    495         } elseif (!$c_topic_images['image_filename_2']) {
    496             $target_number = 2;
    497         } elseif (!$c_topic_images['image_filename_3']) {
    498             $target_number = 3;
    499497        }
    500498
     
    504502        if ($images = $this->decoder->get_images()) {
    505503            $filename = 't_' . $c_commu_topic_id . '_' . $target_number . '_' . time() . '.jpg';
    506             $c_topic_images['image_filename_' . $target_number] = $filename;
     504            $c_topic['image_filename' . $target_number] = $filename;
    507505            db_image_insert_c_image($filename, $images[0]);
    508             db_commu_update_c_commu_topic_comment_images($c_topic['c_commu_topic_comment_id'], $c_topic_images['image_filename_1'], $c_topic_images['image_filename_2'], $c_topic_images['image_filename_3']);
     506            db_commu_update_c_commu_topic_comment_images($c_topic['c_commu_topic_comment_id'], $c_topic['image_filename1'], $c_topic['image_filename2'], $c_topic['image_filename3']);
    509507            return true;
    510508        } else {
Note: See TracChangeset for help on using the changeset viewer.