Give admins download links for original media


/ Published in: JavaScript
Save to your folder(s)

When logged in with the Affiliate admin account, the media play page will have a link to download the original media. The link is is displayed at the bottom of the media description, just above the admin tags field.

Thanks to KickApps for their assistance with this code.

Updated for changes to KickApps page code


Copy this code and paste it in your HTML
  1. if (Ka.Info.PAGE == 'pages/mediaPlayPage.jsp' &&
  2. (DWRUtil.getValue('userRole') == 'WEBMASTER' || DWRUtil.getValue('userRole') == 'EDITOR')) {
  3. if (Ka.Info.MEDIATYPE == 'VIDEO') {
  4. var links = '<br><a href="'
  5. + Ka.Info.PATHTOMEDIA
  6. + '">mp4 format (transcoded)</a><br>';
  7. // KickApps renames the media extension to lower case extension, but Ka.Info retains the case of the original upload
  8. // So we must convert to lower to correct it here
  9. links += '<a href="'
  10. + Ka.Info.STATICSERVER
  11. + '/kickapps/images/videos/'
  12. + Ka.Info.MEDIAID
  13. + Ka.Info.ORIGVIDEOFORMAT.toLowerCase()
  14. + '">Original upload</a><br>';
  15. } else if (Ka.Info.MEDIATYPE == 'AUDIO') {
  16. var links = '<br><a href="'
  17. + Ka.Info.AUDIOPHOTOSERVERPATH
  18. + Ka.Info.PATHTOMEDIA
  19. + '">mp3 format</a><br>';
  20. }
  21. document.getElementById("ka_playPageDetails").innerHTML = document.getElementById("ka_playPageDetails").innerHTML + links;
  22. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.