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

Changeset 243


Ignore:
Timestamp:
Sep 26, 2006, 1:59:36 PM (14 years ago)
Author:
takanashi
Message:

日記記事ごとの閲覧権限追加

Location:
OpenPNE/trunk
Files:
1 added
42 edited
1 copied

Legend:

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

    r102 r243  
    7171    $ids = implode(',', array_map('intval', $bookmarks));
    7272
    73     // 日記を全員に公開しているメンバーのみを取得
    74     $sql = 'SELECT c_member_id FROM c_member WHERE c_member_id IN ('.$ids.')' .
    75             ' AND public_flag_diary = \'public\'';
    76     $public = db_get_col($sql);
    77     $ids = implode(',', array_map('intval', $public));
     73    $sql = 'SELECT c_diary.* FROM c_diary, c_member WHERE c_diary.c_member_id IN ('.$ids.') AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\')) AND c_diary.c_member_id=c_member.c_member_id ORDER BY r_datetime DESC';
    7874
    79     $sql = 'SELECT * FROM c_diary WHERE c_member_id IN (' . $ids . ') ORDER BY r_datetime DESC';
    8075    $diary_list = db_get_all_limit($sql, 0, intval($limit));
    8176
     
    114109    $ids = implode(',', array_map('intval', $bookmarks));
    115110
    116     // 日記を全員に公開しているメンバーのみを取得
    117     $sql = 'SELECT c_member_id FROM c_member WHERE c_member_id IN ('.$ids.')' .
    118             ' AND public_flag_diary = \'public\'';
    119     $public = db_get_col($sql);
    120     $ids = implode(',', array_map('intval', $public));
     111    $sql = 'SELECT c_diary.* FROM c_diary, c_member WHERE c_diary.c_member_id IN ('.$ids.') AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\')) AND c_diary.c_member_id=c_member.c_member_id ORDER BY r_datetime DESC';
    121112
    122     $sql = 'SELECT * FROM c_diary WHERE c_member_id IN (' . $ids . ') ORDER BY r_datetime DESC';
    123113    $diary_list = db_get_all_page($sql, intval($page), intval($page_size));
    124114    foreach ($diary_list as $key => $value) {
  • OpenPNE/trunk/webapp/lib/db/read/diary.php

    r136 r243  
    173173    $where = "c_friend.c_member_id_from = ?" .
    174174            " AND c_diary.c_member_id = c_friend.c_member_id_to" .
     175            " AND c_diary.c_member_id = c_member.c_member_id" .
     176            ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\') OR (c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\'))' .
    175177            " AND c_diary.r_datetime > ?";
     178
    176179    $params = array(intval($c_member_id), $last_week);
    177180
    178     $sql = "SELECT c_diary.* FROM c_diary, c_friend WHERE " . $where .
     181    $sql = "SELECT c_diary.* FROM c_diary, c_friend, c_member WHERE " . $where .
    179182            " ORDER BY c_diary.r_datetime DESC";
    180183    $lst = db_get_all_page($sql, $page, $page_size, $params);
     
    185188    }
    186189
    187     $sql = 'SELECT count(*) FROM c_diary, c_friend WHERE ' . $where;
     190    $sql = 'SELECT count(*) FROM c_diary, c_friend, c_member WHERE ' . $where;
    188191    $total_num = db_get_one($sql, $params);
    189192
     
    234237/**
    235238 * フレンド最新日記リスト取得
     239 * 日記公開範囲を考慮
    236240 *
    237241 * @param   int $c_member_id
     
    244248    $ids = implode(',', array_map('intval', $friends));
    245249
    246     $hint = db_mysql_hint('USE INDEX (r_datetime_c_member_id, r_datetime)');
    247     $sql = 'SELECT * FROM c_diary' . $hint .
    248             ' WHERE c_member_id IN (' . $ids . ')' .
    249             ' ORDER BY r_datetime DESC';
     250    $hint = db_mysql_hint('USE INDEX (c_diary.r_datetime_c_member_id, c_diary.r_datetime)');
     251    $sql = 'SELECT c_diary.* FROM c_diary INNER JOIN c_member USING (c_member_id)' . $hint .
     252            ' WHERE c_diary.c_member_id IN (' . $ids . ')' .
     253            ' AND (((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\'))' .
     254            ' OR ((c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\')))' .
     255            ' ORDER BY c_diary.r_datetime DESC';
     256
    250257    $c_diary_friend_list = db_get_all_limit($sql, 0, $limit);
    251258
     
    267274function p_h_home_c_diary_my_comment_list4c_member_id($c_member_id, $limit)
    268275{
     276
     277    //アクセスブロック
     278    $sql = 'SELECT c_member_id FROM c_access_block where c_member_id_block = ?';
     279    $params = array(intval($c_member_id));
     280    if( !$ids = implode(',', db_get_col($sql, $params)) ) {
     281        $ids = 0;
     282    }
     283
     284
    269285    $date = date('Y-m-d 00:00:00', strtotime('-15 days'));
    270286
    271287    $sql = 'SELECT c_diary_comment.c_diary_id' .
    272            ' FROM c_diary_comment INNER JOIN c_diary USING (c_diary_id)' .
    273            ' WHERE c_diary_comment.c_member_id = ?' .
    274            ' AND c_diary_comment.r_datetime > ?' .
    275            ' AND c_diary.c_member_id <> ?';
     288            ' FROM c_diary_comment INNER JOIN c_diary USING (c_diary_id)' .
     289            ' , c_member, c_friend' .
     290            ' WHERE c_diary_comment.c_member_id = ?' .
     291            ' AND c_diary_comment.r_datetime > ?' .
     292            ' AND c_diary.c_member_id <> ?'.
     293        //アクセスブロック
     294            ' AND c_friend.c_member_id_from = c_diary_comment.c_member_id' .
     295            ' AND c_diary.c_member_id not in('.$ids.')' .
     296        //日記公開範囲絞り
     297            ' AND c_diary.c_member_id = c_member.c_member_id' .
     298            ' AND (((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\')) OR(((c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\')) AND c_diary.c_member_id = c_friend.c_member_id_to))';
     299
    276300    $params = array(intval($c_member_id), $date, intval($c_member_id));
     301
    277302    $c_diary_id_list = db_get_col($sql, $params);
    278303    $c_diary_id_list = array_unique($c_diary_id_list);
     
    302327function p_h_diary_comment_list_c_diary_my_comment_list4c_member_id($c_member_id, $page, $page_size)
    303328{
     329
     330    $sql = 'SELECT c_member_id FROM c_access_block where c_member_id_block = ?';
     331    $params = array(intval($c_member_id));
     332    if( !$ids = implode(',', db_get_col($sql, $params)) ) {
     333        $ids = 0;
     334    }
     335
    304336    $sql = 'SELECT d.c_diary_id' .
    305337            ', d.subject' .
     
    310342            ' INNER JOIN c_diary_comment AS dc USING (c_diary_id)' .
    311343            ', c_diary_comment AS mydc' .
     344            ', c_friend AS f' .
     345            ', c_member AS m' .
     346
    312347        ' WHERE mydc.c_member_id = ?' .
    313348            ' AND mydc.c_diary_id = d.c_diary_id' .
    314349            ' AND mydc.c_member_id <> d.c_member_id' .
     350        //アクセスブロック
     351            ' AND f.c_member_id_from = mydc.c_member_id' .
     352            ' AND d.c_member_id not in('.$ids.')' .
     353        //日記公開範囲絞り
     354            ' AND d.c_member_id = m.c_member_id' .
     355            ' AND (((d.public_flag = \'public\') OR (d.public_flag = \'default\' AND m.public_flag_diary = \'public\')) OR(((d.public_flag = \'friend\') OR (d.public_flag = \'default\' AND m.public_flag_diary = \'friend\')) AND d.c_member_id = f.c_member_id_to))'.
     356
    315357        ' GROUP BY dc.c_diary_id' .
    316358        ' ORDER BY r_datetime DESC';
     359
    317360    $params = array(intval($c_member_id));
    318361    $list = db_get_all_page($sql, $page, $page_size, $params);
     362
    319363    foreach ($list as $key => $value) {
    320364        $list[$key] += db_common_c_member4c_member_id_LIGHT($value['c_member_id']);
     
    454498    }
    455499    $where .= " AND c_member.c_member_id = c_diary.c_member_id";
    456     $where .= " AND c_member.public_flag_diary = 'public'";
     500    $where .= " AND ((c_diary.public_flag = 'public') OR (c_diary.public_flag = 'default' AND c_member.public_flag_diary = 'public'))";
    457501
    458502    $select = "SELECT c_diary.*";
     
    619663
    620664/**
    621  * 日記IDからその日記を書いたメンバIDとニックネームを得る
     665 * 日記IDからその日記を書いたメンバIDとニックネームと日記公開範囲を得る
    622666 */
    623667function k_p_fh_diary_c_member4c_diary_id($c_diary_id)
    624668{
    625     $sql = "SELECT cm.c_member_id, cm.nickname ";
     669    $sql = "SELECT cm.c_member_id, cm.nickname,cm. public_flag_diary ";
    626670    $sql .= " FROM c_member AS cm, c_diary AS cd ";
    627671    $sql .= " WHERE cd.c_diary_id = ?";
  • OpenPNE/trunk/webapp/lib/db/write/diary.php

    r147 r243  
    1010 * 日記を追加
    1111 */
    12 function db_diary_insert_c_diary($c_member_id, $subject, $body)
     12function db_diary_insert_c_diary($c_member_id, $subject, $body, $public_flag)
    1313{
    1414    $data = array(
     
    1616        'subject' => $subject,
    1717        'body' => $body,
     18        'public_flag' => $public_flag,
    1819        'r_datetime' => db_now(),
    1920        'r_date' => db_now(),
     
    2627 * 日記を編集
    2728 */
    28 function db_diary_update_c_diary($c_diary_id, $subject, $body,
     29function db_diary_update_c_diary($c_diary_id, $subject, $body, $public_flag,
    2930    $image_filename_1 = '', $image_filename_2 = '', $image_filename_3 = '')
    3031{
     
    3233        'subject' => $subject,
    3334        'body' => $body,
     35        'public_flag' => $public_flag,
    3436    );
    3537    if ($image_filename_1) $data['image_filename_1'] = $image_filename_1;
  • OpenPNE/trunk/webapp/modules/ktai/do/fh_diary_insert_c_diary_comment.php

    r134 r243  
    3131        $target_c_member = db_common_c_member4c_member_id($target_c_member_id);
    3232
    33         //日記の公開範囲設定
    34         if ($target_c_member['public_flag_diary'] == "friend" &&
    35             !db_friend_is_friend($u, $target_c_member_id) && $target_c_member_id != $u) {
    36             openpne_redirect('ktai', 'page_h_access_block');
    37         }
     33        //友達までの公開かどうか
     34        $is_public_flag_friend = ($target_c_member['public_flag_diary'] == "friend" && $c_diary['public_flag'] == "default") || $c_diary['public_flag'] == "friend";
     35        //公開しないかどうか
     36        $is_public_flag_close = ($target_c_member['public_flag_diary'] == "close" && $c_diary['public_flag'] == "default") || $c_diary['public_flag'] == "close";
    3837
    39         //アクセスブロック設定
    40         if (p_common_is_access_block($u, $target_c_member_id)) {
    41             openpne_redirect('ktai', 'page_h_access_block');
     38        if ($u != $target_c_member_id) {
     39
     40            //日記の公開範囲設定
     41            if ($is_public_flag_friend && !db_friend_is_friend($u, $target_c_member_id)) {
     42                openpne_redirect('ktai', 'page_h_access_block');
     43            }
     44            if($is_public_flag_close)
     45            {
     46                openpne_redirect('ktai', 'page_h_access_block');
     47            }
     48
     49            //アクセスブロック設定
     50            if (p_common_is_access_block($u, $target_c_member_id)) {
     51                openpne_redirect('ktai', 'page_h_access_block');
     52            }
    4253        }
    4354        //---
  • OpenPNE/trunk/webapp/modules/ktai/do/h_diary_edit_insert_c_diary.php

    r102 r243  
    1818        $subject = $requests['subject'];
    1919        $body = $requests['body'];
     20        $public_flag = $requests['public_flag'];
    2021        $target_c_diary_id = $requests['target_c_diary_id'];
    2122        // ----------
     
    3233
    3334        if (!$target_c_diary_id) {
    34             $update_c_diary_id = db_diary_insert_c_diary($u, $subject, $body);
     35            $update_c_diary_id = db_diary_insert_c_diary($u, $subject, $body, $public_flag);
    3536        } else {
    3637            $update_c_diary_id = $target_c_diary_id;
     
    4546         * 携帯はWEBでは画像UPLOADなし
    4647         */
    47         db_diary_update_c_diary($update_c_diary_id, $subject, $body);
     48        db_diary_update_c_diary($update_c_diary_id, $subject, $body, $public_flag);
    4849
    4950        $p = array('target_c_member_id' => $u);
  • OpenPNE/trunk/webapp/modules/ktai/page/f_home.php

    r2 r243  
    4545
    4646        //ターゲットの最新日記5件
    47         $this->set("c_diary_list", k_p_f_home_c_diary_list4c_member_id($target_c_member_id, 5));
     47        $this->set("c_diary_list", $this->_db_diary_get_c_diary_list4c_member_id($target_c_member_id, $is_friend, 5) );
    4848
    4949        //フレンドランダム5人
     
    6666        return 'success';
    6767    }
     68
     69    //f_home仕様 日記公開範囲を考慮する
     70    function _db_diary_get_c_diary_list4c_member_id($target_c_member_id, $is_friend, $count = 10)
     71    {
     72        $sql = 'SELECT c_diary.* FROM c_diary' .
     73            ' INNER JOIN c_member USING (c_member_id)'.
     74            ' WHERE c_diary.c_member_id = ?';
     75
     76        if($is_friend)
     77        {
     78            $sql .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\') OR (c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\'))';
     79        }
     80        else
     81        {
     82            $sql .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\'))';
     83        }
     84
     85        $sql .= ' ORDER BY c_diary.r_datetime DESC';
     86
     87        $params = array(intval($target_c_member_id));
     88        $arr = db_get_all_limit($sql, 0, $count, $params);
     89        foreach ($arr as $key => $value) {
     90            $arr[$key]['count_comment'] = db_diary_count_c_diary_comment4c_diary_id($value['c_diary_id']);
     91        }
     92        return $arr;
     93    }
     94
     95
    6896}
    6997
  • OpenPNE/trunk/webapp/modules/ktai/page/fh_diary.php

    r102 r243  
    2323        $this->set("page", $page);
    2424
    25         $target_c_member = k_p_fh_diary_c_member4c_diary_id($target_c_diary_id);
    26         $target_c_member_id = $target_c_member['c_member_id'];
     25        $c_diary = db_diary_get_c_diary4id($target_c_diary_id);
    2726
    28         if (p_common_is_access_block($u, $target_c_member_id)) {
    29             openpne_redirect('ktai', 'page_h_access_block');
     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'];
     28
     29        //友達までの公開かどうか
     30        $is_public_flag_friend = ($target_c_member['public_flag_diary'] == "friend" && $c_diary['public_flag'] == "default") || $c_diary['public_flag'] == "friend";
     31        //公開しないかどうか
     32        $is_public_flag_close = ($target_c_member['public_flag_diary'] == "close" && $c_diary['public_flag'] == "default") || $c_diary['public_flag'] == "close";
     33        if ($u != $target_c_member_id) {
     34
     35            //日記の公開範囲設定
     36            if ($is_public_flag_friend && !db_friend_is_friend($u, $target_c_member_id)) {
     37                ktai_display_error('この日記にはアクセスできません');
     38            }
     39            if($is_public_flag_close)
     40            {
     41                ktai_display_error('この日記にはアクセスできません');
     42            }
     43
     44            //アクセスブロック設定
     45            if (p_common_is_access_block($u, $target_c_member_id)) {
     46                openpne_redirect('ktai', 'page_h_access_block');
     47            }
    3048        }
    31 
    32         $target_c_member = db_common_c_member4c_member_id($target_c_member_id);
    33         // フレンドにしか公開していない
    34         if ($target_c_member['public_flag_diary'] == "friend" &&
    35             !db_friend_is_friend($u, $target_c_member_id) &&
    36             $target_c_member_id != $u) {
    37 
    38             ktai_display_error('この日記にはアクセスできません');
    39         }
    40 
    4149        //管理画面HTML
    4250        $this->set('c_siteadmin', p_common_c_siteadmin4target_pagename('k_fh_diary'));
     
    4654
    4755        //日記
    48         $c_diary = db_diary_get_c_diary4id($target_c_diary_id);
    4956        $this->set("target_c_diary", $c_diary);
    5057        //自分で日記を見たとき
     
    5259            //日記を閲覧済みにする
    5360            db_diary_update_c_diary_is_checked($target_c_diary_id, 1);
     61            $this->set("type", 'h');
     62           
    5463        }
    5564        //コメント
  • OpenPNE/trunk/webapp/modules/ktai/page/fh_diary_list.php

    r134 r243  
    1919        if (!$target_c_member_id) $target_c_member_id = $u;
    2020
     21        $is_friend = db_friend_is_friend($u, $target_c_member_id);
     22
     23        if ($target_c_member_id == $u) {
     24            $type = 'h';
     25            $this->set("type", $type);
     26        }
     27
    2128        if (p_common_is_access_block($u, $target_c_member_id)) {
    2229            openpne_redirect('ktai', 'page_h_access_block');
     
    2431
    2532        $target_c_member = db_common_c_member4c_member_id($target_c_member_id);
    26         // フレンドにしか公開していない
    27         if ($target_c_member['public_flag_diary'] == "friend" &&
    28             !db_friend_is_friend($u, $target_c_member_id) &&
    29             $target_c_member_id != $u) {
    30 
    31             ktai_display_error('この日記にはアクセスできません');
    32         }
    3333
    3434        //ターゲット情報
    35         $this->set("target_c_member", db_common_c_member4c_member_id_LIGHT($target_c_member_id));
     35        $this->set("target_c_member", db_common_c_member4c_member_id($target_c_member_id));
    3636
    3737        // 1ページ当たりに表示する日記の数
     
    3939        $page += $direc;
    4040        //ターゲットの詳細な日記リスト
    41         $list = k_p_fh_diary_list_c_diary_list4c_member_id($target_c_member_id, $page_size, $page);
     41        $list = $this->_p_fh_diary_list_diary_list4c_member_id($target_c_member_id, $is_friend, $type, $page_size, $page);
    4242
    4343        $this->set("target_diary_list", $list[0]);
     
    5454        return 'success';
    5555    }
     56
     57    /**
     58     * あるメンバーの日記リストを取得
     59     * 日記公開範囲を考慮
     60     *
     61     * @param int $c_member_id
     62     * @param int $page_size
     63     * @param int $page
     64     * @return array 日記リスト
     65     */
     66    function _p_fh_diary_list_diary_list4c_member_id($c_member_id, $is_friend, $type, $page_size, $page)
     67    {
     68        if ($type == 'h') {
     69            return p_fh_diary_list_diary_list4c_member_id($c_member_id, $page_size, $page);
     70        }
     71
     72        $sql   = 'SELECT c_diary.*';
     73        $from  = ' FROM c_diary INNER JOIN c_member USING (c_member_id)';
     74        $where = ' WHERE c_diary.c_member_id = ?' ;
     75        $order = ' ORDER BY c_diary.r_datetime DESC';
     76
     77
     78        if ($is_friend) {
     79            $where .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\') OR (c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\'))';
     80        } else {
     81            $where .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\'))';
     82        }
     83
     84        $sql .= $from . $where . $order;
     85
     86        $params = array(intval($c_member_id));
     87        $list = db_get_all_page($sql, $page, $page_size, $params);
     88
     89        foreach ($list as $key => $c_diary) {
     90            $list[$key]['num_comment'] = db_diary_count_c_diary_comment4c_diary_id($c_diary['c_diary_id']);
     91        }
     92
     93        $sql = 'SELECT COUNT(c_diary.*)' . $from . $where . $order;
     94        $total_num = db_get_one($sql, $params);
     95
     96        if ($total_num != 0) {
     97            $total_page_num =  ceil($total_num / $page_size);
     98            if ($page >= $total_page_num) {
     99                $next = false;
     100            } else {
     101                $next = true;
     102            }
     103
     104            if ($page <= 1) {
     105                $prev = false;
     106            } else {
     107                $prev = true;
     108            }
     109        }
     110        return array($list, $prev, $next);
     111    }
     112
    56113}
    57114
  • OpenPNE/trunk/webapp/modules/ktai/page/h_diary_edit.php

    r13 r243  
    2222                handle_kengen_error();
    2323            }
     24        } else {
     25            $c_diary['public_flag'] = 'default';
     26            $this->set('target_c_diary', $c_diary);
    2427        }
    2528
     
    3235        $this->set('blog_address', $mail_address);
    3336
     37        //メンバ情報
     38        $this->set('member', db_common_c_member4c_member_id($u));
     39
     40
    3441        return 'success';
    3542    }
  • OpenPNE/trunk/webapp/modules/ktai/page/h_diary_list_friend.php

    r102 r243  
    2121        $this->set("page_size", $page_size);
    2222
    23         $lst = k_p_h_diary_list_friend_h_diary_list_friend4c_member_id($u, $page_size, $page);
     23        //日付のリミットはとりあえず30
     24        $lst = p_h_diary_list_friend_h_diary_list_friend4c_member_id($u, $page_size, $page, 30);
    2425        $this->set("h_diary_list_friend", $lst[0]);
    2526        $this->set("is_prev", $lst[1]);
  • OpenPNE/trunk/webapp/modules/ktai/templates/f_home.tpl

    r2 r243  
    4242({/if})
    4343
    44 ({if $relation.friend||$target_c_member.public_flag_diary=="public"})
     44({if $c_diary_list})
    4545◆日記<br>
    4646({foreach from=$c_diary_list item=c_diary})
  • OpenPNE/trunk/webapp/modules/ktai/templates/fh_diary.tpl

    r147 r243  
    88({/if})
    99({$target_c_diary.r_datetime|date_format:"%y/%m/%d %H:%M"})<br>
    10 ({$target_c_diary.subject})<br>
     10({$target_c_diary.subject})
     11
     12({if $type == "h"})
     13<span style="color: red">
     14(
     15({if $target_c_diary.public_flag == "default"})
     16日記全体の設定に従う(({if $target_diary_writer.public_flag_diary == "public"})全員に公開({elseif $target_diary_writer.public_flag_diary == "friend"})({$WORD_FRIEND_HALF})まで公開({elseif $target_diary_writer.public_flag_diary == "close"})公開しない({/if}))
     17({elseif $target_c_diary.public_flag == "public"})
     18全員に公開
     19({elseif $target_c_diary.public_flag == "friend"})
     20({$WORD_FRIEND_HALF})まで公開
     21({elseif $target_c_diary.public_flag == "close"})
     22公開しない
     23({/if})
     24)
     25</span>
     26({/if})
     27<br>
    1128<br>
    1229({$target_c_diary.body|nl2br})<br>
  • OpenPNE/trunk/webapp/modules/ktai/templates/fh_diary_list.tpl

    r2 r243  
    44<hr><br>
    55({foreach from=$target_diary_list item=target_diary})
    6 ({$target_diary.r_date|date_format:"%y/%m/%d"})-<a href="({t_url m=ktai a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;({$tail})">({$target_diary.subject})</a> (({$target_diary.count_comment}))
     6({$target_diary.r_date|date_format:"%y/%m/%d"})-<a href="({t_url m=ktai a=page_fh_diary})&amp;target_c_diary_id=({$target_diary.c_diary_id})&amp;({$tail})">({$target_diary.subject})</a> (({$target_diary.num_comment}))
     7
     8({if $type == "h"})
     9<span style="color: red">
     10(
     11({if $target_diary.public_flag == "default"})
     12日記全体の設定に従う(({if $target_c_member.public_flag_diary == "public"})全員に公開({elseif $target_c_member.public_flag_diary == "friend"})({$WORD_FRIEND_HALF})まで公開({elseif $target_c_member.public_flag_diary == "close"})公開しない({/if}))
     13({elseif $target_diary.public_flag == "public"})
     14全員に公開
     15({elseif $target_diary.public_flag == "friend"})
     16({$WORD_FRIEND_HALF})まで公開
     17({elseif $target_diary.public_flag == "close"})
     18公開しない
     19({/if})
     20)
     21</span>
     22({/if})
     23
     24
    725<br>
    826({/foreach})
  • OpenPNE/trunk/webapp/modules/ktai/templates/h_config_public_flag_diary.tpl

    r2 r243  
    1111<input type="radio" name="public_flag_diary" value="friend"({if $c_member.public_flag_diary=="friend"}) checked="checked"({/if})>
    1212({$WORD_MY_FRIEND_HALF})まで公開<br>
     13<input type="radio" name="public_flag_diary" value="close"({if $c_member.public_flag_diary == "close"}) checked="checked"({/if})>
     14公開しない<br>
    1315<input type="submit" value="変更"><br>
    1416</form>
  • OpenPNE/trunk/webapp/modules/ktai/templates/h_diary_edit.tpl

    r2 r243  
    1515本文<br>
    1616<textarea name="body" rows="6" cols="14">({$target_c_diary.body})</textarea><br>
     17<input type="radio" name="public_flag" value="default"({if $target_c_diary.public_flag == "default"}) checked="checked"({/if})>日記全体の設定に従う(({if $member.public_flag_diary == "public"})全員に公開({elseif $member.public_flag_diary == "friend"})({$WORD_FRIEND_HALF})まで公開({elseif $member.public_flag_diary == "close"})公開しない({/if}))<br>
     18<input type="radio" name="public_flag" value="public"({if $target_c_diary.public_flag == "public"}) checked="checked"({/if})>全員に公開
     19<input type="radio" name="public_flag" value="friend"({if $target_c_diary.public_flag == "friend"}) checked="checked"({/if})>({$WORD_FRIEND_HALF})まで公開
     20<input type="radio" name="public_flag" value="close"({if $target_c_diary.public_flag == "close"}) checked="checked"({/if})>公開しない<br>
     21
    1722<input type="submit" value="送信">
    1823</form>
  • OpenPNE/trunk/webapp/modules/ktai/validate/do/h_diary_edit_insert_c_diary.ini

    r2 r243  
    55type = "string"
    66
     7[public_flag]
     8type = "string"
     9default = "default"
     10
    711[target_c_diary_id]
    812type = "int"
  • OpenPNE/trunk/webapp/modules/pc/do/fh_diary_insert_c_diary_comment.php

    r147 r243  
    3333        $target_c_member = db_common_c_member4c_member_id($target_c_member_id);
    3434
    35         //日記の公開範囲設定
    36         if ($target_c_member['public_flag_diary'] == "friend" &&
    37             !db_friend_is_friend($u, $target_c_member_id) && $target_c_member_id != $u) {
    38             openpne_redirect('pc', 'page_h_err_diary_access');
    39         }
     35        //友達までの公開かどうか
     36        $is_public_flag_friend = ($target_c_member['public_flag_diary'] == "friend" && $c_diary['public_flag'] == "default") || $c_diary['public_flag'] == "friend";
     37        //公開しないかどうか
     38        $is_public_flag_close = ($target_c_member['public_flag_diary'] == "close" && $c_diary['public_flag'] == "default") || $c_diary['public_flag'] == "close";
    4039
    41         //アクセスブロック設定
    42         if (p_common_is_access_block($u, $target_c_member_id)) {
    43             openpne_redirect('pc', 'page_h_access_block');
     40        if ($u != $target_c_member_id) {
     41            //日記の公開範囲設定
     42            if ($is_public_flag_friend &&
     43                 !db_friend_is_friend($u, $target_c_member_id)) {
     44                openpne_redirect('pc', 'page_h_err_diary_access');
     45            }
     46
     47            if($is_public_flag_close)
     48            {
     49                openpne_redirect('pc', 'page_h_err_diary_access');
     50            }
     51
     52            //アクセスブロック設定
     53            if (p_common_is_access_block($u, $target_c_member_id)) {
     54                openpne_redirect('pc', 'page_h_access_block');
     55            }
    4456        }
    4557        //---
  • OpenPNE/trunk/webapp/modules/pc/do/h_diary_add_insert_c_diary.php

    r2 r243  
    1717        $subject = $requests['subject'];
    1818        $body = $requests['body'];
     19        $public_flag = $requests['public_flag'];
    1920        $tmpfile_1 = $requests['tmpfile_1'];
    2021        $tmpfile_2 = $requests['tmpfile_2'];
     
    3940        $c_member_id = $u;
    4041
    41         $c_diary_id = db_diary_insert_c_diary($c_member_id, $subject, $body);
     42        $c_diary_id = db_diary_insert_c_diary($c_member_id, $subject, $body, $public_flag);
    4243
    4344        $filename_1 = image_insert_c_image4tmp("d_{$c_diary_id}_1", $tmpfile_1);
     
    4647        t_image_clear_tmp($sessid);
    4748
    48         db_diary_update_c_diary($c_diary_id, $subject, $body, $filename_1, $filename_2, $filename_3);
     49        db_diary_update_c_diary($c_diary_id, $subject, $body, $public_flag, $filename_1, $filename_2, $filename_3);
    4950
    5051        $p = array('target_c_diary_id' => $c_diary_id);
  • OpenPNE/trunk/webapp/modules/pc/do/h_diary_edit_insert_c_diary.php

    r2 r243  
    1818        $subject = $requests['subject'];
    1919        $body = $requests['body'];
     20        $public_flag = $requests['public_flag'];
    2021        $tmpfile_1 = $requests['tmpfile_1'];
    2122        $tmpfile_2 = $requests['tmpfile_2'];
     
    6465
    6566        t_image_clear_tmp($sessid);
    66         db_diary_update_c_diary($target_c_diary_id, $subject, $body, $filename_1, $filename_2, $filename_3);
     67        db_diary_update_c_diary($target_c_diary_id, $subject, $body, $public_flag, $filename_1, $filename_2, $filename_3);
    6768
    6869        $p = array('target_c_diary_id' => $target_c_diary_id);
  • OpenPNE/trunk/webapp/modules/pc/page/f_home.php

    r134 r243  
    6565        $this->set('c_friend_list', p_f_home_c_friend_list4c_member_id($target_c_member_id, 9));
    6666        $this->set('c_friend_count', db_friend_count_friends($target_c_member_id));
    67         $this->set('c_diary_list', db_diary_get_c_diary_list4c_member_id($target_c_member_id, 5));
     67        $this->set('c_diary_list', $this->_db_diary_get_c_diary_list4c_member_id($target_c_member_id, $is_friend, 5));
     68
    6869        $this->set('user_count', p_common_count_c_commu4c_member_id($target_c_member_id));
    6970        $this->set('c_commu_list', p_f_home_c_commu_list4c_member_id($target_c_member_id, 9));
     
    8283        return 'success';
    8384    }
     85
     86    //f_home仕様 日記公開範囲を考慮する
     87    function _db_diary_get_c_diary_list4c_member_id($target_c_member_id, $is_friend, $count = 10)
     88    {
     89        $sql = 'SELECT c_diary.* FROM c_diary' .
     90            ' INNER JOIN c_member USING (c_member_id)'.
     91            ' WHERE c_diary.c_member_id = ?';
     92
     93        if($is_friend)
     94        {
     95            $sql .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\') OR (c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\'))';
     96        }
     97        else
     98        {
     99            $sql .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\'))';
     100        }
     101
     102        $sql .= ' ORDER BY c_diary.r_datetime DESC';
     103
     104        $params = array(intval($target_c_member_id));
     105        $arr = db_get_all_limit($sql, 0, $count, $params);
     106        foreach ($arr as $key => $value) {
     107            $arr[$key]['comment_count'] = db_diary_count_c_diary_comment4c_diary_id($value['c_diary_id']);
     108        }
     109        return $arr;
     110    }
     111
    84112}
    85113
  • OpenPNE/trunk/webapp/modules/pc/page/fh_comment_list.php

    r102 r243  
    3030            $type = "f";
    3131
    32             //日記の公開範囲設定
    33             if (($target_c_member['public_flag_diary'] == "friend" &&
    34                  !db_friend_is_friend($u, $target_c_member_id))) {
    35                 openpne_redirect('pc', 'page_h_err_diary_access');
    36             }
     32            $is_friend = db_friend_is_friend($u, $target_c_member_id);
    3733
    3834            // アクセスブロック
     
    4440
    4541        //c_member_id から自分の日記についてるコメントIDリストを取得
    46         $target_c_diary_comment_id = p_fh_diary_c_diary_comment_id_list4c_member_id($target_c_member_id);
     42        $target_c_diary_comment_id = $this->_p_fh_diary_c_diary_comment_id_list4c_member_id($target_c_member_id, $is_friend, $type);
    4743
    4844        $page_size = 50;
     
    6460        return 'success';
    6561    }
     62
     63
     64    //c_member_id から自分の日記についてるコメントID(複数)を取得
     65    //日記公開範囲を考慮
     66    function _p_fh_diary_c_diary_comment_id_list4c_member_id($c_member_id, $is_friend, $type)
     67    {
     68        if ($type == 'h') {
     69            return p_fh_diary_c_diary_comment_id_list4c_member_id($c_member_id);
     70        }
     71
     72        $sql = "SELECT cdc.c_diary_comment_id FROM c_diary as cd,c_diary_comment as cdc, c_member as cm" .
     73            " WHERE cd.c_member_id = ?".
     74            " AND cd.c_diary_id = cdc.c_diary_id".
     75            " AND cd.c_member_id = cm.c_member_id";
     76
     77        if ($is_friend) {
     78            $sql .= ' AND ((cd.public_flag = \'public\') OR (cd.public_flag = \'default\' AND cm.public_flag_diary = \'public\') OR (cd.public_flag = \'friend\') OR (cd.public_flag = \'default\' AND cm.public_flag_diary = \'friend\'))';
     79        } else {
     80            $sql .= ' AND ((cd.public_flag = \'public\') OR (cd.public_flag = \'default\' AND cm.public_flag_diary = \'public\'))';
     81        }
     82
     83        $params = array(intval($c_member_id));
     84        return db_get_col($sql, $params);
     85    }
     86
     87
    6688}
    6789
  • OpenPNE/trunk/webapp/modules/pc/page/fh_diary.php

    r102 r243  
    3939            $target_c_member = db_common_c_member4c_member_id($target_c_member_id);
    4040
     41            //友達までの公開かどうか
     42            $is_public_flag_friend = ($target_c_member['public_flag_diary'] == "friend" && $target_c_diary['public_flag'] == "default") || $target_c_diary['public_flag'] == "friend";
     43            //公開しないかどうか
     44            $is_public_flag_close = ($target_c_member['public_flag_diary'] == "close" && $target_c_diary['public_flag'] == "default") || $target_c_diary['public_flag'] == "close";
     45
     46            $is_friend = db_friend_is_friend($u, $target_c_member_id);
     47
    4148            //日記の公開範囲設定
    42             if (($target_c_member['public_flag_diary'] == "friend" &&
    43                  !db_friend_is_friend($u, $target_c_member_id))) {
     49            if ($is_public_flag_friend && !$is_friend) {
     50                openpne_redirect('pc', 'page_h_err_diary_access');
     51            }
     52
     53            if($is_public_flag_close)
     54            {
    4455                openpne_redirect('pc', 'page_h_err_diary_access');
    4556            }
     
    6677
    6778        //最近の日記を取得
    68         $list_set = p_fh_diary_list_diary_list4c_member_id($target_c_member_id, 7, 1);
     79        $list_set = $this->_p_fh_diary_list_diary_list4c_member_id($target_c_member_id, $is_friend, $type, 7, 1);
     80
    6981        $this->set("new_diary_list", $list_set[0]);
    7082
     
    93105        return 'success';
    94106    }
     107
     108
     109    /**
     110     * あるメンバーの日記リストを取得
     111     * 日記公開範囲を考慮
     112     *
     113     * @param int $c_member_id
     114     * @param int $page_size
     115     * @param int $page
     116     * @return array 日記リスト
     117     */
     118    function _p_fh_diary_list_diary_list4c_member_id($c_member_id, $is_friend, $type, $page_size, $page)
     119    {
     120        if ($type == 'h') {
     121            return p_fh_diary_list_diary_list4c_member_id($c_member_id, $page_size, $page);
     122        }
     123
     124        $sql   = 'SELECT c_diary.*';
     125        $from  = ' FROM c_diary INNER JOIN c_member USING (c_member_id)';
     126        $where = ' WHERE c_diary.c_member_id = ?' ;
     127        $order = ' ORDER BY c_diary.r_datetime DESC';
     128
     129
     130        if ($is_friend) {
     131            $where .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\') OR (c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\'))';
     132        } else {
     133            $where .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\'))';
     134        }
     135
     136        $sql .= $from . $where . $order;
     137
     138        $params = array(intval($c_member_id));
     139        $list = db_get_all_page($sql, $page, $page_size, $params);
     140
     141        foreach ($list as $key => $c_diary) {
     142            $list[$key]['num_comment'] = db_diary_count_c_diary_comment4c_diary_id($c_diary['c_diary_id']);
     143        }
     144
     145        $sql = 'SELECT COUNT(c_diary.*)' . $from . $where . $order;
     146        $total_num = db_get_one($sql, $params);
     147
     148        if ($total_num != 0) {
     149            $total_page_num =  ceil($total_num / $page_size);
     150            if ($page >= $total_page_num) {
     151                $next = false;
     152            } else {
     153                $next = true;
     154            }
     155
     156            if ($page <= 1) {
     157                $prev = false;
     158            } else {
     159                $prev = true;
     160            }
     161        }
     162        return array($list, $prev, $next);
     163    }
     164
     165
    95166}
    96167
  • OpenPNE/trunk/webapp/modules/pc/page/fh_diary_comment_confirm.php

    r147 r243  
    3737            $target_c_member = db_common_c_member4c_member_id($target_c_member_id);
    3838
     39            //友達までの公開かどうか
     40            $is_public_flag_friend = ($target_c_member['public_flag_diary'] == "friend" && $target_diary['public_flag'] == "default") || $target_diary['public_flag'] == "friend";
     41            //公開しないかどうか
     42            $is_public_flag_close = ($target_c_member['public_flag_diary'] == "close" && $target_diary['public_flag'] == "default") || $target_diary['public_flag'] == "close";
     43
    3944            //日記の公開範囲設定
    40             if (($target_c_member['public_flag_diary'] == "friend" &&
    41                  !db_friend_is_friend($u, $target_c_member_id))) {
     45            if ($is_public_flag_friend &&
     46                 !db_friend_is_friend($u, $target_c_member_id)) {
     47                openpne_redirect('pc', 'page_h_err_diary_access');
     48            }
     49
     50            if($is_public_flag_close)
     51            {
    4252                openpne_redirect('pc', 'page_h_err_diary_access');
    4353            }
  • OpenPNE/trunk/webapp/modules/pc/page/fh_diary_list.php

    r102 r243  
    3131            $is_diary_admin = false;
    3232            $target_c_member = db_common_c_member4c_member_id($target_c_member_id);
    33 
    34             //日記の公開範囲設定
    35             if (   $target_c_member['public_flag_diary'] == 'friend'
    36                 && !db_friend_is_friend($u, $target_c_member_id)) {
    37                 openpne_redirect('pc', 'page_h_err_diary_access');
    38             }
     33            $is_friend = db_friend_is_friend($u, $target_c_member_id);
    3934
    4035            // アクセスブロック
     
    5651        //年月日で一覧表示、日記数に制限なし
    5752        if ($year && $month) {
    58             $list_set = p_fh_diary_list_diary_list_date4c_member_id($target_c_member_id, $year, $month, $day);
     53            $list_set = $this->_p_fh_diary_list_diary_list_date4c_member_id($target_c_member_id, $is_friend, $type, $year, $month, $day);
    5954            $rss_list = p_fh_diary_list_c_rss_cache_list_date($target_c_member_id, $year, $month, $day);
    6055        } else {
     
    6358            $this->set('all', 1);
    6459
    65             $list_set = p_fh_diary_list_diary_list4c_member_id($target_c_member_id, $page_size, $page);
     60            $list_set = $this->_p_fh_diary_list_diary_list4c_member_id($target_c_member_id, $is_friend, $type, $page_size, $page);
    6661            $rss_list = p_fh_diary_list_c_rss_cache_list($target_c_member_id, $page_size, $page);
    6762        }
     
    9691        return 'success';
    9792    }
     93
     94
     95    /**
     96     * あるメンバーの指定された年月日の日記のリストを得る
     97     * 日記公開範囲を考慮
     98     */
     99
     100    function _p_fh_diary_list_diary_list_date4c_member_id($c_member_id, $is_friend, $type, $year, $month, $day=0)
     101    {
     102
     103        if ($type == 'h') {
     104            return p_fh_diary_list_diary_list_date4c_member_id($c_member_id, $year, $month, $day);
     105        }
     106
     107        if ($day) {
     108            $s_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $month, $day, $year));
     109            $e_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $month, $day+1, $year));
     110        } else {
     111            $s_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $month, 1, $year));
     112            $e_date = date('Y-m-d H:i:s', mktime(0, 0, 0, $month+1, 1, $year));
     113        }
     114
     115        $sql = 'SELECT c_diary.* FROM c_diary INNER JOIN c_member USING (c_member_id)' .
     116               ' WHERE c_diary.c_member_id = ? AND c_diary.r_datetime >= ? AND c_diary.r_datetime < ?' ;
     117
     118
     119        if ($is_friend) {
     120            $sql .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\') OR (c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\'))';
     121        } else {
     122            $sql .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\'))';
     123        }
     124
     125        $sql .= ' ORDER BY c_diary.r_datetime DESC';
     126
     127        $params = array(intval($c_member_id), $s_date, $e_date);
     128        $list = db_get_all($sql, $params);
     129
     130        foreach ($list as $key => $c_diary) {
     131            $list[$key]['num_comment'] = db_diary_count_c_diary_comment4c_diary_id($c_diary['c_diary_id']);
     132        }
     133
     134        return array($list , false, false);
     135    }
     136
     137
     138    /**
     139     * あるメンバーの日記リストを取得
     140     * 日記公開範囲を考慮
     141     *
     142     * @param int $c_member_id
     143     * @param int $page_size
     144     * @param int $page
     145     * @return array 日記リスト
     146     */
     147    function _p_fh_diary_list_diary_list4c_member_id($c_member_id, $is_friend, $type, $page_size, $page)
     148    {
     149        if ($type == 'h') {
     150            return p_fh_diary_list_diary_list4c_member_id($c_member_id, $page_size, $page);
     151        }
     152
     153        $sql   = 'SELECT c_diary.*';
     154        $from  = ' FROM c_diary INNER JOIN c_member USING (c_member_id)';
     155        $where = ' WHERE c_diary.c_member_id = ?' ;
     156        $order = ' ORDER BY c_diary.r_datetime DESC';
     157
     158
     159        if ($is_friend) {
     160            $where .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\') OR (c_diary.public_flag = \'friend\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'friend\'))';
     161        } else {
     162            $where .= ' AND ((c_diary.public_flag = \'public\') OR (c_diary.public_flag = \'default\' AND c_member.public_flag_diary = \'public\'))';
     163        }
     164
     165        $sql .= $from . $where . $order;
     166
     167        $params = array(intval($c_member_id));
     168        $list = db_get_all_page($sql, $page, $page_size, $params);
     169
     170        foreach ($list as $key => $c_diary) {
     171            $list[$key]['num_comment'] = db_diary_count_c_diary_comment4c_diary_id($c_diary['c_diary_id']);
     172        }
     173
     174        $sql = 'SELECT COUNT(c_diary.*)' . $from . $where . $order;
     175        $total_num = db_get_one($sql, $params);
     176
     177        if ($total_num != 0) {
     178            $total_page_num =  ceil($total_num / $page_size);
     179            if ($page >= $total_page_num) {
     180                $next = false;
     181            } else {
     182                $next = true;
     183            }
     184
     185            if ($page <= 1) {
     186                $prev = false;
     187            } else {
     188                $prev = true;
     189            }
     190        }
     191        return array($list, $prev, $next);
     192    }
     193
     194
    98195}
    99196
  • OpenPNE/trunk/webapp/modules/pc/page/h_diary_add.php

    r102 r243  
    1414        $form_val['subject'] = $requests['subject'];
    1515        $form_val['body'] = $requests['body'];
     16        $form_val['public_flag'] = $requests['public_flag'];
    1617        // ----------
    1718
  • OpenPNE/trunk/webapp/modules/pc/page/h_diary_add_confirm.php

    r134 r243  
    2222        $subject = $requests['subject'];
    2323        $body = $requests['body'];
     24        $public_flag = $requests['public_flag'];
    2425        // ----------
    2526
     
    5859            "subject" => $subject,
    5960            "body" => $body,
     61            "public_flag" => $public_flag,
    6062            "upfile_1" => $_FILES['upfile_1'],
    6163            "upfile_2" => $_FILES['upfile_2'],
  • OpenPNE/trunk/webapp/modules/pc/page/h_diary_edit.php

    r134 r243  
    1515        $subject = $requests['subject'];
    1616        $body = $requests['body'];
     17        $public_flag = $requests['public_flag'];
    1718        // ----------
    1819
  • OpenPNE/trunk/webapp/modules/pc/page/h_diary_edit_confirm.php

    r102 r243  
    2222        $subject = $requests['subject'];
    2323        $body = $requests['body'];
     24        $public_flag = $requests['public_flag'];
    2425        // ----------
    2526
     
    6061            "subject" => $subject,
    6162            "body" => $body,
     63            "public_flag" => $public_flag,
    6264            "upfile_1" => $_FILES['upfile_1'],
    6365            "upfile_2" => $_FILES['upfile_2'],
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_diary.tpl

    r241 r243  
    332332<tr>
    333333<td style="width:36px;" class="bg_06"><img src="({t_img_url_skin filename=content_header_1})" style="width:30px;height:20px;" class="dummy"></td>
    334 <td style="width:486px;padding:2px 0px;" class="bg_06"><span class="b_b c_00"><span id="DOM_fh_diary_writer">({$target_member.nickname})</span>({if $type == "f"})さん({/if})の日記</span><span style="color: red">
    335 
     334<td style="width:486px;padding:2px 0px;" class="bg_06"><span class="b_b c_00"><span id="DOM_fh_diary_writer">({$target_member.nickname})</span>({if $type == "f"})さん({/if})の日記</span></td>
     335</tr>
     336</table>
     337<!-- ここまで:小タイトル -->
     338({*ここまで:header*})
     339({*ここから:body*})
     340<!-- ここから:主内容 -->
     341<!-- ここから:主内容>>日記表示 -->
     342<table border="0" cellspacing="0" cellpadding="0" style="width:524px;" class="border_01">
     343({*********})
     344<tr>
     345<td style="width:522px;height:1px;" class="bg_01" colspan="7"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     346</tr>
     347({*********})
     348<tr>
     349<td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     350<td style="width:95px;" class="bg_05" align="center" valign="top" rowspan="3">
     351<div style="padding:4px 3px;">
     352
     353({$target_diary.r_datetime|date_format:"%Y年%m月%d日<br>%H:%M"})
     354
     355</div>
     356</td>
     357<td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     358<td style="width:424px;" class="bg_02" align="left" valign="middle">
     359<div style="padding:4px 3px;">
     360
     361<span id="DOM_fh_diary_title">({$target_diary.subject})
    336362({if $type == "h"})
     363<span style="color: red">
    337364(
    338365({if $target_diary.public_flag == "default"})
     
    346373({/if})
    347374)
    348 ({/if})
    349 
    350 </span></td>
    351 </tr>
    352 </table>
    353 <!-- ここまで:小タイトル -->
    354 ({*ここまで:header*})
    355 ({*ここから:body*})
    356 <!-- ここから:主内容 -->
    357 <!-- ここから:主内容>>日記表示 -->
    358 <table border="0" cellspacing="0" cellpadding="0" style="width:524px;" class="border_01">
    359 ({*********})
    360 <tr>
    361 <td style="width:522px;height:1px;" class="bg_01" colspan="7"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    362 </tr>
    363 ({*********})
    364 <tr>
    365 <td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    366 <td style="width:95px;" class="bg_05" align="center" valign="top" rowspan="3">
    367 <div style="padding:4px 3px;">
    368 
    369 ({$target_diary.r_datetime|date_format:"%Y年%m月%d日<br>%H:%M"})
    370 
    371 </div>
    372 </td>
    373 <td style="width:1px;" class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    374 <td style="width:424px;" class="bg_02" align="left" valign="middle">
    375 <div style="padding:4px 3px;">
    376 
    377 <span id="DOM_fh_diary_title">({$target_diary.subject})</span>
     375</span>
     376({/if})
     377
     378</span>
    378379
    379380</div>
  • OpenPNE/trunk/webapp/modules/pc/templates/fh_diary_list.tpl

    r2 r243  
    412412({$item.subject})
    413413
     414({if $type == "h"})
     415<span style="color: red">
     416(
     417({if $item.public_flag == "default"})
     418日記全体の設定に従う(({if $target_member.public_flag_diary == "public"})全員に公開({elseif $target_member.public_flag_diary == "friend"})({$WORD_FRIEND})まで公開({elseif $target_member.public_flag_diary == "close"})公開しない({/if}))
     419({elseif $item.public_flag == "public"})
     420全員に公開
     421({elseif $item.public_flag == "friend"})
     422({$WORD_FRIEND})まで公開
     423({elseif $item.public_flag == "close"})
     424公開しない
     425({/if})
     426)
     427</span>
     428({/if})
     429
     430
    414431</div>
    415432</td>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_config.tpl

    r99 r243  
    474474
    475475<input type="radio" name="public_flag_diary" value="public"({if $c_member.public_flag_diary == "public"}) checked="checked"({/if}) class="no_bg" id="public_flag_diary_public"><label for="public_flag_diary_public">全員に公開</label>
    476 <input type="radio" name="public_flag_diary" value="friend"({if $c_member.public_flag_diary == "friend"}) checked="checked"({/if}) class="no_bg" id="public_flag_diary_friend"><label for="public_flag_diary_friend">({$WORD_FRIEND})まで公開</label><br>
     476<input type="radio" name="public_flag_diary" value="friend"({if $c_member.public_flag_diary == "friend"}) checked="checked"({/if}) class="no_bg" id="public_flag_diary_friend"><label for="public_flag_diary_friend">({$WORD_FRIEND})まで公開</label>
     477<input type="radio" name="public_flag_diary" value="close"({if $c_member.public_flag_diary == "close"}) checked="checked"({/if}) class="no_bg" id="public_flag_diary_close"><label for="public_flag_diary_close">公開しない</label><br>
    477478
    478479</div>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_add.tpl

    r2 r243  
    419419</tr>
    420420({*********})
     421
     422<tr>
     423<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     424<td class="bg_05" align="center" valign="middle">
     425<div style="padding:4px 3px;">
     426
     427公開範囲
     428
     429</div>
     430</td>
     431<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     432<td class="bg_02" align="left" valign="middle">
     433<div style="padding:4px 3px;">
     434
     435<input type="radio" name="public_flag" value="default"({if $form_val.public_flag == "default"}) checked="checked"({/if}) class="no_bg" id="public_flag_default"><label for="public_flag_default">日記全体の設定に従う(({if $target_member.public_flag_diary == "public"})全員に公開({elseif $target_member.public_flag_diary == "friend"})({$WORD_FRIEND})まで公開({elseif $target_member.public_flag_diary == "close"})公開しない({/if}))</label><br>
     436<input type="radio" name="public_flag" value="public"({if $form_val.public_flag == "public"}) checked="checked"({/if}) class="no_bg" id="public_flag_public"><label for="public_flag_public">全員に公開</label>
     437<input type="radio" name="public_flag" value="friend"({if $form_val.public_flag == "friend"}) checked="checked"({/if}) class="no_bg" id="public_flag_friend"><label for="public_flag_friend">({$WORD_FRIEND})まで公開</label>
     438<input type="radio" name="public_flag" value="close"({if $form_val.public_flag == "close"}) checked="checked"({/if}) class="no_bg" id="public_flag_close"><label for="public_flag_close">公開しない</label><br>
     439
     440</div>
     441</td>
     442<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     443</tr>
     444
     445({*********})
     446<tr>
     447<td class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     448</tr>
     449({*********})
    421450<tr>
    422451<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_add_confirm.tpl

    r2 r243  
    198198<tr>
    199199<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     200<td class="bg_05" align="left" valign="middle">
     201
     202<div class="padding_s">
     203
     204公開範囲
     205
     206</div>
     207
     208</td>
     209<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     210<td class="bg_02" align="left" valign="middle">
     211
     212<div class="padding_s">
     213
     214({if $form_val.public_flag == "default"})
     215日記全体の設定に従う(({if $member.public_flag_diary == "public"})全員に公開({elseif $member.public_flag_diary == "friend"})({$WORD_FRIEND})まで公開({elseif $member.public_flag_diary == "close"})公開しない({/if}))
     216({elseif $form_val.public_flag == "public"})
     217全員に公開
     218({elseif $form_val.public_flag == "friend"})
     219({$WORD_FRIEND})まで公開
     220({elseif $form_val.public_flag == "close"})
     221公開しない
     222({/if})
     223</div>
     224
     225</td>
     226<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     227</tr>
     228({*********})
     229<tr>
     230<td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     231</tr>
     232({*********})
     233<tr>
     234<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    200235<td class="bg_03" align="center" valign="middle" colspan="3">
    201236
     
    208243<input type="hidden" name="subject" value="({$form_val.subject})">
    209244<input type="hidden" name="body" value="({$form_val.body})">
     245<input type="hidden" name="public_flag" value="({$form_val.public_flag})">
    210246<input type="hidden" name="tmpfile_1" value="({$form_val.tmpfile_1})">
    211247<input type="hidden" name="tmpfile_2" value="({$form_val.tmpfile_2})">
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_edit.tpl

    r2 r243  
    437437</tr>
    438438({*********})
     439
     440
     441<tr>
     442<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     443<td class="bg_05" align="center" valign="middle">
     444<div style="padding:4px 3px;">
     445
     446公開範囲
     447
     448</div>
     449</td>
     450<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     451<td class="bg_02" align="left" valign="middle">
     452<div style="padding:4px 3px;">
     453
     454<input type="radio" name="public_flag" value="default"({if $diary.public_flag == "default"}) checked="checked"({/if}) class="no_bg" id="public_flag_default"><label for="public_flag_default">日記全体の設定に従う(({if $target_member.public_flag_diary == "public"})全員に公開({elseif $target_member.public_flag_diary == "friend"})({$WORD_FRIEND})まで公開({elseif $target_member.public_flag_diary == "close"})公開しない({/if}))</label><br>
     455<input type="radio" name="public_flag" value="public"({if $diary.public_flag == "public"}) checked="checked"({/if}) class="no_bg" id="public_flag_public"><label for="public_flag_public">全員に公開</label>
     456<input type="radio" name="public_flag" value="friend"({if $diary.public_flag == "friend"}) checked="checked"({/if}) class="no_bg" id="public_flag_friend"><label for="public_flag_friend">({$WORD_FRIEND})まで公開</label>
     457<input type="radio" name="public_flag" value="close"({if $diary.public_flag == "close"}) checked="checked"({/if}) class="no_bg" id="public_flag_close"><label for="public_flag_close">公開しない</label><br>
     458
     459</div>
     460</td>
     461<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     462</tr>
     463
     464({*********})
     465<tr>
     466<td class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     467</tr>
     468({*********})
     469
    439470<tr>
    440471<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
  • OpenPNE/trunk/webapp/modules/pc/templates/h_diary_edit_confirm.tpl

    r2 r243  
    180180<tr>
    181181<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     182<td class="bg_05" align="left" valign="middle">
     183
     184<div class="padding_s">
     185
     186公開範囲
     187
     188</div>
     189
     190</td>
     191<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     192<td class="bg_02" align="left" valign="middle">
     193
     194<div class="padding_s">
     195
     196({if $form_val.public_flag == "default"})
     197日記全体の設定に従う(
     198({if $member.public_flag_diary == "public"})
     199全員に公開
     200({elseif $member.public_flag_diary == "friend"})
     201({$WORD_FRIEND})まで公開
     202({elseif $member.public_flag_diary == "close"})
     203公開しない
     204({/if})
     205)
     206({elseif $form_val.public_flag == "public"})
     207全員に公開
     208({elseif $form_val.public_flag == "friend"})
     209({$WORD_FRIEND})まで公開
     210({elseif $form_val.public_flag == "close"})
     211公開しない
     212({/if})
     213</div>
     214
     215</td>
     216<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     217</tr>
     218({*********})
     219<tr>
     220<td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     221</tr>
     222({*********})
     223<tr>
     224<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    182225<td class="bg_03" align="center" valign="middle" colspan="3">
    183226<div class="padding_w_s">
     
    190233<input type="hidden" name="subject" value="({$form_val.subject})">
    191234<input type="hidden" name="body" value="({$form_val.body})">
     235<input type="hidden" name="public_flag" value="({$form_val.public_flag})">
    192236<input type="hidden" name="tmpfile_1" value="({$form_val.tmpfile_1})">
    193237<input type="hidden" name="tmpfile_2" value="({$form_val.tmpfile_2})">
  • OpenPNE/trunk/webapp/modules/pc/templates/inc_f_home_h_prof.tpl

    r216 r243  
    978978
    979979<!-- ここから:主内容>最新日記 -->
    980 ({if $c_diary_list&&($target_c_member.public_flag_diary == "public"||$is_friend||$is_h_prof)})
     980({if $c_diary_list})
    981981<tr>
    982982<td class="border_01 bg_09 padding_s" style="width:90px;border-right:none;border-top:none;">
     
    989989({foreach from=$c_diary_list item=item})
    990990<img src="./skin/dummy.gif" style="width:14px;height:14px;" class="icon icon_1">({$item.r_date|date_format:"%m月%d日"})…&nbsp;<a href="({t_url m=pc a=page_fh_diary})&amp;target_c_diary_id=({$item.c_diary_id})">({$item.subject|default:"&nbsp;"}) (({$item.comment_count}))</a>
    991 ({if $item.image_filename_1 || $item.image_filename_2 || $item.image_filename_3})<img src="({t_img_url_skin filename=icon_camera})" class="icon">({/if})<br>
     991({if $item.image_filename_1 || $item.image_filename_2 || $item.image_filename_3})<img src="({t_img_url_skin filename=icon_camera})" class="icon">({/if})
     992
     993({if $is_h_prof})
     994<span style="color: red">
     995(
     996({if $item.public_flag == "default"})
     997日記全体の設定に従う(({if $target_c_member.public_flag_diary == "public"})全員に公開({elseif $target_c_member.public_flag_diary == "friend"})({$WORD_FRIEND})まで公開({elseif $target_c_member.public_flag_diary == "close"})公開しない({/if}))
     998({elseif $item.public_flag == "public"})
     999全員に公開
     1000({elseif $item.public_flag == "friend"})
     1001({$WORD_FRIEND})まで公開
     1002({elseif $item.public_flag == "close"})
     1003公開しない
     1004({/if})
     1005)
     1006</span>
     1007({/if})
     1008
     1009<br>
    9921010({/foreach})
    9931011
  • OpenPNE/trunk/webapp/modules/pc/validate/do/h_diary_add_insert_c_diary.ini

    r2 r243  
    44
    55[body]
     6type = "string"
     7required = 1
     8
     9[public_flag]
    610type = "string"
    711required = 1
  • OpenPNE/trunk/webapp/modules/pc/validate/do/h_diary_edit_insert_c_diary.ini

    r2 r243  
    88
    99[body]
     10type = "string"
     11required = 1
     12
     13[public_flag]
    1014type = "string"
    1115required = 1
  • OpenPNE/trunk/webapp/modules/pc/validate/page/h_diary_add.ini

    r2 r243  
    1010default = ""
    1111caption = "本文"
     12
     13[public_flag]
     14type = "string"
     15required = 0
     16default = "default"
     17caption = "公開範囲"
  • OpenPNE/trunk/webapp/modules/pc/validate/page/h_diary_add_confirm.ini

    r2 r243  
    88required = 1
    99caption = "本文"
     10
     11[public_flag]
     12type = "string"
     13required = 1
     14caption = "公開範囲"
  • OpenPNE/trunk/webapp/modules/pc/validate/page/h_diary_edit.ini

    r2 r243  
    1313required = 0
    1414caption = "本文"
     15
     16[public_flag]
     17type = "string"
     18required = 0
     19caption = "公開範囲"
  • OpenPNE/trunk/webapp/modules/pc/validate/page/h_diary_edit_confirm.ini

    r2 r243  
    1313required = 1
    1414caption = "本文"
     15
     16[public_flag]
     17type = "string"
     18required = 1
     19caption = "公開範囲"
Note: See TracChangeset for help on using the changeset viewer.