diff --git a/root/composer.json b/root/composer.json
index 20328ff0..772e0316 100644
--- a/root/composer.json
+++ b/root/composer.json
@@ -1,6 +1,6 @@
{
"name": "board3/portal",
- "type": "phpbb3-extension",
+ "type": "phpbb-extension",
"description": "Adds a portal with several blocks to your forum. You can change the settings, move the blocks, add new blocks and more in the ACP.",
"homepage": "http://www.board3.de",
"version": "2.1.0-dev",
@@ -47,7 +47,7 @@
}],
"require": {
"php": ">=5.2",
- "phpbb": "3.1.0-dev"
+ "phpbb/phpbb": "3.1.0-dev"
},
"extra": {
"display-name": "Board3 Portal"
diff --git a/root/config/services.yml b/root/config/services.yml
index e1cd809a..c686da1e 100644
--- a/root/config/services.yml
+++ b/root/config/services.yml
@@ -1,11 +1,12 @@
services:
board3.portal.main:
- class: phpbb_ext_board3_portal_controller_main
+ class: \board3\portal\controller\main
arguments:
- @auth
- @config
- @template
- @user
+ - @path_helper
- %core.root_path%
- .%core.php_ext%
diff --git a/root/controller/main.php b/root/controller/main.php
index 2a2c3213..f5685b38 100644
--- a/root/controller/main.php
+++ b/root/controller/main.php
@@ -7,7 +7,9 @@
*
*/
-class phpbb_ext_board3_portal_controller_main
+namespace board3\portal\controller;
+
+class main
{
/**
* Auth object
@@ -57,6 +59,12 @@ class phpbb_ext_board3_portal_controller_main
*/
private $includes_path;
+ /**
+ * phpBB path helper
+ * @var \phpbb\path_helper
+ */
+ protected $path_helper;
+
/**
* Constructor
* NOTE: The parameters of this method must match in order and type with
@@ -65,10 +73,11 @@ class phpbb_ext_board3_portal_controller_main
* @param phpbb_config_db $config phpBB Config object
* @param phpbb_template $template Template object
* @param phpbb_user $user User object
+ * @param \phpbb\path_helper $path_helper phpBB path helper
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP file extension
*/
- public function __construct($auth, $config, $template, $user, $phpbb_root_path, $php_ext)
+ public function __construct($auth, $config, $template, $user, $path_helper, $phpbb_root_path, $php_ext)
{
global $portal_root_path;
@@ -76,6 +85,7 @@ class phpbb_ext_board3_portal_controller_main
$this->config = $config;
$this->template = $template;
$this->user = $user;
+ $this->path_helper = $path_helper;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->includes_path = $phpbb_root_path . 'ext/board3/portal/portal/';
@@ -90,21 +100,21 @@ class phpbb_ext_board3_portal_controller_main
}
}
- /**
- * Extension front handler method. This is called automatically when your extension is accessed
- * through index.php?ext=example/foobar
- * @return null
- */
- public function handle()
- {
+ /**
+ * Extension front handler method. This is called automatically when your extension is accessed
+ * through index.php?ext=example/foobar
+ * @return null
+ */
+ public function handle()
+ {
$this->check_permission();
- // We defined the phpBB objects in __construct() and can use them in the rest of our class like this
- //echo 'Welcome, ' . $this->user->data['username'];
+ // We defined the phpBB objects in __construct() and can use them in the rest of our class like this
+ //echo 'Welcome, ' . $this->user->data['username'];
- // The following takes two arguments:
- // 1) which extension language folder we're using (it's not smart enough to use its own automatically)
- // 2) what language file to use
- $this->user->add_lang_ext('board3/portal', 'mods/portal');
+ // The following takes two arguments:
+ // 1) which extension language folder we're using (it's not smart enough to use its own automatically)
+ // 2) what language file to use
+ $this->user->add_lang_ext('board3/portal', 'mods/portal');
/**
* get initial data
@@ -199,7 +209,7 @@ class phpbb_ext_board3_portal_controller_main
{
$this->template->assign_block_vars('modules_' . column_num_string($row['module_column']), array(
'TEMPLATE_FILE' => 'portal/modules/' . $template_module['template'],
- 'IMAGE_SRC' => $this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $template_module['image_src'],
+ 'IMAGE_SRC' => $this->path_helper->get_web_root_path() . $this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $template_module['image_src'],
'TITLE' => $template_module['title'],
'CODE' => $template_module['code'],
'MODULE_ID' => $row['module_id'],
@@ -211,7 +221,7 @@ class phpbb_ext_board3_portal_controller_main
{
$this->template->assign_block_vars('modules_' . column_num_string($row['module_column']), array(
'TEMPLATE_FILE' => 'portal/modules/' . $template_module,
- 'IMAGE_SRC' => $this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $row['module_image_src'],
+ 'IMAGE_SRC' => $this->path_helper->get_web_root_path() . $this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/images/portal/' . $row['module_image_src'],
'IMAGE_WIDTH' => $row['module_image_width'],
'IMAGE_HEIGHT' => $row['module_image_height'],
'MODULE_ID' => $row['module_id'],
@@ -240,19 +250,19 @@ class phpbb_ext_board3_portal_controller_main
'S_BOTTOM_COLUMN' => ($module_count['bottom'] > 0) ? true : false,
'S_DISPLAY_PHPBB_MENU' => $this->config['board3_phpbb_menu'],
'B3P_DISPLAY_JUMPBOX' => $this->config['board3_display_jumpbox'],
- 'T_EXT_THEME_PATH' => $this->phpbb_root_path . 'ext/board3/portal/styles/' . $this->user->style['style_path'] . '/theme/',
+ 'T_EXT_THEME_PATH' => $this->path_helper->get_web_root_path() . $this->root_path . 'styles/' . $this->user->style['style_path'] . '/theme/',
));
- // And now to output the page.
- page_header($this->user->lang('PORTAL'));
+ // And now to output the page.
+ page_header($this->user->lang('PORTAL'));
- // foobar_body.html is in ./ext/foobar/example/styles/prosilver/template/foobar_body.html
- $this->template->set_filenames(array(
- 'body' => 'portal/portal_body.html'
- ));
+ // foobar_body.html is in ./ext/foobar/example/styles/prosilver/template/foobar_body.html
+ $this->template->set_filenames(array(
+ 'body' => 'portal/portal_body.html'
+ ));
- page_footer();
- }
+ page_footer();
+ }
// check if user should be able to access this page
private function check_permission()
diff --git a/root/ext.php b/root/ext.php
index 4b5fd6f1..3cc7397e 100644
--- a/root/ext.php
+++ b/root/ext.php
@@ -4,6 +4,8 @@
// however you can override the default methods and add custom
// installation logic
-class phpbb_ext_board3_portal_ext extends phpbb_extension_base
+namespace board3\portal;
+
+class ext extends \phpbb\extension\base
{
}
diff --git a/root/migrations/210_beta1.php b/root/migrations/v210_beta1.php
similarity index 99%
rename from root/migrations/210_beta1.php
rename to root/migrations/v210_beta1.php
index 34b72e42..f8a50357 100644
--- a/root/migrations/210_beta1.php
+++ b/root/migrations/v210_beta1.php
@@ -7,7 +7,9 @@
*
*/
-class phpbb_ext_board3_portal_migrations_210_beta1 extends phpbb_db_migration
+namespace board3\portal\migrations;
+
+class v210_beta1 extends \phpbb\db\migration\migration
{
/**
* Portal config table
@@ -22,7 +24,7 @@ class phpbb_ext_board3_portal_migrations_210_beta1 extends phpbb_db_migration
static public function depends_on()
{
- return array('phpbb_db_migration_data_310_extensions');
+ return array('\phpbb\db\migration\data\v310\extensions');
}
public function update_schema()
diff --git a/root/portal/modules/portal_calendar.php b/root/portal/modules/portal_calendar.php
index f45fd61b..f885e3a3 100644
--- a/root/portal/modules/portal_calendar.php
+++ b/root/portal/modules/portal_calendar.php
@@ -110,8 +110,8 @@ class portal_calendar_module
// output our general calendar bits
$down = $this->mini_cal_month - 1;
$up = $this->mini_cal_month + 1;
- $prev_month = '
';
- $next_month = '
';
+ $prev_month = '
';
+ $next_month = '
';
$template->assign_block_vars('minical', array(
'S_SUNDAY_FIRST' => ($config['board3_sunday_first_' . $module_id]) ? true : false,
@@ -591,11 +591,6 @@ class portal_calendar_module
**/
private function makeTimestamp($date)
{
-<<<<<<< HEAD
-=======
- global $user;
-
->>>>>>> 36903cb... Display correct day of the week with negative UTC offset
$this->stamp = strtotime($date);
return ($this->stamp);
}
diff --git a/root/portal/modules/portal_poll.php b/root/portal/modules/portal_poll.php
index db70d5ed..2fe95581 100644
--- a/root/portal/modules/portal_poll.php
+++ b/root/portal/modules/portal_poll.php
@@ -348,7 +348,7 @@ class portal_poll_module
$sql = 'SELECT t.poll_title, t.poll_start, t.topic_id, t.topic_first_post_id, t.forum_id, t.poll_length, t.poll_vote_change, t.poll_max_options, t.topic_status, f.forum_status, p.bbcode_bitfield, p.bbcode_uid
FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p, ' . FORUMS_TABLE . " f
- WHERE t.forum_id = f.forum_id AND t.topic_approved = 1 AND t.poll_start > 0
+ WHERE t.forum_id = f.forum_id AND t.topic_visibility = 1 AND t.poll_start > 0
{$where}
AND t.topic_moved_id = 0
AND p.post_id = t.topic_first_post_id
diff --git a/root/styles/prosilver/template/event/overall_header_head_append.html b/root/styles/prosilver/template/event/overall_header_head_append.html
index 2ca0ca1f..dfb983a1 100755
--- a/root/styles/prosilver/template/event/overall_header_head_append.html
+++ b/root/styles/prosilver/template/event/overall_header_head_append.html
@@ -1 +1 @@
-
+
diff --git a/root/styles/prosilver/template/portal/_block_config.html b/root/styles/prosilver/template/portal/_block_config.html
index c14b14ba..c87b8ea9 100644
--- a/root/styles/prosilver/template/portal/_block_config.html
+++ b/root/styles/prosilver/template/portal/_block_config.html
@@ -1,6 +1,6 @@
-
+
diff --git a/root/styles/prosilver/template/portal/modules/news_compact_center.html b/root/styles/prosilver/template/portal/modules/news_compact_center.html
index ed3125be..448af991 100644
--- a/root/styles/prosilver/template/portal/modules/news_compact_center.html
+++ b/root/styles/prosilver/template/portal/modules/news_compact_center.html
@@ -10,10 +10,10 @@
{$CC_BLOCK_H_L}
-