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

Changeset 5089


Ignore:
Timestamp:
Jan 29, 2008, 3:07:12 PM (12 years ago)
Author:
ebihara
Message:

#1780:日記管理に公開範囲を載せるようにし、日記管理から当該日記IDの日記コメント管理ページにジャンプできるようにした

Location:
OpenPNE/trunk/webapp/modules/admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/trunk/webapp/modules/admin/lib/db_admin.php

    r4933 r5089  
    20402040}
    20412041
     2042function monitor_diary_comment_list4c_diary_id($c_diary_id, $page_size, $page)
     2043{
     2044    $page = intval($page);
     2045    $page_size = intval($page_size);
     2046
     2047    $where = " WHERE c_diary_comment.c_diary_id = ? ";
     2048    $params[] = intval($c_diary_id);
     2049   
     2050    $select = "SELECT c_diary_comment.*, c_diary.subject";
     2051    $from = " FROM c_diary_comment"
     2052        ." LEFT JOIN c_diary ON c_diary.c_diary_id = c_diary_comment.c_diary_id ";
     2053    $order = " ORDER BY r_datetime desc";
     2054   
     2055    $sql = $select . $from . $where . $order;
     2056    $list = db_get_all_limit($sql,($page-1)*$page_size,$page_size,$params);
     2057   
     2058    foreach ($list as $key => $value) {
     2059        $list[$key]['c_member'] = db_member_c_member_with_profile($value['c_member_id']);
     2060        $list[$key]['count_comments'] = db_diary_count_c_diary_comment4c_diary_id($value['c_diary_id']);
     2061    }
     2062   
     2063    $sql =
     2064        "SELECT COUNT(*) "
     2065        . $from
     2066        . $where ;
     2067    $total_num = db_get_one($sql, $params);
     2068   
     2069    $total_page_num =  ceil($total_num / $page_size);
     2070    $next = ($page < $total_page_num);
     2071    $prev = ($page > 1);
     2072   
     2073    return array($list , $prev , $next, $total_num, $total_page_num);
     2074}
     2075
    20422076function monitor_commu_list($keyword, $page_size, $page)
    20432077{
  • OpenPNE/trunk/webapp/modules/admin/page/diary_comment_list.php

    r4933 r5089  
    2121        $keyword = $requests['keyword'];
    2222        $target_c_diary_comment_id = $requests['target_c_diary_comment_id'];
     23        $target_c_diary_id = $requests['target_c_diary_id'];
    2324
    2425        $page_size = 20;
     
    2728            list($diary_comment_list,$prev,$next,$total_num,$total_page_num)
    2829            = monitor_diary_comment_list4c_diary_comment_id($target_c_diary_comment_id,$page_size,$page);
     30        } elseif ($target_c_diary_id) {
     31            list($diary_comment_list, $prev, $next, $total_num, $total_page_num)
     32            = monitor_diary_comment_list4c_diary_id($target_c_diary_id, $page_size, $page);
    2933        } else {
    3034            list($diary_comment_list,$prev,$next,$total_num,$total_page_num)
     
    3842        $this->set('keyword', $keyword);
    3943        $this->set('target_c_diary_comment_id', $target_c_diary_comment_id);
     44        $this->set('target_c_diary_id', $target_c_diary_id);
    4045        $this->set('total_num', $total_num);
    4146       
  • OpenPNE/trunk/webapp/modules/admin/templates/diary_comment_list.tpl

    r5088 r5089  
    2727<input type="hidden" name="m" value="({$module_name})" />
    2828<input type="hidden" name="a" value="page_({$hash_tbl->hash('diary_comment_list','page')})" />
    29 <h3 class="item">ID検索</h3>
     29<h3 class="item">日記ID検索</h3>
     30<input class="basic" type="text" name="target_c_diary_id" value="({$target_c_diary_id})" />
     31<span class="textBtnS"><input type="submit" value="検索" /></span>
     32</form>
     33
     34<form action="./" method="get">
     35<input type="hidden" name="m" value="({$module_name})" />
     36<input type="hidden" name="a" value="page_({$hash_tbl->hash('diary_comment_list','page')})" />
     37<h3 class="item">日記コメントID検索</h3>
    3038<input class="basic" type="text" name="target_c_diary_comment_id" value="({$target_c_diary_comment_id})" />
    3139<span class="textBtnS"><input type="submit" value="検索" /></span>
  • OpenPNE/trunk/webapp/modules/admin/templates/diary_list.tpl

    r5088 r5089  
    6767<th>タイトル</th>
    6868<td>
    69 <a href="({t_url _absolute=1 m=pc a=page_fh_diary})&amp;target_c_diary_id=({$item.c_diary_id})" target="_blank">({$item.subject})</a> (コメント({$item.count_comments})件)
     69<a href="({t_url _absolute=1 m=pc a=page_fh_diary})&amp;target_c_diary_id=({$item.c_diary_id})" target="_blank">({$item.subject})</a> (({if $item.count_comments})<a href="?m=({$module_name})&amp;a=page_({$hash_tbl->hash('diary_comment_list','page')})&amp;target_c_diary_id=({$item.c_diary_id})">({/if})コメント({$item.count_comments})件({if $item.count_comments})</a>({/if}))
    7070</td>
    7171</tr>
     
    7575<td>
    7676<a href="({t_url _absolute=1 m=pc a=page_f_home})&amp;target_c_member_id=({$item.c_member_id})" target="_blank">({$item.c_member.nickname})</a>
     77</td>
     78</tr>
     79({****})
     80<tr>
     81<th>公開範囲</th>
     82<td>
     83({if $item.public_flag == "public"})
     84全員に公開
     85({elseif $item.public_flag == "friend"})
     86({$smarty.const.WORD_MY_FRIEND})まで公開
     87({elseif $item.public_flag == "private"})
     88公開しない
     89({/if})
    7790</td>
    7891</tr>
  • OpenPNE/trunk/webapp/modules/admin/validate/page/diary_comment_list.ini

    r3484 r5089  
    1010type = "int"
    1111caption = "ID"
     12
     13[target_c_diary_id]
     14type = "int"
     15min = 1
     16caption = "日記ID"
Note: See TracChangeset for help on using the changeset viewer.