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

Changeset 4001


Ignore:
Timestamp:
Sep 13, 2007, 7:24:40 PM (12 years ago)
Author:
ebihara
Message:

#1081:fh_diaryの「前の日記」「次の日記」に対応した

Location:
OpenPNE/trunk/webapp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/lib/db/diary.php

    r3786 r4001  
    255255    $sql = 'SELECT c_diary_id FROM c_diary WHERE c_diary_id = ?';
    256256    return (bool)db_get_one($sql, array(intval($c_diary_id)));
     257}
     258
     259/**
     260 * 指定した日記の前の日記IDを取得する
     261 *
     262 * @param int $c_member_id
     263 * @param int $c_diary_id
     264 */
     265function db_diary_c_diary_id_prev4c_diary_id($c_member_id, $c_diary_id, $u = null)
     266{
     267    $public_flag_condition = db_diary_public_flag_condition($c_member_id, $u);
     268        $sql = 'SELECT c_diary_id FROM c_diary WHERE c_member_id = ? AND c_diary_id < ?'
     269         . $public_flag_condition . ' ORDER BY c_diary_id DESC';
     270    return db_get_one($sql, array(intval($c_member_id), intval($c_diary_id)));
     271}
     272
     273/**
     274 * 指定した日記の次の日記IDを取得する
     275 *
     276 * @param int $c_member_id
     277 * @param int $c_diary_id
     278 */
     279function db_diary_c_diary_id_next4c_diary_id($c_member_id, $c_diary_id, $u = null)
     280{
     281    $public_flag_condition = db_diary_public_flag_condition($c_member_id, $u);
     282    $sql = 'SELECT c_diary_id FROM c_diary WHERE c_member_id = ? AND c_diary_id > ?'
     283         . $public_flag_condition . ' ORDER BY c_diary_id ASC';
     284    return db_get_one($sql, array(intval($c_member_id), intval($c_diary_id)));
    257285}
    258286
  • OpenPNE/trunk/webapp/modules/ktai/page/fh_diary.php

    r3757 r4001  
    2525        $c_diary = db_diary_get_c_diary4id($target_c_diary_id);
    2626
    27         $target_c_member = k_p_fh_diary_c_member4c_diary_id($target_c_diary_id);        $target_c_member_id = $target_c_member['c_member_id'];
     27        $target_c_member = k_p_fh_diary_c_member4c_diary_id($target_c_diary_id);
     28        $target_c_member_id = $target_c_member['c_member_id'];
    2829
    2930        if ($u != $target_c_member_id) {
     
    4647        //日記
    4748        $this->set("target_c_diary", $c_diary);
     49        $this->set('c_diary_id_prev', db_diary_c_diary_id_prev4c_diary_id($target_c_member_id, $target_c_diary_id, $u));
     50        $this->set('c_diary_id_next', db_diary_c_diary_id_next4c_diary_id($target_c_member_id, $target_c_diary_id, $u));
    4851        //自分で日記を見たとき
    4952        if ($c_diary['c_member_id'] == $u) {
  • OpenPNE/trunk/webapp/modules/ktai/templates/fh_diary.tpl

    r3864 r4001  
    2525
    2626(({if $target_c_diary.public_flag == "public"})全員に公開({elseif $target_c_diary.public_flag == "friend"})({$WORD_MY_FRIEND_HALF})まで公開({elseif $target_c_diary.public_flag == "private"})公開しない({/if}))
     27
     28({if $c_diary_id_prev || $c_diary_id_next})
     29<hr color="#({$ktai_color_config.border_01})">
     30<center>
     31({if $c_diary_id_prev})<a href="({t_url m=ktai a=page_fh_diary})&amp;target_c_diary_id=({$c_diary_id_prev})&amp;({$tail})">前の日記</a>({/if})
     32({if $c_diary_id_prev && $c_diary_id_next})&nbsp;({/if})
     33({if $c_diary_id_next})<a href="({t_url m=ktai a=page_fh_diary})&amp;target_c_diary_id=({$c_diary_id_next})&amp;({$tail})">次の日記</a>({/if})
     34</center>
     35({/if})
    2736
    2837({if $c_diary_comment})
  • OpenPNE/trunk/webapp/modules/pc/page/fh_diary.php

    r3900 r4001  
    9898        $this->set("new_diary_list", $list_set[0]);
    9999
     100        $this->set('c_diary_id_prev', db_diary_c_diary_id_prev4c_diary_id($target_c_member_id, $target_c_diary_id, $u));
     101        $this->set('c_diary_id_next', db_diary_c_diary_id_next4c_diary_id($target_c_member_id, $target_c_diary_id, $u));
     102
    100103        //カレンダー関係
    101104        //カレンダー開始用変数
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_diary.tpl

    r3904 r4001  
    516516<img src="./skin/dummy.gif" alt="" class="v_spacer_l">
    517517
     518<!-- ********************************** -->
     519<!-- ******ここから:前の日記/次の日記****** -->
     520({if $c_diary_id_prev || $c_diary_id_next})
     521
     522<table cellspacing="0" cellpadding="0" border="0" style="width:540px;margin:0px auto;">
     523<tr>
     524<!-- ************************************** -->
     525<td align="left" style="width: 10px"><img src="./skin/dummy.gif" alt="" style="width:10px;" class="dummy"></td>
     526<td align="left" style="width: 260px;">
     527({if $c_diary_id_prev})
     528<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$c_diary_id_prev})">前の日記</a>
     529({else})
     530&nbsp;
     531({/if})
     532</td>
     533
     534<!-- ************************************** -->
     535
     536<td align="right" style="width: 260px;">
     537({if $c_diary_id_next})
     538<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$c_diary_id_next})">次の日記</a>
     539({else})
     540&nbsp;
     541({/if})
     542</td>
     543<td align="right" style="width: 10px"><img src="./skin/dummy.gif" alt="" style="width:10px;" class="dummy"></td>
     544<!-- ************************************** -->
     545
     546</tr>
     547</table>
     548
     549<img class="v_spacer_l" alt="" src="./skin/dummy.gif"/>
     550
     551({/if})
     552<!-- ******ここまで:前の日記/次の日記****** -->
     553<!-- ******************************** -->
     554
    518555({if $target_diary_comment_list})
    519556<!-- ********************************* -->
Note: See TracChangeset for help on using the changeset viewer.