Keyword

Preview video for unregistered users

  • davidllovi
  • davidllovi's Avatar Topic Author
  • Offline
  • New Member
More
12 years 11 months ago #56961 by davidllovi
Preview video for unregistered users was created by davidllovi
Hi!
first of all a big thanks for all the work done. It is amazing!
Now if you could give me a hand with this small problem:
I would like to have two different views of the same item, depending wether the user is registered or not. If the user is registered, he could access a video from vimeo. Otherwise, another video which would be the preview (no, it's not adult content!!)
I've tried to make it simple; I thought to replace videoID with a field I am not going to use, itemVideoCredits.
So I have edited administrator/components/com_k2/models/item.php (line 500 or so)
and changed it to:

if (JRequest::getVar('videoID')) {
$provider = JRequest::getWord('videoProvider');
$user = JFactory::getUser();
if($user->usertype == "Registered")
$videoID = JRequest::getVar('videoID');
else
$videoID = JRequest::getVar('itemVideoCredits');

$row->video = '{'.$provider.'}'.$videoID.'{/'.$provider.'}';
}

Well it doesn't work. It deletes blank the videoID when I save the item.
So do you think of a nice and simple way to do it?

I know that mine is more than an information request! If you could find some time to think it out, I would be most grateful.
Thanks!
David

Please Log in or Create an account to join the conversation.

More
12 years 11 months ago #56962 by william white
Replied by william white on topic Re: Preview video for unregistered users
I would not edit the core files.
If the video is the same for everyone who is not registared i would put it in an override of item.php and use something like this
just under if isset itemVideo
if user is not registared
show perview video
else
let the regular item php code work

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum