本文整理匯總了PHP中TBGSettings::isDefaultUserGuest方法的典型用法代碼示例。如果您正苦於以下問題:PHP TBGSettings::isDefaultUserGuest方法的具體用法?PHP TBGSettings::isDefaultUserGuest怎麽用?PHP TBGSettings::isDefaultUserGuest使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類TBGSettings
的用法示例。
在下文中一共展示了TBGSettings::isDefaultUserGuest方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __
disabled<?php
}
?>
>
<option value=1<?php
if (TBGSettings::isDefaultUserGuest()) {
?>
selected<?php
}
?>
><?php
echo __('No, the default user is a guest account');
?>
</option>
<option value=0<?php
if (!TBGSettings::isDefaultUserGuest()) {
?>
selected<?php
}
?>
><?php
echo __('Yes, the default user is a normal account');
?>
</option>
</select>
</td>
</tr>
<tr>
<td class="config_explanation" colspan="2"><?php
echo __('Select if the default user is a guest user or a normal user');
?>
示例2: isGuest
/**
* Checks whether or not the current user is a "regular" or "guest" user
*
* @return boolean
*/
public function isGuest()
{
return (bool) (!$this->isLoggedIn() || $this->getID() == TBGSettings::getDefaultUserID() && TBGSettings::isDefaultUserGuest());
}
示例3: hasUserVoted
/**
* Whether or not the current user has voted
*
* @return boolean
*/
public function hasUserVoted($user_id, $up)
{
$user_id = is_object($user_id) ? $user_id->getID() : $user_id;
$this->_setupVotes();
if ($user_id == TBGSettings::getDefaultUserID() && TBGSettings::isDefaultUserGuest() || !$this->getProject()->canVoteOnIssues()) {
return true;
}
if (array_key_exists($user_id, $this->_votes)) {
return $up ? (int) $this->_votes[$user_id] > 0 : (int) $this->_votes[$user_id] < 0;
} else {
return false;
}
}