2011/07/06 表示系など。
@@ -106,6 +106,8 @@ | ||
106 | 106 | $this->artlSet['total'] = $result['total']; |
107 | 107 | $this->artlSet['unit'] = 1; |
108 | 108 | |
109 | + // | |
110 | + | |
109 | 111 | //スキン |
110 | 112 | $this->readSkin('article'); |
111 | 113 | $this->readSkin('tree'); |
@@ -113,7 +115,7 @@ | ||
113 | 115 | //コンテント |
114 | 116 | $myContent = ''; |
115 | 117 | $myContent .= getArticlehtml($article, $this->baseSet, $this->artlSet); |
116 | - $myContent .= '<hr />'; | |
118 | + //$myContent .= '<hr />'; | |
117 | 119 | foreach( $tree as $tr ) { |
118 | 120 | if ( $tr['parent_id'] == 0 ) { |
119 | 121 | $myContent .= getTreeHtml($tr); |
@@ -190,7 +192,7 @@ | ||
190 | 192 | $myContent = ''; |
191 | 193 | foreach($trees as $tr) { |
192 | 194 | |
193 | - $myContent .= getTreeHtml($tr); | |
195 | + $myContent .= getTreeHtml($tr, $this->baseSet['pubURL']); | |
194 | 196 | $branchMap = branchExtender($branches, $tr['id'], $tr['tree_number']); |
195 | 197 | $depthBranch=array(); |
196 | 198 | $myContent .= makeBranch($branches, $tr['id'], $branchMap, $depthBranch); |
@@ -262,7 +264,7 @@ | ||
262 | 264 | foreach( $tree as $tr ) { |
263 | 265 | |
264 | 266 | if ( $tr['parent_id'] == 0 ) { |
265 | - $myContent .= getTreeHtml($tr); | |
267 | + $myContent .= getTreeHtml($tr, $this->baseSet['pubURL']); | |
266 | 268 | $branchMap = branchExtender($tree, $tr['id'], $tr['tree_number']); |
267 | 269 | $depthBranch=array(); |
268 | 270 | $myContent .= makeBranch($tree, $tr['id'], $branchMap, $depthBranch ); |
@@ -511,6 +513,7 @@ | ||
511 | 513 | } |
512 | 514 | |
513 | 515 | |
516 | + | |
514 | 517 | } |
515 | 518 | |
516 | 519 | ?> |
\ No newline at end of file |
@@ -112,6 +112,7 @@ | ||
112 | 112 | |
113 | 113 | $this->content = $myContent; |
114 | 114 | |
115 | + $this->set['vw_body'] = 'onLoad="inputInit();"'; | |
115 | 116 | $this->set['view'] = 'input'; |
116 | 117 | $this->setLayout('base'); |
117 | 118 |
@@ -217,7 +218,7 @@ | ||
217 | 218 | |
218 | 219 | $this->content = $myContent; |
219 | 220 | |
220 | - | |
221 | + $this->set['vw_body'] = 'onLoad="inputInit();"'; | |
221 | 222 | $this->setLayout('base'); |
222 | 223 | |
223 | 224 |
@@ -311,6 +312,77 @@ | ||
311 | 312 | $vld->run( $this->getPost('email'), $GLOBALS['LNG']['email'], "max_len&80" ); |
312 | 313 | $vld->run( $this->getPost('homepage'), $GLOBALS['LNG']['homepage'], "max_len&200" ); |
313 | 314 | |
315 | + | |
316 | + $uploadFile = array(); | |
317 | + if ( $GLOBALS['CNF']['clipfile'] >= 1 and $GLOBALS['CNF']['clipfile_types']!='' ) { | |
318 | + | |
319 | + if ( $_FILES ) { | |
320 | + | |
321 | + //チェック | |
322 | + $fileCheck = true; | |
323 | + $types = explode(",", $GLOBALS['CNF']['clipfile_types']); | |
324 | + foreach ( $_FILES as $key => $file ) { | |
325 | + $fileCheck = true; | |
326 | + if ( ! $file['tmp_name'] ) continue; | |
327 | + | |
328 | + //var_dump($file); | |
329 | + | |
330 | + $typeOn = false; | |
331 | + foreach ( $types as $t ) { | |
332 | + //var_dump( strpos($file['type'], $t) ); | |
333 | + | |
334 | + if ( strpos($file['type'], $t) !== false ) { | |
335 | + $typeOn = true; | |
336 | + } | |
337 | + | |
338 | + } | |
339 | + if ( ! $typeOn ) { | |
340 | + array_push($vld->errMsgs, $GLOBALS['LNG']['failedFileType']. "(" . $file['type'] . ")"); | |
341 | + $fileCheck = false; | |
342 | + break; | |
343 | + } | |
344 | + | |
345 | + | |
346 | + if ( $file['size'] > ( $GLOBALS['CNF']['clipfile_maxsize']*1024 ) ) { | |
347 | + array_push($vld->errMsgs, $GLOBALS['LNG']['failedFileSize'] . "(" . $file['size'] . ")"); | |
348 | + $fileCheck = false; | |
349 | + break; | |
350 | + } | |
351 | + | |
352 | + | |
353 | + //情報を格納 | |
354 | + if ( $fileCheck == true ) { | |
355 | + $uploadFile[$key] = array( 'name'=>$file["name"], 'tmp_name'=>$file["tmp_name"] ); | |
356 | + } | |
357 | + | |
358 | + } | |
359 | + | |
360 | + | |
361 | + } else { | |
362 | + exit; //不正 | |
363 | + } | |
364 | + | |
365 | + } | |
366 | + | |
367 | + //var_dump($vld->errMsgs); | |
368 | + //var_dump($uploadFile); | |
369 | + //exit; | |
370 | + | |
371 | + /* | |
372 | + if (is_uploaded_file($_FILES["upfile"]["tmp_name"])) { | |
373 | + if (move_uploaded_file($_FILES["upfile"]["tmp_name"], "files/" . $_FILES["upfile"]["name"])) { | |
374 | + chmod("files/" . $_FILES["upfile"]["name"], 0644); | |
375 | + echo $_FILES["upfile"]["name"] . "をアップロードしました。"; | |
376 | + } else { | |
377 | + echo "ファイルをアップロードできません。"; | |
378 | + } | |
379 | + } else { | |
380 | + echo "ファイルが選択されていません。"; | |
381 | + } | |
382 | + */ | |
383 | + | |
384 | + | |
385 | + | |
314 | 386 | if ( ! empty($vld->errMsgs) ) { |
315 | 387 | $this->postSet['errMessage'] = $GLOBALS['LNG']['postInvalid']; |
316 | 388 | $this->postSet['errMsgAry'] = $vld->errMsgs; |
@@ -348,6 +420,12 @@ | ||
348 | 420 | $data['personKey'] = |
349 | 421 | $dh->makePersonKey($this->getPost('author'), $this->getPost('password'), $GLOBALS['USR']['access']['host']); |
350 | 422 | |
423 | + //添付ファイル | |
424 | + foreach ( $uploadFile as $key => $file ) { | |
425 | + $data[$key] = $this->qt($file['name']); | |
426 | + } | |
427 | + | |
428 | + | |
351 | 429 | /* |
352 | 430 | var_dump( $GLOBALS['USR']['access'] ); |
353 | 431 | echo "<br>"; |
@@ -364,6 +442,14 @@ | ||
364 | 442 | //Create |
365 | 443 | //echo "INSERT!"; |
366 | 444 | $newId = $artMdl->insertArticle($data); |
445 | + | |
446 | + //ファイル処理 | |
447 | + $upPath = DATAPATH . "/" . $this->id . "/uploads/" . $newId . "_"; | |
448 | + foreach ( $uploadFile as $file ) { | |
449 | + $ret = move_uploaded_file( $file['tmp_name'], $upPath . $file['name'] ); | |
450 | + if ( $ret == false ) trigger_error ('Failed move_uploaded_file.'); | |
451 | + } | |
452 | + | |
367 | 453 | //exit; |
368 | 454 | //リダイレクト |
369 | 455 | $this->redirect('act=sngl&a=' . $newId); |
@@ -62,11 +62,11 @@ | ||
62 | 62 | |
63 | 63 | //dataURL |
64 | 64 | if ( $this->id ) { |
65 | - $this->set['dataURL'] = DATAURL ."/". $this->id; | |
65 | + $this->baseSet['dataURL'] = DATAURL ."/". $this->id; | |
66 | 66 | } else { |
67 | - $this->set['dataURL'] = DATAURL ."/default"; | |
67 | + $this->baseSet['dataURL'] = DATAURL ."/default"; | |
68 | 68 | } |
69 | - $this->set['pubURL'] = PUBURL; | |
69 | + $this->baseSet['pubURL'] = PUBURL; | |
70 | 70 | |
71 | 71 | |
72 | 72 | //スキンパス |
@@ -89,6 +89,7 @@ | ||
89 | 89 | //$this->set['id'] = |
90 | 90 | |
91 | 91 | $this->set['vw_title'] = $GLOBALS['CNF']['vw_title']; |
92 | + if ( ! isset($this->set['vw_body']) ) $this->set['vw_body'] = ''; | |
92 | 93 | $this->set['vw_header'] = $GLOBALS['CNF']['vw_header']; |
93 | 94 | $this->set['vw_footer'] = $GLOBALS['CNF']['vw_footer']; |
94 | 95 |
@@ -131,8 +132,7 @@ | ||
131 | 132 | |
132 | 133 | |
133 | 134 | |
134 | - protected function lordLib($className) | |
135 | - | |
135 | + protected function loadLib($className) | |
136 | 136 | { |
137 | 137 | require_once( APPPATH. "/libs/" . strtolower ($className). '.php' ); |
138 | 138 | return new $className(); |
@@ -223,7 +223,7 @@ | ||
223 | 223 | |
224 | 224 | $url = $this->baseSet['linkBaseUrl']; |
225 | 225 | |
226 | - $url = DIRURL . '/' . SELFNAME . $url . $target; | |
226 | + $url = $url . $target; | |
227 | 227 | |
228 | 228 | //echo $url; |
229 | 229 |
@@ -253,6 +253,7 @@ | ||
253 | 253 | 'password' => '', |
254 | 254 | 'personkey' => '', |
255 | 255 | 'article' => '', |
256 | + 'article_add' => '', | |
256 | 257 | 'email' => '', |
257 | 258 | 'email_code' => '', |
258 | 259 | 'homepage' => '', |
@@ -102,7 +102,7 @@ | ||
102 | 102 | |
103 | 103 | function execute($sql) { |
104 | 104 | if ( empty($sql) ) trigger_error ('Empty Query!'); |
105 | - | |
105 | + //echo $sql; | |
106 | 106 | $result = sqlite_exec($this->conn, $sql, $this->dbError); |
107 | 107 | if (!$result) $this->errTrigger('Failed Execute Query!' . $this->dbError); |
108 | 108 |
@@ -419,15 +419,68 @@ | ||
419 | 419 | |
420 | 420 | function updateArticle($data) { |
421 | 421 | |
422 | + // | |
423 | + $now = $this->qt( date( "Y-m-d H:i:s", time() ) ); | |
424 | + | |
422 | 425 | $this->openConn(2); |
423 | 426 | |
427 | + $sql = | |
428 | + "UPDATE epitta_articles SET " . | |
429 | + " subject=". $data['subject'] . "," . | |
430 | + " author=". $data['author'] . "," . | |
431 | + " article=". $data['article'] . "," . | |
432 | + " article_add=". $data['article_add'] . "," . | |
433 | + " email=". $data['email'] . "," . | |
434 | + " email_code=". $data['email_code'] . "," . | |
435 | + " homepage=". $data['homepage'] . "," . | |
436 | + " fontcolor=". $data['fontcolor'] . "," . | |
437 | + " iconfile=". $data['iconfile'] . "," . | |
438 | + " reserved1=". $data['reserved1'] . "," . | |
439 | + " reserved2=". $data['reserved2'] . "," . | |
440 | + " reserved3=". $data['reserved3'] . "," . | |
441 | + " modified_at=$now" . | |
442 | + " WHERE id={$data['article_id']}"; | |
443 | + | |
444 | + $result = $this->execute($sql); | |
445 | + | |
446 | + | |
447 | + if ( $result!=false and $data['parent_id'] > 0 ) { | |
448 | + //返信時、親記事書き換え | |
449 | + $sql = | |
450 | + "UPDATE epitta_articles SET " . | |
451 | + " tree_updated_at=$now" . | |
452 | + " WHERE id={$data['parent_id']}"; | |
453 | + | |
454 | + $result = $this->execute($sql); | |
455 | + | |
456 | + } | |
457 | + | |
458 | + $this->closeConn(2); | |
459 | + | |
460 | + | |
461 | + if ( $result==false ) trigger_error ('Cannot Update!'); | |
462 | + | |
463 | + | |
464 | + return $result; | |
465 | + | |
466 | + } | |
467 | + | |
468 | + | |
469 | + | |
470 | + function updateAddArticle($data) { | |
471 | + | |
472 | + // | |
424 | 473 | $now = $this->qt( date( "Y-m-d H:i:s", time() ) ); |
425 | 474 | |
475 | + $this->openConn(2); | |
476 | + | |
477 | + $now = $this->qt( date( "Y-m-d H:i:s", time() ) ); | |
478 | + | |
426 | 479 | $sql = |
427 | 480 | "UPDATE epitta_articles SET " . |
428 | - " subject, author, article, article_add," . | |
429 | - " email, email_code, homepage, fontcolor, iconfile, reserved1, reserved2, reserved3, " . | |
430 | - " modified_at" . | |
481 | + " article=, " . | |
482 | + " article_add=," . | |
483 | + " modified_at=" . | |
431 | 484 | " WHERE id={$data['article_id']}"; |
432 | 485 | |
433 | 486 | $result = $this->execute($sql); |
@@ -447,7 +500,7 @@ | ||
447 | 500 | $this->closeConn(2); |
448 | 501 | |
449 | 502 | |
450 | - if ( $result==false ) trigger_error ('Invalid article id!'); | |
503 | + if ( $result==false ) trigger_error ('Cannot Update!'); | |
451 | 504 | |
452 | 505 | |
453 | 506 | return $result; |
@@ -456,7 +509,6 @@ | ||
456 | 509 | |
457 | 510 | |
458 | 511 | |
459 | - | |
460 | 512 | function updateArticleStatus($id, $status) { |
461 | 513 | |
462 | 514 | $this->openConn(2); |
@@ -485,7 +537,7 @@ | ||
485 | 537 | $this->closeConn(2); |
486 | 538 | |
487 | 539 | |
488 | - if ( $result==false ) trigger_error ('Invalid article id!'); | |
540 | + if ( $result==false ) trigger_error ('Cannot Update!'); | |
489 | 541 | |
490 | 542 | |
491 | 543 | return $result; |
@@ -33,10 +33,12 @@ | ||
33 | 33 | img_view INTEGER NOT NULL DEFAULT 0, |
34 | 34 | |
35 | 35 | clipfile INTEGER NOT NULL DEFAULT 1, |
36 | + clipfile_types TEXT DEFAULT 'jpeg,gif,png,txt,zip', | |
37 | + clipfile_maxsize INTEGER NOT NULL DEFAULT 300, | |
36 | 38 | icon_on INTEGER NOT NULL DEFAULT 1, |
37 | 39 | icons TEXT DEFAULT '', |
38 | 40 | ftcolor_on INTEGER NOT NULL DEFAULT 1, |
39 | - ftcolors TEXT DEFAULT 'red, blue, #008000', | |
41 | + ftcolors TEXT DEFAULT 'black, red, blue, #008000', | |
40 | 42 | captcha_on INTEGER NOT NULL DEFAULT 0, |
41 | 43 | keyword_on INTEGER NOT NULL DEFAULT 0, |
42 | 44 | keyword_q TEXT DEFAULT 'エピッタをひらがな4文字で入力してください。', |
@@ -73,12 +75,11 @@ | ||
73 | 75 | ); |
74 | 76 | |
75 | 77 | |
78 | +#テスト | |
79 | +INSERT INTO epitta_boards ( id, name, tree_max, plain_max, clipfile, created_at ) | |
80 | + VALUES ( 'default', 'def_ab12', 3, 3, 2, '2011-06-01 00:00:00' ); | |
76 | 81 | |
77 | -INSERT INTO epitta_boards ( id, name, tree_max, plain_max, created_at ) | |
78 | - VALUES ( 'default', 'def_ab12', 3, 3, '2011-05-01 00:00:00' ); | |
79 | 82 | |
80 | - | |
81 | - | |
82 | 83 | CREATE table epitta_articles ( |
83 | 84 | |
84 | 85 | id INTEGER PRIMARY KEY, |
@@ -47,11 +47,6 @@ | ||
47 | 47 | |
48 | 48 | |
49 | 49 | |
50 | - | |
51 | -//アップロードファイル最大サイズ | |
52 | -define('MAXFILE', (500 * 1024) ); | |
53 | - | |
54 | - | |
55 | 50 | /* |
56 | 51 | //セッション |
57 | 52 | session_save_path(''); |
@@ -80,6 +80,8 @@ | ||
80 | 80 | |
81 | 81 | 'postInvalid' => '入力に不備があります', |
82 | 82 | 'failedPassword' => 'パスワードが不正です。', |
83 | +'failedFileType' => '添付するファイルのタイプが許可されていません。', | |
84 | +'failedFileSize' => '添付するファイルのサイズが制限を超えています。', | |
83 | 85 | |
84 | 86 | |
85 | 87 | ); |
@@ -28,7 +28,7 @@ | ||
28 | 28 | </td> |
29 | 29 | <td> |
30 | 30 | <div style="border:1px solid #678;"> |
31 | - <a href="?act=trsgl&t={$art['tree_number']}">{$art['subject']}</a><br />{$art['created_at']} | |
31 | + <a href="?act=thsgl&t={$art['tree_number']}">{$art['subject']}</a><br />{$art['created_at']} | |
32 | 32 | </div> |
33 | 33 | </td> |
34 | 34 | <td>{$art['author']}</td> |
@@ -1,13 +1,15 @@ | ||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -function getTreeHtml($art) { | |
4 | +function getTreeHtml($art, $pubUrl) { | |
5 | 5 | |
6 | + $clipfiles = makeClips($art['clipfile1'], $art['clipfile2'], $art['clipfile3'], $pubUrl); | |
7 | + | |
6 | 8 | $myContent = ''; |
7 | 9 | $myContent .=<<< HTML |
8 | 10 | <div class="tree"> |
9 | 11 | <div style="border:1px solid #678;"> |
10 | - <a href="?act=trsgl&t={$art['tree_number']}">[TR:{$art['tree_number']}]</a>:<a href="?act=sngl&a={$art['id']}">[{$art['id']}]:{$art['subject']}</a> {$art['author']} {$art['created_at']} | |
12 | + <a href="?act=trsgl&t={$art['tree_number']}">[TR:{$art['tree_number']}]</a>:<a href="?act=sngl&a={$art['id']}">[{$art['id']}]:{$art['subject']}</a>$clipfiles {$art['author']} <span class="treeParentDate">{$art['created_at']}</span> | |
11 | 13 | </div> |
12 | 14 | </div> |
13 | 15 |
@@ -17,12 +19,14 @@ | ||
17 | 19 | } |
18 | 20 | |
19 | 21 | |
20 | -function getBranchHtml($art, $twig='') { | |
22 | +function getBranchHtml($art, $twig='', $pubUrl) { | |
21 | 23 | |
24 | + $clipfiles = makeClips($art['clipfile1'], $art['clipfile2'], $art['clipfile3'], $pubUrl); | |
25 | + | |
22 | 26 | $myContent = ''; |
23 | 27 | $myContent .=<<< HTML |
24 | 28 | <div style="border:1px solid #678;"> |
25 | - {$twig}<!--{$art['tree_number']}--><a href="?act=sngl&a={$art['id']}">【{$art['id']}】][pid:{$art['parent_id']}]:{$art['subject']}</a> {$art['author']} {$art['created_at']} | |
29 | + {$twig}<!--{$art['tree_number']}--><a href="?act=sngl&a={$art['id']}">【{$art['id']}】][pid:{$art['parent_id']}]:{$art['subject']}</a>$clipfiles {$art['author']} <span class="treeChildDate">{$art['created_at']}</span> | |
26 | 30 | </div> |
27 | 31 | HTML; |
28 | 32 |
@@ -29,4 +33,29 @@ | ||
29 | 33 | return $myContent; |
30 | 34 | } |
31 | 35 | |
36 | + | |
37 | +function makeClips($clip1, $clip2, $clip3, $pubUrl) { | |
38 | + if (! $clip1 and $clip2 and $clip3) return ''; | |
39 | + | |
40 | + $myContent = ''; | |
41 | + | |
42 | +if ( $clip1 ) { | |
43 | +$myContent .=<<< HTML | |
44 | + <span class="clip"><img src="{$pubUrl}/img/clip.gif"></span> | |
45 | +HTML; | |
46 | +} | |
47 | +if ( $clip2 ) { | |
48 | +$myContent .=<<< HTML | |
49 | + <span class="clip"><img src="{$pubUrl}/img/clip.gif"></span> | |
50 | +HTML; | |
51 | +} | |
52 | +if ( $clip3 ) { | |
53 | +$myContent .=<<< HTML | |
54 | + <span class="clip"><img src="{$pubUrl}/img/clip.gif"></a></span> | |
55 | +HTML; | |
56 | +} | |
57 | + | |
58 | + return $myContent; | |
59 | +} | |
60 | + | |
32 | 61 | ?> |
\ No newline at end of file |
@@ -5,8 +5,8 @@ | ||
5 | 5 | |
6 | 6 | //パーツ作成 |
7 | 7 | $clips = makeFileUpload($postSet['clipfile']); |
8 | - $ftclr = makeFontColor($postSet['ftcolor_on'], $postSet['ftcolors'], $art['fontcolor']); | |
9 | - $icon = makeIcon($postSet['icon_on'], $postSet['icons'], $art['iconfile']); | |
8 | + $ftclr = makeFontColorSelect($postSet['ftcolor_on'], $postSet['ftcolors'], $art['fontcolor']); | |
9 | + $icon = makeIconSelect($postSet['icon_on'], $postSet['icons'], $art['iconfile']); | |
10 | 10 | $captc = makeCaptcha($postSet['captcha_on']); |
11 | 11 | $kword = makeKeyword($postSet['keyword_on'], $postSet['keyword_q'], $postSet['keyword_a']); |
12 | 12 | $prev = makePreview($postSet['preview']); |
@@ -125,8 +125,8 @@ | ||
125 | 125 | function getModifyInputHtml($baseSet, $art, $postSet, $mode=1) { |
126 | 126 | |
127 | 127 | //パーツ作成 |
128 | - $ftclr = makeFontColor($postSet['ftcolor_on'], $postSet['ftcolors'], $art['fontcolor']); | |
129 | - $icon = makeIcon($postSet['icon_on'], $postSet['icons'], $art['iconfile']); | |
128 | + $ftclr = makeFontColorSelect($postSet['ftcolor_on'], $postSet['ftcolors'], $art['fontcolor']); | |
129 | + $icon = makeIconSelect($postSet['icon_on'], $postSet['icons'], $art['iconfile']); | |
130 | 130 | $captc = makeCaptcha($postSet['captcha_on']); |
131 | 131 | $kword = makeKeyword($postSet['keyword_on'], $postSet['keyword_q'], $postSet['keyword_a']); |
132 | 132 | $prev = makePreview($postSet['preview']); |
@@ -372,12 +372,12 @@ | ||
372 | 372 | } |
373 | 373 | |
374 | 374 | |
375 | -function makeFontColor($flag, $ftcolors, $setColor) { | |
375 | +function makeFontColorSelect($flag, $ftcolors, $setColor) { | |
376 | 376 | $myContent = ''; |
377 | 377 | if ( $flag ) { |
378 | 378 | $myContent .=<<< HTML |
379 | 379 | <div class="itemName">{$GLOBALS['LNG']['fontColor']}:</div> |
380 | - <div class="itemInput"><select name="fontcolor"> | |
380 | + <div class="itemInput"><select name="fontcolor" id="fontcolor" class="fontColorSelect" onChange="fontColorChange()"> | |
381 | 381 | HTML; |
382 | 382 | |
383 | 383 | $colorAry = explode(',', $ftcolors); |
@@ -401,7 +401,7 @@ | ||
401 | 401 | } |
402 | 402 | |
403 | 403 | |
404 | -function makeIcon($flag, $icons, $setIcon) { | |
404 | +function makeIconSelect($flag, $icons, $setIcon) { | |
405 | 405 | $myContent = ''; |
406 | 406 | |
407 | 407 | if ( $flag ) { |
@@ -408,10 +408,11 @@ | ||
408 | 408 | $myContent .=<<< HTML |
409 | 409 | <div class="itemName">{$GLOBALS['LNG']['icon']}:</div> |
410 | 410 | <div class="itemInput left1"><select name="iconfile"> |
411 | + <option name="指定なし" value="">指定なし</option> | |
411 | 412 | HTML; |
412 | 413 | |
413 | 414 | $iconAry = explode(',', $icons); |
414 | - var_dump($iconAry); | |
415 | + //var_dump($iconAry); | |
415 | 416 | foreach( $iconAry as $icon ) { |
416 | 417 | $ic = explode('=', $icon); |
417 | 418 | if ( count($ic)!=2 ) continue; |
@@ -5,9 +5,15 @@ | ||
5 | 5 | |
6 | 6 | $email = makeEmail($art['email']); |
7 | 7 | $homepage = makeHomepage($art['homepage']); |
8 | - $clipfiles = makeClipFiles($art['clipfile1'], $art['clipfile2'], $art['clipfile3']); | |
9 | - $fileimages = makeFileImages( $artlSet['img_view'], $art['clipfile1'], $art['clipfile2'], $art['clipfile3']); | |
8 | + $icon = makeIcon($art['iconfile'], $baseSet['pubURL'] . "/img/icon/"); | |
9 | + $ftcspan = makeFtc($art['fontcolor']); | |
10 | + $clipfiles = | |
11 | + makeClipFiles($art['id'], $art['clipfile1'], $art['clipfile2'], $art['clipfile3'], $baseSet['pubURL'], $baseSet['dataURL']); | |
12 | + $fileimages = | |
13 | + makeFileImages( $artlSet['img_view'], $art['id'], $art['clipfile1'], $art['clipfile2'], $art['clipfile3'], $baseSet['dataURL']); | |
10 | 14 | $editBtn = makeEditButton($art['id'], $baseSet, $artlSet ); |
15 | + | |
16 | + $art['article'] = nl2br($art['article']); | |
11 | 17 | |
12 | 18 | $article =<<< HTML |
13 | 19 | <div style="margin-left:{$indent};"> |
@@ -14,8 +20,9 @@ | ||
14 | 20 | <div class="articleBoxOut"> |
15 | 21 | <div class="articleTitleBox">{$art['tree_number']}:{$art['id']}:{$art['subject']}</div> |
16 | 22 | <div class="articleAuthorBox"> |
17 | -{$art['author']}<br /> | |
18 | -{$email}{$homepage}<br /> | |
23 | +<div class="articleAuthor">{$art['author']}</div> | |
24 | +{$icon} | |
25 | +{$email}{$homepage} | |
19 | 26 | {$clipfiles} |
20 | 27 | |
21 | 28 | <br /> |
@@ -42,9 +49,8 @@ | ||
42 | 49 | <div class="articleTextBoxOut"> |
43 | 50 | <div class="articleCreate">{$art['created_at']}</div> |
44 | 51 | <div class="articleTextBox"> |
45 | -{$art['article']} | |
52 | +{$ftcspan}{$art['article']}</span> | |
46 | 53 | |
47 | -<br/> | |
48 | 54 | {$fileimages} |
49 | 55 | |
50 | 56 | <br /> |
@@ -69,7 +75,7 @@ | ||
69 | 75 | $myContent = ''; |
70 | 76 | |
71 | 77 | $myContent .=<<< HTML |
72 | - <span><a href="mailto:{$email}">[Email]</a></span> | |
78 | + <span class="mail"><a href="mailto:{$email}">[Email]</a></span> | |
73 | 79 | HTML; |
74 | 80 | |
75 | 81 | return $myContent; |
@@ -82,17 +88,41 @@ | ||
82 | 88 | $myContent = ''; |
83 | 89 | |
84 | 90 | $myContent .=<<< HTML |
85 | - <span><a href="{$homepage}">[Home]</a></span> | |
91 | + <span class="home"><a href="{$homepage}">[Home]</a></span> | |
86 | 92 | HTML; |
87 | 93 | |
88 | 94 | return $myContent; |
89 | 95 | } |
90 | 96 | |
97 | +function makeIcon($iconfile, $pubURL) { | |
98 | + if (! $iconfile) return ''; | |
91 | 99 | |
92 | -function makeClipFiles($clip1, $clip2, $clip3) { | |
100 | + $myContent = ''; | |
101 | + | |
102 | +$myContent .=<<< HTML | |
103 | + <div class="icon"><img src="{$pubURL}{$iconfile}" alt="アイコン" /></div> | |
104 | +HTML; | |
105 | + | |
106 | + return $myContent; | |
107 | +} | |
108 | + | |
109 | +function makeFtc($ftcolor) { | |
110 | + if (! $ftcolor) return '<span>'; | |
111 | + | |
112 | + $myContent = ''; | |
113 | + | |
114 | +$myContent .=<<< HTML | |
115 | + <span style="color:{$ftcolor};"> | |
116 | +HTML; | |
117 | + | |
118 | + return $myContent; | |
119 | +} | |
120 | + | |
121 | +function makeClipFiles($artId, $clip1, $clip2, $clip3, $pubUrl, $dataUrl) { | |
93 | 122 | if (! $clip1 and $clip2 and $clip3) return ''; |
94 | 123 | |
95 | 124 | $myContent = ''; |
125 | + $dataUrl2 = $dataUrl . "/uploads/" . $artId . "_"; | |
96 | 126 | |
97 | 127 | $myContent .=<<< HTML |
98 | 128 | <div class="clipfiles"> |
@@ -100,17 +130,17 @@ | ||
100 | 130 | |
101 | 131 | if ( $clip1 ) { |
102 | 132 | $myContent .=<<< HTML |
103 | - <div class="clip"><a href="$clip1"><img src="clip.gif"></a></div> | |
133 | + <span class="clip"><a href="{$dataUrl2}{$clip1}" target="_blank"><img src="{$pubUrl}/img/clip.gif"></a></span> | |
104 | 134 | HTML; |
105 | 135 | } |
106 | 136 | if ( $clip2 ) { |
107 | 137 | $myContent .=<<< HTML |
108 | - <div class="clip"><a href="$clip2"><img src="clip.gif"></a></div> | |
138 | + <span class="clip"><a href="{$dataUrl2}{$clip2}" target="_blank"><img src="{$pubUrl}/img/clip.gif"></a></span> | |
109 | 139 | HTML; |
110 | 140 | } |
111 | 141 | if ( $clip3 ) { |
112 | 142 | $myContent .=<<< HTML |
113 | - <div class="clip"><a href="$clip3"><img src="clip.gif"></a></div> | |
143 | + <span class="clip"><a href="{$dataUrl2}{$clip3}" target="_blank"><img src="{$pubUrl}/img/clip.gif"></a></span> | |
114 | 144 | HTML; |
115 | 145 | } |
116 | 146 |
@@ -123,30 +153,37 @@ | ||
123 | 153 | } |
124 | 154 | |
125 | 155 | |
126 | -function makeFileImages($mode, $clip1, $clip2, $clip3) { | |
156 | +function makeFileImages($mode, $artId, $clip1, $clip2, $clip3, $dataUrl) { | |
127 | 157 | if (! $clip1 and $clip2 and $clip3) return ''; |
128 | - | |
158 | + echo $mode; | |
129 | 159 | if( empty($mode) ) return ''; |
130 | 160 | |
161 | + $dataUrl2 = $dataUrl . "/uploads/" . $artId . "_"; | |
131 | 162 | $myContent = ''; |
132 | 163 | |
164 | + // | |
165 | + $vh = loadHelper('viewHelper'); | |
166 | + | |
167 | + | |
133 | 168 | $myContent .=<<< HTML |
134 | 169 | <div class="imageFileView"> |
135 | 170 | HTML; |
136 | 171 | |
137 | -if ( $clip1 ) { | |
172 | +if ( $clip1 and $vh->isImage($dataUrl2.$clip1)!=false ) { | |
138 | 173 | $myContent .=<<< HTML |
139 | - <div class="clipImage"><img src="$clip1"></div> | |
174 | + <div class="clipImage"><img src="{$dataUrl2}{$clip1}"></div> | |
140 | 175 | HTML; |
141 | 176 | } |
142 | -if ( $clip2 ) { | |
177 | + | |
178 | +if ( $clip2 and $vh->isImage($dataUrl2.$clip2)!=false ) { | |
143 | 179 | $myContent .=<<< HTML |
144 | - <div class="clipImage"><img src="$clip1"></div> | |
180 | + <div class="clipImage"><img src="{$dataUrl2}{$clip2}"></div> | |
145 | 181 | HTML; |
146 | 182 | } |
147 | -if ( $clip3 ) { | |
183 | + | |
184 | +if ( $clip3 and $vh->isImage($dataUrl2.$clip3)!=false ) { | |
148 | 185 | $myContent .=<<< HTML |
149 | - <div class="clipImage"><img src="$clip1"></div> | |
186 | + <div class="clipImage"><img src="{$dataUrl2}{$clip3}"></div> | |
150 | 187 | HTML; |
151 | 188 | } |
152 | 189 |
@@ -2,14 +2,14 @@ | ||
2 | 2 | <html lang="<?php echo LANG; ?>"> |
3 | 3 | <head> |
4 | 4 | <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>" /> |
5 | -<meta http-equiv="content-script-type" content="text/javascript"> | |
6 | -<meta http-equiv="content-style-type" content="text/css"> | |
7 | -<link rel="stylesheet" type="text/css" href="<?php echo $this->set['dataURL']; ?>/base.css"> | |
8 | -<link rel="stylesheet" type="text/css" href="<?php echo $this->set['dataURL']; ?>/overwrite.css"> | |
9 | -<script type="text/javascript" src="<?php echo $this->set['pubURL']; ?>/js/common.js"></script> | |
5 | +<meta http-equiv="content-script-type" content="text/javascript" /> | |
6 | +<meta http-equiv="content-style-type" content="text/css" /> | |
7 | +<link rel="stylesheet" type="text/css" href="<?php echo $this->baseSet['dataURL']; ?>/base.css" /> | |
8 | +<link rel="stylesheet" type="text/css" href="<?php echo $this->baseSet['dataURL']; ?>/overwrite.css" /> | |
9 | +<script type="text/javascript" src="<?php echo $this->baseSet['pubURL']; ?>/js/common.js"></script> | |
10 | 10 | <title><?php echo $this->set['vw_title']; ?></title> |
11 | 11 | </head> |
12 | -<body> | |
12 | +<body <?php echo $this->set['vw_body']; ?>> | |
13 | 13 | |
14 | 14 | |
15 | 15 | <div class="container"> |
@@ -15,16 +15,21 @@ | ||
15 | 15 | |
16 | 16 | $email = makeEmail($art['email']); |
17 | 17 | $homepage = makeHomepage($art['homepage']); |
18 | + $icon = makeIcon($art['iconfile'], $baseSet['pubURL'] . "/img/icon/"); | |
19 | + $ftcspan = makeFtc($art['fontcolor']); | |
18 | 20 | $clipfiles = makeClipFiles($art['clipfile1'], $art['clipfile2'], $art['clipfile3']); |
19 | 21 | $fileimages = makeFileImages( $artlSet['img_view'], $art['clipfile1'], $art['clipfile2'], $art['clipfile3']); |
20 | 22 | $editBtn = makeEditButton($baseSet['id'], $baseSet['plfm'], $art['id'], $artlSet['delete_mode'], $artlSet['edit_mode']); |
23 | + | |
24 | + $art['article'] = nl2br($art['article']); | |
21 | 25 | |
22 | 26 | $article =<<< HTML |
23 | 27 | <div class="threadHeadBoxOut"> |
24 | 28 | <div class="threadTitleBox">{$art['tree_number']}:{$art['id']}:{$art['subject']}</div> |
25 | 29 | <div class="articleAuthorBox"> |
26 | -{$art['author']}<br /> | |
27 | -{$email}{$homepage}<br /> | |
30 | +<div class="articleAuthor">{$art['author']}</div> | |
31 | +{$icon} | |
32 | +{$email}{$homepage} | |
28 | 33 | {$clipfiles} |
29 | 34 | |
30 | 35 | <br /> |
@@ -40,7 +45,7 @@ | ||
40 | 45 | <div class="articleTextBoxOut"> |
41 | 46 | <div class="articleCreate">{$art['created_at']}</div> |
42 | 47 | <div class="articleTextBox"> |
43 | -{$art['article']} | |
48 | +{$ftcspan}{$art['article']}</span> | |
44 | 49 | |
45 | 50 | <br/> |
46 | 51 | {$fileimages} |