Welcome to the archive of the old FlatPress support forum. Browse more than a decade of FlatPress wisdom! Login is disabled.

The current FlatPress support forum is available here: forum.flatpress.org
Page/Post Views statistics generator
  • Hi All,

    It's been some time since I've contributed anything to FlatPress, I'm glad that people are using my SiteMap script now, that's great to see!
    I've added another script that I thought may be useful to people on here. It works with the PostViews plugin and generates a list of all of your blog posts with a histogram that shows how many views each of the posts had.

    Here's what it looks like:

    I put the code up on my blog, you can find it here if you are interested: http://www.igorkromin.net/index.php/2014/05/01/page-view-statistics-generator-for-flatpress/

    Hope this is useful for some of you!

  • Thank you Igor. that looks awesome! I'm looking for a few years now to find that kind of solution!

    I saved it as an.php file and uploded it to my blo main directory :)
  • I should probably have been a little bit more clear in my post, it's just a standalone file, but it requires the PostViews plugin to be enabled.

    Glad you made use of this :)
  • Could you add static pages to your plugin? Would that be possible? I think it would be a pretty neat addition. 
  • Do static pages have the ability to track the number of times they have been viewed? I don't use statics myself, so haven't done this. Happy to have someone else modify my script to include those.
  • Oops, I didn't expose my idea properly. 

    I meant to ask if you were interested to include statics in the regular sitemap plugin. My bad. 
  • Same answer really, I don't use statics but happy for someone else to add this. If I get some time over the next few weeks I will have a look into it.
  • That would be great. Thank you for your time! :)
  • How can I change the plugin to sort the entries by views? I would like that the first bar shows the most viewed entry and the last one the entry with  fewest views.
  • Quite easy, add the following function to the code:

    function cmp($a, $b) {
    if ($a[1] == $b[1]) { return 0; }
    return ($a[1] > $b[1]) ? -1 : 1;

    Then before the foreach loop, call this:

    usort($entry, 'cmp');
  • Works like a charm, thank you very much :)
  • Marc,

    I've just got some code posted to add the static pages to the site map generator. Check it out here: http://www.igorkromin.net/index.php/2014/06/04/add-flatpress-static-page-links-to-the-sitemapphp-site-map-generator/

Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion