本文整理匯總了PHP中GWF_User::isWebspider方法的典型用法代碼示例。如果您正苦於以下問題:PHP GWF_User::isWebspider方法的具體用法?PHP GWF_User::isWebspider怎麽用?PHP GWF_User::isWebspider使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類GWF_User
的用法示例。
在下文中一共展示了GWF_User::isWebspider方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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);
}