Changeset 2296
- Timestamp:
- Mar 26, 2007, 7:52:26 PM (15 years ago)
- Location:
- OpenPNE/branches/2_8/webapp
- Files:
-
- 6 edited
- 7 copied
Legend:
- Unmodified
- Added
- Removed
-
OpenPNE/branches/2_8/webapp/lib/db/commu.php
r2282 r2296 2297 2297 2298 2298 // c_commu_topic_comment(画像) 2299 $sql = 'SELECT image_filename1, image_filename2, image_filename3 ' .2299 $sql = 'SELECT image_filename1, image_filename2, image_filename3, filename' . 2300 2300 ' FROM c_commu_topic_comment WHERE c_commu_topic_id = ?'; 2301 2301 $params = array(intval($c_commu_topic_id)); … … 2306 2306 image_data_delete($topic_comment['image_filename2']); 2307 2307 image_data_delete($topic_comment['image_filename3']); 2308 db_file_delete_c_file($topic_comment['filename']); 2308 2309 } 2309 2310 … … 2437 2438 } 2438 2439 } 2440 if (!empty($topic_comment['filename4'])) { 2441 $data['filename'] = $topic_comment['filename4']; 2442 } 2439 2443 $where = array( 2440 2444 'c_commu_topic_id' => intval($c_commu_topic_id), … … 2448 2452 $data = array( 2449 2453 'image_filename'.intval($image_num) => '', 2454 ); 2455 $where = array( 2456 'c_commu_topic_id' => intval($c_commu_topic_id), 2457 'number' => 0, 2458 ); 2459 return db_update('c_commu_topic_comment', $data, $where); 2460 } 2461 2462 function db_commu_delete_c_commu_topic_comment_file($c_commu_topic_id) 2463 { 2464 $data = array( 2465 'filename' => '', 2450 2466 ); 2451 2467 $where = array( -
OpenPNE/branches/2_8/webapp/lib/db/file.php
r2295 r2296 4 4 * @license http://www.php.net/license/3_01.txt PHP License 3.01 5 5 */ 6 7 /** 8 * IDからファイルの情報を取得する 9 * 10 * @param int $c_file_id 11 */ 12 function db_file_c_file4c_file_id($c_file_id) 13 { 14 $sql = 'SELECT * FROM c_file WHERE c_file_id = ?'; 15 $params = array(intval($c_file_id)); 16 $file = db_get_row($sql, $params); 17 $file['size'] = strlen($file['bin']); 18 return $file; 19 } 6 20 7 21 /** -
OpenPNE/branches/2_8/webapp/modules/admin/lib/db_admin.php
r2184 r2296 2223 2223 } 2224 2224 2225 /** 2226 * 指定したファイル名のファイルへのリンクを削除する 2227 * 2228 * @param string $filename 2229 */ 2230 function db_admin_delete_c_file_link4filename($filename) 2231 { 2232 // c_commu_topic_comment 2233 $tbl = 'c_commu_topic_comment'; 2234 _db_admin_empty_image_filename($tbl, $filename, 'filename'); 2235 } 2236 2225 2237 ?> -
OpenPNE/branches/2_8/webapp/modules/admin/templates/list_c_file.tpl
r2294 r2296 49 49 <th>作成日</th> 50 50 <th>ファイルサイズ</th> 51 <th> </th> 51 52 </tr> 52 53 </thead> … … 77 78 </td> 78 79 ({****}) 80 <td> 81 <a href="?m=({$module_name})&a=page_({$hash_tbl->hash('delete_c_file_confirm')})&target_c_file_id=({$item.c_file_id})">削除</a> 82 </td> 83 ({****}) 79 84 ({/foreach}) 80 85 </tbody> -
OpenPNE/branches/2_8/webapp/modules/pc/do/c_topic_edit_update_c_commu_topic.php
r1856 r2296 19 19 $upfile_obj2 = $_FILES['image_filename2']; 20 20 $upfile_obj3 = $_FILES['image_filename3']; 21 $upfile_obj4 = $_FILES['filename4']; 21 22 22 23 //--- 権限チェック … … 57 58 } 58 59 } 60 if ($upfile_obj4['error'] !== UPLOAD_ERR_NO_FILE) { 61 if (OPENPNE_USE_FILEUPLOAD) { 62 $filesize = $upfile_obj4['size']; 63 if ((!$filesize) || ($filesize > IMAGE_MAX_FILESIZE * 1024)) { 64 $err_msg[] = '添付ファイルは'.IMAGE_MAX_FILESIZE.'KB以内のファイルにしてください'; 65 } 66 } else { 67 $err_msg[] = 'ファイルのアップロードはできません。'; 68 } 69 } 59 70 60 71 if ($err_msg) { … … 73 84 $tmpfile2 = t_image_save2tmp($upfile_obj2, $sessid, "t_2"); 74 85 $tmpfile3 = t_image_save2tmp($upfile_obj3, $sessid, "t_3"); 86 if (OPENPNE_USE_FILEUPLOAD) { 87 $tmpfile4 = t_file_save2tmp($upfile_obj4, $sessid, "t_4"); 88 } 75 89 76 90 if ($tmpfile1) { … … 82 96 if ($tmpfile3) { 83 97 $filename3 = image_insert_c_image4tmp("t_{$c_commu_topic_id}_3", $tmpfile3); 98 } 99 if ($tmpfile4) { 100 $filename4 = file_insert_c_file4tmp("t_{$c_commu_topic_id}_4", $tmpfile4, $upfile_obj4['name']); 84 101 } 85 102 t_image_clear_tmp(session_id()); … … 109 126 image_data_delete($c_topic['image_filename3']); 110 127 } 128 if ($filename4) { 129 $update_c_commu_topic_comment['filename4'] = $filename4; 130 db_file_delete_c_file($c_topic['filename4']); 131 } 111 132 db_commu_update_c_commu_topic_comment($c_commu_topic_id, $update_c_commu_topic_comment); 112 133 -
OpenPNE/branches/2_8/webapp/modules/pc/templates/c_topic_edit.tpl
r1818 r2296 186 186 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td> 187 187 </tr> 188 ({*********}) 188 189 ({if $smarty.const.OPENPNE_USE_FILEUPLOAD}) 190 ({*********}) 191 <tr> 192 <td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td> 193 </tr> 194 ({*********}) 195 <tr> 196 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td> 197 <td class="bg_05" align="left" valign="middle"> 198 199 <div class="padding_s"> 200 201 ファイル 202 203 </div> 204 205 </td> 206 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td> 207 <td class="bg_02" align="left" valign="middle"> 208 209 <div class="padding_s"> 210 211 ({if $c_topic.filename}) 212 ({$c_topic.filename})<br> 213 <a href="({t_url m=pc a=do_c_topic_edit_delete_c_commu_topic_comment_file})&target_c_commu_topic_id=({$c_topic.c_commu_topic_id})&sessid=({$PHPSESSID})">削除</a><br> 214 ({/if}) 215 <input type="file" name="filename4" size="40"> 216 217 </div> 218 219 </td> 220 <td class="bg_01" align="center"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td> 221 </tr> 222 ({*********}) 223 ({/if}) 189 224 <tr> 190 225 <td style="height:1px;" class="bg_01" colspan="5"><img src="./skin/dummy.gif" style="width:1px;height:1px;" class="dummy"></td>
Note: See TracChangeset
for help on using the changeset viewer.