Skip to content
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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Aurelienazerty
Copy link

Quick modification for made works with DisplayLastPost extension
https://www.phpbb.com/customise/db/extension/displaylastpost/

@Aurelienazerty
Copy link
Author

Copy link
Owner

@kasimi kasimi left a 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
Copy link
Owner

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;
Copy link
Owner

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) {
Copy link
Owner

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++);

Copy link
Owner

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.

@Aurelienazerty
Copy link
Author

New comit

@kasimi
Copy link
Owner

kasimi commented Aug 16, 2018

Could you also fix the formatting issues that I commented?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants