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

Changeset 5999


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

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

File:
1 edited

Legend:

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

    r4529 r5999  
    592592
    593593    $friends = db_friend_c_member_id_list($c_member_id);
    594     $firends[] = 0;
    595594    $friend_ids = implode(',', $friends);
    596595
     
    612611                        ' AND mydc.c_member_id <> d.c_member_id' .
    613612                        ' AND d.c_member_id NOT IN (' . $except_ids . ')' .
    614                         ' AND (d.public_flag = \'public\' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . ')))' .
     613                        ' AND (d.public_flag = \'public\'';
     614        if ($friend_ids) {
     615            $sql .= ' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . '))';
     616        }
     617        $sql .= ')' .
    615618                    ' GROUP BY dc.c_diary_id' .
    616619                ') as sub_diary_tbl' .
     
    631634                ' AND mydc.c_member_id <> d.c_member_id' .
    632635                ' AND d.c_member_id NOT IN (' . $except_ids . ')' .
    633                 ' AND (d.public_flag = \'public\' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . ')))' .
     636                ' AND (d.public_flag = \'public\'';
     637        if ($friend_ids) {
     638            $sql .= ' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . '))';
     639        }
     640        $sql .= ')' .
    634641            ' GROUP BY dc.c_diary_id' .
    635642            ' ORDER BY r_datetime DESC';
     
    651658            ' AND mydc.c_member_id <> d.c_member_id' .
    652659            ' AND d.c_member_id NOT IN (' . $except_ids . ')' .
    653             ' AND (d.public_flag = \'public\' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . ')))';
     660            ' AND (d.public_flag = \'public\'';
     661    if ($friend_ids) {
     662        $sql .= ' OR (d.public_flag = \'friend\' AND d.c_member_id IN (' . $friend_ids . '))';
     663    }
     664    $sql .= ')';
     665 
    654666    $total_num = db_get_one($sql, $params);
    655667
Note: See TracChangeset for help on using the changeset viewer.