PageRenderTime 42ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/broken-link-checker/modules/extras/dailymotion-embed.php

https://bitbucket.org/lgorence/quickpress
PHP | 39 lines | 18 code | 7 blank | 14 comment | 1 complexity | 804e24153d5af6faa97d12e5e34c6fe9 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, AGPL-1.0
  1. <?php
  2. /*
  3. Plugin Name: Embedded DailyMotion videos
  4. Description: Parse embedded videos from DailyMotion
  5. Version: 1.0
  6. Author: Janis Elsts
  7. ModuleCategory: parser
  8. ModuleClassName: blcDailyMotionEmbed
  9. ModuleContext: on-demand
  10. ModuleLazyInit: true
  11. */
  12. if ( !class_exists('blcEmbedParserBase') ){
  13. require 'embed-parser-base.php';
  14. }
  15. class blcDailyMotionEmbed extends blcEmbedParserBase {
  16. function init(){
  17. parent::init();
  18. $this->url_search_string = 'dailymotion.com/swf/video/';
  19. $this->short_title = __('DailyMotion Video','broken-link-checker');
  20. $this->long_title = __('Embedded DailyMotion video', 'broken-link-checker');
  21. }
  22. function link_url_from_src($src){
  23. //Extract video ID from the SRC. Only the part before the underscore matters,
  24. //but we're going to use the entire slug to make the display URL look better.
  25. $video_id = end(explode('/', $src));
  26. //Reconstruct the video permalink based on the ID
  27. $url = 'http://www.dailymotion.com/video/' . $video_id;
  28. return $url;
  29. }
  30. }
  31. ?>