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

Changeset 6000


Ignore:
Timestamp:
Mar 24, 2008, 12:49:50 PM (13 years ago)
Author:
ogawa
Message:

#2081:一人もマイフレンドがいない状態で日記コメント記入履歴の「もっと読む」をクリックすると「記入したコメントはありません」と表示されていたのを修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/stable-2.8.x/webapp/lib/db/diary.php

    r3057 r6000  
    564564
    565565    $friends = db_friend_c_member_id_list($c_member_id);
    566     $firends[] = 0;
    567566    $friend_ids = implode(',', $friends);
    568567
     
    579578            ' AND mydc.c_member_id <> d.c_member_id' .
    580579            ' AND d.c_member_id NOT IN (' . $except_ids . ')' .
    581             ' AND (d.public_flag = \'public\' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . ')))' .
     580            ' AND (d.public_flag = \'public\'';
     581    if ($friend_ids) {
     582        $sql .= ' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . '))';
     583    }
     584    $sql .= ')' .
    582585        ' GROUP BY dc.c_diary_id' .
    583586        ' ORDER BY r_datetime DESC';
     
    598601            ' AND mydc.c_member_id <> d.c_member_id' .
    599602            ' AND d.c_member_id NOT IN (' . $except_ids . ')' .
    600             ' AND (d.public_flag = \'public\' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . ')))';
     603            ' AND (d.public_flag = \'public\'';
     604    if ($friend_ids) {
     605        $sql .= ' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . '))';
     606    }
     607    $sql .= ')';
     608 
    601609    $total_num = db_get_one($sql, $params);
    602610
Note: See TracChangeset for help on using the changeset viewer.