All Good Things Must Come To An End

As you all know, I have been doing WordPress plugins and supporting it for the past 6 years. These 6 years of my life, I have been through my polytechnic education, my national service as well as my university education.

I just graduated from university in December 2009 and have been looking for full-time jobs. I am offered a full-time job and will be starting work on 1st February 2010.

I regret to say that I am NOT ABLE to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.

However, I WILL still update my plugins whenever I can and you still can report bugs to me via email and I will try to fix it.

Author Topic: Show Total Views  (Read 3003 times)

0 Members and 1 Guest are viewing this topic.

Offline stork

  • Newbie
  • *
  • Posts: 1
    • View Profile
Show Total Views
« on: 22 September 2009, 22:45 »
WP Version:    2.8.4
Theme:          greenway 3c by Headsetoptions
URL:              http:ourstorkgotlost.com
Plugin:           WP-Stats 2.50
PHP\MySQL:   PHP 5.2.8\MySQL 5.0.67.d7-ourdelta-log

Is it possible to get the WP-Stats to show Total Views?

Could I use something like this?

### Function: Get Total Views
function get_totalviews($display = true) {
   global $wpdb;
   $totalviews = intval($wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->views WHERE view_type = 'view' AND view_status = 'total'"));
   if($display) {
      echo $totalview;
   } else {
      return $totalview;
   }
}

Offline GaMerZ

  • lesterchan.net
  • Administrator
  • *****
  • Posts: 11,692
    • View Profile
  • WordPress Version: WordPress 3.0.x
  • Theme Name: lesterchan.net v3.4
Re: Show Total Views
« Reply #1 on: 23 September 2009, 02:42 »
If you install WP-PostViews, it will display the total views. You can enabled it WP-Admin -> Settings -> Stats.

Example: http://lesterchan.net/wordpress/stats/

++ lesterchan.net - Lester Chan's Website

I regret to say that I am not able to provide support for my plugins anymore due to my full-time job commitment. I will leave this forum open and let the community help one another.