public/wordpress/wp-content/plugins/wishlist-member-addon-for-wp-courseware/class_members.inc.php
/**
		 * Function called when updating a user for their course access.
		 */
Function called when updating a user for their course access.
Function called when updating a user for their course access .
public function handle_courseSync($userID, $levelList)
		{
			global $wpdb, $wpcwdb;
			$wpdb->show_errors();
			$courseIDList = array();
			if ($levelList && count($levelList) > 0)
			{
				foreach ($levelList as $aLevelID)
				{
					$courses = $this->getCourseAccessListForLevel($aLevelID);
					if ($courses)
					{
						foreach ($courses as $courseIDToKeep => $levelID) 
						{
							$courseIDList[$courseIDToKeep] = $levelID; 
						}
					}
				} 
			} 
			WPCW_courses_syncUserAccess($userID, array_keys($courseIDList), 'sync');
		}
public function handle_courseSync ( $ userID , $ levelList ) { global $ wpdb , $ wpcwdb ; $ wpdb -> show_errors ( ) ; $ courseIDList = array ( ) ; if ( $ levelList && count ( $ levelList ) > 0 ) { foreach ( $ levelList as $ aLevelID ) { $ courses = $ this -> getCourseAccessListForLevel ( $ aLevelID ) ; if ( $ courses ) { foreach ( $ courses as $ courseIDToKeep => $ levelID ) { $ courseIDList [ $ courseIDToKeep ] = $ levelID ; } } } } WPCW_courses_syncUserAccess ( $ userID , array_keys ( $ courseIDList ) , 'sync' ) ; }
Function called when updating a user for their course access.
Function called when updating a user for their course access .
// Might not have any levels to process // Assume that there might be multiple levels per user. // Got courses for this level // Use array index to build a list of valid course IDs // $levelID not needed, just used to assign something interesting. It's // the $courseIDToKeep that's the valuable bit. // end foreach  // end if ($levelList && count($levelList) > 0) // By this point, $courseIDList may or may not contain a list of courses.