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

Changeset 3786


Ignore:
Timestamp:
Aug 29, 2007, 2:59:51 PM (12 years ago)
Author:
ebihara
Message:

#177:日記コメントのソート順が新着順になっていたのを修正

Location:
OpenPNE/trunk/webapp
Files:
3 edited

Legend:

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

    r3738 r3786  
    913913 * 日記へのコメントリストを取得
    914914 */
    915 function k_p_fh_diary_c_diary_comment_list4c_diary_id($c_diary_id, $page_size, $page)
    916 {
    917     $sql = 'SELECT * FROM c_diary_comment WHERE c_diary_id = ? ORDER BY r_datetime DESC';
     915function k_p_fh_diary_c_diary_comment_list4c_diary_id($c_diary_id, $page_size, $page, $desc = true)
     916{
     917    $sql = 'SELECT * FROM c_diary_comment WHERE c_diary_id = ? ORDER BY r_datetime ';
     918    if ($desc) {
     919        $sql .= 'DESC';
     920    } else {
     921        $sql .= 'ASC';
     922    }
    918923    $params = array(intval($c_diary_id));
    919924    $c_diary_comment_list = db_get_all_page($sql, $page, $page_size, $params);
  • OpenPNE/trunk/webapp/modules/pc/page/fh_diary.php

    r3785 r3786  
    7272        }
    7373
    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);
     74        list ($c_diary_comment_list, $is_next, $is_prev, $total_num, $total_page_num)
     75            = k_p_fh_diary_c_diary_comment_list4c_diary_id($target_c_diary_id, $page_size, $page, false);
    7776        $this->set('target_diary_comment_list', $c_diary_comment_list);
    7877        $this->set("is_prev", $is_prev);
     
    8584
    8685        $pager = array();
    87         $pager['end'] = $total_num - ($page_size * ($page - 1));
    88         $pager['start'] = $pager['end'] - count($c_diary_comment_list) + 1;
     86        $pager['start'] = ($page_size * ($page - 1)) + 1;
     87        $pager['end'] = $pager['start'] + count($c_diary_comment_list) - 1;
    8988        $this->set('pager', $pager);
    9089
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_diary.tpl

    r3785 r3786  
    564564({else})
    565565<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})
     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})
    568568({/if})
    569569 ({$pager.start})番~({$pager.end})番を表示
     
    674674({else})
    675675<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})
     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})
    678678({/if})
    679679 ({$pager.start})番~({$pager.end})番を表示
Note: See TracChangeset for help on using the changeset viewer.