Total Views of all Videos


#1

Hello I want to display the total views from all videos in the Admin Area how I can do this? I’m using CB 4.0


#2

1 . Open ./includes/classes/video.class.php
2 . Before the ending

}
?>

add the following function:

	function getTotalViews() {
		global $db;
		$result = $db->select(tbl("video"),"views", " status= 'Sucessful'");
		$totalviews = 0;
		while($result) {
			$totalviews = $totalviews + $result['views'];
		}
		return $totalviews;
	}

3 . Save
To display this in your template, for example on your homepage, do the following:
4 . Open ./styles/{TEMPLATE}/layout/index.html
5 . Add the following code at the top:
{assign var=total_views value=cbvid->getTotalViews()}
6 . Display the value anywhere using {$total_views}
7 . Save & Upload

this code from arvixe blog, step 5 does not work !
anyone know how to fix it ?