ClipShare Community Forums  

Go Back   ClipShare Community Forums > ClipShare PRO - Version 4 > Feature Requests
Register FAQ Bug Tracker Members List Calendar Mark Forums Read

Feature Requests Post your wish list for future upcoming ClipShare versions.


Reply
 
Thread Tools Display Modes
Old 01-15-2010, 07:20 PM   #1
smazzeo
Member
|Forum Newbie|
 
Join Date: Nov 2009
Posts: 1
smazzeo is on a distinguished road
Default Limit Number of Video Views to Guests

I have read through the forums in all of the clipshare versions and in all message boards and have not found a solid piece of code that can be used to limit the number of video views for guests.

All I want to do with this is give the guests a 5 video taste of the material we supply. After 5 video views, we would like for the guest to register for a Free account with us. We are simply using this to get information about our viewers.

I know that the SiteAdmin has a "package" configuration that allows you to set up paying membership for content. I need to be sure that the "package" will support what we are trying to accomplish. If it does not, and I don't believe it will, I need help in redesigning the view_videos.php page so that it can support these criteria.

All posts on the board that relate to this all mention that it has been resolved in the past and that many people have asked before. The one thing that they did not supply was a solution to those who may still have this problem.

The best advice that I have received was that an extra field must be added to the database that constantly counts the number of views per user identified by their IP address. This sounds like what I need to accomplish, but I am looking for a solid piece of code to implement into this program that has been tested.

I am not asking for someone to write this out for me, I am sure that the script has been written before, I just want to know if anyone can point me in the direction of finding it.

Thank you very much.
smazzeo is offline   Reply With Quote
Old 06-25-2010, 08:50 PM   #2
muze
Member
|Forum Junior|
 
Join Date: Jan 2009
Posts: 94
muze is on a distinguished road
Default

I haven't found any solutions either. I need to offer a paid subscription package now that my site is well trafficked, if anything just to cover the bandwidths costs. But what's the point of the packages if people can simply view the site for free and eat up all my bandwidth if they don't create an account?

I'm waiting for the next major release of clip share for a fix, and of not fixed then to get the site modded then. It's not worth it to make or invest in mods for this version when I may have to do it all over again for the next version (which may fix it anyways). Unless someone else has a better idea, all we can do is wait.
muze is offline   Reply With Quote
Old 06-25-2010, 09:08 PM   #3
dargre
Member
|Forum Guru|
 
dargre's Avatar
 
Join Date: Nov 2007
Posts: 2,501
dargre will become famous soon enough
Default

Many use limit by video number watch.
I also personally use a limit for about 5 videos max.
It cannot be 100% perfect as IPs can be dynamic, but mostly works well.

Best is to have new table in database with fields for IP and videos count.
Then in view_video.php you check for IP, next check this IP in database.
If not exists - you save new record with IP and "1" as video count.
If IP already exists - if videos count is less than your limit - you increase number of video count, if video count exceeds your limit - you assign limit error as smarty variable and use in view video template to show message about video limit.

Suggested is to clear such table (use some time in the past) as it can grow very fast (just one more short mysql query)

I think I posted somewhere sometime little bit more of details, but I'm not sure.
Anyway it's pretty easy for semi experienced programmer, only requires some time, but surely not long hours.

D.
dargre is offline   Reply With Quote
Old 06-29-2010, 06:38 PM   #4
muze
Member
|Forum Junior|
 
Join Date: Jan 2009
Posts: 94
muze is on a distinguished road
Default

I found this in view_video.php. It appears as though this functionality is almost built in. Note the commented section.

// GUEST!!!
if ( !isset($_SESSION['UID']) ) {
$guest_ip = $_SERVER['REMOTE_ADDR'];
$guest_date = date('d-m-y');
$sql = "SELECT * FROM guest_info WHERE guest_ip = '" .mysql_real_escape_string($guest_ip). "' AND log_date = '" .mysql_real_escape_string($guest_date). "'";
$rs = $conn->execute($sql);
$sql = "SELECT duration FROM video WHERE vkey = '" .$viewkey. "' LIMIT 1";
$rsx = $conn->execute($sql);
$duration = $rsx->fields['duration'];

if ( $conn->Affected_Rows() ) {
$guest_bw = $rs->fields['use_bw'];
// if ( $guest_bw >= $config['guest_limite'] ) {
// $URL = $config['BASE_URL']. '?msg=Your video limit has esceeded for today!';
// redirect($URL);
// }

$use_bw = $duration+$guest_bw;
$sql = "UPDATE guest_info SET use_bw = '" .mysql_real_escape_string($use_bw). "'
WHERE guest_ip = '" .mysql_real_escape_string($guest_ip). "'
AND log_date = '" .mysql_real_escape_string($guest_date). "'";
$conn->execute($sql);
} else {
$sql = "INSERT INTO guest_info SET guest_ip = '" .mysql_real_escape_string($guest_ip). "',
log_date = '" .mysql_real_escape_string($guest_date). "', use_bw = '" .mysql_real_escape_string($duration). "'";
$conn->execute($sql);
}
}
muze is offline   Reply With Quote
Old 04-18-2012, 07:41 AM   #5
keiooz
Verified Member
|Forum Newbie|
 
Join Date: Apr 2012
Posts: 25
keiooz is on a distinguished road
Default

Have you already used this script and worked? I am also looking for the solution and I hope this could be it.
keiooz is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Limit Guest Video Views gateway General Discussion 6 02-27-2009 07:32 PM
Limit number of views? vbcruiser Pre-Sales Questions 0 08-26-2008 02:15 PM



All times are GMT +1. The time now is 05:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Copyright © 2006-2008 Envient. All Rights Reserved.

An Envient product.