Skip to content

Commit 08727d9

Browse files
committed
Twig final
1 parent 8aa37dd commit 08727d9

File tree

107 files changed

+337
-8232
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+337
-8232
lines changed

featherbb/Controller/Admin/Maintenance.php

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,28 @@ public function display($req, $res, $args)
3535
$action = Input::query('action');
3636
}
3737

38+
AdminUtils::generateAdminMenu('maintenance');
39+
3840
if ($action == 'rebuild') {
3941
$this->model->rebuild();
4042

43+
$queryStr = $this->model->getQueryString();
44+
4145
View::setPageInfo([
4246
'page_title' => [Utils::escape(ForumSettings::get('o_board_title')), __('Rebuilding search index')],
43-
'query_str' => $this->model->getQueryString()
47+
'query_str' => $queryStr['str'],
48+
'id' => $queryStr['id'],
49+
'active_page' => 'admin',
50+
'admin_console' => true,
51+
'link' => '<a href="'. Router::pathFor('adminMaintenance').$queryStr['str'].'">'.__('Click here').'</a>'
4452
]
4553
)->addTemplate('@forum/admin/maintenance/rebuild')->display();
4654
}
4755

48-
if ($action == 'prune') {
56+
else if ($action == 'prune') {
4957
$pruneFrom = Utils::trim(Input::post('prune_from'));
5058
$pruneSticky = intval(Input::post('prune_sticky'));
5159

52-
AdminUtils::generateAdminMenu('maintenance');
53-
5460
if (Input::post('prune_comply')) {
5561
$this->model->pruneComply($pruneFrom, $pruneSticky);
5662
}
@@ -66,15 +72,15 @@ public function display($req, $res, $args)
6672
)->addTemplate('@forum/admin/maintenance/prune')->display();
6773
}
6874

69-
AdminUtils::generateAdminMenu('maintenance');
70-
71-
View::setPageInfo([
72-
'title' => [Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Maintenance')],
73-
'active_page' => 'admin',
74-
'admin_console' => true,
75-
'first_id' => $this->model->getFirstId(),
76-
'categories' => $this->model->getCategories(),
77-
]
78-
)->addTemplate('@forum/admin/maintenance/admin_maintenance')->display();
75+
else {
76+
View::setPageInfo([
77+
'title' => [Utils::escape(ForumSettings::get('o_board_title')), __('Admin'), __('Maintenance')],
78+
'active_page' => 'admin',
79+
'admin_console' => true,
80+
'first_id' => $this->model->getFirstId(),
81+
'categories' => $this->model->getCategories(),
82+
]
83+
)->addTemplate('@forum/admin/maintenance/admin_maintenance')->display();
84+
}
7985
}
8086
}

featherbb/Controller/Admin/Statistics.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ public function display($req, $res, $args)
3838
'total_size' => $total['size'],
3939
'total_records' => $total['records'],
4040
'php_accelerator' => $this->model->phpAccelerator(),
41+
'php_os' => PHP_OS,
42+
'php_version' => phpversion(),
4143
]
4244
)->addTemplate('@forum/admin/statistics')->display();
4345
}

featherbb/Controller/Post.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public function newPost($req, $res, $args)
127127
if (!User::get()->is_guest) {
128128
$this->model->incrementPostCount($post, $new['tid']);
129129
}
130-
// return var_dump($post, $new);
131130

132131
return Router::redirect(Router::pathFor('viewPost', ['id' => $new['tid'], 'name' => $new['topic_subject'], 'pid' => $new['pid']]).'#p'.$new['pid'], __('Post redirect'));
133132
}
@@ -174,6 +173,13 @@ public function newPost($req, $res, $args)
174173
$postData = '';
175174
}
176175

176+
if (Input::post('preview')) {
177+
$previewMessage = Container::get('parser')->parseMessage($post['message'], $post['hide_smilies']);
178+
$previewMessage = Container::get('hooks')->fire('controller.post.edit.preview', $previewMessage);
179+
} else {
180+
$previewMessage = '';
181+
}
182+
177183
return View::setPageInfo([
178184
'title' => [Utils::escape(ForumSettings::get('o_board_title')), $action],
179185
'active_page' => 'post',
@@ -187,6 +193,7 @@ public function newPost($req, $res, $args)
187193
'action' => $action,
188194
'form' => $form,
189195
'post_data' => $postData,
196+
'preview_message' => $previewMessage,
190197
'url_forum' => $urlForum,
191198
'url_topic' => $urlTopic,
192199
'quote' => $quote,

featherbb/Core/AutoUpdater.php

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php namespace FeatherBB\Core;
1+
<?php
2+
3+
namespace FeatherBB\Core;
24

35
/**
46
* Copyright (C) 2015-2017 FeatherBB
@@ -819,55 +821,6 @@ public function update($simulateInstall = true, $deleteDownload = true)
819821

820822
return true;
821823
}
822-
823-
/**
824-
* Bulk cURL requests
825-
*
826-
* @param array $urls URLs to connect to
827-
*
828-
* @return array Array of [url => body content]
829-
*/
830-
// protected function _bulkRequests($urls = array())
831-
// {
832-
// $multi = curl_multi_init();
833-
// $channels = array();
834-
// // Loop through the URLs so request, create curl-handles,
835-
// // attach the handle to our multi-request
836-
// foreach ($urls as $url) {
837-
// $ch = curl_init();
838-
// curl_setopt($ch, CURLOPT_URL, $url);
839-
// curl_setopt($ch, CURLOPT_HEADER, false);
840-
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
841-
// curl_multi_add_handle($multi, $ch);
842-
// $channels[$url] = $ch;
843-
// }
844-
// // While we're still active, execute curl
845-
// $active = null;
846-
// do {
847-
// $mrc = curl_multi_exec($multi, $active);
848-
// } while ($mrc == CURLM_CALL_MULTI_PERFORM);
849-
// while ($active && $mrc == CURLM_OK) {
850-
// // Wait for activity on any curl-connection
851-
// if (curl_multi_select($multi) == -1) {
852-
// continue;
853-
// }
854-
// // Continue to exec until curl is ready to
855-
// // give us more data
856-
// do {
857-
// $mrc = curl_multi_exec($multi, $active);
858-
// } while ($mrc == CURLM_CALL_MULTI_PERFORM);
859-
// }
860-
// // Loop through the channels and retrieve the received
861-
// // content, then remove the handle from the multi-handle
862-
// $results = array();
863-
// foreach ($channels as $url => $channel) {
864-
// $results[$url] = curl_multi_getcontent($channel);
865-
// curl_multi_remove_handle($multi, $channel);
866-
// }
867-
// // Close the multi-handle and return our results
868-
// curl_multi_close($multi);
869-
// return $results;
870-
// }
871824
}
872825

873826
class PluginAutoUpdater extends AutoUpdater
@@ -884,16 +837,3 @@ public function __construct($plugin)
884837
}
885838
}
886839

887-
class CoreAutoUpdater extends AutoUpdater
888-
{
889-
public function __construct()
890-
{
891-
// Construct parent class
892-
parent::__construct(getcwd().'/temp', getcwd());
893-
894-
// Set plugin informations
895-
$this->setRootFolder('featherbb');
896-
$this->setCurrentVersion(ForumEnv::get('FORUM_VERSION'));
897-
$this->setUpdateUrl('https://api.github.com/repos/featherbb/featherbb/releases');
898-
}
899-
}

featherbb/Core/CoreAutoUpdater.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* Copyright (C) 2015-2017 FeatherBB
4+
* based on code by (C) 2008-2015 FluxBB
5+
* and Rickard Andersson (C) 2002-2008 PunBB
6+
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher
7+
*/
8+
9+
namespace FeatherBB\Core;
10+
11+
class CoreAutoUpdater extends AutoUpdater
12+
{
13+
public function __construct()
14+
{
15+
// Construct parent class
16+
parent::__construct(getcwd().'/temp', getcwd());
17+
18+
// Set plugin informations
19+
$this->setRootFolder('featherbb');
20+
$this->setCurrentVersion(ForumEnv::get('FORUM_VERSION'));
21+
$this->setUpdateUrl('https://api.github.com/repos/featherbb/featherbb/releases');
22+
}
23+
}

featherbb/Core/Plugin.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public function setActivePlugins()
3838
public function loadPlugins()
3939
{
4040
$activePlugins = $this->getActivePlugins();
41-
// var_dump($activePlugins);
4241

4342
foreach ($activePlugins as $plugin) {
4443
if ($class = $this->load($plugin)) {

featherbb/Core/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/**
4-
* Copyright (C) 2015-2016 FeatherBB
4+
* Copyright (C) 2015-2017 FeatherBB
55
* based on code by (C) 2008-2015 FluxBB
66
* and Rickard Andersson (C) 2002-2008 PunBB
77
* License: http://www.gnu.org/licenses/gpl.html GPL version 2 or higher

featherbb/Model/Admin/Maintenance.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function rebuild()
5555

5656
public function getQueryString()
5757
{
58-
$queryStr = '';
58+
$queryStr = [];
5959

6060
$perPage = Input::query('i_per_page') ? intval(Input::query('i_per_page')) : 0;
6161
$perPage = Container::get('hooks')->fire('model.admin.maintenance.get_query_str.per_page', $perPage);
@@ -76,7 +76,7 @@ public function getQueryString()
7676

7777
$endAt = 0;
7878
foreach ($result as $curItem) {
79-
echo '<p><span>'.sprintf(__('Processing post'), $curItem['id']).'</span></p>'."\n";
79+
$queryStr['id'] = $curItem['id'];
8080

8181
if ($curItem['id'] == $curItem['first_post_id']) {
8282
$this->search->updateSearchIndex('post', $curItem['id'], $curItem['message'], $curItem['subject']);
@@ -94,7 +94,7 @@ public function getQueryString()
9494
->findOneCol('id');
9595

9696
if ($id) {
97-
$queryStr = '?action=rebuild&i_per_page='.$perPage.'&i_start_at='.intval($id);
97+
$queryStr['str'] = '?action=rebuild&i_per_page='.$perPage.'&i_start_at='.intval($id);
9898
}
9999
}
100100

featherbb/Model/Post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function getInfoPost($tid, $fid)
3434
->selectMany($curPosting['select'])
3535
->innerJoin('forums', ['f.id', '=', 't.forum_id'], 'f')
3636
->leftOuterJoin('forum_perms', 'fp.forum_id=f.id AND fp.group_id='.User::get()->g_id, 'fp')
37-
->leftOuterJoin('topic_subscriptions', 't.id=s.topic_id AND s.user_id='.User::get()->g_id, 's')
37+
->leftOuterJoin('topic_subscriptions', 't.id=s.topic_id AND s.user_id='.User::get()->id, 's')
3838
->whereAnyIs($curPosting['where'])
3939
->where('t.id', $tid);
4040
} else {

featherbb/View/admin/bans/add_ban.php

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)