For thouse of you building an adult tube based on MediaVibe this little mod can help out if you’re considering restrincting some video qualities to some users. Like Redtube or Pornhub do, or most adult tube websites.
This is simple on the MediaVibe CMS, open lib/class.providers.php and find:
/* We have multiple qualities*/$real_link = (isset($qualities["hd"])) ? $qualities["hd"] : $qualities["sd"];
$extra = $qualities;
}
krsort($qualities);
Right before this
krsort($qualities);
add this:
/* Restict some */
$garr = array('1080','720','hd'); /* Guest restrictions */
if(!is_user()) {
foreach ($garr as $rg) {
if(isset($qualities[$rg])) {
unset($qualities[$rg]);
}
}
}
$usrr = array('1080');/* Non premium user restrictions */
if(!has_premium()) {
$qualities = array_diff(array_map('json_encode',$qualities), array_map('json_encode',$usrr));
$qualities = array_map('json_decode', $qualities);
}
Edit the $garr and $usrr arrays wil the values you wish to exclude, $garr is for guests and $usrr is for non-premium users *regular users*.
The $qualities variable is global, so you can acess it from video.php in tpl and create a message that includes the restricted qualities for that user.
Like a “Sign in to watch this in stunning 1080p” that adult tubes have.
Hope this helps!
Cheers
Can it be made into a plugin? Or upgrade the new version, the background can be easily set. We can’t understand this tutorial at all.