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

Changeset 914


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

メッセージの次/前表示

Location:
OpenPNE/branches/takanashi/prj_takanashi2/webapp
Files:
5 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?>
  • OpenPNE/branches/takanashi/prj_takanashi2/webapp/modules/ktai/page/h_message.php

    r516 r914  
    3838        $this->set("com_url", $com_url);
    3939        $this->set("friend_url", $friend_url);
     40       
     41        //送信箱
     42        if ($c_message['c_member_id_from'] == $u) {
     43            $box = 'outbox';
     44        }
     45
     46        $this->set("next_c_message_id", db_message_get_c_message_next_id4c_message_id($u, $target_c_message_id, $box));
     47        $this->set("prev_c_message_id", db_message_get_c_message_prev_id4c_message_id($u, $target_c_message_id, $box));
    4048
    4149        return 'success';
  • OpenPNE/branches/takanashi/prj_takanashi2/webapp/modules/ktai/templates/h_message.tpl

    r887 r914  
    33メッセージBOX<br>
    44<hr>
    5 
     5({if $prev_c_message_id})
     6<a href="({t_url m=ktai a=page_h_message})&amp;target_c_message_id=({$prev_c_message_id})&amp;({$tail})">前を表示</a>
     7({/if})
     8({if $next_c_message_id})
     9<a href="({t_url m=ktai a=page_h_message})&amp;target_c_message_id=({$next_c_message_id})&amp;({$tail})">次を表示</a>
     10({/if})
     11<br>
    612({$c_message.r_datetime|date_format:"%y/%m/%d %H:%M"})<br>
    713({if $c_message.c_member_id_to==$u})<a href="({t_url m=ktai a=page_f_home})&amp;target_c_member_id=({$c_message.c_member_id_from})&amp;({$tail})">({$c_message.c_member_nickname_from})</a>
  • OpenPNE/branches/takanashi/prj_takanashi2/webapp/modules/pc/page/h_message.php

    r516 r914  
    5454        $this->set("jyusin_c_message_id", $jyusin_c_message_id);
    5555
     56        $this->set("next_c_message_id", db_message_get_c_message_next_id4c_message_id($u, $target_c_message_id, $box));
     57        $this->set("prev_c_message_id", db_message_get_c_message_prev_id4c_message_id($u, $target_c_message_id, $box));
     58
     59
    5660        //ボックス判定
    5761        $this->set("box", $box);
  • OpenPNE/branches/takanashi/prj_takanashi2/webapp/modules/pc/templates/h_message.tpl

    r640 r914  
    134134({*ここから:body*})
    135135<!-- ここから:主内容 -->
     136
     137<table border="0" cellspacing="0" cellpadding="0" class="border_01" style="width: 504px;">
     138<tr>
     139<td style="width:340px;height:2em;" class="bg_03" align="left">
     140<div class="padding_s">
     141({if $prev_c_message_id})
     142<a href="({t_url m=pc a=page_h_message})&amp;target_c_message_id=({$prev_c_message_id})&amp;({if $box == 'outbox'})box=({$box})({else})jyusin_c_message_id=({$prev_c_message_id})({/if})">前を表示</a>
     143({/if})
     144</div>
     145</td>
     146<td style="width:340px;height:2em;" class="bg_03" align="right">
     147<div class="padding_s">
     148({if $next_c_message_id})
     149<a href="({t_url m=pc a=page_h_message})&amp;target_c_message_id=({$next_c_message_id})&amp;({if $box == 'outbox'})box=({$box})({else})jyusin_c_message_id=({$next_c_message_id})({/if})">次を表示</a>
     150({/if})
     151</div>
     152</td>
     153</tr>
     154</table>
     155
    136156<table border="0" cellspacing="0" cellpadding="0" style="width:504px;">
    137157({*********})
Note: See TracChangeset for help on using the changeset viewer.