The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 17 posts ] 
Author Message
PostPosted: Wed Nov 05, 2008 5:52 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Oct 24, 2008 5:35 am
Posts: 671
Location: Adodis Technology Pvt Ltd, Bangalore
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.outsource-website-design.com/ - Outsource Your Website Design and Development
http://www.ecommerce-web-developers.com/ - ECommerce Web Development


Top
 Profile  
 
PostPosted: Wed Nov 05, 2008 6:10 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Oct 24, 2008 5:35 am
Posts: 671
Location: Adodis Technology Pvt Ltd, Bangalore
I want the code.

Thanks and regards
Shibu

_________________
http://www.outsource-website-design.com/ - Outsource Your Website Design and Development
http://www.ecommerce-web-developers.com/ - ECommerce Web Development


Top
 Profile  
 
PostPosted: Wed Nov 05, 2008 11:18 pm 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Mon Jul 10, 2006 8:16 pm
Posts: 249
Location: CA
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?


Top
 Profile  
 
PostPosted: Thu Nov 06, 2008 4:26 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Oct 24, 2008 5:35 am
Posts: 671
Location: Adodis Technology Pvt Ltd, Bangalore
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.outsource-website-design.com/ - Outsource Your Website Design and Development
http://www.ecommerce-web-developers.com/ - ECommerce Web Development


Top
 Profile  
 
PostPosted: Thu Nov 06, 2008 5:43 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Mon Jul 10, 2006 8:16 pm
Posts: 249
Location: CA
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


Top
 Profile  
 
PostPosted: Thu Nov 06, 2008 6:13 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Oct 24, 2008 5:35 am
Posts: 671
Location: Adodis Technology Pvt Ltd, Bangalore
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.outsource-website-design.com/ - Outsource Your Website Design and Development
http://www.ecommerce-web-developers.com/ - ECommerce Web Development


Top
 Profile  
 
PostPosted: Thu Nov 06, 2008 6:38 am 
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Mon Jul 10, 2006 8:16 pm
Posts: 249
Location: CA
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.


Top
 Profile  
 
PostPosted: Thu Nov 06, 2008 7:04 am 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Oct 24, 2008 5:35 am
Posts: 671
Location: Adodis Technology Pvt Ltd, Bangalore
Yes , correct.

_________________
http://www.outsource-website-design.com/ - Outsource Your Website Design and Development
http://www.ecommerce-web-developers.com/ - ECommerce Web Development


Top
 Profile  
 
PostPosted: Thu Nov 06, 2008 3:58 pm 
User avatar
Joomla! Virtuoso
Joomla! Virtuoso

Joined: Sat Sep 24, 2005 11:01 pm
Posts: 4785
Location: Toronto, Canada
shibu wrote:
Yes , correct.


Just do:

$mainframe = &JFactory::getApplication();

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

Ian


Top
 Profile  
 
PostPosted: Thu Nov 06, 2008 5:35 pm 
User avatar
Joomla! Guru
Joomla! Guru

Joined: Fri Oct 24, 2008 5:35 am
Posts: 671
Location: Adodis Technology Pvt Ltd, Bangalore
Thanks.

_________________
http://www.outsource-website-design.com/ - Outsource Your Website Design and Development
http://www.ecommerce-web-developers.com/ - ECommerce Web Development


Top
 Profile  
 
PostPosted: Mon Dec 22, 2008 10:29 pm 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Dec 02, 2008 11:34 pm
Posts: 5
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:
  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


Top
 Profile  
 
PostPosted: Mon Jan 11, 2010 9:13 am 
User avatar
Joomla! Enthusiast
Joomla! Enthusiast

Joined: Sun Sep 21, 2008 3:31 am
Posts: 241
look here:
http://www.alltogetherasawhole.org/group/developers/forum/topics/running-joomla-content-plugins

This Guy Did it! :D


Cheers,
Milad


Top
 Profile  
 
PostPosted: Fri Feb 04, 2011 8:22 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Jan 04, 2011 9:40 am
Posts: 9
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.


Top
 Profile  
 
PostPosted: Tue Mar 22, 2011 10:03 am 
Joomla! Fledgling
Joomla! Fledgling

Joined: Thu Jul 15, 2010 11:45 am
Posts: 3
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


Top
 Profile  
 
PostPosted: Mon Apr 04, 2011 5:25 pm 
User avatar
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue Aug 10, 2010 12:52 pm
Posts: 32
Location: Delhi, India
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.


Top
 Profile  
 
PostPosted: Mon Jun 11, 2012 7:49 pm 
Joomla! Intern
Joomla! Intern

Joined: Tue Apr 28, 2009 7:37 am
Posts: 50
Location: pune
Please check this site
http://docs.joomla.org/Supporting_plugi ... _component

_________________
Thanks
Kind Regards


Top
 Profile  
 
PostPosted: Mon Jun 11, 2012 7:53 pm 
Joomla! Intern
Joomla! Intern

Joined: Tue Apr 28, 2009 7:37 am
Posts: 50
Location: pune
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 17 posts ] 



Who is online

Users browsing this forum: No registered users and 8 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group