![]() |
|
|||||||
| Feature Requests Post your wish list for future upcoming ClipShare versions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
|Forum Newbie|
![]() Join Date: Nov 2009
Posts: 1
![]() |
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. |
|
|
|
|
|
#2 |
|
Member
|Forum Junior|
![]() ![]() Join Date: Jan 2009
Posts: 94
![]() |
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. |
|
|
|
|
|
#3 |
|
Member
|Forum Guru|
![]() ![]() ![]() ![]() ![]() Join Date: Nov 2007
Posts: 2,501
![]() |
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. |
|
|
|
|
|
#4 |
|
Member
|Forum Junior|
![]() ![]() Join Date: Jan 2009
Posts: 94
![]() |
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); } } |
|
|
|
|
|
#5 |
|
Verified Member
|Forum Newbie|
![]() Join Date: Apr 2012
Posts: 25
![]() |
Have you already used this script and worked? I am also looking for the solution and I hope this could be it.
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
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 |