• R/O
  • SSH
  • HTTPS

epitta-bbs: Commit


Commit MetaInfo

Revision19 (tree)
Time2011-05-09 23:25:54
Authorwajett

Log Message

2011/05/08 投稿系など。

Change Summary

Incremental Difference

--- app/actions/article_action.php (revision 18)
+++ app/actions/article_action.php (revision 19)
@@ -19,7 +19,6 @@
1919 var $unit = 0;
2020 var $articleHtml = '';
2121
22- var $artlSet = array();
2322
2423
2524 public function __construct()
@@ -28,15 +27,12 @@
2827
2928 require_once( APPPATH . '/models/article_model.php' );
3029
31- //article_id取得
32- $this->artId = $this->getRequest('a', 0);
3330
34- //page取得
35- $this->page = $this->getRequest('p', 1);
31+ $this->artId = $this->getRequest('a', 0); //article_id
32+ $this->page = $this->getRequest('p', 1); //page
33+ $this->trNum = $this->getRequest('t', 0); //tree_number
3634
37- //tree_number取得
38- $this->trNum = $this->getRequest('t', 0);
39-
35+/*
4036 //チェック
4137 if ( !empty($this->artId) ) {
4238 if ( !is_numeric($this->artId) ) trigger_error ('Invalid article id!');
@@ -47,6 +43,7 @@
4743 if ( !empty($this->trNum) ) {
4844 if ( !is_numeric($this->trNum) ) trigger_error ('Invalid tree number!');
4945 }
46+*/
5047
5148 $this->baseSet['a'] = $this->artId;
5249 $this->baseSet['p'] = $this->page;
@@ -56,7 +53,8 @@
5653 $this->artlSet['edit_mode'] = $GLOBALS['CNF']['edit_mode'];
5754 $this->artlSet['img_view'] = $GLOBALS['CNF']['img_view'];
5855
59- $this->set['pager'] = 1;
56+ $this->artlSet['total'] = 0;
57+ $this->artlSet['unit'] = 0;
6058
6159 }
6260
@@ -79,14 +77,32 @@
7977 //echo "disp opend, page=" . $this->page;
8078 $artMdl = new Article_model();
8179
82- $article = $artMdl->getSingleArticle($this->artId);
80+ $article = null;
81+ if ( $this->artId ) {
82+ $article = $artMdl->getSingleArticle($this->artId);
83+
84+ } else if ( $this->page ) {
85+ $trees = $artMdl->getTrees(1, 1, $this->page);
86+ if ( empty($trees) ) trigger_error ('Invalid article!');
87+ $article = array_shift($trees);
88+
89+ } else {
90+ trigger_error ('Invalid article!');
91+
92+ }
93+
8394 if ( empty($article) ) trigger_error ('Invalid article id!');
8495
96+
97+ //$article = $artMdl->getSingleArticle($this->artId);
98+ //if ( empty($article) ) trigger_error ('Invalid article id!');
99+
85100 $tree = $artMdl->getSingleTree($article['tree_number']);
86101
87- $this->set['total'] = 0;
102+ $result = $artMdl->getArticleTotal(1);
103+ $this->artlSet['total'] = $result['total'];
104+ $this->artlSet['unit'] = 1;
88105
89-
90106 //スキン
91107 $this->readSkin('article');
92108 $this->readSkin('tree');
@@ -117,14 +133,16 @@
117133
118134 public function plain()
119135 {
120- $this->unit = $GLOBALS['CNF']['plain_max'];
121136
122137 $artMdl = new Article_model();
123138 $articles = $artMdl->getArticles(1, $GLOBALS['CNF']['plain_max'], $this->page);
124139
125140 $result = $artMdl->getArticleTotal($GLOBALS['CNF']['plain_max']);
126- $this->set['total'] = $result['total'];
141+ $this->artlSet['total'] = $result['total'];
127142
143+ $this->artlSet['unit'] = $GLOBALS['CNF']['plain_max'];
144+
145+
128146 //スキン
129147 $this->readSkin('article');
130148
@@ -149,17 +167,19 @@
149167
150168 public function tree()
151169 {
152- $this->unit = $GLOBALS['CNF']['tree_max'];
153170
154171 $artMdl = new Article_model();
155- echo "page=" .$this->page;
172+ //echo "page=" .$this->page;
156173
157- $trees = $artMdl->getTrees(1, $GLOBALS['CNF']['tree_max'], $this->page);
174+ $trees = $artMdl->getTrees(2, $GLOBALS['CNF']['tree_max'], $this->page);
158175 $branches = $artMdl->getBranches($trees);
159176
160177 $result = $artMdl->getParentTotal($GLOBALS['CNF']['tree_max']);
161- $this->set['total'] = $result['total'];
178+ $this->artlSet['total'] = $result['total'];
162179
180+ $this->artlSet['unit'] = $GLOBALS['CNF']['tree_max'];
181+
182+
163183 //スキン
164184 $this->readSkin('tree');
165185
@@ -190,9 +210,30 @@
190210 //echo "disp tree, page=" . $this->page;
191211
192212 $artMdl = new Article_model();
193- $tree = $artMdl->getSingleTree($this->trNum);
194- //var_dump($tree);
213+ $tree = null;
214+ if ( $this->trNum ) {
215+ $tree = $artMdl->getSingleTree($this->trNum);
195216
217+ } else if ( $this->page ) {
218+ $trees = $artMdl->getTrees(1, 1, $this->page);
219+ if ( empty($trees) ) return;
220+ $tr = array_shift($trees);
221+ $tree = $artMdl->getSingleTree($tr['tree_number']);
222+
223+ } else {
224+ return;
225+
226+ }
227+
228+
229+ $result = $artMdl->getParentTotal(1);
230+ $this->artlSet['total'] = $result['total'];
231+ $this->artlSet['unit'] = 1;
232+
233+
234+ $this->unit = 1;
235+
236+
196237 //スキン
197238 $this->readSkin('article');
198239 $this->readSkin('tree');
@@ -233,7 +274,6 @@
233274
234275 public function thread()
235276 {
236- $this->unit = floor($GLOBALS['CNF']['tree_max']/2);
237277
238278 $artMdl = new Article_model();
239279 $threads = $artMdl->getTrees(1, $this->unit, $this->page);
@@ -241,12 +281,16 @@
241281 $articles = $artMdl->getChildren($threads, $GLOBALS['CNF']['threadhas_max'], 2);
242282
243283 $result = $artMdl->getParentTotal($this->unit);
244- $this->set['total'] = $result['total'];
284+ $this->artlSet['total'] = $result['total'];
245285
286+ $this->artlSet['unit'] = floor($GLOBALS['CNF']['tree_max']/2);
287+
288+
246289 //スキン
247290 $this->readSkin('article'); //先行必須
248291 $this->readSkin('thread');
249292
293+
250294 //コンテント
251295 $myContent = '';
252296 foreach($threads as $key => $th) {
@@ -259,7 +303,7 @@
259303 }
260304
261305 }
262- $myContent .= getThreadFootHtml();
306+ $myContent .= getThreadFootHtml( $th['tree_number'], $this->baseSet);
263307
264308 }
265309
@@ -283,14 +327,79 @@
283327
284328
285329 $artMdl = new Article_model();
286- $trees = $artMdl->getTrees(1, 2, $this->page);
287- $branches = $artMdl->getBranches($trees);
330+ $trees = null;
331+ if ( $this->trNum ) {
332+ $trees = $artMdl->getSingleTree($this->trNum);
288333
334+ } else if ( $this->page ) {
335+ $trees = $artMdl->getTrees(1, 1, $this->page);
336+ if ( empty($trees) ) return;
337+ $tr = array_shift($trees);
338+ $trees = $artMdl->getSingleTree($tr['tree_number']);
289339
290- $this->set['trees'] = $trees;
291- $this->set['branches'] = $branches;
340+ } else {
341+ return;
292342
343+ }
293344
345+
346+ //var_dump($tree);
347+ //exit;
348+
349+ $result = $artMdl->getParentTotal(1);
350+ $this->artlSet['total'] = $result['total'];
351+
352+ $this->artlSet['unit'] = 1;
353+
354+
355+ //スキン
356+ $this->readSkin('article');
357+ $this->readSkin('thread');
358+
359+ //コンテント
360+ $myContent = "";
361+ foreach($trees as $key => $th) {
362+
363+ if ( $th['parent_id'] != 0 ) continue;
364+
365+ $myContent .= getThreadHeadHtml();
366+ $myContent .= getThreadTopHtml($th, $this->baseSet, $this->artlSet);
367+ foreach($trees as $art) {
368+ if ( $art['parent_id'] != 0 ) {
369+ $myContent .= getThreadArticleHtml($art, $this->baseSet, $this->artlSet);
370+ }
371+
372+ }
373+ $myContent .= getThreadFootHtml( $th['tree_number'], $this->baseSet, 2);
374+
375+ }
376+
377+ /*
378+ foreach( $tree as $tr ) {
379+
380+ if ( $tr['parent_id'] == 0 ) {
381+ $myContent .= getArticleHtml($tr, $this->baseSet, $this->artlSet);
382+ $myContent .= makeBranchArticle($tree, $tr['id']);
383+ break;
384+ }
385+ }
386+ */
387+/*
388+ foreach( $tree as $tr ) {
389+
390+ if ( $tr['parent_id'] == 0 ) {
391+ $myContent .= getTreeHtml($tr);
392+ $branchMap = branchExtender($tree, $tr['id'], $tr['tree_number']);
393+ $depthBranch=array();
394+ $myContent .= makeBranch($tree, $tr['id'], $branchMap, $depthBranch );
395+ break;
396+ }
397+
398+ }
399+*/
400+ $this->content = $myContent;
401+
402+
294403 $this->set['view'] = __FUNCTION__;
295404 $this->setLayout('base');
296405
@@ -306,8 +415,6 @@
306415 public function topic()
307416 {
308417
309- $this->unit = $GLOBALS['CNF']['tree_max'];
310-
311418 $artMdl = new Article_model();
312419 $topics = $artMdl->getTopics(1, $GLOBALS['CNF']['tree_max'], $this->page);
313420
@@ -314,8 +421,9 @@
314421 $branches = $artMdl->getBranches($topics);
315422
316423 $result = $artMdl->getParentTotal($GLOBALS['CNF']['tree_max']);
317- $this->set['total'] = $result['total'];
424+ $this->artlSet['total'] = $result['total'];
318425
426+ $this->artlSet['unit'] = $GLOBALS['CNF']['tree_max'];
319427
320428 //スキン
321429 $this->readSkin('topic');
@@ -352,14 +460,15 @@
352460
353461 public function listing()
354462 {
355- $this->unit = $GLOBALS['CNF']['tree_max'] * 3;
356463
357464 $artMdl = new Article_model();
358465 $articles = $artMdl->getArticles(2, $GLOBALS['CNF']['tree_max'] * 3, $this->page);
359466
360467 $result = $artMdl->getParentTotal($GLOBALS['CNF']['tree_max']*3);
361- $this->set['total'] = $result['total'];
468+ $this->artlSet['total'] = $result['total'];
362469
470+ $this->artlSet['unit'] = $GLOBALS['CNF']['tree_max'] * 3;
471+
363472 //スキン
364473 $this->readSkin('list');
365474
@@ -383,6 +492,22 @@
383492 }
384493
385494
495+
496+ private function getTreePrevAndNext($page)
497+ {
498+
499+
500+ $this->artlSet['pageNow'] = 0;
501+ $this->artlSet['pagePrev'] = ;
502+ $this->artlSet['pageNext'] = ;
503+
504+
505+
506+ return true;
507+
508+
509+ }
510+
386511 }
387512
388513 ?>
\ No newline at end of file
--- app/actions/post_action.php (revision 18)
+++ app/actions/post_action.php (revision 19)
@@ -13,9 +13,6 @@
1313 class Post_Action extends Base_Action {
1414
1515
16- var $postSet = array();
17-
18-
1916 public function __construct()
2017 {
2118 parent::__construct();
@@ -30,6 +27,11 @@
3027 if ( !is_numeric($this->artId) ) trigger_error ('Invalid article id!');
3128 }
3229
30+
31+ $this->artlSet['delete_mode'] = $GLOBALS['CNF']['delete_mode'];
32+ $this->artlSet['edit_mode'] = $GLOBALS['CNF']['edit_mode'];
33+ $this->artlSet['img_view'] = $GLOBALS['CNF']['img_view'];
34+
3335 $this->set['pager'] = 0;
3436
3537 }
@@ -64,10 +66,9 @@
6466 $this->postSet['captcha_key'] = "";
6567
6668 $this->postSet['preview'] = '';
67-
68- //$this->postSet = array();
69+ $this->postSet['resto'] = '';
6970 $this->postSet['article_id'] = 0;
70- $this->postSet['parent_id'] = '';
71+ $this->postSet['parent_id'] = 0;
7172
7273 if ( $mode == 1 ) {
7374 $this->postSet['errMessage'] = '';
@@ -80,6 +81,7 @@
8081 $this->readSkin('article_input');
8182 $this->readSkin('article');
8283
84+
8385 //返信モード切り替え
8486 if ( $this->getPost('parent_id') ){
8587 $this->postSet['parent_id'] = $this->getPost('parent_id');
@@ -93,6 +95,12 @@
9395 } else if ( $mode == 2 ) {
9496 $arc = $this->stripslashes_deep($_POST);
9597
98+
99+ } else if ( $mode == 11 ) {
100+ $arc = getArticle($id);
101+ $arc['article_id'] = $arc['id'];
102+
103+
96104 } else {
97105 $arc = $this->stripslashes_deep($_POST);
98106 //var_dump($arc);
@@ -103,11 +111,29 @@
103111 $myContent = '';
104112
105113 if ( $mode==3 ) {
114+ //プレビュー
106115 $arc['created_at'] = date( "Y/m/d H:i:s", time() );
107116 $arc['clipfile1'] = ''; $arc['clipfile2'] = ''; $arc['clipfile3'] = '';
108- $this->postSet['preview'] = getArticleHtml($arc);
117+ $this->postSet['preview'] = getArticleHtml($arc, $this->baseSet, $this->artlSet);
118+
109119 }
110120
121+
122+ //echo "parent=" . $this->postSet['parent_id'];
123+
124+ if ( $this->postSet['parent_id'] ) {
125+ //返信モード
126+ $artMdl = new Article_Model();
127+ $prnt = $artMdl->getSingleArticle($this->postSet['parent_id']);
128+ $prnt['article_id'] = $prnt['id'];
129+
130+ $this->postSet['resto'] = getArticleHtml($prnt, $this->baseSet, $this->artlSet);
131+
132+ $arc['tree_number'] = $prnt['tree_number'];
133+ $arc['parent_id'] = $prnt['id'];
134+
135+ }
136+
111137 $myContent .= geArticleInputHtml($this->baseSet, $arc, $this->postSet, 1);
112138
113139 $this->content = $myContent;
@@ -130,17 +156,31 @@
130156 }
131157
132158
133-/*
134- public function createConfirm()
159+
160+
161+
162+ public function modifySelect()
135163 {
136- if ( isset($_POST['confirm']) and $_POST['confirm']==1) {
137- $this->createInput(2);
138- } else {
139- $this->create();
140- }
164+
165+
166+ //
167+ $modMode = $this->getPost('modMode', 0);
168+ if ( empty($modMode) ) trigger_error ('Invalid Mofify mode!');
169+
170+
171+ //削除のみ
172+ //deleteInput($id);
173+
174+
175+ //編集可能
176+
177+
178+
179+ //$this->createInput(1, $modMode);
141180 return;
181+
142182 }
143-*/
183+
144184
145185
146186
@@ -148,7 +188,6 @@
148188 {
149189
150190 //var_dump($_POST);
151- //ob_start();
152191
153192 //バリデート
154193 $vld = $this->lordLib('Validation');
@@ -156,7 +195,7 @@
156195 $this->postSet['errMsgAry'] = array();
157196
158197 $vld->run( $this->getPost('author'), $GLOBALS['LNG']['author'], "required|max_len&20" );
159- $vld->run( $this->getPost('password'), $GLOBALS['LNG']['password'], "min_len&3|max_len&10" );
198+ $vld->run( $this->getPost('password'), $GLOBALS['LNG']['password'], "min_len&3|max_len&10|alpha_plus" );
160199 $vld->run( $this->getPost('subject'), $GLOBALS['LNG']['subject'], "required|max_len&50" );
161200 $vld->run( $this->getPost('article'), $GLOBALS['LNG']['articleText'], "required|min_len&3|max_len&5000" );
162201 $vld->run( $this->getPost('email'), $GLOBALS['LNG']['email'], "max_len&80" );
@@ -166,7 +205,6 @@
166205 $this->postSet['errMessage'] = $GLOBALS['LNG']['postInvalid'];
167206 $this->postSet['errMsgAry'] = $vld->errMsgs;
168207 $this->createInput(2);
169- //var_dump($vld->errMsgs);
170208 return;
171209 }
172210
@@ -179,16 +217,29 @@
179217 $data = $this->getPostArticleForSQL();
180218
181219
220+ //データ加工
221+ $dh = $this->lordLib('dataHelper');
222+ $data['pwHash'] = $dh->makePasswordHash($this->getPost('password'));
223+ $data['personKey'] =
224+ $dh->makePersonKey($this->getPost('author'), $this->getPost('password'), $GLOBALS['USR']['access']['host']);
225+
226+ /*
227+ var_dump( $GLOBALS['USR']['access'] );
228+ echo "<br>";
229+ echo $this->getPost('password') ." - ". $data['pwHash'] . "<br>";
230+ echo $data['personKey'] . "<br>";
231+ exit;
232+ */
233+
182234 //var_dump($data);
183235 //exit();
184236
185-
186237 $artMdl = new Article_model();
187- if ( empty($data['article_id']) or $data['article_id']==0 ) {
238+ if ( empty($data['article_id']) ) {
188239 //Create
189240 //echo "INSERT!";
190241 $newId = $artMdl->insertArticle($data);
191-
242+ //exit;
192243 //リダイレクト
193244 $this->redirect('act=sngl&a=' . $newId);
194245
@@ -208,6 +259,8 @@
208259
209260
210261
262+
263+
211264 }
212265
213266 ?>
\ No newline at end of file
--- app/actions/base_action.php (revision 18)
+++ app/actions/base_action.php (revision 19)
@@ -15,6 +15,8 @@
1515 var $platform = ''; //pc
1616 var $skin = ''; //default
1717 var $baseSet = array();
18+ var $postSet = array();
19+ var $artlSet = array();
1820
1921 var $content = "";
2022 var $set = array();
@@ -125,16 +127,6 @@
125127 }
126128
127129
128- protected function getRequest($name, $def)
129- {
130- $req = $def;
131- if ( isset($_POST[$name]) ) {
132- $req = $_POST[$name];
133- } else if ( isset($_GET[$name]) ) {
134- $req = $_GET[$name];
135- }
136- return $req;
137- }
138130
139131
140132
@@ -147,7 +139,10 @@
147139 }
148140
149141
150-
142+ /**
143+ * POSTの画面戻し用。
144+ * 配列時の自動再帰。
145+ */
151146 protected function stripslashes_deep($value)
152147 {
153148 $value = is_array($value) ?
@@ -159,7 +154,7 @@
159154
160155
161156
162- protected function getPost($name, $def='')
157+ protected function getRequest($name, $def)
163158 {
164159 $req = $def;
165160 if ( isset($_POST[$name]) ) {
@@ -167,10 +162,29 @@
167162 } else if ( isset($_GET[$name]) ) {
168163 $req = $_GET[$name];
169164 }
165+
166+ if ( is_numeric($def) ) {
167+ if ( ! is_numeric($req) ) {
168+ $req = $def;
169+ }
170+
171+ }
172+
173+
170174 return $req;
171175 }
172176
173177
178+ protected function getPost($name, $def='')
179+ {
180+ $req = $def;
181+ if ( isset($_POST[$name]) ) {
182+ $req = $_POST[$name];
183+ }
184+ return htmlspecialchars($req);
185+ }
186+
187+
174188 protected function getPostArticleForSQL()
175189 {
176190
@@ -207,10 +221,6 @@
207221
208222 protected function redirect($target) {
209223
210-
211-//header("Location: http://127.0.0.1/epitta/7b");
212-//exit;
213-
214224 $url = $this->baseSet['linkBaseUrl'];
215225
216226 $url = DIRURL . '/' . SELFNAME . $url . $target;
--- app/models/article_model.php (revision 18)
+++ app/models/article_model.php (revision 19)
@@ -122,6 +122,9 @@
122122
123123
124124 //データ取得
125+ $fields = '*';
126+ if ( $mode==2 ) $fields = $this->mainFields;
127+
125128 $sql =
126129 " SELECT * FROM epitta_articles" .
127130 " WHERE id IN (" . $ids . ")" .
@@ -187,7 +190,7 @@
187190
188191 $sql = "SELECT * FROM epitta_articles" .
189192 " WHERE status_code<9 AND parent_id!=0 AND tree_number IN (" . $numbers . ")" .
190- " ORDER BY created_at" .$asc. ",id" . $asc . " LIMIT " . $max;
193+ " ORDER BY id" . $asc . " LIMIT " . $max;
191194
192195 //echo $sql;
193196
@@ -313,8 +316,31 @@
313316
314317
315318
319+ /**
320+ *
321+ */
322+ function getPageOfParents($treeNum) {
316323
324+ $this->openConn();
317325
326+
327+ $sql =
328+ "SELECT * FROM epitta_articles" .
329+ " WHERE status_code<9 AND tree_number=" . $treeNum;
330+
331+ //echo "$sql";
332+
333+ $rows = $this->getRecord($sql);
334+
335+
336+ $this->closeConn();
337+
338+ return $rows;
339+
340+ }
341+
342+
343+
318344 //--------------------------
319345
320346
@@ -325,20 +351,24 @@
325351 $this->openConn(2);
326352
327353
328- //tree_numberを取得
329- $sql =
330- "SELECT tree_number FROM epitta_articles" .
331- " WHERE status_code<9 AND parent_id=0 ORDER BY id DESC LIMIT 1";
354+ if ( empty($data['tree_number']) ) {
355+ //tree_numberを取得
356+ $sql =
357+ "SELECT tree_number FROM epitta_articles" .
358+ " WHERE status_code<9 AND parent_id=0 ORDER BY id DESC LIMIT 1";
332359
333- //echo "$sql";
334- $data['tree_number'] = 1;
335- $tree = $this->getRecord($sql, 1);
336- if ( ! empty($tree) ) {
337- //var_dump($tree);
338- $data['tree_number'] = $tree['tree_number'] + 1;
360+ //echo "$sql";
361+ $data['tree_number'] = 1;
362+ $tree = $this->getRecord($sql, 1);
363+ if ( ! empty($tree) ) {
364+ //var_dump($tree);
365+ $data['tree_number'] = $tree['tree_number'] + 1;
366+ }
367+
339368 }
340369
341370
371+
342372 //記事のInsert
343373 $now = $this->qt( date( "Y-m-d H:i:s", time() ) );
344374
--- app/filters/first_filter.php (revision 18)
+++ app/filters/first_filter.php (revision 19)
@@ -15,6 +15,10 @@
1515 public function __construct()
1616 {
1717
18+ //アクセス情報取得
19+ $this->setAccessInfo();
20+
21+
1822 }
1923
2024
@@ -37,8 +41,9 @@
3741 $acs['time'] = date("Y/m/d g:i:s");
3842 $acs['agent'] = $_SERVER['HTTP_USER_AGENT'];
3943 $acs['address'] = $_SERVER['REMOTE_ADDR'];
40- $acs['host'] = $_SERVER['REMOTE_HOST'];
41- $acs['referer'] = $_SERVER['HTTP_REFERER'];
44+ $acs['host'] = $_SERVER['HTTP_HOST'];
45+ $acs['referer'] = '';
46+ if ( isset($_SERVER['HTTP_REFERER']) ) $acs['referer'] = $_SERVER['HTTP_REFERER'];
4247
4348 if ( ($acs['host'] == "") or ($acs['host'] == $acs['address'])) {
4449 $acs['host'] = @gethostbyaddr($acs['address']);
@@ -88,33 +93,33 @@
8893 //OSの取得
8994 //strposなのでIF文の順番に注意
9095 $os = "";
91- if ( strpos("/Windows NT 6.1/",$acs['agent']) ) {
96+ if ( strpos("Windows NT 6.1",$acs['agent']) >= 0 ) {
9297 $os = "Windows NT 6.1";
93- } else if ( strpos("/Windows NT 6.0/",$acs['agent']) ) {
98+ } else if ( strpos("Windows NT 6.0",$acs['agent']) >= 0 ) {
9499 $os = "Windows NT 6.0";
95- } else if ( strpos("/Windows NT 5.2/",$acs['agent']) ) {
100+ } else if ( strpos("Windows NT 5.2",$acs['agent']) >= 0 ) {
96101 $os = "Windows NT 5.2";
97- } else if ( strpos("/Windows NT 5.1/",$acs['agent']) ) {
102+ } else if ( strpos("Windows NT 5.1",$acs['agent']) >= 0 ) {
98103 $os = "Windows NT 5.1";
99- } else if ( strpos("/Windows NT 5.0/",$acs['agent']) ) {
104+ } else if ( strpos("Windows NT 5.0",$acs['agent']) >= 0 ) {
100105 $os = "Windows NT 5.0";
101- } else if ( strpos("/Windows CE/",$acs['agent']) ) {
106+ } else if ( strpos("Windows CE",$acs['agent']) >= 0 ) {
102107 $os = "Windows NT CE";
103- } else if ( strpos("/Windows 9x/",$acs['agent']) ) {
108+ } else if ( strpos("Windows 9x",$acs['agent']) >= 0 ) {
104109 $os = "Windows NT 9x";
105110
106111 //
107- } else if ( strpos("/Mac OS X/",$acs['agent']) ) {
112+ } else if ( strpos("Mac OS X",$acs['agent']) >= 0 ) {
108113 $os = "Mac OS X";
109- } else if ( strpos("/Mac/",$acs['agent']) ) {
114+ } else if ( strpos("Mac",$acs['agent']) >= 0 ) {
110115 $os = "Mac";
111- } else if ( strpos("/iPhone OS/",$acs['agent']) ) {
116+ } else if ( strpos("iPhone OS",$acs['agent']) >= 0 ) {
112117 $os = "iPhone OS";
113- } else if ( strpos("/Android/",$acs['agent']) ) {
118+ } else if ( strpos("Android",$acs['agent']) >= 0 ) {
114119 $os = "Android";
115- } else if ( strpos("/CrOS/",$acs['agent']) ) {
120+ } else if ( strpos("CrOS",$acs['agent']) >= 0 ) {
116121 $os = "CrOS";
117- } else if ( strpos("/Linux/",$acs['agent']) ) {
122+ } else if ( strpos("Linux",$acs['agent']) >= 0 ) {
118123 $os = "Linux";
119124 }
120125
@@ -153,7 +158,11 @@
153158 } else { //PCっぽいもの
154159 $acs['plfm'] = "pc";
155160 $acs['platform'] = $os;
156- $acs['os'] = $os;
161+ if ( $os ) {
162+ $acs['os'] = $os;
163+ } else {
164+ $acs['os'] = "Unknown";
165+ }
157166
158167 }
159168
--- app/app_controller.php (revision 18)
+++ app/app_controller.php (revision 19)
@@ -33,8 +33,6 @@
3333 'modipt' =>array( 'act'=>'Post', 'func'=>'modifyInput' ),
3434 'modcfm' =>array( 'act'=>'Post', 'func'=>'modifyConfirm' ),
3535 'modify' =>array( 'act'=>'Post', 'func'=>'modify' ),
36- 'delcfm' =>array( 'act'=>'Post', 'func'=>'deleteConfrim' ),
37- 'delete' =>array( 'act'=>'Post', 'func'=>'delete' ),
3836
3937 );
4038
--- app/libs/mailer.php (revision 18)
+++ app/libs/mailer.php (revision 19)
@@ -1,4 +1,4 @@
1-<?php if ( ! defined('BASEPATH')) exit('Denied Access');
1+<?php if ( ! defined('BASEPATH')) exit('Denied Access');
22 /**
33 * Epitta BB
44 *
--- app/libs/styleSheet.php (revision 18)
+++ app/libs/styleSheet.php (revision 19)
@@ -1,4 +1,4 @@
1-<?php if ( ! defined('BASEPATH')) exit('Denied Access');
1+<?php if ( ! defined('BASEPATH')) exit('Denied Access');
22 /**
33 * Epitta BB
44 *
--- app/libs/validation.php (revision 18)
+++ app/libs/validation.php (revision 19)
@@ -1,4 +1,4 @@
1-<?php if ( ! defined('BASEPATH')) exit('Denied Access');
1+<?php if ( ! defined('BASEPATH')) exit('Denied Access');
22 /**
33 * Epitta BB
44 *
@@ -109,7 +109,7 @@
109109 $errFlag = true;
110110 }
111111
112- } else if ( $odr == "alpha_dash" ) {
112+ } else if ( $odr == "alpha_plus" ) {
113113 //英数字・アンダーバー・ハイフン
114114 if ( ! $this->alpha_plus($value) ) {
115115 array_push( $this->errMsgs, $name . $this->getMessage("006") );
@@ -328,7 +328,7 @@
328328 function alpha_plus($str)
329329 {
330330 if ( empty($str) ) return true;
331- return ( ! preg_match("/^([-a-z0-9_-])+$/i", $str)) ? false : true;
331+ return ( ! preg_match("/^([a-zA-Z0-9_-])+$/i", $str)) ? false : true;
332332 }
333333
334334 /**
--- app/libs/antispam.php (revision 18)
+++ app/libs/antispam.php (revision 19)
@@ -1,4 +1,4 @@
1-<?php if ( ! defined('BASEPATH')) exit('Denied Access');
1+<?php if ( ! defined('BASEPATH')) exit('Denied Access');
22 /**
33 * Epitta BB
44 *
--- app/libs/platform.php (revision 18)
+++ app/libs/platform.php (revision 19)
@@ -1,4 +1,4 @@
1-<?php if ( ! defined('BASEPATH')) exit('Denied Access');
1+<?php if ( ! defined('BASEPATH')) exit('Denied Access');
22 /**
33 * Epitta BB
44 *
--- system/epitta_config.php (revision 18)
+++ system/epitta_config.php (revision 19)
@@ -60,7 +60,11 @@
6060 session_cache_expire(0);
6161 */
6262
63+//
64+session_cache_limiter('private_no_expire');
6365
66+
67+
6468 //
6569 //mb_regex_encoding('UTF-8');
6670
--- system/epitta_core.php (revision 18)
+++ system/epitta_core.php (revision 19)
@@ -42,8 +42,6 @@
4242 $this->init();
4343
4444
45-
46-
4745 //前フィルター
4846 require_once( APPPATH . '/filters/first_filter.php');
4947 $fstflt = new First_Filter();
@@ -56,7 +54,7 @@
5654
5755 //後フィルター
5856 require_once( APPPATH . '/filters/late_filter.php');
59- $fstflt = new First_Filter();
57+ $ltflt = new Late_Filter();
6058
6159
6260 //アクション
--- system/locals/ja/wordlist.php (revision 18)
+++ system/locals/ja/wordlist.php (revision 19)
@@ -53,16 +53,29 @@
5353 'submitKey' => '投稿キーワード',
5454 'submitButton' => ' 投 稿 ',
5555
56+'responseTo' => '返信対象',
5657
57-'previous' => '前へ',
58-'next' => '次へ',
59-'setup' => 'セットアップ',
58+'articleUnitName' => 'Page',
59+'treeUnitName' => 'Tree',
60+'threadUnitName' => 'Thread',
61+'topicUnitName' => 'Topic',
62+'previous' => 'Prev',
63+'next' => 'Next',
64+'setup' => 'セットアップ',
6065
6166
62-'preview' => 'プレビュー',
63-'postInvalid' => '入力に不備があります',
67+'articleSetButton' => '記事',
68+'pageSetButton' => 'ページ',
6469
70+'preview' => 'プレビュー',
6571
72+
73+'displayThreadsAll' => 'スレッドの全記事を表示',
74+
75+
76+'postInvalid' => '入力に不備があります',
77+
78+
6679 );
6780
6881
--- data/default/base.css (revision 18)
+++ data/default/base.css (revision 19)
@@ -80,7 +80,7 @@
8080
8181 div.menubar {
8282 background-color:#ccddff;
83- margin: 10px 1px;
83+ margin: 1px 1px;
8484 padding: 1px 4px;
8585 clear:both;
8686 }
@@ -158,6 +158,12 @@
158158
159159 }
160160
161+
162+div.topicFrame table {
163+ width: 100%;
164+
165+}
166+
161167 /* articleInput */
162168 div.inputForm {
163169
--- views/pc/default/topic.php (revision 18)
+++ views/pc/default/topic.php (revision 19)
@@ -7,7 +7,7 @@
77 <div class="topicFrame">
88 <table border="1" cellspacing=0>
99 <tr>
10-<th>&nbsp;</th><th>トピック</th><th>投稿者</th><th>返信</th><th>最新記事</th>
10+<th>No</th><th>トピック</th><th>投稿者</th><th>返信</th><th>最新記事</th>
1111 </tr>
1212 HTML;
1313
@@ -23,8 +23,8 @@
2323 $myContent = '';
2424 $myContent .=<<< HTML
2525 <tr>
26-<td>
27-[TR:{$art['tree_number']}:{$art['id']}]
26+<td width="40px">
27+<div class="ctr">{$art['tree_number']}<!--<br />No.{$art['id']}--></div>
2828 </td>
2929 <td>
3030 <div style="border:1px solid #678;">
@@ -32,7 +32,7 @@
3232 </div>
3333 </td>
3434 <td>{$art['author']}</td>
35-<td>{$art['res']}</td>
35+<td width="50px" class="ctr">{$art['res']}</td>
3636 <td>
3737 HTML;
3838
--- views/pc/default/tree.php (revision 18)
+++ views/pc/default/tree.php (revision 19)
@@ -7,7 +7,7 @@
77 $myContent .=<<< HTML
88 <div class="tree">
99 <div style="border:1px solid #678;">
10- <a href="?act=trsgl&t={$art['tree_number']}">[TR:{$art['tree_number']}:{$art['id']}]</>:<a href="?act=sngl&a={$art['id']}">{$art['subject']}</a>&nbsp;{$art['author']}&nbsp;{$art['created_at']}
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']}
1111 </div>
1212 </div>
1313
@@ -22,7 +22,7 @@
2222 $myContent = '';
2323 $myContent .=<<< HTML
2424 <div style="border:1px solid #678;">
25- {$twig}[TR:{$art['tree_number']}:【{$art['id']}】][pid:{$art['parent_id']}]:{$art['subject']}&nbsp;{$art['author']}&nbsp;{$art['created_at']}
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']}
2626 </div>
2727 HTML;
2828
--- views/pc/default/article_input.php (revision 18)
+++ views/pc/default/article_input.php (revision 19)
@@ -11,6 +11,7 @@
1111 $kword = makeKeyword($postSet['keyword_on'], $postSet['keyword_q'], $postSet['keyword_a']);
1212 $prev = makePreview($postSet['preview']);
1313 $err = makeError($postSet['errMessage'], $postSet['errMsgAry']);
14+ $prnt = makeResponseTo($postSet['resto']);
1415
1516
1617 $myContent = '';
@@ -108,6 +109,9 @@
108109 </table>
109110
110111 </div>
112+
113+{$prnt}
114+
111115 </div>
112116 HTML;
113117
@@ -133,6 +137,21 @@
133137 }
134138
135139
140+function makeResponseTo($resTo) {
141+ if (! $resTo) return '';
142+
143+ $myContent = '';
144+$myContent .=<<< HTML
145+ <div class="responseTo">
146+ <div class="responseToTitle">【{$GLOBALS['LNG']['responseTo']}】</div>
147+ {$resTo}
148+ </div>
149+HTML;
150+
151+ return $myContent;
152+}
153+
154+
136155 function makeError($msg, $msgAry) {
137156 if (! $msg) return '';
138157
--- views/pc/default/article.php (revision 18)
+++ views/pc/default/article.php (revision 19)
@@ -19,8 +19,12 @@
1919 {$clipfiles}
2020
2121 <br />
22-<form class="button res">
23-<input type="submit" value="返信" class="resBtn" />
22+<form method="post" action="{$baseSet['script']}?act=crtipt" class="button res">
23+ <input name="id" type="hidden" value="{$baseSet['id']}" />
24+ <input name="plfm" type="hidden" value="{$baseSet['plfm']}" />
25+ <input name="tree_number" type="hidden" value="{$art['tree_number']}" />
26+ <input name="parent_id" type="hidden" value="{$art['id']}" />
27+ <input type="submit" value="返信" class="resBtn" />
2428 </form>
2529
2630 {$editBtn}
@@ -158,10 +162,10 @@
158162
159163 $myContent .=<<< HTML
160164 <form class="button edit">
161-<input type="hidden" name="id" value="" />
162-<input type="hidden" name="plfm" value="" />
163-<input type="hidden" name="article_id" value="" />
164-<input type="hidden" name="act" value="" />
165+<input type="hidden" name="id" value="$id" />
166+<input type="hidden" name="plfm" value="$plfm" />
167+<input type="hidden" name="article_id" value="$articleId" />
168+<input type="hidden" name="act" value="modipt" />
165169 <input type="submit" value="編集" class="button" />
166170 </form>
167171 HTML;
@@ -170,10 +174,10 @@
170174
171175 $myContent .=<<< HTML
172176 <form class="button edit">
173-<input type="hidden" name="id" value="" />
174-<input type="hidden" name="plfm" value="" />
175-<input type="hidden" name="article_id" value="" />
176-<input type="hidden" name="act" value="" />
177+<input type="hidden" name="id" value="$id" />
178+<input type="hidden" name="plfm" value="$plfm" />
179+<input type="hidden" name="article_id" value="$articleId" />
180+<input type="hidden" name="act" value="modipt" />
177181 <input type="submit" value="追記" class="button" />
178182 </form>
179183 HTML;
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
--- views/pc/default/base_layout.php (revision 18)
+++ views/pc/default/base_layout.php (revision 19)
@@ -28,9 +28,7 @@
2828
2929 <div>
3030 <?php
31-if ($this->set['pager']==1) {
32- echo makePageGuide($this->page, $this->unit, $this->set['total'], $this->baseSet);
33-}
31+echo makePageGuide($this->page, $this->artlSet, $this->baseSet);
3432 ?>
3533 </div>
3634
@@ -46,9 +44,7 @@
4644
4745 <div>
4846 <?php
49-if ($this->set['pager']==1) {
50- echo makePagenation($this->page, $this->unit, $this->set['total'], $this->baseSet);
51-}
47+echo makePagenation($this->page, $this->artlSet, $this->baseSet);
5248 ?>
5349 </div>
5450
--- views/pc/default/thread.php (revision 18)
+++ views/pc/default/thread.php (revision 19)
@@ -104,12 +104,22 @@
104104 }
105105
106106
107-function getThreadFootHtml() {
107+function getThreadFootHtml($treeNum, $baseSet, $mode=1) {
108108
109109 $content =<<< HTML
110110 </div>
111111 HTML;
112112
113+if ( $mode == 1 ) {
114+$content .=<<< HTML
115+<div><a href="{$baseSet['linkBaseUrl']}&act=thsgl&t=$treeNum">{$GLOBALS['LNG']['displayThreadsAll']}</a></div>
116+HTML;
117+}
118+
119+$content .=<<< HTML
120+<br />
121+HTML;
122+
113123 return $content;
114124
115125 }
Show on old repository browser