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

Changeset 3785


Ignore:
Timestamp:
Aug 28, 2007, 8:27:27 PM (12 years ago)
Author:
ebihara
Message:

#177:日記コメントにページャを追加

Location:
OpenPNE/trunk/webapp/modules/pc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/modules/pc/page/fh_diary.php

    r2951 r3785  
    1414        $target_c_diary_id = $requests['target_c_diary_id'];
    1515        $body = $requests['body'];
     16        $is_all = $requests['is_all'];
     17        $direc = $requests['direc'];
     18        $page = $requests['page'];
    1619        // ----------
     20
     21        $page += $direc;
    1722
    1823        // target が指定されていない
     
    6065        $this->set("target_member", db_member_c_member4c_member_id($target_c_member_id));
    6166        $this->set("target_diary", $target_c_diary);
    62         $this->set("target_diary_comment_list", db_diary_get_c_diary_comment_list4c_diary_id($target_c_diary_id));
     67
     68        if ($is_all) {
     69            $page_size = db_diary_count_c_diary_comment4c_diary_id($target_c_diary_id);
     70        } else {
     71            $page_size = 10;
     72        }
     73
     74//        $this->set("target_diary_comment_list", db_diary_get_c_diary_comment_list4c_diary_id($target_c_diary_id));
     75        list ($c_diary_comment_list, $is_prev, $is_next, $total_num, $total_page_num)
     76            = k_p_fh_diary_c_diary_comment_list4c_diary_id($target_c_diary_id, $page_size, $page);
     77        $this->set('target_diary_comment_list', $c_diary_comment_list);
     78        $this->set("is_prev", $is_prev);
     79        $this->set("is_next", $is_next);
     80        $this->set("total_num", $total_num);
     81        $this->set("total_page_num", $total_page_num);
     82        $this->set("page_size", $page_size);
     83        $this->set('is_all', $is_all);
     84        $this->set('page', $page);
     85
     86        $pager = array();
     87        $pager['end'] = $total_num - ($page_size * ($page - 1));
     88        $pager['start'] = $pager['end'] - count($c_diary_comment_list) + 1;
     89        $this->set('pager', $pager);
    6390
    6491        $this->set("body", $body);
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_diary.tpl

    r3608 r3785  
    548548({*ここから:body*})
    549549<!-- ここから:主内容 -->
     550<!-- ここから:主内容>>表示件数切り替え -->
     551<table border="0" cellspacing="0" cellpadding="0" style="width:524px;">
     552({*********})
     553<tr>
     554<td style="width:524;height:1px;" class="bg_01" colspan="3"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     555</tr>
     556({*********})
     557<tr>
     558<td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     559<td style="width:522;" class="bg_02" align="right" valign="middle">
     560<div style="padding:4px 3px;">
     561
     562({if $is_all})
     563<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})">最新を表示</a>
     564({else})
     565<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;is_all=1">すべて表示</a>
     566({if $is_next})<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;direc=1&amp;page=({$page})"><前</a> ({/if})
     567({if $is_prev})<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;direc=-1&amp;page=({$page})">次></a> ({/if})
     568({/if})
     569 ({$pager.start})番~({$pager.end})番を表示
     570
     571</div>
     572</td>
     573<td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     574</tr>
     575({*********})
     576<tr>
     577<td style="height:1px;" class="bg_01" colspan="3"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     578</tr>
     579({*********})
     580</table>
     581<!-- ここまで:主内容>>表示件数切り替え -->
    550582<!-- ここから:主内容>>コメント表示 -->
    551583<table border="0" cellspacing="0" cellpadding="0" style="width:524px;" class="border_01">
     
    626658</table>
    627659<!-- ここまで:主内容>>コメント表示 -->
     660<!-- ここから:主内容>>表示件数切り替え -->
     661<table border="0" cellspacing="0" cellpadding="0" style="width:524px;">
     662({*********})
     663<tr>
     664<td style="width:524;height:1px;" class="bg_01" colspan="3"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     665</tr>
     666({*********})
     667<tr>
     668<td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     669<td style="width:522;" class="bg_02" align="right" valign="middle">
     670<div style="padding:4px 3px;">
     671
     672({if $is_all})
     673<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})">最新を表示</a>
     674({else})
     675<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;is_all=1">すべて表示</a>
     676({if $is_next})<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;direc=1&amp;page=({$page})"><前</a> ({/if})
     677({if $is_prev})<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;direc=-1&amp;page=({$page})">次></a> ({/if})
     678({/if})
     679 ({$pager.start})番~({$pager.end})番を表示
     680
     681</div>
     682</td>
     683<td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     684</tr>
     685({*********})
     686<tr>
     687<td style="height:1px;" class="bg_01" colspan="3"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     688</tr>
     689({*********})
     690</table>
     691<!-- ここまで:主内容>>表示件数切り替え -->
    628692<!-- ここまで:主内容 -->
    629693({*ここまで:body*})
  • OpenPNE/trunk/webapp/modules/pc/validate/page/fh_diary.ini

    r2 r3785  
    44[body]
    55type = "string"
     6
     7[is_all]
     8type = "int"
     9default = 0
     10
     11[direc]
     12type = "int"
     13default = 0
     14
     15[page]
     16type = "int"
     17default = 1
     18min = 1
Note: See TracChangeset for help on using the changeset viewer.