本文整理汇总了PHP中JUser::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP JUser::getName方法的具体用法?PHP JUser::getName怎么用?PHP JUser::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUser
的用法示例。
在下文中一共展示了JUser::getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: replyTopic
/**
* @param $row
* @param KunenaForumCategory $category
* @param KunenaForumTopic $topic
* @param $subject
*
* @return bool|string
*/
protected function replyTopic($row, KunenaForumCategory $category, KunenaForumTopic $topic, $subject)
{
$uri = JFactory::getURI();
if (JSession::checkToken() == false) {
$this->app->enqueueMessage(JText::_('COM_KUNENA_ERROR_TOKEN'), 'error');
return false;
}
/*if ($this->hasCaptcha() && !$this->verifyCaptcha()) {
return $this->showForm ( $row, $category, $topic, $subject );
}*/
// Create topic if it doesn't exist
if (!$topic->exists()) {
$topic = $this->createTopic($row, $category, $subject);
}
$params = array('name' => JRequest::getString('name', $this->user->getName(), 'POST'), 'email' => JRequest::getString('email', null, 'POST'), 'subject' => $subject, 'message' => JRequest::getString('message', null, 'POST'));
if ($this->hasCaptcha() && !$this->verifyCaptcha()) {
$this->app->redirect($uri->toString(), $result);
}
$message = $topic->newReply($params);
$success = $message->save();
if (!$success) {
$this->app->enqueueMessage($message->getError(), 'error');
return false;
}
$message->sendNotification();
if ($message->hold) {
$result = JText::_('PLG_KUNENADISCUSS_PENDING_MODERATOR_APPROVAL');
} else {
$result = JText::_('PLG_KUNENADISCUSS_MESSAGE_POSTED');
}
// Redirect
$app = JFactory::getApplication('site');
$app->redirect($uri->toString(), $result);
return '';
}