1 sheepking Mar 26, 2006 23:32
3 yosemirza Mar 27, 2006 20:09
Sheepking,...I have tried the code..but didn't work
maybe other can help with that.
It would be great and useful i think
4 sheepking Mar 28, 2006 18:08
Sorry Yosemirza...here's the full code. I only include the bits that does something. It's basically copied from the youtube plugin code, but changed to fit quicktime movies rather than flash :)
Since this plugin only works for Quicktime movies, if I have it right it will do [qt]link to movie[/qt] in a post and it render in page.
BTW bear in mind that my knowledge of php is about 0.01% of the youtube plugin author so don't trust your blog on it :D
<?php
if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
class movie_plugin extends Plugin
{
var $name = 'movie_plugin';
var $code = 'movie';
var $priority = 10;
var $version = '0.1';
var $author = 'JGJones';
var $help_url = 'http://gwallgofi.com';
var $is_tool = true;
var $apply_when = 'opt-out';
var $apply_to_html = true;
var $apply_to_xml = true;
function movie_plugin()
{
$this->short_desc = T_('movie_plugin');
$this->long_desc = T_('Insert videos into posts.');
}
// with thanks to code borrowed from YouTube plugin.
// This will work only for Quicktime movies
var $search = array( '#\[vid](.+?)\[/vid]#is' );
var $replace = array('<div style="text-align:center"><object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="320" height="260"><param name="src" value="$1" /><param name="controller" value="true" /><object type="video/quicktime" data="$1" width="320" height="260" class="mov"><param name="controller" value="true" /> Error text. </object></object></div>');
function AdminEndHtmlHead( & $params )
{}
function AdminAfterPageFooter( & $params )
{}
function DisplayToolbar( & $params )
{}
function DisplayEditorButton( & $params )
{}
function Render( & $params )
{
if( ! parent::Render( $params ) )
{ // We cannot render the required format
return false;
}
$content = & $params['data'];
$content = preg_replace( $this->search, $this->replace, $content );
return true;
}
}
?>
put that code into a file, name as movie.plugin.php and place in plugin folder. Cheers
5 sheepking Mar 28, 2006 18:18
ok it won't kill your blog - that's something :)
I have a movie link wrapped with [qt] [/qt] but sadly does not work. Post shows the [qt]link[/qt]. hmm what am I doing wrong here? Hope some extremely nice chap helps out here? I'll even tell my mum that you're super nice and to knit you a woolly hat?...well she can't knit...
6 yosemirza Mar 29, 2006 18:56
Thanks...I will try again...
before i just turned off my html checker to post movie
I am not good in Php or something like that.
your plugin will work...
Do you want to see my web? It's in Minangkabau Language ( A Nice Place in West Sumatra, Indonesia ) but not all, I haven't finished to translate yet...
Hello. I made the YouTube plugin and it looks like your code snippet will work the same way, using a renderer to bypass the html validator. That should work fine. Of course, that type of plugin requires you to be using at least version 1.6, but I'm guessing that you already know that since you're using the file manager, too. Have you tried your code yet? Does it work?