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

Isso comments plugin #651

Merged
merged 1 commit into from
Oct 18, 2016
Merged

Conversation

ArthurHoaro
Copy link
Member

@ArthurHoaro ArthurHoaro commented Oct 3, 2016

Use Isso client to let visitors comments on permalinks

Note: also affect private links because links can previously commented links can be set to private and the other way around.

Note bis: It's not beautifully integrated for now.

ping #181

@ArthurHoaro ArthurHoaro added plugin bells and whistles in review 3rd party interoperability with third-party platforms labels Oct 3, 2016
@ArthurHoaro ArthurHoaro added this to the 0.8.1 milestone Oct 3, 2016
@ArthurHoaro ArthurHoaro self-assigned this Oct 3, 2016
@nodiscc
Copy link
Member

nodiscc commented Oct 3, 2016

Hey @ArthurHoaro , looks cool. Just to make sure I understand (I have not tested it yet):

if (count($data['links']) == 1) { 

The comments box is only displayed when there is only one link visible (access by permalink, or search with a single result)? Or does it litter the linklist with 30 comment boxes? The first solution is preferable.

Simple code, great work

@ArthurHoaro
Copy link
Member Author

Thanks! Yes, it is displayed only when 1 link is displayed. However, I didn't think of search results. It probably shouldn't be displayed in this case.

@kalvn
Copy link

kalvn commented Oct 3, 2016

To avoid ISSO to be displayed on search result, you could use the same condition I used for my disqus plugin: checking that there is only 1 result and that the query string parameter page is not defined (since it's not present on permalink pages).

if(count($data['links']) === 1 && !isset($_GET['page']) && !empty($disqusShortname)){

Just ignore the last part of the condition, here.

Additionally, if you really want to be sure you're on the expected page, you can also check that the current link's ID is actually present in the URL:

if(isset($_GET[$link['shorturl']])){

It's a bit extreme as it should always be true but just in case.

@ArthurHoaro
Copy link
Member Author

Updated!

  • Only displayed on permalinks. I did something similar @kalvn, but without requiring to access $_GET within the plugin.
  • Unit tests.
  • One line of CSS to, at least, align the title.

@@ -0,0 +1,3 @@
#isso-thread > h4 {
text-align: center;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newline

* Plugin Isso.
*/

$issoUrl = $conf->get('plugins.ISSO_SERVER');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

access to $conf could be made directly from the Linklist render hook, which would help keeping test code clean

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll use #659. The errors were assigned at PageBuilder initialization, which prevent from using your solution.

Use Isso client to let visitors comments on permalinks
@ArthurHoaro
Copy link
Member Author

Updated.

Copy link
Member

@virtualtam virtualtam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ArthurHoaro ArthurHoaro merged commit c1c2102 into shaarli:master Oct 18, 2016
@ArthurHoaro ArthurHoaro deleted the plugin-isso2 branch October 18, 2016 06:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party interoperability with third-party platforms in review plugin bells and whistles
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants