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

Changeset 811


Ignore:
Timestamp:
Nov 21, 2006, 2:51:23 PM (14 years ago)
Author:
ebihara
Message:

日記カテゴリ関連機能を日記編集時にも使用できるように

Location:
OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc/do/h_diary_edit_insert_c_diary.php

    r260 r811  
    3131        $tmpfile_2 = $requests['tmpfile_2'];
    3232        $tmpfile_3 = $requests['tmpfile_3'];
     33        $category = explode(' ', rtrim($requests['category']));
    3334        // ----------
    3435
     
    4344
    4445        $sessid = session_id();
     46
     47        //カテゴリ登録しなおし
     48        db_diary_category_delete_c_diary_category_diary($target_c_diary_id);
     49        foreach($category as $value) {
     50            $c_category_id = db_diary_get_category_id4category_name($c_member_id, $value);
     51            if (is_null($c_category_id)) {
     52                $c_category_id = db_diary_category_insert_category($c_member_id, $value);
     53            }
     54            db_diary_category_insert_c_diary_category_diary($target_c_diary_id, $c_category_id);
     55        }
    4556
    4657        $filename_1 = $filename_2 = $filename_3 = '';
  • OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc/page/h_diary_edit.php

    r243 r811  
    7676        $this->set("date_list", p_fh_diary_list_date_list4c_member_id($u));
    7777
     78        //この日記のカテゴリリストを得る
     79        $this->set("category", db_diary_category_list4c_diary_id($target_c_diary_id));
     80        //ユーザのカテゴリリスト
     81        $this->set("category_list", db_diary_category_list4c_member_id($u));
     82
    7883        return 'success';
    7984    }
  • OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc/page/h_diary_edit_confirm.php

    r243 r811  
    2323        $body = $requests['body'];
    2424        $public_flag = $requests['public_flag'];
     25        $category = rtrim($requests['category']);
    2526        // ----------
    2627
     
    5152        }
    5253
     54        $category_list = array_unique(explode(" ", rtrim($category)));
     55        if (count($category_list) > 5) {
     56            $_REQUEST['msg'] = 'カテゴリの指定は5個以下にしてください';
     57            openpne_forward('pc', 'page', 'h_diary_add');
     58            exit;
     59        }
     60        foreach ($category_list as $value) {
     61            if(strlen($value) > 20) {
     62                $_REQUEST['msg'] = 'カテゴリの文字数は半角20文字以内にしてください';
     63                openpne_forward('pc', 'page', 'h_diary_add');
     64                exit;
     65            }
     66        }
     67
    5368        $this->set('inc_navi', fetch_inc_navi("h"));
    5469
     
    6883            "tmpfile_2" => $tmpfiles[2],
    6984            "tmpfile_3" => $tmpfiles[3],
     85            "category" => join(" ", $category_list),
    7086        );
    7187        $this->set("form_val", $form_val);
  • OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc/templates/h_diary_edit.tpl

    r385 r811  
    22<body>
    33({ext_include file="inc_extension_pagelayout_top.tpl"})
     4
     5<script type="text/javascript" src="modules/pc/diary_category_form.js"></script>
     6
    47<table class="mainframe" border="0" cellspacing="0" cellpadding="0">
    58<tr>
     
    434437({*********})
    435438<tr>
     439<td class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     440</tr>
     441({*********})
     442
     443<tr>
     444<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     445<td class="bg_05" align="center" valign="middle">
     446<div style="padding:4px 3px;">
     447
     448カテゴリ
     449
     450</div>
     451</td>
     452<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     453<td class="bg_02" align="left" valign="middle">
     454<div style="padding:4px 3px;">
     455<input type="text" name="category" id="category" size="40" value="({foreach from=$category item=item})({$item.category_name}) ({/foreach})">
     456<script>
     457    var category = new diaryCategoryForm("category",
     458        [({foreach from=$category_list item=value})"({$value})",({/foreach})]);
     459</script>
     460
     461</div>
     462</td>
     463<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     464</tr>
     465({*********})
     466<tr>
    436467<td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
    437468</tr>
  • OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc/templates/h_diary_edit_confirm.tpl

    r385 r811  
    170170
    171171</div>
     172</td>
     173<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     174</tr>
     175({*********})
     176<tr>
     177<td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     178</tr>
     179({*********})
     180<tr>
     181<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({$form_val.category})
     197
     198</div>
     199
    172200</td>
    173201<td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
     
    228256<input type="hidden" name="tmpfile_2" value="({$form_val.tmpfile_2})">
    229257<input type="hidden" name="tmpfile_3" value="({$form_val.tmpfile_3})">
     258<input type="hidden" name="category" value="({$form_val.category})">
    230259<td><input type="submit" class="submit" value=" 決  定 "></td>
    231260</form>
  • OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc/validate/do/h_diary_edit_insert_c_diary.ini

    r260 r811  
    2929type = "string"
    3030default = ""
     31
     32[category]
     33type = "string"
  • OpenPNE/branches/ebihara/dev_2_6/webapp/modules/pc/validate/page/h_diary_edit_confirm.ini

    r243 r811  
    1818required = 1
    1919caption = "公開範囲"
     20
     21[category]
     22type = "string"
     23default = ""
Note: See TracChangeset for help on using the changeset viewer.