Using xvideoplaypack plugin in my own component

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
User avatar
FredFlinstone
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 13, 2006 3:05 pm
Location: Albershausen, Germany
Contact:

Using xvideoplaypack plugin in my own component

Post by FredFlinstone » Tue Jan 01, 2008 9:45 pm

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
Last edited by FredFlinstone on Fri Jan 04, 2008 1:47 pm, edited 1 time in total.

User avatar
FredFlinstone
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Tue Jun 13, 2006 3:05 pm
Location: Albershausen, Germany
Contact:

Re: Using xvideoplaypack plugin in my own component

Post by FredFlinstone » Thu Jan 03, 2008 7:23 pm

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!

User avatar
pe7er
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 162
Joined: Thu Aug 18, 2005 8:55 pm
Location: Nijmegen, The Netherlands
Contact:

Re: Using xvideoplaypack plugin in my own component

Post by pe7er » Fri Jan 04, 2008 7:54 am

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!
Kind Regards,
Peter Martin (aka pe7er)
db8.nl - Joomla! implementation, programming, template and component development [Dutch]
>> Questions? Get help more easily with JTS-post Assistant: viewtopic.php?f=428&t=272481


Post Reply