Hi everyone, please need a php script for this. I have some movie thrillers on my site which is not via you tube. Viewers can play the thrillers and watch on my site. However i need a script that will show number of times each thriller was played. Thanks for all replies
Then you need a script wich can count how many times a video is loaded, ain't very simple but doable!
you can try this http://www.jeroenwijering.com/ Code (markup): and if you want count how many times a video is loaded, you need database
Hi I did not see any code, thanks! The videos are on the site, i just need script to show number of times it is played.
Without a proper video delivery system such as the one pointed at earlier (although pointing at www.bitsontherun.com would have been more descriptive) its pretty difficult, there are a few metrics you can capture though. You can count your page views on that page as to how many visitors have loaded the video. Then you can look at your web logs for the downloads of the FLV, if the download size = the size of the .flv someone downloaded the whole file (Of course doesnt mean it actually played it), if the size of the download is less than the size of the .FLV they did a downloaded some of the file. Although it costs more using a system like Bits on the Run or Ooyala will give you these kinds of stats as part of the package. Jen
I am using fliqz and when i log in i see number of plays at the back end bu t i wish to see it on front end too
first you need database... for exampe your database have log table and log table have video_id, total, and url field CREATE TABLE `foo`.`log` ( `video_id` INT NOT NULL , `total` INT NOT NULL , `url` VARCHAR( 100 ) NOT NULL , PRIMARY KEY ( `video_id` ) ) ENGINE = MYISAM Code (markup): after that you need connect your database, select your database and update your database every time member access your video. $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); if (!$link) { die('Not connected : ' . mysql_error()); } $db_selected = mysql_select_db('foo', $link); if (!$db_selected) { die ('Can\'t use foo : ' . mysql_error()); } $url = 'http://'.$_SERVER['HTTP_HOST'].'/'.$_SERVER['PHP_SELF']; $sql = "SELECT total FROM foo WHERE url = '$url'"; $result = mysql_query($sql); if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } $row = mysql_fetch_assoc($result)) { mysql_free_result($result); $sql = (mysql_num_rows($result) > 0) ? 'UPDATE foo SET total = '. ($row['total'] + 1) : "INSERT INTO foo (total, url) VALUES ('1', $url)"; mysql_query($sql) or die(mysql_error()); $total = ($row['total'] > 0) ? $row['total'] + 1 : 1; echo "total : $total"; PHP:
Have you tried asking fliqz? They may have a webservice or some other way. Other than that its write a PHP script to log in and screen scrape. Jen