Related Topics


[Video CMS v4]How 2 ? Only registred users can watch Videos ?  (Read 584 times) Print

1 B


ipeci  January 16, 2014, 09:21:56 PM

Hallo
How i can make it , only registred users can watch video┬┤s ?
Plz Help.

Regards

Logged


Alexander  January 16, 2014, 09:26:19 PM

Hi!

Code
if(is_user()) {
//user is logged
}
if(!is_user()) {
// is guest
}

Logged

ipeci  January 16, 2014, 09:31:08 PM

Wow thank you Alex for a quick reply .

I just ned to know were i ned to modifly that code ? wich folder in the script?

Regards

Logged


Alexander  January 16, 2014, 09:53:44 PM

I guess that depends from you, I would go wrap it around the embed in tpl/main/video.php

Logged

ipeci  January 16, 2014, 09:56:18 PM

Thank You
The problem is , i dont wont to make all videos , just some videos i chose ?

 :-\

Logged


Alexander  January 16, 2014, 10:18:14 PM

You can bundle it with featured option.

On video page

Code
if(is_user() && ($video->featured > 0)) {
//user is logged and video is featured
}

Logged

ipeci  January 16, 2014, 11:05:42 PM

Hi,
thank you for your help .

i have make a video as futured and puted the code on line18 to /video.php and tryed !?!
but is not work for me ? :-\

best thank.

Logged


Alexander  January 17, 2014, 12:14:41 AM

Change

Code
<?php echo $embedvideo; ?>

to

Code
<?php
if( $video->featured > 0) {
if(is_user()) {
echo $embedvideo;
} else {
echo _lang("Please login to see this video.");

}

} else {

echo $embedvideo;

}
?>

Logged

Alexander  January 17, 2014, 12:15:09 AM

I was giving you coding tips, you should have said you don't know how to use them :)

Logged

ipeci  January 17, 2014, 02:53:20 AM

Wow Cool now its working ....

Thank you Thank you Thank you Alexander   :-* :-* :-*

Best Regards

Logged