Plugin Directory

Changeset 2446304


Ignore:
Timestamp:
12/26/2020 11:33:01 PM (5 years ago)
Author:
nellalink
Message:

Show Correct matrix Tree for users registered via registration sponsor form

Location:
rimplenet/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • rimplenet/trunk/README.txt

    r2442018 r2446304  
    55Requires at least: 3.0.1
    66Tested up to: 5.6
    7 Stable tag: 1.0.5
     7Stable tag: 1.1.0
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    7878
    7979== Changelog ==
     80= 1.1.0 =
     81* Rimplenet Matrix can safely show trees for referral users on pages
    8082= 1.0.7 =
    8183* BETA SUPPORT for Creation of Investment Pages, FULL SUPPORT will be available Version 1.2.0
     
    9698
    9799== Upgrade Notice ==
     100= 1.1.0 =
     101* Rimplenet Matrix can safely show trees for referral users on pages
    98102= 1.0.7 =
    99103* BETA SUPPORT for Creation of Investment Pages, FULL SUPPORT will be available Version 1.2.0
  • rimplenet/trunk/public/class-rimplenet-mlm-matrix-public.php

    r2442018 r2446304  
    201201        return $generatedArrDL;
    202202     }
     203     
     204     
     205      $cur_user_id = key($generatedArrDL);//Get first array value which is parent user id
    203206    foreach($AllParentArrValues as $parent_id){
    204207       
    205         $parent_occurence = $count_parent_arr[$parent_id]; //check how many children has this parent
     208        $child_user_id = $parent_id; //in this case $child_user_id is ating $parent_id
     209        $depth_limit = $this->getDepthPositionToParentinMatrix($child_user_id,$cur_user_id,$matrix_id, $generatedArrDL);
     210       
     211       if($depth_limit<$depth){ // if this parent depth position to matrix start user is less than matrix depth, look for its children
     212        $parent_occurence = $count_parent_arr[$parent_id]; //check  & count how many children has this parent
    206213        if(empty($parent_occurence) ){
    207214            $parent_occurence = 0;
     
    219226           
    220227        }
     228       }
    221229       
    222230        if(count($generatedArrDL)>=$max_capacity){
     
    231239
    232240
    233 function getDepthtoParentinMatrix($matrix_id, $child_user_id, $ArrDL ){
     241function getDepthPositionToParentinMatrix($child_user_id,$parent_user_id,$matrix_id, $ArrDL, $depth_up=0 ){
     242     
     243     
     244      //var_dump($ArrDL);
    234245      $mlm_matrix_post = get_post($matrix_id);
    235246     
     
    237248      $depth = $mlm_matrix_post->depth;
    238249     
    239       $DL_user_parsed  = $this->parseMatrixTree($ArrDL)[0];
    240       return $DL_user_parsed;
     250     
     251      if (array_key_exists($child_user_id,$ArrDL)){
     252        $depth_up++;
     253        $child_user_id = $ArrDL[$child_user_id];
     254        return $this->getDepthPositionToParentinMatrix($child_user_id,$parent_user_id,$matrix_id, $ArrDL, $depth_up);
     255      }
     256     
     257      else{
     258        return $depth_up-1;
     259      }
     260     
    241261}
    242262 
     
    278298   
    279299      $max_capacity = $this->getMatrixCapacity($matrix_id);
    280      
    281       $limit = ($max_capacity-1)/$width;
    282      if(count($selectedArr)>=$max_capacity or $pointer>=$depth+$limit){
     300      $node_limit = ($max_capacity-1)/$width;
     301     
     302       //$child_user_id = key(array_slice($selectedArr, -1, 1, true));//Get last array key
     303       $cur_user_id = key($selectedArr);//Get first array value which is current user id
     304       $checkArrDL = $selectedArr;
     305       foreach($checkArrDL as $child_user_id=>$value){
     306           $depth_limit = $this->getDepthPositionToParentinMatrix($child_user_id,$cur_user_id,$matrix_id, $selectedArr);
     307           if($depth_limit>$depth){
     308                unset($selectedArr[$child_user_id]);
     309                $max_depth_reached = "yes";
     310            }
     311        }
     312      // echo $child_user_id." - ".$parent_user_id."<br>";
     313      $depth_limit = $this->getDepthPositionToParentinMatrix($child_user_id,$parent_user_id,$matrix_id, $selectedArr);
     314      //echo $depth_limit."<br>";
     315     if(count($selectedArr)>=$max_capacity or $pointer>=$depth+$node_limit or $max_depth_reached=="yes"){
     316         
    283317        return $selectedArr;
    284318     }
  • rimplenet/trunk/public/css/rimplenet-mlm-public.css

    r2429761 r2446304  
    1717 }
    1818 
     19 .rimplenet-not-matrix-member{
     20     text-align: center;
     21     color: #d93c3c;
     22     font-weight: 500;
     23     font-size: 1.1rem;
     24     border: 1px solid;
     25     border-radius: 5px;
     26 }
    1927 
    2028.rimplenet-select{
  • rimplenet/trunk/public/layouts/design-mlm-tree.php

    r2440841 r2446304  
    4242if(!in_array( $user_id,$all_matx_subs_arr )){
    4343   
    44     echo __('<p class="not_matrix_member">You are not a member of this matrix yet</p>');
     44    echo __('<p class="rimplenet-not-matrix-member">You are not a member of this matrix yet</p>');
    4545    //$array_user_DL = $this->getFullDummySubsArr($matrix_id);
    4646   
     
    6767    //echo var_dump($this->getMatrixCapacity($matrix_id));
    6868    //echo var_dump($array_user_DL);
    69     //echo var_dump($this->getDepthtoParentinMatrix($matrix_id, 7,  $array_user_DL ));
     69    //echo var_dump($this->getDepthPositionToParentinMatrix(25,1,$matrix_id,$array_user_DL ));
    7070    //echo var_dump($this->getFullDummyandFullRealSubsArr($matrix_id, $user_id));
    7171   //echo var_dump($this->getSubscribersDownlineArr($matrix_id, $user_id));
  • rimplenet/trunk/rimplenet.php

    r2442018 r2446304  
    1616 * Plugin Name:       Rimplenet
    1717 * Plugin URI:        https://rimplenet.com
    18  * Description:       RimpleNet E-Wallets | Investments Plugin | MLM | Matrix | Referral Manager | FinTech
    19  * Version:           1.0.7
     18 * Description:       RimpleNet E-Wallets | Investments Plugin | MLM | Matrix Tree | Referral Manager | FinTech
     19 * Version:           1.1.0
    2020 * Author:            Nellalink
    2121 * Author URI:        https://rimplenet.com
Note: See TracChangeset for help on using the changeset viewer.