本文整理汇总了PHP中KunenaForumCategoryHelper::subscribe方法的典型用法代码示例。如果您正苦于以下问题:PHP KunenaForumCategoryHelper::subscribe方法的具体用法?PHP KunenaForumCategoryHelper::subscribe怎么用?PHP KunenaForumCategoryHelper::subscribe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KunenaForumCategoryHelper
的用法示例。
在下文中一共展示了KunenaForumCategoryHelper::subscribe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unSubscribeCategory
/**
* Un-subscribe from a category
*
* @param string|int $catid Forum Category id
* @param UserTable $user Viewed at User
* @param PluginTable $plugin Current Plugin
* @return boolean Result
*/
public static function unSubscribeCategory($catid, $user, $plugin)
{
if (!class_exists('KunenaForumCategoryHelper')) {
return false;
}
if ($catid == 'all') {
$categories = KunenaForumCategoryHelper::getLatestSubscriptions((int) $user->id, 0, 0);
$ids = array_keys(array_pop($categories));
} else {
$ids = array((int) $catid);
}
if (!$ids || !KunenaForumCategoryHelper::subscribe($ids, 0, (int) $user->id)) {
return false;
}
return true;
}
示例2: unSubscribeCategory
/**
* Un-subscribe from a category
*
* @param string|int $catid Forum Category id
* @param UserTable $user Viewed at User
* @param PluginTable $plugin Current Plugin
* @return boolean Result
*/
static public function unSubscribeCategory( $catid, $user, /** @noinspection PhpUnusedParameterInspection */ $plugin )
{
if ( ! class_exists( 'KunenaForumCategoryHelper' ) ) {
return false;
}
if ( $catid == 'all' ) {
$categories = KunenaForumCategoryHelper::getLatestSubscriptions( (int) $user->id, 0, 0 );
$ids = array_keys( array_pop( $categories ) );
} else {
$ids = array( (int) $catid );
}
if ( ( ! $ids ) || ( ! KunenaForumCategoryHelper::subscribe( $ids, 0, (int) $user->id ) ) ) {
return false;
}
return true;
}