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

Ignore:
Timestamp:
Nov 27, 2006, 4:52:42 PM (14 years ago)
Author:
takanashi
Message:

メッセージの次/前表示

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/takanashi/prj_takanashi2/webapp/lib/db/message.php

    r619 r914  
    598598}
    599599
     600
     601//メッセージの次のc_message_idを取得
     602function db_message_get_c_message_next_id4c_message_id($c_member_id, $c_message_id, $box)
     603{
     604    if ($box == 'savebox' || $box == 'trash') {
     605        return null;
     606    } else if ($box == 'outbox'){   //送信箱
     607        $where = " WHERE c_member_id_from = ?";
     608    } else {                        //受信箱
     609        $where = " WHERE c_member_id_to = ?";
     610    }
     611
     612    $sql =  "SELECT c_message_id FROM c_message" .
     613            $where.
     614            " AND is_deleted_to = 0" .
     615            " AND is_send = 1" .
     616            " AND c_message_id > ?" .
     617            " ORDER BY r_datetime";
     618    $params = array(
     619                intval($c_member_id),
     620                intval($c_message_id)
     621              );
     622
     623    return db_get_one($sql, $params);
     624}
     625
     626//メッセージの前のc_message_idを取得
     627function db_message_get_c_message_prev_id4c_message_id($c_member_id, $c_message_id, $box)
     628{
     629    if ($box == 'savebox' || $box == 'trash') {
     630        return null;
     631    } else if ($box == 'outbox'){   //送信箱
     632        $where = " WHERE c_member_id_from = ?";
     633    } else {                        //受信箱
     634        $where = " WHERE c_member_id_to = ?";
     635    }
     636
     637    $sql =  "SELECT c_message_id FROM c_message" .
     638            $where.
     639            " AND is_deleted_to = 0" .
     640            " AND is_send = 1" .
     641            " AND c_message_id < ?" .
     642            " ORDER BY r_datetime DESC";
     643    $params = array(
     644                intval($c_member_id),
     645                intval($c_message_id)
     646              );
     647
     648    return db_get_one($sql, $params);
     649}
     650
    600651?>
Note: See TracChangeset for help on using the changeset viewer.