"/></a> <a href="<?php echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $user->id); ?> " class="wall-coc-author"><?php echo $user->getDisplayName(); ?> </a> <?php echo JText::_('POST ON'); ?> <span class="wall-coc-date"><?php echo $date->toFormat(JText::_('DATE_FORMAT_LC2')); ?> </span> <?php if (ActivityComments::isSiteAdmin() || $my->id == $act->actor) { ?> | <span class="coc-remove"><a href="javascript:void(0);" onclick="jax.call('community','plugins,activitycomment,removecomment','<?php echo $row->id; ?> ');"><?php echo JText::_('REMOVE COMMENT'); ?> </a></span> <?php } ?> <p><?php echo $row->comment; ?> </p>
function savecomment($response, $id, $value) { require_once JPATH_PLUGINS . DS . 'community' . DS . 'activitycomment' . DS . 'helper.php'; JPlugin::loadLanguage('plg_activitycomment', JPATH_ADMINISTRATOR); $my =& CFactory::getUser(); if ($my->id == 0) { return 'invalid'; } if (empty($value)) { $response->addScriptCall(ActivityComments::getjs() . '("#activity-' . $id . '-comment-errors").html("' . JText::_('COMMENT CANNOT BE EMPTY') . '").css("color","red");'); return $response->sendResponse(); } $my =& CFactory::getUser(); require_once JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'models' . DS . 'wall.php'; $wall =& JTable::getInstance('Wall', 'CTable'); CFactory::load('helpers', 'linkgenerator'); $params = ActivityComments::getParams(); $value = strip_tags($value); $value = cGenerateURILinks($value, true, $params->get('shareurltarget')); // Get current date $date =& JFactory::getDate(); $now = $date->toMySQL(); $wall->type = 'activity'; $wall->contentid = $id; $wall->post_by = $my->id; $wall->comment = $value; $wall->date = $now; $wall->published = 1; $wall->ip = $_SERVER['REMOTE_ADDR']; $wall->store(); $params = ActivityComments::getParams(); $sendEmail = $params->get('notifycomment', 0); $db =& JFactory::getDBO(); if ($sendEmail == 1) { $query = 'select actor from #__community_activities where id=' . $db->Quote($id); $db->setQuery($query); $actorId = $db->loadResult(); if ($actorId != $my->id) { $actor =& CFactory::getUser($actorId); CFactory::load('libraries', 'notification'); $notification = new CNotificationLibrary(); $current = CRoute::emailLink(ActivityComments::getCurrent(), false) . '#profile-newsfeed-item' . $id; $notification->add('profile.activity.comment', $my->id, $actorId, JText::sprintf('SOMEONE COMMENTED MAIL SUBJECT', $my->getDisplayName()), JText::sprintf('SOMEONE COMMENTED MAIL CONTENT', $actor->getDisplayName(), $my->getDisplayName(), $current)); } } // send emails to subscribers $a = 'select * from #__activity_subscribe where ' . '`activity_id`=' . $db->Quote($id) . ' ' . 'and `type`=' . $db->Quote('profile'); $db->setQuery($a); $subscribers = $db->loadObjectList(); if ($subscribers) { $emails = array(); foreach ($subscribers as $subscriber) { $emails[] = $subscriber->user_id; } CFactory::load('libraries', 'notification'); $notification = new CNotificationLibrary(); $current = CRoute::emailLink(ActivityComments::getCurrent(), false) . '#profile-newsfeed-item' . $id; $notification->add('profile.activity.comment', $my->id, $emails, JText::sprintf('SUBSCRIBE SOMEONE COMMENTED MAIL SUBJECT', $my->getDisplayName()), JText::sprintf('SUBSCRIBE SOMEONE COMMENTED MAIL CONTENT', $my->getDisplayName(), $current)); } $joomla = JFactory::getConfig(); $offset = $my->getParam('timezone', $joomla->getValue('offset')); $config = CFactory::getConfig(); $date->setOffset($offset + $config->get('daylightsavingoffset')); ob_start(); ?> <div class="wallcmt small" id="activity-comment-item-<?php echo $wall->id; ?> "> <a href="<?php echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id); ?> "><img class="wall-coc-avatar" src="<?php echo $my->getThumbAvatar(); ?> "/></a> <a href="<?php echo CRoute::_('index.php?option=com_community&view=profile&userid=' . $my->id); ?> " class="wall-coc-author"><?php echo $my->getDisplayName(); ?> </a> <?php echo JText::_('POST ON'); ?> <span class="wall-coc-date"><?php echo $date->toFormat(JText::_('DATE_FORMAT_LC2')); ?> </span> <?php if (ActivityComments::isSiteAdmin()) { ?> | <span class="coc-remove"><a href="javascript:void(0);" onclick="jax.call('community','plugins,activitycomment,removecomment','<?php echo $wall->id; ?> ');"><?php echo JText::_('REMOVE COMMENT'); ?> </a></span> <?php } ?> <p><?php echo $wall->comment; ?> </p> </div> <?php $contents = ob_get_contents(); ob_end_clean(); $closeComment = $params->get('autoclose', 0); if ($closeComment) { $response->addScriptCall('activityHideComment', $id); } $response->addScriptCall(ActivityComments::getjs() . '("#activity-' . $id . '-comment-errors").html("' . JText::_('COMMENT ADDED') . '").css("color","green");'); $response->addScriptCall('activityInsertComment', $id, $contents, $params->get('commentordering', 'asc')); return $response->sendResponse(); }