-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with the DisplayLastPost extension by Aurelienazerty #14
base: master
Are you sure you want to change the base?
Conversation
Quick modification for made works with DisplayLastPost extension https://www.phpbb.com/customise/db/extension/displaylastpost/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor code style issues, and please add a check for your config value display_last_post_show
, otherwise the numbers are off if your extension's setting is set to no
.
@@ -67,14 +71,16 @@ class listener implements EventSubscriberInterface | |||
* @param template $template | |||
* @param db_interface $db | |||
* @param FirstPostOnEveryPage $firstPostOnEveryPage | |||
* @param DisplayLastPost $displayLastPost |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use tabs here to fix alignment.
@@ -83,6 +89,7 @@ public function __construct( | |||
$this->template = $template; | |||
$this->db = $db; | |||
$this->firstPostOnEveryPage = $firstPostOnEveryPage; | |||
$this->displayLastPost = $displayLastPost; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a tab here to fix alignment.
return $this->first_post_num + ($is_ascending ? +$this->offset++ : -$this->offset++); | ||
$return = $this->first_post_num + ($is_ascending ? +$this->offset++ : -$this->offset++); | ||
|
||
if ($this->displayLastPost !== null && $start) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please move the {
to a new line.
@@ -319,7 +326,13 @@ protected function get_post_number($default_sort_by, $default_sort_dir, $default | |||
$this->offset = $is_ascending ? 1 : 0; | |||
} | |||
|
|||
return $this->first_post_num + ($is_ascending ? +$this->offset++ : -$this->offset++); | |||
$return = $this->first_post_num + ($is_ascending ? +$this->offset++ : -$this->offset++); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the tabs on this empty line, same on line 334.
New comit |
Could you also fix the formatting issues that I commented? |
Quick modification for made works with DisplayLastPost extension
https://www.phpbb.com/customise/db/extension/displaylastpost/