本文整理汇总了PHP中JUser::exists方法的典型用法代码示例。如果您正苦于以下问题:PHP JUser::exists方法的具体用法?PHP JUser::exists怎么用?PHP JUser::exists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JUser
的用法示例。
在下文中一共展示了JUser::exists方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showForm
/**
* @param $row
* @param KunenaForumCategory $category
* @param KunenaForumTopic $topic
* @param $subject
*
* @return string
*/
protected function showForm($row, KunenaForumCategory $category, KunenaForumTopic $topic, $subject)
{
$canPost = $this->canPost($category, $topic);
if (!$canPost) {
if (!$this->user->exists()) {
$this->debug("showForm: Public posting is not permitted, show login instead");
$login = KunenaLogin::getInstance();
$loginlink = $login->getLoginURL();
$registerlink = $login->getRegistrationURL();
$this->msg = JText::sprintf('PLG_KUNENADISCUSS_LOGIN_OR_REGISTER', '"' . $loginlink . '"', '"' . $registerlink . '"');
} else {
$this->debug("showForm: Unfortunately you cannot discuss this item");
$this->msg = JText::_('PLG_KUNENADISCUSS_NO_PERMISSION_TO_POST');
}
}
$this->open = $this->params->get('quickpost_open', false);
$this->name = JRequest::getString('name', $this->user->getName(), 'POST');
$this->email = JRequest::getString('email', null, 'POST');
$this->message = JRequest::getString('message', null, 'POST');
ob_start();
$this->debug("showForm: Rendering form");
include __DIR__ . "/tmpl/form.php";
$str = ob_get_contents();
ob_end_clean();
return $str;
}