// Add hooks for BuddyBoss profile type changes function usc_init_buddyboss_hooks() { // Check if BuddyBoss is active and integration is enabled if (function_exists('bp_get_member_type') && function_exists('bp_get_member_types')) { $buddyboss_integration_enabled = get_site_option('usc_buddyboss_integration_enabled', false); if ($buddyboss_integration_enabled) { // Hook into profile type changes add_action('bp_set_member_type', 'usc_handle_profile_type_change', 10, 3); add_action('bp_remove_member_type', 'usc_handle_profile_type_change', 10, 2); USC_Logger::log("BuddyBoss integration hooks initialized"); } } } add_action('init', 'usc_init_buddyboss_hooks'); /** * Handle profile type changes and update user roles accordingly */ function usc_handle_profile_type_change($user_id, $member_type, $append = false) { // Skip if user is being processed already to prevent recursion global $usc_currently_processing; if (!isset($usc_currently_processing)) { $usc_currently_processing = array(); } $process_key = "profile_type_change_{$user_id}"; if (isset($usc_currently_processing[$process_key])) { return; } $usc_currently_processing[$process_key] = true; // Get profile type mapping $profile_type_mapping = get_site_option('usc_profile_type_role_mapping', array()); // Get user's current profile types $profile_types = bp_get_member_type($user_id, false); if (!is_array($profile_types)) { $profile_types = $profile_types ? array($profile_types) : array(); } // Get roles to assign based on profile types $roles_to_assign = array(); foreach ($profile_types as $type) { if (isset($profile_type_mapping[$type]) && is_array($profile_type_mapping[$type])) { $roles_to_assign = array_merge($roles_to_assign, $profile_type_mapping[$type]); } } // Remove duplicates $roles_to_assign = array_unique($roles_to_assign); if (!empty($roles_to_assign)) { // Get user $user = get_user_by('ID', $user_id); if (!$user) { unset($usc_currently_processing[$process_key]); return; } // Update user roles on main site $current_blog_id = get_current_blog_id(); switch_to_blog(1); // Main site // Temporarily remove hooks to prevent recursion remove_action('add_user_role', 'enhanced_sync_user_data', 20); remove_action('remove_user_role', 'enhanced_sync_user_data', 20); remove_action('set_user_role', 'enhanced_sync_user_data', 20); // Remove all existing roles if not appending if (!$append) { $current_roles = $user->roles; foreach ($current_roles as $role) { // Don't remove administrator role for safety if ($role != 'administrator') { $user->remove_role($role); } } } // Add new roles foreach ($roles_to_assign as $role) { $user->add_role($role); } // Restore hooks add_action('add_user_role', 'enhanced_sync_user_data', 20); add_action('remove_user_role', 'enhanced_sync_user_data', 20); add_action('set_user_role', 'enhanced_sync_user_data', 20); restore_current_blog(); // Trigger sync to propagate roles to all subsites enhanced_sync_user_data($user_id); USC_Logger::log("Updated roles for user $user_id based on BuddyBoss profile types: " . implode(', ', $profile_types)); } unset($usc_currently_processing[$process_key]); } /** * Register custom cron schedules */ function usc_add_cron_schedules($schedules) { $schedules['one_minute'] = array( 'interval' => 60, 'display' => __('Every Minute') ); $schedules['five_minutes'] = array( 'interval' => 300, 'display' => __('Every 5 Minutes') ); $schedules['fifteen_minutes'] = array( 'interval' => 900, 'display' => __('Every 15 Minutes') ); $schedules['thirty_minutes'] = array( 'interval' => 1800, 'display' => __('Every 30 Minutes') ); return $schedules; } add_filter('cron_schedules', 'usc_add_cron_schedules'); /** * Targeted Sync functionality for Enhanced Multisite User Role & Capability Sync * * This file implements the targeted sync feature that processes only newly registered * users and users whose roles or profile types have been updated recently. */ // Exit if accessed directly if (!defined('ABSPATH')) exit; /** * Class to handle Targeted Sync functionality */ class USC_Targeted_Sync { /** * Constructor */ public function __construct() { // Initialize hooks $this->init_hooks(); } /** * Initialize hooks */ private function init_hooks() { // Register cron action add_action('usc_targeted_sync_cron', array($this, 'process_pending_users')); // Track users that need syncing add_action('user_register', array($this, 'mark_user_for_sync')); add_action('add_user_role', array($this, 'mark_user_for_sync')); add_action('remove_user_role', array($this, 'mark_user_for_sync')); add_action('set_user_role', array($this, 'mark_user_for_sync')); // If BuddyBoss is active, track profile type changes if (function_exists('bp_get_member_type')) { add_action('bp_set_member_type', array($this, 'mark_user_for_sync')); add_action('bp_remove_member_type', array($this, 'mark_user_for_sync')); } // Schedule initial cron if not already scheduled if (!wp_next_scheduled('usc_targeted_sync_cron')) { $cron_interval = get_site_option('usc_cron_interval', 'five_minutes'); if ($cron_interval != 'disabled') { wp_schedule_event(time(), $cron_interval, 'usc_targeted_sync_cron'); USC_Logger::log("Targeted sync cron scheduled with interval: $cron_interval"); } } } /** * Mark a user for syncing */ public function mark_user_for_sync($user_id) { // If we received a different parameter (like from bp_set_member_type), extract user_id if (is_array($user_id) && isset($user_id['user_id'])) { $user_id = $user_id['user_id']; } // Get current pending users $pending_users = get_site_option('usc_pending_sync_users', array()); // Add user to pending list if not already there if (!in_array($user_id, $pending_users)) { $pending_users[] = $user_id; update_site_option('usc_pending_sync_users', $pending_users); USC_Logger::log("User $user_id marked for sync"); } } /** * Process pending users */ public function process_pending_users() { // Check if sync is already running if (USC_Database::is_sync_locked()) { USC_Logger::log("Targeted sync skipped - another sync operation is in progress"); return; } // Get pending users $pending_users = get_site_option('usc_pending_sync_users', array()); if (empty($pending_users)) { USC_Logger::log("No pending users to sync"); return; } // Get sync settings $include_admins = get_site_option('usc_include_admins', false); $skip_empty_roles = get_site_option('usc_skip_empty_roles', true); $batch_size = get_site_option('usc_batch_size', 10); // Limit batch size $users_to_process = array_slice($pending_users, 0, $batch_size); // Set sync lock USC_Database::set_sync_lock(array( 'time' => current_time('mysql'), 'admin_id' => 0, // System 'args' => array( 'include_admins' => $include_admins, 'skip_empty_roles' => $skip_empty_roles, 'targeted' => true ) )); // Initialize sync state $sync_state = array( 'in_progress' => true, 'start_time' => current_time('mysql'), 'last_time' => current_time('mysql'), 'total_users' => count($users_to_process), 'processed' => 0, 'success_count' => 0, 'failure_count' => 0, 'include_admins' => $include_admins, 'skip_empty_roles' => $skip_empty_roles, 'targeted' => true ); USC_Database::save_sync_state($sync_state); USC_Logger::log("Starting targeted sync of " . count($users_to_process) . " users"); // Process users $success_count = 0; $failure_count = 0; $processed_users = array(); foreach ($users_to_process as $user_id) { // Skip administrators if not included if (!$include_admins && user_can($user_id, 'manage_network')) { USC_Logger::log("Skipping administrator user: $user_id"); $processed_users[] = $user_id; continue; } // Sync user $result = enhanced_sync_user_data($user_id, false, $skip_empty_roles); if ($result) { $success_count++; } else { $failure_count++; } // Mark as processed $processed_users[] = $user_id; // Update sync state $sync_state['processed']++; $sync_state['success_count'] = $success_count; $sync_state['failure_count'] = $failure_count; $sync_state['last_time'] = current_time('mysql'); USC_Database::save_sync_state($sync_state); } // Remove processed users from pending list $pending_users = array_diff($pending_users, $processed_users); update_site_option('usc_pending_sync_users', $pending_users); // Clear sync lock and state USC_Database::clear_sync_lock(); USC_Database::clear_sync_state(); USC_Logger::log("Completed targeted sync. Processed: " . count($processed_users) . ", Success: $success_count, Failures: $failure_count, Remaining: " . count($pending_users)); } /** * Get current targeted sync status */ public static function get_status() { $pending_users = get_site_option('usc_pending_sync_users', array()); $cron_interval = get_site_option('usc_cron_interval', 'five_minutes'); $next_run = wp_next_scheduled('usc_targeted_sync_cron'); return array( 'pending_count' => count($pending_users), 'cron_interval' => $cron_interval, 'next_run' => $next_run, 'enabled' => ($cron_interval != 'disabled') ); } } // Initialize the class new USC_Targeted_Sync(); Register إنشاء عضوية – الحق المغير للحياة Life Changing Truth
القائمة إغلاق

Register إنشاء عضوية

 
 
 

موقعنا يحتوي على ألاف المحتويات منها العام ومنها الخاص (التي تظهر للمستخدم حسب القسم والعضوية SN)…إن أردت الإطلاع والإستفادة من هذه المحتويات يمكنك إنشاء حساب مجاني واحد للإشتراك في أيا مما يلي أو كلهم : – مدارس الكتاب المقدس بالإنترنت أو بالحضور  أو  المناهج –  المشتريات المتجر  – لرؤية المحتويات الأعضاء الخاصة اي للدخول على:  قسم الأعضاء الخاص إس إن SN  أو  أقسام  الشباب  و  الأطفال.

بعد إنشاء حسابك بنجاح، سيتم تنشيطه في نفس الوقت وسينشأ بمستوى عضوية قاصر على مدارس الكتاب والمتجر فقط، ولكن لرفع مستوى العضوية للإطلاع على محتويات الأعضاء والإجتماعات الخاصة SN هذا يتم في خلال يومين بالأكثر. بعد ملء الإستمارة بالأسفل ستطلع عليها الإدارة لتحديد نوع العضوية طبقا لبياناتك.. رجاء لا تكرر ملء إستمارة العضوية أكثر من مرة … في حال عدم الرد تواصل معنا.

– رجاء بعد ضغطك على  “Create Membership إنشيء عضوية”  أن تنتظر لتتأكد أنه تم تحويلك الى صفحة مرحبا Welcome، للتأكد من ملئك لها بطريقة سليمة، ووصولها لنا.   مالم تظهر رسالة التأكيد نرجو النظر في الخانات ومراجعتها جيدا وملء الخانات الناقصة، وإعادة الضغط على الزر بالأسفل.

 * يحق لخدمة الحق المغير للحياة أن تقبل أو لا تقبل عضوية المتقدم بالإشتراك * بملئك لهذه الإستمارة أنت تؤكد أنك قد إطلعت على وتوافق على بنود الخصوصية والإسترجاع والعضوية والإقتباس التي في صفحة البنود


 Registration Form إستمارة إنشاء حساب

  • لا نقبل أسماء مختصرة أو مستعارة
  • Should be letters & numbers يجب أن تحتوي على حروف وارقام
  •  
    Strength indicator
  • ----More About You المزيد عنك----

    البيانات التالية لا يراها أحد غير الإدارة ويتحدد عليها قبول أو عدم قبول العضوية ويحق لخدمة الحق المغير للحياة قبول أو عدم قبول أي طلب عضوية مع التعهد بالإلتزام بسرية البيانات ==== The fields below are for Admin only According to it the membership will be accepted or not accepted. Life Changing Truth Ministry has the FULL right to accept or un accept any requested membership with our confirmation to keep confidential all the given information.
  • هذه البيانات تساعدنا على قبول عضويتك، ونشكرك على البيانات
  • رجاء ملئها بتاريخ ميلادك مثل هذا المثال 20/01/2020
  • Optional إختياري - But will be asked for it later on ولكن ستطلب منك فيما بعد
  • أكتب بإختصار عن إختبارك للميلاد الجديد ومنذ متى تقريبا
  • أكتب بإختصار عن إختبار الملء بالروح ومنذ متى تقريبا
  • -------Membership Section SN قسم الأعضاء الخاص إس إن-------

    قسم الأعضاء يحتوي على محتويات تفتح فقط لمن هم منتمين ومتابعين للحق المغير للحياة كجسدهم وهو غذاء روحي يختلف عن العام The Membership Section SN contains contents that we open only for people who are loyal & committed to the Life Changing Truth. It contains spiritual food different from the public.
  • IMPORTANT هام: On checking the field above you declare that you have read and agree to the بإختيارك الخانة أعلاه تقر أنك قد قرأت وإطلعت على بنود الخدمة والخصوصية المذكورة في الرابط وأوافق عليها وأتعهد بالإلتزام بها Terms and Conditions & Privacy Policy بنود الخصوصية, الإسترجاع وشبكة التواصل
  •  
  •  
    تسجيل الدخول | كلمة المرور مفقودة