POST VIEWS Plugin for Homepage & Channel

  1. 3 years ago

    Hi Esotalk team,

    We need a plugin to display each "POST VIEWS" in front and can sort posts on homepage or in channel based on views.

  2. [deleted]

    25 Jun 2015

    Good idea.

  3. Well as of now views are seen like this.
    -image-
    As for sorting conversations via views, that seems rather pointless, if it were views then you may have unwanted (Old) posts viewed and voted up because of people viewing them while new conversations being posted would be voted down because lack of views.

  4. [deleted]

    1 Aug 2015

    We already have a working, stable plugin called views .

    This plugin already has order by views functionality:
    -image-

    To show views on homepage, we need to add the following line after line no 50 in - core/views/conversations/conversation.php

    echo "<span style='float:right;color:#999999'>".Ts("%s view", "%s views", $data["conversation"]["views"])."</span>";

    To avoid changing core code, we can override the conversation.php file by duplicating it (with same folder structure) within views plugin folder.

    I'm attaching the modified views plugin here. You should be able to see the views on conversations as shown below. Whenever you search for conversations, you'll be able to see the views and even sort conversation by views :-) Hope this helps!

    -image-

  5. [deleted]

    1 Aug 2015

    Added 'settings' panel for admin where admin can choose to enable/disable showing view count on home page / search results.
    -image-

    You can take it from here:
    https://github.com/yathish1618/Views

    @Toby I've created a pull request. Can you please merge it with master if its ok?

    P. S. Its my first contribution to open source code :-)

  6. [deleted]

    1 Aug 2015

    @chaos Added 'settings' panel for admin where admin can choose to enable/disable showing view count on home page / search results.
    -image-

    You can take it from here:
    https://github.com/yathish1618/Views

    @Toby I've created a pull request. Can you please merge it with master if its ok?

    P. S. Its my first contribution to open source code :-)

    thanks=)

  7. @chaos

    I'm attaching the modified views plugin here. You should be able to see the views on conversations as shown below.
    https://github.com/yathish1618/Views

    Thanks for this! Although I have one question? If we already have views installed, do we unistall the previous views plugin and then install from the link you provided and no modifications needed?

  8. [deleted]

    1 Aug 2015

    @Tech

    No.

    Simply replacing the views plugin folder is enough :-)

  9. Sounds like a plan. ;)

 

or Sign Up to reply!