Kunena 6.2.5 & module Kunena Latest 6.0.7 released

The Kunena team has announce the arrival of Kunena 6.2.5 [K 6.2.5] which is now available for download as a native Joomla extension for J! 4.3.x/4.4.x/5.0.x. This version addresses most of the issues that were discovered in K 6.1 / K 6.2 and issues discovered during the last development stages of K 6.2

This category contains miscellaneous, uncategorised third-party extensions (e.g. JomSocial, Community Builder, etc.) relating to older versions of Kunena that are no longer supported.

This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.

The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, the ideas in these topics may not work with later versions and, for that reason, the topics are locked.

Question EmailToSubscribers only Topics!

More
13 years 4 months ago #1 by dazzafact
Hello,
if a user post a answer to a subscribed topic there will be also send a email to the Subscribers. How can i change this to send only emails if there is post a new Topic? Not for Answers only for Topics?
I want to ask with Php, if the post was a Topic not a reply.
Code:
public function emailToSubscribers($LastPostUrl = false, $mailsubs = false, $mailmods = false, $mailadmins = false) { if ($LastPostUrl === false) { jimport ( 'joomla.environment.uri' ); $uri = JURI::getInstance ( JURI::base () ); $LastPostUrl = $uri->toString ( array ('scheme', 'host', 'port' ) ) . CKunenaLink::GetMessageURL($this->get ( 'id' ), $this->get ( 'catid' ), 0, false); } //get all subscribers, moderators and admins who will get the email $emailToList = CKunenaTools::getEMailToList ( $this->get ( 'catid' ), $this->get ( 'thread' ), $mailsubs, $mailmods, $mailadmins, $this->_my->id ); if (count ( $emailToList )) { jimport('joomla.mail.helper'); if (! $this->_config->email || ! JMailHelper::isEmailAddress ( $this->_config->email )) { $this->_app->enqueueMessage ( JText::_ ( 'COM_KUNENA_EMAIL_INVALID' ), 'notice' ); return false; } else if ($_SERVER ["REMOTE_ADDR"] == '127.0.0.1') { $this->_app->enqueueMessage ( JText::_ ( 'COM_KUNENA_EMAIL_DISABLED' ), 'notice' ); return false; } // clean up the message for review $authorname = $this->get ( 'name' ); $message = smile::purify ( $this->get ( 'message' ) ); $subject = $this->get ( 'subject' ); $mailsender = JMailHelper::cleanAddress ( $this->_config->board_title . " " . JText::_ ( 'COM_KUNENA_GEN_FORUM' ) ); $mailsubject = JMailHelper::cleanSubject ( "[" . $this->_config->board_title . " " . JText::_ ( 'COM_KUNENA_GEN_FORUM' ) . "] " . $subject . " (" . $this->parent->catname . ")" ); foreach ( $emailToList as $emailTo ) { if (! $emailTo->email || ! JMailHelper::isEmailAddress ( $emailTo->email )) continue; if ($emailTo->subscription) { $msg1 = JText::_ ( 'COM_KUNENA_POST_EMAIL_NOTIFICATION1' ); $msg2 = JText::_ ( 'COM_KUNENA_POST_EMAIL_NOTIFICATION2' ); } else { $msg1 = JText::_ ( 'COM_KUNENA_POST_EMAIL_MOD1' ); $msg2 = JText::_ ( 'COM_KUNENA_POST_EMAIL_MOD2' ); } $msg = "$emailTo->name,\n\n"; $msg .= $msg1 . " " . $this->_config->board_title . " " . JText::_ ( 'COM_KUNENA_GEN_FORUM' ) . "\n\n"; $msg .= JText::_ ( 'COM_KUNENA_MESSAGE_SUBJECT' ) . ": " . $subject . "\n"; $msg .= JText::_ ( 'COM_KUNENA_GEN_FORUM' ) . ": " . $this->parent->catname . "\n"; $msg .= JText::_ ( 'COM_KUNENA_VIEW_POSTED' ) . ": " . $authorname . "\n\n"; $msg .= $msg2 . "\n"; $msg .= "URL: $LastPostUrl\n\n"; if ($this->_config->mailfull == 1) { $msg .= JText::_ ( 'COM_KUNENA_GEN_MESSAGE' ) . ":\n-----\n"; $msg .= $message; $msg .= "\n-----"; } $msg .= "\n\n"; $msg .= JText::_ ( 'COM_KUNENA_POST_EMAIL_NOTIFICATION3' ) . "\n"; $msg .= "\n\n\n\n"; $msg .= "** Powered by Kunena! - http://www.kunena.org **"; $msg = JMailHelper::cleanBody ( $msg ); JUtility::sendMail ( $this->_config->email, $mailsender, $emailTo->email, $mailsubject, $msg ); } } }

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

Time to create page: 0.409 seconds