How to call plugin inside component for joomla 1.5?

For Joomla! 1.5 Coding related discussions, please use: http://groups.google.com/group/joomla-dev-general
Locked
User avatar
shibu
Joomla! Guru
Joomla! Guru
Posts: 681
Joined: Fri Oct 24, 2008 5:35 am
Location: Openkey Technologies, India
Contact:

How to call plugin inside component for joomla 1.5?

Post by shibu » Wed Nov 05, 2008 5:52 pm

I want to call plugin inside a component for joomla 1.5.
Please help me as soon as posible.

Thanks and regards
Shibu
http://www.openkeytech.com/ - Joomla Extension Development

User avatar
shibu
Joomla! Guru
Joomla! Guru
Posts: 681
Joined: Fri Oct 24, 2008 5:35 am
Location: Openkey Technologies, India
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by shibu » Wed Nov 05, 2008 6:10 pm

I want the code.

Thanks and regards
Shibu
http://www.openkeytech.com/ - Joomla Extension Development

orware
Joomla! Explorer
Joomla! Explorer
Posts: 255
Joined: Mon Jul 10, 2006 8:16 pm
Location: CA
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by orware » Wed Nov 05, 2008 11:18 pm

shibu,

What kind of plugin do you want to call? Do you want to import it and have access to parameters set in the plugin?

User avatar
shibu
Joomla! Guru
Joomla! Guru
Posts: 681
Joined: Fri Oct 24, 2008 5:35 am
Location: Openkey Technologies, India
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by shibu » Thu Nov 06, 2008 4:26 am

The plugin type is system plugin.
I want both.
The plugin description is shown below.
Users to a JUGA group depending on the product they purchased in Virtuemart.
http://www.openkeytech.com/ - Joomla Extension Development

orware
Joomla! Explorer
Joomla! Explorer
Posts: 255
Joined: Mon Jul 10, 2006 8:16 pm
Location: CA
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by orware » Thu Nov 06, 2008 5:43 am

shibu,

Please check out this post I created earlier today and let me know if it's helpful:
http://forum.joomla.org/viewtopic.php?f=304&t=341016

User avatar
shibu
Joomla! Guru
Joomla! Guru
Posts: 681
Joined: Fri Oct 24, 2008 5:35 am
Location: Openkey Technologies, India
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by shibu » Thu Nov 06, 2008 6:13 am

Thanks for your soon reply.
But its only getting the plugin parameters.

I want to plugin call function.

"I am working in virtuemart for joomla 1.5.
At the end of checkout thank you page.
I want to call a plugin."
I don't konw the call function ..

Thanks and regards
Shibu
http://www.openkeytech.com/ - Joomla Extension Development

orware
Joomla! Explorer
Joomla! Explorer
Posts: 255
Joined: Mon Jul 10, 2006 8:16 pm
Location: CA
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by orware » Thu Nov 06, 2008 6:38 am

Well, after you do the import of the plugin, at that point you should be able to execute any of its functions in your code when you need to, so that should work fine I think.

User avatar
shibu
Joomla! Guru
Joomla! Guru
Posts: 681
Joined: Fri Oct 24, 2008 5:35 am
Location: Openkey Technologies, India
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by shibu » Thu Nov 06, 2008 7:04 am

Yes , correct.
http://www.openkeytech.com/ - Joomla Extension Development

User avatar
ianmac
Joomla! Virtuoso
Joomla! Virtuoso
Posts: 4784
Joined: Sat Sep 24, 2005 11:01 pm
Location: Toronto, Canada

Re: How to call plugin inside component for joomla 1.5?

Post by ianmac » Thu Nov 06, 2008 3:58 pm

shibu wrote:Yes , correct.
Just do:

$mainframe = &JFactory::getApplication();

$mainframe->triggerEvent('onAfterInitialise'); // or other event

Ian

User avatar
shibu
Joomla! Guru
Joomla! Guru
Posts: 681
Joined: Fri Oct 24, 2008 5:35 am
Location: Openkey Technologies, India
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by shibu » Thu Nov 06, 2008 5:35 pm

Thanks.
http://www.openkeytech.com/ - Joomla Extension Development

jshorb
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Dec 02, 2008 11:34 pm

Re: How to call plugin inside component for joomla 1.5?

Post by jshorb » Mon Dec 22, 2008 10:29 pm

I have a follow-up question. I am using the aWiki component extension and have the text stored in a variable "$article". I simply want to run the text of the aWiki article through the same filters/plugins that are run on my articles that are written within Joomla!. This is the view.html.php file:

Code: Select all

  function display($tpl = null)                                                                         
  { 
    global $mainframe;//
    $model =& $this->getModel();                                                                        
    $article = $model->getArticle();

    $mainframe = &JFactory::getApplication();//                                                           
    $params        =& $mainframe->getParams('com_awiki');//    
    $mainframe->triggerEvent('onPrepareContent', array( & $article, & $params, 0)); // HERE   

    $this->assignRef( 'article', $article );                                                            
        
    parent::display($tpl);
  }   
I have added all the lines which have comment marks after them. I'm fairly sure that my problem lies with the line indicated, but to be honest, I don't know what params are needed to run through all the various plugins. I know all the ones I'm looking to implement are search-and-replace style ones, so they don't actually use any of the params passed to them.

The code doesn't return any error messages in the log file, it renders the wiki text quite well. It just doesn't actually do any of the search and replaces. (for an example, I am using the WikiBot plugin)

If you need any other code or information, please let me know!

Thanks,
Justin

User avatar
MeeDNite
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 249
Joined: Sun Sep 21, 2008 3:31 am

Re: How to call plugin inside component for joomla 1.5?

Post by MeeDNite » Mon Jan 11, 2010 9:13 am

look here:
http://www.alltogetherasawhole.org/grou ... nt-plugins

This Guy Did it! :D


Cheers,
Milad

bhavin88
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Tue Jan 04, 2011 9:40 am

Re: How to call plugin inside component for joomla 1.5?

Post by bhavin88 » Fri Feb 04, 2011 8:22 am

hello,

i have same problem related with plugin. The scenario is that i have one custom module. In that module i fetch some articles from database and display it. And i used one plugin for facebook share, tweet button. when article's detail page will load that plugin properly. But when that module will load plugin not able to display that button.

i want to know that how do i call that plugin or any method of that plugin in my custom module.

Thanks.

neha2786
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Thu Jul 15, 2010 11:45 am

Re: How to call plugin inside component for joomla 1.5?

Post by neha2786 » Tue Mar 22, 2011 10:03 am

Hello,

I have to include a plugin inside a component. Please help me on how to do this?
I have "locator" component and want to include "Extra Vote" plugin inside it. How can I do this?

Thanks

User avatar
ursitesion
Joomla! Apprentice
Joomla! Apprentice
Posts: 32
Joined: Tue Aug 10, 2010 12:52 pm
Location: Delhi, India
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by ursitesion » Mon Apr 04, 2011 5:25 pm

Hi neha2786, its easy to call a plugin within third party extension. I have included "ExtraVote" plugin in my own component beside content. Following is the way to include "ExtraVote" plugin :

global $mainframe;
include_once('components/com_content/models/article.php');
include_once('components/com_content/helpers/query.php');
$dispatcher =& JDispatcher::getInstance();
$articleObject=new ContentModelArticle();
$id= JRequest::getVar('content_id'); // content_id is the id of the content
$limitstart = JRequest::getVar('limitstart', 0, '', 'int'); // for pagination, required for
$articleObject->setId($id);
$item=new JObject;
$item->text = $articleObject->getArticle();
$item->params = clone($mainframe->getParams('com_content'));
JPluginHelper::importPlugin('content'); // very important
$results=$dispatcher->trigger('onBeforeDisplayContent', array (& $item->text, & $item->params, $limitstart));
echo $results[0];

It worked for me. Let me know if any issue you have.

gurukatre
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Apr 28, 2009 7:37 am
Location: pune
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by gurukatre » Mon Jun 11, 2012 7:49 pm

Thanks
Kind Regards

gurukatre
Joomla! Intern
Joomla! Intern
Posts: 50
Joined: Tue Apr 28, 2009 7:37 am
Location: pune
Contact:

Re: How to call plugin inside component for joomla 1.5?

Post by gurukatre » Mon Jun 11, 2012 7:53 pm

Instead of calling built-in plugin trigger you can call your own function
for example :-

//here system is plugin group
JPluginHelper::importPlugin( 'system' );
$dispatcher =& JDispatcher::getInstance();

//here intercept_requests is function which is written in side one of the plugin of system group.
$results = $dispatcher->trigger( 'intercept_requests', array(JRequest::get('post')));

working for joomla 2.5 as well
Thanks
Kind Regards


Locked

Return to “Joomla! 1.5 Coding”