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

Changeset 581


Ignore:
Timestamp:
Nov 3, 2006, 3:59:01 PM (14 years ago)
Author:
ebihara
Message:

r579でコミットしたコードにミスがあったのを修正(メッセージのソートが正常に行われない現象、コーディング規約に則していない箇所がある等)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/ebihara/prj_tuning_2_5/webapp/lib/db/message.php

    r579 r581  
    186186
    187187    $sql = 'SELECT * FROM c_message WHERE '. $where_from . ' ORDER BY r_datetime DESC';
    188     $sql_num = 'SELECT COUNT(*) FROM c_message WHERE '. $where_from . ' ORDER BY r_datetime DESC';
     188    $sql_num = 'SELECT COUNT(*) FROM c_message WHERE '. $where_from;
    189189    $params = array(intval($c_member_id));
    190     $c_message_list_from = db_get_all_page($sql, $page, $page_size, $params);
     190    $c_message_list_from = db_get_all_page($sql, 1, ($page_size * ($page + 1)), $params);
    191191    $c_message_num_from = db_get_one($sql_num, $params);
    192192
     
    196196
    197197    $sql = 'SELECT * FROM c_message WHERE '. $where_to . ' ORDER BY r_datetime DESC';
    198     $sql_num = 'SELECT COUNT(*) FROM c_message WHERE '. $where_to . ' ORDER BY r_datetime DESC';
    199     $c_message_list_to = db_get_all_page($sql, $page, $page_size, $params);
     198    $sql_num = 'SELECT COUNT(*) FROM c_message WHERE '. $where_to;
     199    $c_message_list_to = db_get_all_page($sql, 1, ($page_size * ($page + 1)), $params);
    200200    $c_message_num_to = db_get_one($sql_num, $params);
    201201
     
    206206    }
    207207    array_multisort($c_message_id, SORT_DESC, $c_message_list);
    208     $c_message_list = array_slice($c_message_list, 0, 20);
     208    $c_message_list = array_slice($c_message_list, ($page_size * ($page - 1) + 1), 20);
    209209
    210210    $total_num = $c_message_num_from + $c_message_num_to;
     
    224224    }
    225225
    226     foreach($c_message_list as $key => $value) {
     226    foreach ($c_message_list as $key => $value) {
    227227        if ($value['c_member_id_to'] == $c_member_id) {
    228228            $c_member = db_common_c_member4c_member_id_LIGHT($value['c_member_id_from']);
     
    234234    }
    235235
    236     return array($c_message_list , $prev , $next);
     236    return array($c_message_list, $prev, $next);
    237237}
    238238
Note: See TracChangeset for help on using the changeset viewer.