dailymotion_videozap plugin by Bruno Duyé
Creates an embedded object of Dailymotion VideoZap widget.
Last updated on 2008-12-08. Provides Syntax.
No compatibility info given!
Similar to dailymotion, flashplayer, flowplay, google_video, video, youtube, youtubev2.
This DokuWiki plugin creates an embedded Dailymotion VideoZap widget in an Wiki page from a Dailymotion playlist. User can embed many movies just specifying the playlist ID with simple syntax.
This plugin is based on the Dailymotion plugin written by Christophe Benz.
Basic syntax:
{{dailymotion_videozap>Id}}
Extended syntax:
{{dailymotion_videozap>Id:Params}}
Please note that if you change the parameters cols and rows, you will need to change total size, too (fixed to 2×5 videos (604px x 355px) for the moment, see TODO list).
Wiki syntax
{{dailymotion>xqs4d_les-nous_la-fin-du-monde}}
To get that Id :
Here is the source code:
<?php /** * Plugin Dailymotion::VideoZap : Create Dailymotion VideoZap from a Dailymotion playlist Id * http://www.dokuwiki.org/plugin:dailymotion_videozap * * @license GPL v3 (http://www.gnu.org/licenses/gpl.html) * @author Bruno Duyé * * Based on the Dailymotion plugin written by Christophe Benz * * Usage : * {{dailymotion_videozap>Id}} where Id is Dailymotion playlist Id (see the online doc for details) * {{dailymotion_videozap>Id:Params}} * */ if(!defined('DOKU_INC')) die(); if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); require_once(DOKU_PLUGIN.'syntax.php'); class syntax_plugin_dailymotion_videozap extends DokuWiki_Syntax_Plugin { function getInfo(){ return array( 'author' => 'Bruno Duyé', 'email' => 'bruno.duye gmail com', 'date' => '2008-12-08', 'name' => 'Dailymotion::VideoZap Plugin', 'desc' => 'Dailymotion videozap from a playlist', 'url' => '', ); } function getType() { return 'substition'; } function getSort() { return 159; } function connectTo($mode) { $this->Lexer->addSpecialPattern('\{\{dailymotion_videozap>[^}]*\}\}', $mode, 'plugin_dailymotion_videozap'); } /** * Handle the match */ function handle($match, $state, $pos, &$handler){ $params = substr($match, strlen('{{dailymotion_videozap>'), - strlen('}}') ); // Strip markup return array($state, explode(':', $params)); } /** * Create output */ function render($mode, &$renderer, $data) { if($mode == 'xhtml'){ list($state, $params) = $data; list($playlist_id, $videozap_params) = $params; if(preg_match('/^[-0-9a-z_]+$/', $playlist_id) == 0) { $renderer->doc .= 'Error: Playlist ID must be alphanumeric characters or \'-\' or \'_\'. Given value: ' . htmlentities($playlist_id); return false; } $url = 'http://www.dailymotion.com/videozap/playlist/'; $code .= '<iframe marginwidth="0" marginheight="0" width="604" height="355" frameborder="0" scrolling="no" src="' . $url; $code .= htmlentities($playlist_id) . '?' . htmlentities($videozap_params) . '"></iframe>'; $renderer->doc .= $code; return true; } return false; } } ?>
PS: do not add a newline at the end of file
Paste the source code in a new file : lib/plugins/dailymotion_videozap/syntax.php in your DokuWiki installation directory.
{{dailymotion>xqs4d_les-nous_la-fin-du-monde:2:4}}
for 2×4 video grid