• R/O
  • SSH
  • HTTPS

epitta-bbs: Commit


Commit MetaInfo

Revision21 (tree)
Time2011-07-06 00:51:15
Authorwajett

Log Message

2011/07/06 表示系など。

Change Summary

Incremental Difference

--- app/actions/article_action.php (revision 20)
+++ app/actions/article_action.php (revision 21)
@@ -106,6 +106,8 @@
106106 $this->artlSet['total'] = $result['total'];
107107 $this->artlSet['unit'] = 1;
108108
109+ //
110+
109111 //スキン
110112 $this->readSkin('article');
111113 $this->readSkin('tree');
@@ -113,7 +115,7 @@
113115 //コンテント
114116 $myContent = '';
115117 $myContent .= getArticlehtml($article, $this->baseSet, $this->artlSet);
116- $myContent .= '<hr />';
118+ //$myContent .= '<hr />';
117119 foreach( $tree as $tr ) {
118120 if ( $tr['parent_id'] == 0 ) {
119121 $myContent .= getTreeHtml($tr);
@@ -190,7 +192,7 @@
190192 $myContent = '';
191193 foreach($trees as $tr) {
192194
193- $myContent .= getTreeHtml($tr);
195+ $myContent .= getTreeHtml($tr, $this->baseSet['pubURL']);
194196 $branchMap = branchExtender($branches, $tr['id'], $tr['tree_number']);
195197 $depthBranch=array();
196198 $myContent .= makeBranch($branches, $tr['id'], $branchMap, $depthBranch);
@@ -262,7 +264,7 @@
262264 foreach( $tree as $tr ) {
263265
264266 if ( $tr['parent_id'] == 0 ) {
265- $myContent .= getTreeHtml($tr);
267+ $myContent .= getTreeHtml($tr, $this->baseSet['pubURL']);
266268 $branchMap = branchExtender($tree, $tr['id'], $tr['tree_number']);
267269 $depthBranch=array();
268270 $myContent .= makeBranch($tree, $tr['id'], $branchMap, $depthBranch );
@@ -511,6 +513,7 @@
511513 }
512514
513515
516+
514517 }
515518
516519 ?>
\ No newline at end of file
--- app/actions/post_action.php (revision 20)
+++ app/actions/post_action.php (revision 21)
@@ -112,6 +112,7 @@
112112
113113 $this->content = $myContent;
114114
115+ $this->set['vw_body'] = 'onLoad="inputInit();"';
115116 $this->set['view'] = 'input';
116117 $this->setLayout('base');
117118
@@ -217,7 +218,7 @@
217218
218219 $this->content = $myContent;
219220
220-
221+ $this->set['vw_body'] = 'onLoad="inputInit();"';
221222 $this->setLayout('base');
222223
223224
@@ -311,6 +312,77 @@
311312 $vld->run( $this->getPost('email'), $GLOBALS['LNG']['email'], "max_len&80" );
312313 $vld->run( $this->getPost('homepage'), $GLOBALS['LNG']['homepage'], "max_len&200" );
313314
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+
314386 if ( ! empty($vld->errMsgs) ) {
315387 $this->postSet['errMessage'] = $GLOBALS['LNG']['postInvalid'];
316388 $this->postSet['errMsgAry'] = $vld->errMsgs;
@@ -348,6 +420,12 @@
348420 $data['personKey'] =
349421 $dh->makePersonKey($this->getPost('author'), $this->getPost('password'), $GLOBALS['USR']['access']['host']);
350422
423+ //添付ファイル
424+ foreach ( $uploadFile as $key => $file ) {
425+ $data[$key] = $this->qt($file['name']);
426+ }
427+
428+
351429 /*
352430 var_dump( $GLOBALS['USR']['access'] );
353431 echo "<br>";
@@ -364,6 +442,14 @@
364442 //Create
365443 //echo "INSERT!";
366444 $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+
367453 //exit;
368454 //リダイレクト
369455 $this->redirect('act=sngl&a=' . $newId);
--- app/actions/base_action.php (revision 20)
+++ app/actions/base_action.php (revision 21)
@@ -62,11 +62,11 @@
6262
6363 //dataURL
6464 if ( $this->id ) {
65- $this->set['dataURL'] = DATAURL ."/". $this->id;
65+ $this->baseSet['dataURL'] = DATAURL ."/". $this->id;
6666 } else {
67- $this->set['dataURL'] = DATAURL ."/default";
67+ $this->baseSet['dataURL'] = DATAURL ."/default";
6868 }
69- $this->set['pubURL'] = PUBURL;
69+ $this->baseSet['pubURL'] = PUBURL;
7070
7171
7272 //スキンパス
@@ -89,6 +89,7 @@
8989 //$this->set['id'] =
9090
9191 $this->set['vw_title'] = $GLOBALS['CNF']['vw_title'];
92+ if ( ! isset($this->set['vw_body']) ) $this->set['vw_body'] = '';
9293 $this->set['vw_header'] = $GLOBALS['CNF']['vw_header'];
9394 $this->set['vw_footer'] = $GLOBALS['CNF']['vw_footer'];
9495
@@ -131,8 +132,7 @@
131132
132133
133134
134- protected function lordLib($className)
135-
135+ protected function loadLib($className)
136136 {
137137 require_once( APPPATH. "/libs/" . strtolower ($className). '.php' );
138138 return new $className();
@@ -223,7 +223,7 @@
223223
224224 $url = $this->baseSet['linkBaseUrl'];
225225
226- $url = DIRURL . '/' . SELFNAME . $url . $target;
226+ $url = $url . $target;
227227
228228 //echo $url;
229229
@@ -253,6 +253,7 @@
253253 'password' => '',
254254 'personkey' => '',
255255 'article' => '',
256+ 'article_add' => '',
256257 'email' => '',
257258 'email_code' => '',
258259 'homepage' => '',
--- app/models/base_model.php (revision 20)
+++ app/models/base_model.php (revision 21)
@@ -102,7 +102,7 @@
102102
103103 function execute($sql) {
104104 if ( empty($sql) ) trigger_error ('Empty Query!');
105-
105+ //echo $sql;
106106 $result = sqlite_exec($this->conn, $sql, $this->dbError);
107107 if (!$result) $this->errTrigger('Failed Execute Query!' . $this->dbError);
108108
--- app/models/article_model.php (revision 20)
+++ app/models/article_model.php (revision 21)
@@ -419,15 +419,68 @@
419419
420420 function updateArticle($data) {
421421
422+ //
423+ $now = $this->qt( date( "Y-m-d H:i:s", time() ) );
424+
422425 $this->openConn(2);
423426
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+ //
424473 $now = $this->qt( date( "Y-m-d H:i:s", time() ) );
425474
475+ $this->openConn(2);
476+
477+ $now = $this->qt( date( "Y-m-d H:i:s", time() ) );
478+
426479 $sql =
427480 "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=" .
431484 " WHERE id={$data['article_id']}";
432485
433486 $result = $this->execute($sql);
@@ -447,7 +500,7 @@
447500 $this->closeConn(2);
448501
449502
450- if ( $result==false ) trigger_error ('Invalid article id!');
503+ if ( $result==false ) trigger_error ('Cannot Update!');
451504
452505
453506 return $result;
@@ -456,7 +509,6 @@
456509
457510
458511
459-
460512 function updateArticleStatus($id, $status) {
461513
462514 $this->openConn(2);
@@ -485,7 +537,7 @@
485537 $this->closeConn(2);
486538
487539
488- if ( $result==false ) trigger_error ('Invalid article id!');
540+ if ( $result==false ) trigger_error ('Cannot Update!');
489541
490542
491543 return $result;
--- SetUpTools/create_sql.php (revision 20)
+++ SetUpTools/create_sql.php (revision 21)
@@ -33,10 +33,12 @@
3333 img_view INTEGER NOT NULL DEFAULT 0,
3434
3535 clipfile INTEGER NOT NULL DEFAULT 1,
36+ clipfile_types TEXT DEFAULT 'jpeg,gif,png,txt,zip',
37+ clipfile_maxsize INTEGER NOT NULL DEFAULT 300,
3638 icon_on INTEGER NOT NULL DEFAULT 1,
3739 icons TEXT DEFAULT '',
3840 ftcolor_on INTEGER NOT NULL DEFAULT 1,
39- ftcolors TEXT DEFAULT 'red, blue, #008000',
41+ ftcolors TEXT DEFAULT 'black, red, blue, #008000',
4042 captcha_on INTEGER NOT NULL DEFAULT 0,
4143 keyword_on INTEGER NOT NULL DEFAULT 0,
4244 keyword_q TEXT DEFAULT 'エピッタをひらがな4文字で入力してください。',
@@ -73,12 +75,11 @@
7375 );
7476
7577
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' );
7681
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' );
7982
80-
81-
8283 CREATE table epitta_articles (
8384
8485 id INTEGER PRIMARY KEY,
--- system/epitta_config.php (revision 20)
+++ system/epitta_config.php (revision 21)
@@ -47,11 +47,6 @@
4747
4848
4949
50-
51-//アップロードファイル最大サイズ
52-define('MAXFILE', (500 * 1024) );
53-
54-
5550 /*
5651 //セッション
5752 session_save_path('');
--- system/locals/ja/wordlist.php (revision 20)
+++ system/locals/ja/wordlist.php (revision 21)
@@ -80,6 +80,8 @@
8080
8181 'postInvalid' => '入力に不備があります',
8282 'failedPassword' => 'パスワードが不正です。',
83+'failedFileType' => '添付するファイルのタイプが許可されていません。',
84+'failedFileSize' => '添付するファイルのサイズが制限を超えています。',
8385
8486
8587 );
--- views/pc/default/topic.php (revision 20)
+++ views/pc/default/topic.php (revision 21)
@@ -28,7 +28,7 @@
2828 </td>
2929 <td>
3030 <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']}
3232 </div>
3333 </td>
3434 <td>{$art['author']}</td>
--- views/pc/default/tree.php (revision 20)
+++ views/pc/default/tree.php (revision 21)
@@ -1,13 +1,15 @@
11 <?php
22
33
4-function getTreeHtml($art) {
4+function getTreeHtml($art, $pubUrl) {
55
6+ $clipfiles = makeClips($art['clipfile1'], $art['clipfile2'], $art['clipfile3'], $pubUrl);
7+
68 $myContent = '';
79 $myContent .=<<< HTML
810 <div class="tree">
911 <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>&nbsp;{$art['author']}&nbsp;{$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&nbsp;{$art['author']}&nbsp;<span class="treeParentDate">{$art['created_at']}</span>
1113 </div>
1214 </div>
1315
@@ -17,12 +19,14 @@
1719 }
1820
1921
20-function getBranchHtml($art, $twig='') {
22+function getBranchHtml($art, $twig='', $pubUrl) {
2123
24+ $clipfiles = makeClips($art['clipfile1'], $art['clipfile2'], $art['clipfile3'], $pubUrl);
25+
2226 $myContent = '';
2327 $myContent .=<<< HTML
2428 <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>&nbsp;{$art['author']}&nbsp;{$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&nbsp;{$art['author']}&nbsp;<span class="treeChildDate">{$art['created_at']}</span>
2630 </div>
2731 HTML;
2832
@@ -29,4 +33,29 @@
2933 return $myContent;
3034 }
3135
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+
3261 ?>
\ No newline at end of file
--- views/pc/default/article_input.php (revision 20)
+++ views/pc/default/article_input.php (revision 21)
@@ -5,8 +5,8 @@
55
66 //パーツ作成
77 $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']);
1010 $captc = makeCaptcha($postSet['captcha_on']);
1111 $kword = makeKeyword($postSet['keyword_on'], $postSet['keyword_q'], $postSet['keyword_a']);
1212 $prev = makePreview($postSet['preview']);
@@ -125,8 +125,8 @@
125125 function getModifyInputHtml($baseSet, $art, $postSet, $mode=1) {
126126
127127 //パーツ作成
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']);
130130 $captc = makeCaptcha($postSet['captcha_on']);
131131 $kword = makeKeyword($postSet['keyword_on'], $postSet['keyword_q'], $postSet['keyword_a']);
132132 $prev = makePreview($postSet['preview']);
@@ -372,12 +372,12 @@
372372 }
373373
374374
375-function makeFontColor($flag, $ftcolors, $setColor) {
375+function makeFontColorSelect($flag, $ftcolors, $setColor) {
376376 $myContent = '';
377377 if ( $flag ) {
378378 $myContent .=<<< HTML
379379 <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()">
381381 HTML;
382382
383383 $colorAry = explode(',', $ftcolors);
@@ -401,7 +401,7 @@
401401 }
402402
403403
404-function makeIcon($flag, $icons, $setIcon) {
404+function makeIconSelect($flag, $icons, $setIcon) {
405405 $myContent = '';
406406
407407 if ( $flag ) {
@@ -408,10 +408,11 @@
408408 $myContent .=<<< HTML
409409 <div class="itemName">{$GLOBALS['LNG']['icon']}:</div>
410410 <div class="itemInput left1"><select name="iconfile">
411+ <option name="指定なし" value="">指定なし</option>
411412 HTML;
412413
413414 $iconAry = explode(',', $icons);
414- var_dump($iconAry);
415+ //var_dump($iconAry);
415416 foreach( $iconAry as $icon ) {
416417 $ic = explode('=', $icon);
417418 if ( count($ic)!=2 ) continue;
--- views/pc/default/article.php (revision 20)
+++ views/pc/default/article.php (revision 21)
@@ -5,9 +5,15 @@
55
66 $email = makeEmail($art['email']);
77 $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']);
1014 $editBtn = makeEditButton($art['id'], $baseSet, $artlSet );
15+
16+ $art['article'] = nl2br($art['article']);
1117
1218 $article =<<< HTML
1319 <div style="margin-left:{$indent};">
@@ -14,8 +20,9 @@
1420 <div class="articleBoxOut">
1521 <div class="articleTitleBox">{$art['tree_number']}:{$art['id']}:{$art['subject']}</div>
1622 <div class="articleAuthorBox">
17-{$art['author']}<br />
18-{$email}{$homepage}<br />
23+<div class="articleAuthor">{$art['author']}</div>
24+{$icon}
25+{$email}{$homepage}
1926 {$clipfiles}
2027
2128 <br />
@@ -42,9 +49,8 @@
4249 <div class="articleTextBoxOut">
4350 <div class="articleCreate">{$art['created_at']}</div>
4451 <div class="articleTextBox">
45-{$art['article']}
52+{$ftcspan}{$art['article']}</span>
4653
47-<br/>
4854 {$fileimages}
4955
5056 <br />
@@ -69,7 +75,7 @@
6975 $myContent = '';
7076
7177 $myContent .=<<< HTML
72- <span><a href="mailto:{$email}">[Email]</a></span>
78+ <span class="mail"><a href="mailto:{$email}">[Email]</a></span>
7379 HTML;
7480
7581 return $myContent;
@@ -82,17 +88,41 @@
8288 $myContent = '';
8389
8490 $myContent .=<<< HTML
85- <span><a href="{$homepage}">[Home]</a></span>
91+ <span class="home"><a href="{$homepage}">[Home]</a></span>
8692 HTML;
8793
8894 return $myContent;
8995 }
9096
97+function makeIcon($iconfile, $pubURL) {
98+ if (! $iconfile) return '';
9199
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) {
93122 if (! $clip1 and $clip2 and $clip3) return '';
94123
95124 $myContent = '';
125+ $dataUrl2 = $dataUrl . "/uploads/" . $artId . "_";
96126
97127 $myContent .=<<< HTML
98128 <div class="clipfiles">
@@ -100,17 +130,17 @@
100130
101131 if ( $clip1 ) {
102132 $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>
104134 HTML;
105135 }
106136 if ( $clip2 ) {
107137 $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>
109139 HTML;
110140 }
111141 if ( $clip3 ) {
112142 $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>
114144 HTML;
115145 }
116146
@@ -123,30 +153,37 @@
123153 }
124154
125155
126-function makeFileImages($mode, $clip1, $clip2, $clip3) {
156+function makeFileImages($mode, $artId, $clip1, $clip2, $clip3, $dataUrl) {
127157 if (! $clip1 and $clip2 and $clip3) return '';
128-
158+ echo $mode;
129159 if( empty($mode) ) return '';
130160
161+ $dataUrl2 = $dataUrl . "/uploads/" . $artId . "_";
131162 $myContent = '';
132163
164+ //
165+ $vh = loadHelper('viewHelper');
166+
167+
133168 $myContent .=<<< HTML
134169 <div class="imageFileView">
135170 HTML;
136171
137-if ( $clip1 ) {
172+if ( $clip1 and $vh->isImage($dataUrl2.$clip1)!=false ) {
138173 $myContent .=<<< HTML
139- <div class="clipImage"><img src="$clip1"></div>
174+ <div class="clipImage"><img src="{$dataUrl2}{$clip1}"></div>
140175 HTML;
141176 }
142-if ( $clip2 ) {
177+
178+if ( $clip2 and $vh->isImage($dataUrl2.$clip2)!=false ) {
143179 $myContent .=<<< HTML
144- <div class="clipImage"><img src="$clip1"></div>
180+ <div class="clipImage"><img src="{$dataUrl2}{$clip2}"></div>
145181 HTML;
146182 }
147-if ( $clip3 ) {
183+
184+if ( $clip3 and $vh->isImage($dataUrl2.$clip3)!=false ) {
148185 $myContent .=<<< HTML
149- <div class="clipImage"><img src="$clip1"></div>
186+ <div class="clipImage"><img src="{$dataUrl2}{$clip3}"></div>
150187 HTML;
151188 }
152189
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
--- views/pc/default/base_layout.php (revision 20)
+++ views/pc/default/base_layout.php (revision 21)
@@ -2,14 +2,14 @@
22 <html lang="<?php echo LANG; ?>">
33 <head>
44 <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>
1010 <title><?php echo $this->set['vw_title']; ?></title>
1111 </head>
12-<body>
12+<body <?php echo $this->set['vw_body']; ?>>
1313
1414
1515 <div class="container">
--- views/pc/default/thread.php (revision 20)
+++ views/pc/default/thread.php (revision 21)
@@ -15,16 +15,21 @@
1515
1616 $email = makeEmail($art['email']);
1717 $homepage = makeHomepage($art['homepage']);
18+ $icon = makeIcon($art['iconfile'], $baseSet['pubURL'] . "/img/icon/");
19+ $ftcspan = makeFtc($art['fontcolor']);
1820 $clipfiles = makeClipFiles($art['clipfile1'], $art['clipfile2'], $art['clipfile3']);
1921 $fileimages = makeFileImages( $artlSet['img_view'], $art['clipfile1'], $art['clipfile2'], $art['clipfile3']);
2022 $editBtn = makeEditButton($baseSet['id'], $baseSet['plfm'], $art['id'], $artlSet['delete_mode'], $artlSet['edit_mode']);
23+
24+ $art['article'] = nl2br($art['article']);
2125
2226 $article =<<< HTML
2327 <div class="threadHeadBoxOut">
2428 <div class="threadTitleBox">{$art['tree_number']}:{$art['id']}:{$art['subject']}</div>
2529 <div class="articleAuthorBox">
26-{$art['author']}<br />
27-{$email}{$homepage}<br />
30+<div class="articleAuthor">{$art['author']}</div>
31+{$icon}
32+{$email}{$homepage}
2833 {$clipfiles}
2934
3035 <br />
@@ -40,7 +45,7 @@
4045 <div class="articleTextBoxOut">
4146 <div class="articleCreate">{$art['created_at']}</div>
4247 <div class="articleTextBox">
43-{$art['article']}
48+{$ftcspan}{$art['article']}</span>
4449
4550 <br/>
4651 {$fileimages}
Show on old repository browser