本文整理汇总了PHP中GWF_User::getUserData方法的典型用法代码示例。如果您正苦于以下问题:PHP GWF_User::getUserData方法的具体用法?PHP GWF_User::getUserData怎么用?PHP GWF_User::getUserData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GWF_User
的用法示例。
在下文中一共展示了GWF_User::getUserData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getUnreadForum
/**
* Get Forum Unread Counter - Quickhook for topmenu.
* @param array(GWF_User $user)
* @return string the counter enclosed in [counter]
* @todo create countUnread()
*/
public static function getUnreadForum(GWF_User $user, $pattern = '[%s]', $default = '[0]')
{
if (false === self::loadModuleClass('Forum', 'GWF_ForumThread.php')) {
return '';
}
if (true === $user->isGuest() || true === $user->isWebspider()) {
return '';
}
$uid = $user->getID();
$data = $user->getUserData();
$grp = GWF_TABLE_PREFIX . 'usergroup';
$permquery = "(thread_gid=0 OR (SELECT 1 FROM {$grp} WHERE ug_userid={$uid} AND ug_groupid=thread_gid))";
$stamp = isset($data['GWF_FORUM_STAMP']) ? $data['GWF_FORUM_STAMP'] : $user->getVar('user_regdate');
$regtimequery = sprintf('thread_lastdate>=\'%s\'', $stamp);
$conditions = "( (thread_postcount>0) AND ({$permquery}) AND ({$regtimequery} OR thread_force_unread LIKE '%:{$uid}:%') AND (thread_unread NOT LIKE '%:{$uid}:%') AND (thread_options&4=0) )";
if (false === ($count = GDO::table('GWF_ForumThread')->selectVar('COUNT(*)', $conditions))) {
return '';
# DB Error
}
return $count === '0' ? $default : sprintf($pattern, $count);
}
示例2: isAPIKeyCorrect
public function isAPIKeyCorrect(GWF_User $user, $api_key)
{
$data = $user->getUserData();
if (!isset($data['WC_NO_XSS_PASS'])) {
return false;
}
return $data['WC_NO_XSS_PASS'] === $api_key;
}
示例3: getReadStamp
private static function getReadStamp(GWF_User $user)
{
$data = $user->getUserData();
return isset($data[self::STAMP_NAME]) ? $data[self::STAMP_NAME] : $user->getVar('user_regdate');
}