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

CommentFileSizeAuthor
#2 flashvideo_members_download.patch1.55 KBgrove101

Comments

vm’s picture

Creating 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.

grove101’s picture

Title: Original Video Download only available to logged in users » Patch Created
Status: Active » Needs review
StatusFileSize
new1.55 KB

Thx 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 ...

marcoBauli’s picture

Title: Patch Created » Members only video downloads

reverting node title