スレッドの引っ越し

このコミットが含まれているのは:
テクニカル諏訪子 2019-02-26 18:25:41 +09:00
コミット 1c13ea6b36
2個のファイルの変更22行の追加55行の削除

ファイルの表示

@ -603,7 +603,7 @@ class BoardController extends Controller {
return array(
'tid' => ($tid ? $tid->tid : 0),
'uid' => ($tid ? $tid->uid : 0),
'date' => ($tid ? strftime('%Y/%m/%d(%a) %H:%M:%S %Z', date($tid->date)) : 'まだ')
'date' => ($tid ? strftime('%Y/%m/%d(%a) %H:%M:%S %Z', $tid->date) : 'まだ')
);
}
@ -1023,61 +1023,28 @@ class BoardController extends Controller {
$valid = $this->objAuth->getPermissions($request->username, $request->password);
if ($valid['for_move'] == 1) {
DB::table('for_forums')
->where('id', $request->old_id)
->decrement('threads', 1);
DB::table('for_forums')
->where('id', $request->old_id)
->decrement('posts', 1);
DB::table('for_forums')
->where('id', $request->new_id)
->increment('threads', 1);
DB::table('for_forums')
->where('id', $request->new_id)
->increment('posts', 1);
$getLastTopic = DB::table('for_threads')
->select('last_date', 'last_uid')
->where('for_id', $request->old_id)
->orderBy('last_date', 'desc')
->offset(1)
->limit(1)
->get();
$getCurrentTopic = DB::table('for_threads')
->select('last_date', 'last_uid')
->where('for_id', $request->old_id)
->orderBy('last_date', 'desc')
->offset(0)
->limit(1)
->get();
// Old forum.
DB::table('for_forums')
->where('id', $request->old_id)
->update([
'last_uid' => $getLastTopic[0]->last_uid,
'last_date' => $getLastTopic[0]->last_date
]);
DB::table('for_threads')
$res = DB::table('for_threads')
->where('id', $request->id)
->update([
'for_id' => $request->new_id
]);
// New forum.
DB::table('for_forums')
$for = DB::table('for_forums')
->select('title', 'cat_id')
->where('id', $request->new_id)
->update([
'last_uid' => $getCurrentTopic[0]->last_uid,
'last_date' => $getCurrentTopic[0]->last_date
]);
->first();
return 'Success';
$cat = DB::table('for_category')
->select('title')
->where('id', $for->cat_id)
->first();
return array([
'fid' => $request->new_id,
'ftit' => $for->title,
'cid' => $for->cat_id,
'ctit' => $cat->title
]);
}
else {
return 'Permission denied.';
@ -1557,8 +1524,8 @@ class BoardController extends Controller {
't_title' => $t->title,
't_replies' => $replysuu,
't_views' => $t->views,
't_first_date' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', date($userFD)),
't_last_date' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', date($userLD)),
't_first_date' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', $userFD),
't_last_date' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', $userLD),
't_sticky' => $t->sticky,
't_lock' => $t->lock,
't_poll' => $t->poll,
@ -1826,11 +1793,11 @@ class BoardController extends Controller {
'id' => $i->id,
'tid' => $i->top_id,
'uid' => $i->user_id,
'post_date' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', date($i->post_date)),
'post_date' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', $i->post_date),
'message' => $mess,
'delete' => $i->delete,
'delreason' => $i->delreason,
'lastedit' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', date($i->lastedit)),
'lastedit' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', $i->lastedit),
'lasteditUnix' => $i->lastedit,
'ipaddress' => $i->ipaddress,
'nolayout' => $i->nolayout,

ファイルの表示

@ -659,7 +659,7 @@ class UserController extends Controller {
'avatar' => ($user[0]->avatar != '' ? $user[0]->avatar : 'assets/avatars/haznoavaz.png'),
'col' => $showCol,
'message' => $g->message,
'postdate' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', date($g->postdate)),
'postdate' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', $g->postdate),
'isEdit' => $g->isEdit,
'isDel' => $g->isDel
);
@ -727,7 +727,7 @@ class UserController extends Controller {
'avatar' => ($user[0]->avatar != '' ? $user[0]->avatar : 'assets/avatars/haznoavaz.png'),
'col' => $showCol,
'message' => $g->message,
'postdate' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', date($g->postdate)),
'postdate' => strftime('%Y/%m/%d(%a) %H:%M:%S %Z', $g->postdate),
'isEdit' => $g->isEdit,
'isDel' => $g->isDel
);