1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Post Views Widget 0.1

Discussion in 'Plugins' started by shibuya246, Sep 7, 2010.

  1. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Post Views Widget
    Version: 0.1
    Author: Alan (shibuya246)
    Created on: 2010/09/07
    Last Updated:
    Tested on: Hotaru 1.4.1
    Plugins Required: Widgets
    Plug & Play: Yes
    Supported: Yes

    Displays a list of most viewed posts in a widget.

    1. Upload the "post_views_widget" folder to your plugins folder.
    2. Install it from Plugin Management in Admin.
    3. Enable the widget in Admin -> Widgets

    By default, 10 entries will show, but you can change that number by editing $limit at the top of post_views_widget.php.

    Revision History
    v.0.1 2010/09/07 - Alan- Released first version

    Please click "Rate Thread" and give this plugin a rating. Thank you.


    Attached Files:

    nothingman and richrf like this.
  2. richrf

    richrf New Member

    Thanks for the great work Alan.

  3. nothingman

    nothingman Active Member

    Hi Alan, I was wondering if the Post Views could be integrated with # Best from: # 24 Hrs # 7 Days # 30 Days # 365 Days # All Time ?
    What I'm trying to say is, besides the no. of comments and votes, why not take into consideration the no. of views for a story when deciding what story is the best from, say the last 7 days, last 24 hrs etc?
  4. Nick

    Nick Well-Known Member

    You could probably just edit the bookmarking_sort_filter.php template so that it contains a link to "views", i.e.

    <a href="<?php echo $h->url(array('page'=>'views')); ?>">Views</a>
    nothingman likes this.
  5. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    Not sure if I am understanding this right, but you want the most viewed over the last 30 days or the most viewed posts that were posted in the last 30 days?

    The view count does not save the date/time of the view, just a counter number that is updated, so it would not be possible to filter by most viewed within time frame.
    nothingman likes this.
  6. nothingman

    nothingman Active Member

    When we click the links at the top, such as Best from: 24 Hrs 7 Days 30 Days 365 Days All Time etc, the best stories from the last 24 Hrs or last 7 days are sorted and loaded. I believe these are sorted based on the number of comments and the number of votes that a story has received. So I was wondering if the number of Views too could be used as a condition to sort the 'top' stories.

    But, as you have mentioned that the date/time of the view is not stored and that it is just a counter I don't think number of Views of a story could be taken into consideration. Thanks anyway!
    Last edited: Sep 7, 2010
  7. Nick

    Nick Well-Known Member

    They are sorted by most votes on posts submitted within X time period. It's possible to do the same for most viewed posts (via the "bookmarking_functions_preparelist" plugin hook), but it would be a much bigger headache than you'd expect. The current sort filters work with category, tag and user pages, too, so you'd need to account for those. It would have to be incorporated into the Post Views plugin to guarantee the user is actually tracking post views (I'm not on my site). And even if it all works swimmingly, what do you do about all the additional links? Popular, Upcoming, Latest, All, Highest votes from 24hrs, 7days, 30 days, 365 days, All Time, Most viewed from 24hrs, 7days, 30 days, 365 days, All Time.... very messy.

    Would the feature get enough use to make it worthwhile? I don't think so. It would be best implemented on sites that order posts solely by page views and not votes.

    The simplest solution for a typical voting site is a single link (as I posted above) that links to the Most Views page. If you're using the Archive plugin, the posts will automatically be filtered to most views from the last 6 months, 3 months, or whatever you've set the archive to.
  8. richrf

    richrf New Member

    Hi all,

    On my site, visitors are not voting that often, so by default the stories that I would like to promote are those that attracting the most views. In time this may change as voting becomes more common but at startup there are just not enough votes so voting becomes a poor indicator of interest. When when considers that Digg may get tens of thousands of visits and a post can get to the front page with a few dozen votes, one can see that it takes a huge site to attract a meaningful number of votes.

    The optimal situation would be to have the option to use either views or votes as the sorting field. I would definitely contribute to the development of this kind of plugin if others would also contribute. Of course, the plugin would be made available to the general community if it was built.

  9. nothingman

    nothingman Active Member

    Noticed that the "numbers" spill out of the gray box (that shows the number of views) if number of views exceeds 3 digits, could there be a way to wrap the numbers?

  10. richrf

    richrf New Member

    I am having a similar problem on Links.com. There is an alignment problem when the link is greater than three lines.

Share This Page