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

Changeset 7353


Ignore:
Timestamp:
May 23, 2008, 8:05:08 PM (11 years ago)
Author:
ebihara
Message:

#2432:アクセスブロックを考慮する際には全体の最新日記取得に準拠するよう修正

File:
1 edited

Legend:

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

    r7295 r7353  
    546546         . ' FROM c_diary_comment_log AS cdcl INNER JOIN c_diary AS cd USING (c_diary_id) '
    547547         . ' WHERE cdcl.c_member_id = ?'
    548          . ' AND cd.public_flag <> \'private\'';
    549 
    550     $blocked = db_member_access_block_list4c_member_id_to($c_member_id);
    551     $blocked_ids = implode(',', array_map('intval', $blocked));
    552     if ($blocked_ids) {
    553         $sql .= ' AND cd.c_member_id NOT IN (' . $blocked_ids . ')';
    554     }
    555 
    556     $friends = db_friend_c_member_id_list($c_member_id);
     548         . ' AND cd.public_flag = \'public\'';
     549
     550    $friends = db_friend_c_member_id_list($c_member_id, true);
    557551    $friend_ids = implode(',', array_map('intval', $friends));
    558552    if ($friend_ids) {
    559          $sql .= ' AND (cd.public_flag = \'public\''
    560                . ' OR (cd.public_flag = \'friend\' AND cd.c_member_id IN (' . $friend_ids . ')))';
     553         $sql .= ' OR (cd.public_flag = \'friend\' AND cd.c_member_id IN (' . $friend_ids . '))';
    561554    }
    562555
     
    578571    $select = 'SELECT cdcl.c_diary_id, cdcl.r_datetime AS maxdate, cd.*';
    579572    $from = ' FROM c_diary_comment_log AS cdcl INNER JOIN c_diary AS cd USING (c_diary_id) ';
    580     $where = ' WHERE cdcl.c_member_id = ? AND cd.public_flag <> \'private\'';
    581 
    582 
    583     $blocked = db_member_access_block_list4c_member_id_to($c_member_id);
    584     $blocked_ids = implode(',', array_map('intval', $blocked));
    585     if ($blocked_ids) {
    586         $where .= ' AND cd.c_member_id NOT IN (' . $blocked_ids . ')';
    587     }
    588 
    589     $friends = db_friend_c_member_id_list($c_member_id);
     573    $where = ' WHERE cdcl.c_member_id = ? AND cd.public_flag = \'public\'';
     574
     575
     576    $friends = db_friend_c_member_id_list($c_member_id, true);
    590577    $friend_ids = implode(',', array_map('intval', $friends));
    591578    if ($friend_ids) {
    592          $where .= ' AND (cd.public_flag = \'public\''
    593                . ' OR (cd.public_flag = \'friend\' AND cd.c_member_id IN (' . $friend_ids . ')))';
     579         $where .= ' OR (cd.public_flag = \'friend\' AND cd.c_member_id IN (' . $friend_ids . '))';
    594580    }
    595581
Note: See TracChangeset for help on using the changeset viewer.