本文整理汇总了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 );
//.........这里部分代码省略.........