当前位置: 首页>>代码示例>>PHP>>正文


PHP CBuser::load方法代码示例

本文整理汇总了PHP中CBuser::load方法的典型用法代码示例。如果您正苦于以下问题:PHP CBuser::load方法的具体用法?PHP CBuser::load怎么用?PHP CBuser::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBuser的用法示例。


在下文中一共展示了CBuser::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getAuto

	private function getAuto( $user, $rawPassword, $extras, $trigger ) {
		$cbUser									=	new CBuser();

		$cbUser->load( (int) $user->id );

		if ( ( ! isset( $user->gids ) ) || ( isset( $user->gids ) && ( ! is_array( $user->gids ) ) ) ) {
			$gids								=	array( $user->gid );
		} else {
			$gids								=	$user->gids;
		}

		if ( $user->id ) {
			array_unshift( $gids, -3 );

			if ( isModerator( $user->id ) ) {
				array_unshift( $gids, -5 );
			} else {
				array_unshift( $gids, -4 );
			}
		} else {
			array_unshift( $gids, -2 );
		}

		array_unshift( $gids, -1 );

		$access									=	explode( '|*|', $trigger->get( 'access' ) );

		if ( ! array_intersect( $access, $gids ) ) {
			return;
		}

		$conditionals							=	count( explode( "\n", $trigger->get( 'field' ) ) );

		for ( $i = 0, $n = $conditionals; $i < $n; $i++ ) {
			if ( ! cbgjautoClass::getFieldMatch( $user, $cbUser, $extras, cbgjClass::getHTMLCleanParam( true, "field$i", null, null, $trigger->get( 'field' ) ), cbgjClass::getCleanParam( true, "operator$i", null, null, $trigger->get( 'operator' ) ), cbgjClass::getHTMLCleanParam( true, "value$i", null, null, $trigger->get( 'value' ) ) ) ) {
				return;
			}
		}

		$plugin									=	cbgjClass::getPlugin();
		$exclude								=	$trigger->get( 'exclude' );

		if ( $exclude ) {
			cbArrayToInts( explode( ',', $exclude ) );

			$exclude							=	array_unique( $exclude );

			if ( in_array( $user->id, $exclude ) ) {
				return;
			}
		}

		$params									=	$trigger->getParams();

		if ( ( $params->get( 'auto', null ) == 3 ) && $params->get( 'cat_name', null ) ) {
			$owner								=	(int) $cbUser->replaceUserVars( $params->get( 'cat_owner', $user->id ), true, true, $extras );

			if ( ! $owner ) {
				$owner							=	(int) $user->id;
			}

			$parent								=	(int) $params->get( 'cat_parent', 0 );
			$name								=	trim( strip_tags( $cbUser->replaceUserVars( $params->get( 'cat_name', null ), true, true, $extras ) ) );
			$description						=	$cbUser->replaceUserVars( $params->get( 'cat_description', null ), true, true, $extras );

			if ( $params->get( 'cat_unique', 1 ) ) {
				$where							=	array( array( 'user_id', '=', $owner ), array( 'name', '=', $name ), array( 'parent', '=', (int) $parent ) );
			} else {
				$where							=	array( array( 'name', '=', $name ), array( 'parent', '=', (int) $parent ) );
			}

			$row								=	cbgjData::getCategories( null, $where, null, null, false );

			if ( ! $row->get( 'id' ) ) {
				$row->set( 'published', 1 );
				$row->set( 'parent', (int) $parent );
				$row->set( 'user_id', $owner );
				$row->set( 'name', $name );

				if ( $plugin->params->get( 'category_editor', 1 ) >= 2 ) {
					$row->set( 'description', cbgjClass::getFilteredText( $description ) );
				} else {
					$row->set( 'description', trim( strip_tags( $description ) ) );
				}

				$row->set( 'access', (int) $plugin->params->get( 'category_access_default', -2 ) );
				$row->set( 'types', $params->get( 'types', $plugin->params->get( 'category_types_default', '1|*|2|*|3' ) ) );
				$row->set( 'create', (int) $plugin->params->get( 'category_create_default', 1 ) );
				$row->set( 'create_access', (int) $plugin->params->get( 'category_createaccess_default', -1 ) );
				$row->set( 'nested', (int) $plugin->params->get( 'category_nested_default', 1 ) );
				$row->set( 'nested_access', (int) $plugin->params->get( 'category_nestedaccess_default', -1 ) );
				$row->set( 'date', cbgjClass::getUTCDate() );
				$row->set( 'ordering', 99999 );

				$row->store();
			}
		} elseif ( ( $params->get( 'auto', null ) == 2 ) && $params->get( 'category', null ) && $params->get( 'grp_name', null ) ) {
			if ( ( $params->get( 'category', null ) == -1 ) && $params->get( 'cat_name', null ) ) {
				$owner							=	(int) $cbUser->replaceUserVars( $params->get( 'cat_owner', $user->id ), true, true, $extras );

//.........这里部分代码省略.........
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:101,代码来源:cbgroupjiveauto.php


注:本文中的CBuser::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。