Page 1 of 1

Using xvideoplaypack plugin in my own component

Posted: Tue Jan 01, 2008 9:45 pm
by FredFlinstone
Hi friends,
I would like to use plugin (in this case it is "xvideoplaypack" mambot) in my custom components.

detail info:
- I installed that plugin (XtremVideoPlayer)
- the main file ("xvideoplaypack.php") of this plugin contains next code (bit of this):
$_MAMBOTS->registerFunction( 'onPrepareContent', 'youtube_content' );
...
function youtube_content( $published, &$row, &$params, $page=0 ) {
...
}
- how can I use this plugin's function in my custom component:
- in my component is loaded next text string: [youtube:http://www.youtube.com/watch?v=blablabla] from database
and I want manage this text string with function "youtube_content" in plugin
and return back to component result from that plugin's function.

My answer is:
How to call plugin's function in my component script and how can I pass atributtes, and which attributtes?

thank for help

Fred

Re: Using xvideoplaypack plugin in my own component

Posted: Thu Jan 03, 2008 7:23 pm
by FredFlinstone
Hi all,
this information may be make happy many beginners (and Joomlers also).

I have installed some plugin (in old terminology - mambot). In my case it is (for example) plugin "xvideoplaypack". And how I can to use this plugin (its funcionality) in my custom component?
Answer is very simply.

Here is fragment of code of my components:

...some code of my custom component...
/* using of plugin: */
$_MAMBOTS->loadBotGroup('content');
$PassedValue=new mosEmpty();
/* next value may be loaded from database: */
$PassedValue->text="[youtube:http://www.youtube.com/watch?v=gsBC5C5ERho]";
$results= $_MAMBOTS->trigger('onPrepareContent',array(&$PassedValue,&$params,$page),1);
/* display YouTube video: */
echo $PassedValue->text;

... that's all folks!

Re: Using xvideoplaypack plugin in my own component

Posted: Fri Jan 04, 2008 7:54 am
by pe7er
Thanks for the follow-up with your solution.

Could you please mark your first message in this thread as "solved" ? (Modify the first message and choose the Message Icon [solved] Image).
This way the list of messages shows that the question has been solved, and other users can benefit from it.
Thanks!