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

Changeset 9217


Ignore:
Timestamp:
Nov 18, 2008, 2:55:38 PM (11 years ago)
Author:
akamine
Message:

#1474 親記事に画像が付いている場合カメラの画像を表示するよう修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.12.x/webapp/lib/db/commu.php

    r9091 r9217  
    524524    foreach ($list as $key => $value) {
    525525        $list[$key]['count_comments'] = db_commu_get_max_c_commu_topic_comment_number4c_topic_id($value['c_commu_topic_id']);
    526         $last_comment = db_commu_get_last_c_topic_comment($value['c_commu_topic_id']);
    527         $list[$key]['image_filename1'] = $last_comment['image_filename1'];
    528         $list[$key]['image_filename2'] = $last_comment['image_filename2'];
    529         $list[$key]['image_filename3'] = $last_comment['image_filename3'];
     526        $start_comment = db_commu_get_start_c_topic_comment($value['c_commu_topic_id']);
     527        $list[$key]['image_filename1'] = $start_comment['image_filename1'];
     528        $list[$key]['image_filename2'] = $start_comment['image_filename2'];
     529        $list[$key]['image_filename3'] = $start_comment['image_filename3'];
    530530    }
    531531    return $list;
     
    11741174        $c_commu_topic_list[$key]['nickname'] = $c_member['nickname'];
    11751175
    1176         $temp = db_commu_get_last_c_topic_comment($value['c_commu_topic_id']);
     1176        $temp = db_commu_get_start_c_topic_comment($value['c_commu_topic_id']);
    11771177
    11781178        $sql = 'SELECT name AS c_commu_name FROM c_commu WHERE c_commu_id = ?';
     
    12141214        $c_commu_topic_list[$key]['nickname'] = $c_member['nickname'];
    12151215
    1216         $temp = db_commu_get_last_c_topic_comment($value['c_commu_topic_id']);
     1216        $temp = db_commu_get_start_c_topic_comment($value['c_commu_topic_id']);
    12171217
    12181218        $sql = 'SELECT name AS c_commu_name FROM c_commu WHERE c_commu_id = ?';
     
    33633363
    33643364/*
    3365  * 最終書き込みコメントの情報取得
    3366  */
    3367 function db_commu_get_last_c_topic_comment($c_commu_topic_id)
    3368 {
    3369     $sql = 'SELECT * FROM c_commu_topic_comment WHERE c_commu_topic_id = ? ORDER BY r_datetime DESC';
     3365 * 最初の書き込みコメントの情報取得(親トピック)
     3366 */
     3367function db_commu_get_start_c_topic_comment($c_commu_topic_id)
     3368{
     3369    $sql = 'SELECT * FROM c_commu_topic_comment WHERE c_commu_topic_id = ? ORDER BY r_datetime ASC';
    33703370    $params = array(intval($c_commu_topic_id));
    33713371    return db_get_row($sql,$params);
Note: See TracChangeset for help on using the changeset viewer.