Hi,
I wanted only logged members to download videos. So I edited the flashvideo_objects.inc
replaced
if($video_text == '') {
$output .= '<p>'. t('Download the original : ');
$output .= l(basename($video['original_video']), file_create_url($video['original_video']), array('title' => ba
sename($video['original_video'])), NULL, NULL, TRUE) . '</p>';
}
else {
$output .= '<p>' . l($video_text, file_create_url($video['original_video']), array('title' => $video_text), NUL
L, NULL, TRUE) . '</p>';
}
}
return $output . '</div>';
}
With
global $user;
if ($user->uid)
{
if($video_text == '')
{
$output .= '<p>'.l(basename("Download Original"), file_create_url($video['original_video']), array('title' => basename("Download Now")), NULL, NULL, TRUE) . '</p>';
}
else
{
$output .= '<p>'.l(basename($video_text), file_create_url($video['original_video']), array('title' => basename("Download Now")), NULL, NULL, TRUE) . '</p>';
}
}
else
{
$output .= '<p>'.l(basename("Log In To Download Original Clip"),"http://www.example.com/user/", array('title' => basename("Log In Now")), NULL, NULL, TRUE) . '</p>';
}
}
return $output . '</div>';
}
Hope it helps
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | flashvideo_members_download.patch | 1.55 KB | grove101 |
Comments
Comment #1
vm commentedCreating patches
you'll want to create a patch against the most recent -dev version to insure that it applys cleanly to any code that may have already been changed by the developer for the next release.
I also believe something of this nature should use the drupal access control system so that it can be turned on or off based on roles.
Comment #2
grove101 commentedThx for the tip VeryMisunderstood, I have created a patch. I'll try to work on the code so it uses the drupal access control system ...
Comment #3
marcoBauli commentedreverting node title