Keyword

Contact Author, Please HELP!

  • Tomoko Goto
  • Tomoko Goto's Avatar Topic Author
  • Offline
  • New Member
More
12 years 5 months ago #65240 by Tomoko Goto
Contact Author, Please HELP! was created by Tomoko Goto
Hello,

I am looking for module or plugin allow all the registered users to contact author of the item through a contact form on the k2 item page?
I have currently installed Joomla 2.5.4 and k2 2.5.6.
I hope there is a piece of clue for this inquiry.

Cheers.

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago #65241 by william white
Replied by william white on topic Re: Contact Author, Please HELP!
you will have to either include email code emailto: in your custom override or, use the example plugin and create a simple plugin to do this

Please Log in or Create an account to join the conversation.

  • Tomoko Goto
  • Tomoko Goto's Avatar Topic Author
  • Offline
  • New Member
More
12 years 5 months ago #65242 by Tomoko Goto
Replied by Tomoko Goto on topic Re: Contact Author, Please HELP!
Thanks for your help and quick reply.
I knew that you gonna comment as always.
I actually am a beginner of joomla and k2.
I really appreciate if you explain more about first option coz second one sounds difficult for me.
Do I have to override default.php under comphonent/com_mailto/views/mailto/tmpl/?

Please Log in or Create an account to join the conversation.

  • Tomoko Goto
  • Tomoko Goto's Avatar Topic Author
  • Offline
  • New Member
More
12 years 5 months ago #65243 by Tomoko Goto
Replied by Tomoko Goto on topic Re: Contact Author, Please HELP!
Hello william,
I am creating a plugin for this. everything works fine except one thing I can not find solution.
I need to retrieve author's email address from k2 item page and following code doesn't work.

$this->_params = new JParameter( $this->item->params->get('itemAuthorEmail'));

Currently, defined jimport and JLoader as follow

jimport('joomla.plugins.plugin');
JLoader::register('K2Plugin', JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'lib'.DS.'k2plugin.php');

Am I missing jimport and/or JLoader?

Please Log in or Create an account to join the conversation.

More
12 years 5 months ago - 12 years 5 months ago #65244 by william white
Replied by william white on topic Re: Contact Author, Please HELP!
I played with it a bit in an override and the code below placed in item.php will detect registared user and present a link to the authors email address. You might be able to use some of the syntax in your plugin.
Please post your code for the plugin if you will.
<!-- Start Code Email Author -->                    
 <?php $user =& JFactory::getUser(); ?>
  <?php if($user->get('guest') ==0 ) {echo "<a href=" . '"mailto:' . $this->item->author->email .'">Email Author </a>' ;}
 else {echo "";} ?>
<!-- End Code Email Author -->

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum