53. File Comparison Report

Produced on Thu Jul 17 07:17:31 2008 UTC. This report uses XHTML and CSS2, and is best viewed with a reasonably standards compliant browser such as the latest version of Firefox or Internet Explorer. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

53.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.2 join.php Sun May 11 13:17:04 2008 UTC
2 Dolphin-v.6.1.3 join.php Wed Jul 16 09:51:23 2008 UTC

53.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 5 1008
Changed 3 6
Inserted 0 0
Removed 1 1

53.3 Comparison options

Whitespace All differences in whitespace within lines are ignored
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

53.4 Active regular expressions

No regular expressions were active.

53.5 Comparison detail

1   <?php   1   <?php
2     2  
3   require_on ce( './inc /header.in c.php' );   3   require_on ce( './inc /header.in c.php' );
4   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'admin.i nc.php' );   4   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'admin.i nc.php' );
5   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'db.inc. php' );   5   require_on ce( BX_DIR ECTORY_PAT H_INC      . 'db.inc. php' );
6   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofileField s.php' );   6   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofileField s.php' );
7   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofilesCont roller.php ' );   7   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolPr ofilesCont roller.php ' );
8   require_on ce( BX_DIR ECTORY_PAT H_ROOT     . "templat es/tmpl_{$ tmpl}/scri pts/BxTemp lFormView. php" );   8   require_on ce( BX_DIR ECTORY_PAT H_ROOT     . "templat es/tmpl_{$ tmpl}/scri pts/BxTemp lFormView. php" );
9     9  
10   //aa blya  join nah!   10   //aa blya  join nah!
11     11  
12   $_page['na me_index']  = 3;   12   $_page['na me_index']  = 3;
13   $_page['cs s_name']    = 'join.c ss';   13   $_page['cs s_name']    = 'join.c ss';
14   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/ui.date picker.js" ></script> ';   14   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/ui.date picker.js" ></script> ';
15   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/jquery. form.js">< /script>';   15   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="' . $sit e['plugins '] . 'jque ry/jquery. form.js">< /script>';
16   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="inc/js/j oin.js"></ script>';   16   $_page['ex tra_js']   .= '<scrip t type="te xt/javascr ipt" langu age="JavaS cript" src ="inc/js/j oin.js"></ script>';
17     17  
18   //init dat epicker   18   //init dat epicker
19   $iMinAge   = (int)get Param( 'se arch_start _age' );   19   $iMinAge   = (int)get Param( 'se arch_start _age' );
20   $iMaxAge   = (int)get Param( 'se arch_end_a ge'   );   20   $iMaxAge   = (int)get Param( 'se arch_end_a ge'   );
21   $iCurYear  = (int)dat e('Y');   21   $iCurYear  = (int)dat e('Y');
22   $iMinYear  = $iCurYea r - $iMaxA ge - 1;   22   $iMinYear  = $iCurYea r - $iMaxA ge - 1;
23   $iMaxYear  = $iCurYea r - $iMinA ge;   23   $iMaxYear  = $iCurYea r - $iMinA ge;
24     24  
25   $iSelected Rel = ceil ( $iMinAge  * 365.25  ); //get r elative da ys number  for defaul t date   25   $iSelected Rel = ceil ( $iMinAge  * 365.25  ); //get r elative da ys number  for defaul t date
26     26  
27   $sDatepick erInit = $ oTemplConf ig -> cust omize['joi n']['datep ickerInit' ];   27   $sDatepick erInit = $ oTemplConf ig -> cust omize['joi n']['datep ickerInit' ];
28     28  
29   $sDatepick erInit = s tr_replace ( '{min_ye ar}', $iMi nYear,      $sDatepic kerInit );   29   $sDatepick erInit = s tr_replace ( '{min_ye ar}', $iMi nYear,      $sDatepic kerInit );
30   $sDatepick erInit = s tr_replace ( '{max_ye ar}', $iMa xYear,      $sDatepic kerInit );   30   $sDatepick erInit = s tr_replace ( '{max_ye ar}', $iMa xYear,      $sDatepic kerInit );
31   $sDatepick erInit = s tr_replace ( '{dfl_da ys}', $iSe lectedRel,  $sDatepic kerInit );   31   $sDatepick erInit = s tr_replace ( '{dfl_da ys}', $iSe lectedRel,  $sDatepic kerInit );
32     32  
33   $_page['ex tra_js']   .= '   33   $_page['ex tra_js']   .= '
34       <scrip t type="te xt/javascr ipt" langu age="JavaS cript">   34       <scrip t type="te xt/javascr ipt" langu age="JavaS cript">
35           $(  document  ).ready( f unction(){   35           $(  document  ).ready( f unction(){
36                ' . $sDa tepickerIn it . '   36                ' . $sDa tepickerIn it . '
37           }  );   37           }  );
38       </scri pt>';   38       </scri pt>';
39     39  
40   check_logg ed();   40   check_logg ed();
41     41  
42   $_page['he ader'] = _ t( '_JOIN_ H' );   42   $_page['he ader'] = _ t( '_JOIN_ H' );
43   $_page['he ader_text' ] = _t( '_ JOIN_H' );   43   $_page['he ader_text' ] = _t( '_ JOIN_H' );
44     44  
45   if( $logge d['member' ] )   45   if( $logge d['member' ] )
46   {   46   {
47       $_page ['name_ind ex'] = 0;   47       $_page ['name_ind ex'] = 0;
48       $_page _cont[0][' page_main_ code'] = _ t( '_Sorry , you\'re  already jo ined' );   48       $_page _cont[0][' page_main_ code'] = _ t( '_Sorry , you\'re  already jo ined' );
49       PageCo de();   49       PageCo de();
50       exit;   50       exit;
51   }   51   }
52     52  
53   if ( getPa ram('reg_b y_inv_only ') == 'on'  && getID( $_COOKIE[' idFriend'] )==0 ) {   53   if ( getPa ram('reg_b y_inv_only ') == 'on'  && getID( $_COOKIE[' idFriend'] )==0 ) {
54       $_page ['name_ind ex'] = 0;   54       $_page ['name_ind ex'] = 0;
55       $_page _cont[0][' page_main_ code'] = M sgBox(_t(' registrati on by invi tation onl y'));   55       $_page _cont[0][' page_main_ code'] = M sgBox(_t(' registrati on by invi tation onl y'));
56       PageCo de();   56       PageCo de();
57       exit;   57       exit;
58   }   58   }
59     59  
60   $oJoinProc  = new BxD olJoinProc essor();   60   $oJoinProc  = new BxD olJoinProc essor();
61     61  
62   $_ni = $_p age['name_ index'];   62   $_ni = $_p age['name_ index'];
63   $_page_con t[$_ni]['p age_main_c ode'] = $o JoinProc - > process( );   63   $_page_con t[$_ni]['p age_main_c ode'] = $o JoinProc - > process( );
64     64  
65     65  
66   PageCode() ;   66   PageCode() ;
67     67  
68     68  
69     69  
70     70  
71   class BxDo lJoinProce ssor {   71   class BxDo lJoinProce ssor {
72          72       
73       var $o PF; //prof ile fields   73       var $o PF; //prof ile fields
74       var $i Page; //cu rrently sh own page   74       var $i Page; //cu rrently sh own page
75       var $a Pages; //a vailable p ages   75       var $a Pages; //a vailable p ages
76       var $a Values; // inputted v alues   76       var $a Values; // inputted v alues
77       var $a Errors; // errors gen erated on  page   77       var $a Errors; // errors gen erated on  page
78       var $b AjaxMode;  // defines  if the sc ript were  requested  by ajax   78       var $b AjaxMode;  // defines  if the sc ript were  requested  by ajax
79          79       
80       var $b CoupleEnab led;   80       var $b CoupleEnab led;
81       var $a CoupleMutu alItems;   81       var $a CoupleMutu alItems;
82       var $b Couple;   82       var $b Couple;
83          83       
84       functi on BxDolJo inProcesso r() {   84       functi on BxDolJo inProcesso r() {
85           $t his -> aVa lues = arr ay( 0 => a rray(), 1  => array()  ); // dou ble arrays  (for coup les)   85           $t his -> aVa lues = arr ay( 0 => a rray(), 1  => array()  ); // dou ble arrays  (for coup les)
86           $t his -> aEr rors = arr ay( 0 => a rray(), 1  => array()  );    86           $t his -> aEr rors = arr ay( 0 => a rray(), 1  => array()  ); 
87              87           
88           /*  @var $thi s->oPF BxD olProfileF ields */   88           /*  @var $thi s->oPF BxD olProfileF ields */
89           $t his -> oPF  = new BxD olProfileF ields(1);   89           $t his -> oPF  = new BxD olProfileF ields(1);
90              90           
91           $t his -> bAj axMode = (  isset( $_ SERVER['HT TP_X_REQUE STED_WITH' ] ) and $_ SERVER['HT TP_X_REQUE STED_WITH' ] == 'XMLH ttpRequest ' );   91           $t his -> bAj axMode = (  isset( $_ SERVER['HT TP_X_REQUE STED_WITH' ] ) and $_ SERVER['HT TP_X_REQUE STED_WITH' ] == 'XMLH ttpRequest ' );
92       }   92       }
93          93       
94       functi on process () {   94       functi on process () {
95           if ( !$this - > oPF -> a Area )   95           if ( !$this - > oPF -> a Area )
96                return ' Profile Fi elds cache  not loade d. Cannot  continue.' ;   96                return ' Profile Fi elds cache  not loade d. Cannot  continue.' ;
97              97           
98           $t his -> aPa ges = arra y_keys( $t his -> oPF  -> aArea  );   98           $t his -> aPa ges = arra y_keys( $t his -> oPF  -> aArea  );
99              99           
100           $t his -> iPa ge = ( iss et( $_POST ['join_pag e'] ) ) ?  $_POST['jo in_page']  : 0; // ge t current  working pa ge from PO ST   100           $t his -> iPa ge = ( iss et( $_POST ['join_pag e'] ) ) ?  $_POST['jo in_page']  : 0; // ge t current  working pa ge from PO ST
101              101           
102           if ( $this ->  iPage !==  'done' )   102           if ( $this ->  iPage !==  'done' )
103                $this ->  iPage = ( int)$this  -> iPage;   103                $this ->  iPage = ( int)$this  -> iPage;
104              104           
105           $t his -> get CoupleOpti ons();   105           $t his -> get CoupleOpti ons();
106              106           
107           $t his -> pro cessPostVa lues();   107           $t his -> pro cessPostVa lues();
108              108           
109           if ( $this ->  bAjaxMode  ) {   109           if ( $this ->  bAjaxMode  ) {
110                $this ->  showError sJson();   110                $this ->  showError sJson();
111                exit;   111                exit;
112           }  else {   112           }  else {
113                ob_start ();   113                ob_start ();
114                   114                
115                if( $thi s -> iPage  === 'done ' ) { //if  all pages  are finis hed and no  errors fo und   115                if( $thi s -> iPage  === 'done ' ) { //if  all pages  are finis hed and no  errors fo und
116                    list ( $iMemID,  $sStatus  ) = $this  -> registe rMember();   116                    list ( $iMemID,  $sStatus  ) = $this  -> registe rMember();
117                       117                    
118                    if(  !$iMemID )   118                    if(  !$iMemID )
119                         $this -> s howFailPag e();   119                         $this -> s howFailPag e();
120                    else   120                    else
121                         $this -> s howFinishP age( $iMem ID, $sStat us );   121                         $this -> s howFinishP age( $iMem ID, $sStat us );
122                } else   122                } else
123                    $thi s -> showJ oinForm();   123                    $thi s -> showJ oinForm();
124                   124                
125                return o b_get_clea n();   125                return o b_get_clea n();
126           }   126           }
127       }   127       }
128          128       
129       functi on getCoup leOptions( ) {   129       functi on getCoup leOptions( ) {
130           // find Coupl e item   130           // find Coupl e item
131           $a CoupleItem  = false;   131           $a CoupleItem  = false;
132           fo reach ($th is -> aPag es as $iPa geInd => $ iPage) { / /cycle pag es   132           fo reach ($th is -> aPag es as $iPa geInd => $ iPage) { / /cycle pag es
133                $aBlocks  = $this - > oPF -> a Area[ $iPa ge ];   133                $aBlocks  = $this - > oPF -> a Area[ $iPa ge ];
134                foreach  ($aBlocks  as $iBlock ID => $aBl ock) {   / /cycle blo cks   134                foreach  ($aBlocks  as $iBlock ID => $aBl ock) {   / /cycle blo cks
135                    $aIt ems = $aBl ock['Items '];   135                    $aIt ems = $aBl ock['Items '];
136                    fore ach ($aIte ms as $iIt emID => $a Item) {  / /cycle ite ms   136                    fore ach ($aIte ms as $iIt emID => $a Item) {  / /cycle ite ms
137                         if( $aItem ['Name'] = = 'Couple'  ) { // we  found it!   137                         if( $aItem ['Name'] = = 'Couple'  ) { // we  found it!
138                             $aCoup leItem = $ aItem;   138                             $aCoup leItem = $ aItem;
139                             break;   139                             break;
140                         }   140                         }
141                    }   141                    }
142                       142                    
143                    if(  $aCoupleIt em ) // we  already f ound it   143                    if(  $aCoupleIt em ) // we  already f ound it
144                         break;   144                         break;
145                }   145                }
146                   146                
147                if( $aCo upleItem )  // we alr eady found  it   147                if( $aCo upleItem )  // we alr eady found  it
148                    brea k;   148                    brea k;
149           }   149           }
150              150           
151           if ( $aCouple Item ) {   151           if ( $aCouple Item ) {
152                $this ->  bCoupleEn abled       = true;   152                $this ->  bCoupleEn abled       = true;
153                $this ->  bCouple               = ( isset ( $_REQUES T['Couple' ] ) and $_ REQUEST['C ouple'] ==  'yes' ) ?  true : fa lse;   153                $this ->  bCouple               = ( isset ( $_REQUES T['Couple' ] ) and $_ REQUEST['C ouple'] ==  'yes' ) ?  true : fa lse;
154           }  else {   154           }  else {
155                $this ->  bCoupleEn abled       = false;   155                $this ->  bCoupleEn abled       = false;
156                $this ->  bCouple               = false;   156                $this ->  bCouple               = false;
157           }   157           }
158              158           
159           $t his -> aCo upleMutual Items = $t his -> oPF  -> getCou pleMutualF ields();   159           $t his -> aCo upleMutual Items = $t his -> oPF  -> getCou pleMutualF ields();
160       }   160       }
161          161       
162       functi on process PostValues () {   162       functi on process PostValues () {
163              163           
164           fo reach ($th is -> aPag es as $iPa ge) { //cy cle pages   164           fo reach ($th is -> aPag es as $iPa ge) { //cy cle pages
165                   165                
166                if( $thi s -> iPage  !== 'done ' and $iPa ge >= $thi s -> iPage  ) {   166                if( $thi s -> iPage  !== 'done ' and $iPa ge >= $thi s -> iPage  ) {
167                    $thi s -> iPage  = $iPage;  // we are  on the cu rrent page . dont pro cess these  values, d ont go fur ther, just  show form .   167                    $thi s -> iPage  = $iPage;  // we are  on the cu rrent page . dont pro cess these  values, d ont go fur ther, just  show form .
168                    brea k;   168                    brea k;
169                }   169                }
170                   170                
171                // proce ss post va lues by Pr ofile Fiel ds class   171                // proce ss post va lues by Pr ofile Fiel ds class
172                $this ->  oPF -> pr ocessPostV alues( $th is -> bCou ple, $this  -> aValue s, $this - >aErrors,  $iPage );   172                $this ->  oPF -> pr ocessPostV alues( $th is -> bCou ple, $this  -> aValue s, $this - >aErrors,  $iPage );
173                   173                
174                if( !emp ty( $this  -> aErrors [0] ) or (  $this ->  bCouple an d !empty(  $this -> a Errors[1]  ) ) ) { // we found e rrors on p revious pa ge   174                if( !emp ty( $this  -> aErrors [0] ) or (  $this ->  bCouple an d !empty(  $this -> a Errors[1]  ) ) ) { // we found e rrors on p revious pa ge
175                    // d o not proc ess furthe r values,  just go to  erroneous  page.   175                    // d o not proc ess furthe r values,  just go to  erroneous  page.
176                    $thi s -> iPage  = $iPage;   176                    $thi s -> iPage  = $iPage;
177                    brea k;   177                    brea k;
178                }   178                }
179           }   179           }
180       }   180       }
181          181       
182       functi on showErr orsJson()  {   182       functi on showErr orsJson()  {
183           he ader('Cont ent-Type:t ext/javasc ript');   183           he ader('Cont ent-Type:t ext/javasc ript');
184              184           
185           ec ho $this - > oPF -> g enJsonErro rs( $this  -> aErrors , $this ->  bCouple ) ;   185           ec ho $this - > oPF -> g enJsonErro rs( $this  -> aErrors , $this ->  bCouple ) ;
186       }   186       }
187          187       
188       functi on showJoi nForm() {   188       functi on showJoi nForm() {
189              189           
190           // echoDbg( $ this -> aV alues );ex it;   190           // echoDbg( $ this -> aV alues );ex it;
191              191           
192           $a FormAttrs  = array(   192           $a FormAttrs  = array(
193                'id' =>  'join_form ',   193                'id' =>  'join_form ',
194                'onsubmi t' => 'ret urn valida teJoinForm (this);'   194                'onsubmi t' => 'ret urn valida teJoinForm (this);'
195           );   195           );
196              196           
197           $a TableAttrs  = array(   197           $a TableAttrs  = array(
198                'id' =>  'join_form _table'   198                'id' =>  'join_form _table'
199           );   199           );
200              200           
201           $a FormParams  = array(   201           $a FormParams  = array(
202                'hidden'  => $this  -> genHidd enFieldsAr ray()   202                'hidden'  => $this  -> genHidd enFieldsAr ray()
203           );   203           );
204              204           
205           $a TableParam s = array(   205           $a TableParam s = array(
206                'double'  => $this  ->bCoupleE nabled,   206                'double'  => $this  ->bCoupleE nabled,
207                'second_ enabled' = > $this ->  bCouple   207                'second_ enabled' = > $this ->  bCouple
208           );   208           );
209              209           
210           $a TableParam s['headers ']     = a rray( '',  _t( '_Firs t Person'  ), _t( '_S econd Pers on' ) );   210           $a TableParam s['headers ']     = a rray( '',  _t( '_Firs t Person'  ), _t( '_S econd Pers on' ) );
211           $a TableParam s['headers _add'] = ' class="hea der form_s econd_col" ' . ( $thi s -> bCoup le ? '' :  ' style="d isplay: no ne;"' );   211           $a TableParam s['headers _add'] = ' class="hea der form_s econd_col" ' . ( $thi s -> bCoup le ? '' :  ' style="d isplay: no ne;"' );
212              212           
213           $a Buttons =  array(   213           $a Buttons =  array(
214                array(   214                array(
215                    'typ e' => 'sub mit',   215                    'typ e' => 'sub mit',
216                    'val ue' => _t(  '_Submit'  ),   216                    'val ue' => _t(  '_Submit'  ),
217                    'cla ss' => 'in put_submit '   217                    'cla ss' => 'in put_submit '
218                )   218                )
219           );   219           );
220              220           
221           /*  @var $oFo rm BxTempl FormView * /   221           /*  @var $oFo rm BxTempl FormView * /
222           $o Form = new  BxTemplFo rmView( 'j oin_form'  );   222           $o Form = new  BxTemplFo rmView( 'j oin_form'  );
223           $o Form -> be gin( $aFor mAttrs, $a TableAttrs , $aFormPa rams, $aTa bleParams  );   223           $o Form -> be gin( $aFor mAttrs, $a TableAttrs , $aFormPa rams, $aTa bleParams  );
224              224           
225           $a Blocks = $ this -> oP F -> aArea [ $this ->  iPage ];   225           $a Blocks = $ this -> oP F -> aArea [ $this ->  iPage ];
226           fo reach( $aB locks as $ aBlock ) {   226           fo reach( $aB locks as $ aBlock ) {
227                $oForm - > beginBlo ck( _t( $a Block['Cap tion'] ) ) ;   227                $oForm - > beginBlo ck( _t( $a Block['Cap tion'] ) ) ;
228                   228                
229                foreach(  $aBlock[' Items'] as  $aItem )  {   229                foreach(  $aBlock[' Items'] as  $aItem )  {
230                       230                    
231                    $aCo l0 = array ();   231                    $aCo l0 = array ();
232                       232                    
233                    $aCo l0['Type']       = $a Item['Type '];   233                    $aCo l0['Type']       = $a Item['Type '];
234                    $aCo l0['Name']       = (  $aItem['Ty pe'] == 's ystem' ) ?  $aItem['N ame'] : (  $aItem['Na me'] . '[0 ]' );   234                    $aCo l0['Name']       = (  $aItem['Ty pe'] == 's ystem' ) ?  $aItem['N ame'] : (  $aItem['Na me'] . '[0 ]' );
235                    $aCo l0['Mandat ory'] = $a Item['Mand atory'];   235                    $aCo l0['Mandat ory'] = $a Item['Mand atory'];
236                    $aCo l0['Contro l']   = $a Item['Cont rol'];   236                    $aCo l0['Contro l']   = $a Item['Cont rol'];
237                    $aCo l0['Values ']    = $a Item['Valu es'];   237                    $aCo l0['Values ']    = $a Item['Valu es'];
238                    $aCo l0['UseLKe y']   = $a Item['UseL Key'];   238                    $aCo l0['UseLKe y']   = $a Item['UseL Key'];
239                       239                    
240                    $aCo l0['Captio n']   = _t ( $aItem[' Caption']  );   240                    $aCo l0['Captio n']   = _t ( $aItem[' Caption']  );
241                    $aCo l0['Desc']       = _t ( $aItem[' Desc'], $a Item['Min' ], $aItem[ 'Max'] );   241                    $aCo l0['Desc']       = _t ( $aItem[' Desc'], $a Item['Min' ], $aItem[ 'Max'] );
242                    if(  $aCol0['De sc'] == $a Item['Desc '] )   242                    if(  $aCol0['De sc'] == $a Item['Desc '] )
243                         $aCol0['De sc'] = '';   243                         $aCol0['De sc'] = '';
244                       244                    
245                    // s et value   245                    // s et value
246                    if(  isset( $th is -> aVal ues[0][ $a Item['Name '] ] ) )   246                    if(  isset( $th is -> aVal ues[0][ $a Item['Name '] ] ) )
247                         $aCol0['Va lue']   =  $this -> a Values[0][  $aItem['N ame'] ];   247                         $aCol0['Va lue']   =  $this -> a Values[0][  $aItem['N ame'] ];
248                    else if ( $aIte m['Name']  == 'Couple ' )   248                    else if ( $aIte m['Name']  == 'Couple ' )
249                         $aCol0['Va lue'] = $t his -> bCo uple;   249                         $aCol0['Va lue'] = $t his -> bCo uple;
250                       250                    
251                    // s et error   251                    // s et error
252                    if(  isset( $th is -> aErr ors[0][ $a Item['Name '] ] ) )   252                    if(  isset( $th is -> aErr ors[0][ $a Item['Name '] ] ) )
253                         $aCol0['Er ror']   =  $this -> a Errors[0][  $aItem['N ame'] ];   253                         $aCol0['Er ror']   =  $this -> a Errors[0][  $aItem['N ame'] ];
254                       254                    
255                    // c heck secon d person's  field   255                    // c heck secon d person's  field
256                    if(  $this -> b CoupleEnab led and !i n_array( $ aItem['Nam e'], $this  -> aCoupl eMutualIte ms ) ) {   256                    if(  $this -> b CoupleEnab led and !i n_array( $ aItem['Nam e'], $this  -> aCoupl eMutualIte ms ) ) {
257                         $aCol1 = a rray();   257                         $aCol1 = a rray();
258                           258                        
259                         $aCol1['Ty pe']    =  $aItem['Ty pe'];   259                         $aCol1['Ty pe']    =  $aItem['Ty pe'];
260                         $aCol1['Na me']    =  $aItem['Na me'] . '[1 ]';   260                         $aCol1['Na me']    =  $aItem['Na me'] . '[1 ]';
261                         $aCol1['Co ntrol'] =  $aItem['Co ntrol'];   261                         $aCol1['Co ntrol'] =  $aItem['Co ntrol'];
262                         $aCol1['Va lues']  =  $aItem['Va lues'];   262                         $aCol1['Va lues']  =  $aItem['Va lues'];
263                         $aCol1['Us eLKey'] =  $aItem['Us eLKey'];   263                         $aCol1['Us eLKey'] =  $aItem['Us eLKey'];
264                           264                        
265                         // set val ue   265                         // set val ue
266                         if( isset(  $this ->  aValues[1] [ $aItem[' Name'] ] )  )   266                         if( isset(  $this ->  aValues[1] [ $aItem[' Name'] ] )  )
267                             $aCol1 ['Value']    = $this  -> aValues [1][ $aIte m['Name']  ];   267                             $aCol1 ['Value']    = $this  -> aValues [1][ $aIte m['Name']  ];
268                           268                        
269                         // set err or   269                         // set err or
270                         if( isset(  $this ->  aErrors[1] [ $aItem[' Name'] ] )  )   270                         if( isset(  $this ->  aErrors[1] [ $aItem[' Name'] ] )  )
271                             $aCol1 ['Error']    = $this  -> aValues [1][ $aIte m['Name']  ];   271                             $aCol1 ['Error']    = $this  -> aValues [1][ $aIte m['Name']  ];
272                           272                        
273                         $oForm ->  addRow( $a Col0, $aCo l1 );   273                         $oForm ->  addRow( $a Col0, $aCo l1 );
274                    } el se   274                    } el se
275                         $oForm ->  addRow( $a Col0 );   275                         $oForm ->  addRow( $a Col0 );
276                }    276                } 
277                   277                
278                $oForm - > endBlock ();   278                $oForm - > endBlock ();
279           }   279           }
280              280           
281           $o Form -> en d( $aButto ns );   281           $o Form -> en d( $aButto ns );
282              282           
283           ec ho $oForm  -> getCode ();   283           ec ho $oForm  -> getCode ();
284              284           
285           // boonex id   285           // boonex id
286           /*  if( getPa ram( 'enab le_get_boo nex_id' )  )   286           /*  if( getPa ram( 'enab le_get_boo nex_id' )  )
287           {   287           {
288                global $ tmpl;   288                global $ tmpl;
289                   289                
290                echo "<d iv class=\ "import_bo onex_id\"> ";   290                echo "<d iv class=\ "import_bo onex_id\"> ";
291                $action  = "boonex" ;   291                $action  = "boonex" ;
292                $text =  '<div clas s="boonex_ id">' . _t ( '_Import  BoonEx ID ' ) . '</d iv>';   292                $text =  '<div clas s="boonex_ id">' . _t ( '_Import  BoonEx ID ' ) . '</d iv>';
293                $table        = "Pr ofiles";   293                $table        = "Pr ofiles";
294                $login_p age  = "{$ site['url' ]}member.p hp";   294                $login_p age  = "{$ site['url' ]}member.p hp";
295                $join_pa ge   = "{$ site['url' ]}join_for m.php";   295                $join_pa ge   = "{$ site['url' ]}join_for m.php";
296                $forgot_ page = '';   296                $forgot_ page = '';
297                 $template      =  
" {$dir['roo t']} templates/ tmpl_{$tmp l}/join_lo gin_form.h tml";
  297                 $template      =   BX_DIRECTO RY_PATH_RO OT   .   "
templates/ tmpl_{$tmp l}/join_lo gin_form.h tml";
298     298  
299                echo Log inForm( $t ext,$actio n,$table,$ login_page ,$forgot_p age,$templ ate );   299                echo Log inForm( $t ext,$actio n,$table,$ login_page ,$forgot_p age,$templ ate );
300     300  
301                echo "</ div>";   301                echo "</ div>";
302           }  */   302           }  */
303       }   303       }
304          304       
305       functi on genHidd enFieldsAr ray() {   305       functi on genHidd enFieldsAr ray() {
306           $a HiddenFiel ds = array ();   306           $a HiddenFiel ds = array ();
307              307           
308           // retrieve n ext page   308           // retrieve n ext page
309           $i PageInd =  (int)array _search( $ this -> iP age, $this  -> aPages  );   309           $i PageInd =  (int)array _search( $ this -> iP age, $this  -> aPages  );
310           $i NextInd =  $iPageInd  + 1;   310           $i NextInd =  $iPageInd  + 1;
311              311           
312           if ( array_ke y_exists(  $iNextInd,  $this ->  aPages ) )   312           if ( array_ke y_exists(  $iNextInd,  $this ->  aPages ) )
313                $sNextPa ge = $this  -> aPages [ $iNextIn d ];   313                $sNextPa ge = $this  -> aPages [ $iNextIn d ];
314           el se   314           el se
315                $sNextPa ge = 'done ';   315                $sNextPa ge = 'done ';
316              316           
317           //  insert ne xt page   317           //  insert ne xt page
318           $a HiddenFiel ds['join_p age'] = $s NextPage;   318           $a HiddenFiel ds['join_p age'] = $s NextPage;
319              319           
320           // echoDbg( $ this -> aV alues );   320           // echoDbg( $ this -> aV alues );
321              321           
322           //  insert en tered valu es   322           //  insert en tered valu es
323           $i Humans = $ this -> bC ouple ? 2  : 1;   323           $i Humans = $ this -> bC ouple ? 2  : 1;
324           fo r( $iHuman  = 0; $iHu man < $iHu mans; $iHu man ++ ) {   324           fo r( $iHuman  = 0; $iHu man < $iHu mans; $iHu man ++ ) {
325                foreach(  $this ->  aPages as  $iPage ) {   325                foreach(  $this ->  aPages as  $iPage ) {
326                    if(  $iPage ==  $this -> i Page )   326                    if(  $iPage ==  $this -> i Page )
327                         break; //  we are on  this page   327                         break; //  we are on  this page
328                       328                    
329                    $aBl ocks = $th is -> oPF  -> aArea[  $iPage ];   329                    $aBl ocks = $th is -> oPF  -> aArea[  $iPage ];
330                    fore ach( $aBlo cks as $aB lock ) {   330                    fore ach( $aBlo cks as $aB lock ) {
331                         foreach( $ aBlock['It ems'] as $ aItem ) {   331                         foreach( $ aBlock['It ems'] as $ aItem ) {
332                             $sItem Name = $aI tem['Name' ];   332                             $sItem Name = $aI tem['Name' ];
333                                333                             
334                             if( is set( $this  -> aValue s[$iHuman] [ $sItemNa me ] ) ) {   334                             if( is set( $this  -> aValue s[$iHuman] [ $sItemNa me ] ) ) {
335                                 $m Value = $t his -> aVa lues[$iHum an][ $sIte mName ];   335                                 $m Value = $t his -> aVa lues[$iHum an][ $sIte mName ];
336                                    336                                 
337                                 sw itch( $aIt em['Type']  ) {   337                                 sw itch( $aIt em['Type']  ) {
338                                      case 'pa ss':   338                                      case 'pa ss':
339                                          $aHi ddenFields [ $sItemNa me . '_con firm[' . $ iHuman . ' ]' ] = $mV alue;   339                                          $aHi ddenFields [ $sItemNa me . '_con firm[' . $ iHuman . ' ]' ] = $mV alue;
340                                      case 'te xt':   340                                      case 'te xt':
341                                      case 'ar ea':   341                                      case 'ar ea':
342                                      case 'da te':   342                                      case 'da te':
343                                      case 'se lect_one':   343                                      case 'se lect_one':
344                                      case 'nu m':   344                                      case 'nu m':
345                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  ']' ] = $ mValue;   345                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  ']' ] = $ mValue;
346                                      break;   346                                      break;
347                                         347                                      
348                                      case 'se lect_set':   348                                      case 'se lect_set':
349                                          fore ach( $mVal ue as $iIn d => $sVal ue )   349                                          fore ach( $mVal ue as $iIn d => $sVal ue )
350                                               $aHiddenFi elds[ $sIt emName . ' [' . $iHum an . ']['  . $iInd .  ']' ] = $s Value;   350                                               $aHiddenFi elds[ $sIt emName . ' [' . $iHum an . ']['  . $iInd .  ']' ] = $s Value;
351                                      break;   351                                      break;
352                                         352                                      
353                                      case 'ra nge':   353                                      case 'ra nge':
354                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  '][0]' ]  = $mValue[ 0];   354                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  '][0]' ]  = $mValue[ 0];
355                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  '][1]' ]  = $mValue[ 1];   355                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  '][1]' ]  = $mValue[ 1];
356                                      break;   356                                      break;
357                                         357                                      
358                                      case 'bo ol':   358                                      case 'bo ol':
359                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  ']' ] = $ mValue ? ' yes' : '';   359                                          $aHi ddenFields [ $sItemNa me . '[' .  $iHuman .  ']' ] = $ mValue ? ' yes' : '';
360                                      break;   360                                      break;
361                                         361                                      
362                                      case 'sy stem':   362                                      case 'sy stem':
363                                          swit ch( $aItem ['Name'] )  {   363                                          swit ch( $aItem ['Name'] )  {
364                                               case 'Coup le':   364                                               case 'Coup le':
365                                               case 'Term sOfUse':   365                                               case 'Term sOfUse':
366                                                   $aHidd enFields[  $sItemName  ] = $mVal ue ? 'yes'  : '';   366                                                   $aHidd enFields[  $sItemName  ] = $mVal ue ? 'yes'  : '';
367                                               break;   367                                               break;
368                                                 368                                              
369                                               case 'Capt cha':   369                                               case 'Capt cha':
370                                                   $aHidd enFields[  $sItemName  ] = $mVal ue;   370                                                   $aHidd enFields[  $sItemName  ] = $mVal ue;
371                                               break;   371                                               break;
372                                          }   372                                          }
373                                      break;   373                                      break;
374                                 }   374                                 }
375                             }   375                             }
376                         }   376                         }
377                    }   377                    }
378                }   378                }
379           }   379           }
380           re turn $aHid denFields;   380           re turn $aHid denFields;
381       }   381       }
382          382       
383       functi on registe rMember()  {   383       functi on registe rMember()  {
384            $bEnAff   =   (   getParam(' en
_aff')   ==   'on'   );
  384            $bEnAff   =   (   getParam(' en able _aff')   ==   'on'   );
385     385  
386           $o PC = new B xDolProfil esControll er();   386           $o PC = new B xDolProfil esControll er();
387              387           
388           // convert to  profile   388           // convert to  profile
389           $a Profile =  $this -> o PF -> getP rofileFrom Values( $t his -> aVa lues[0] );   389           $a Profile =  $this -> o PF -> getP rofileFrom Values( $t his -> aVa lues[0] );
390           // create it   390           // create it
391           li st( $iMemI D, $sStatu s ) = $oPC  -> create Profile( $ aProfile ) ;   391           li st( $iMemI D, $sStatu s ) = $oPC  -> create Profile( $ aProfile ) ;
392              392           
393           if ( !$iMemID  )   393           if ( !$iMemID  )
394                return a rray( fals e, 'Fail'  );   394                return a rray( fals e, 'Fail'  );
395              395           
396           if ( $this ->  bCouple )  {   396           if ( $this ->  bCouple )  {
397                //conver t   397                //conver t
398                $aProfil e = $this  -> oPF ->  getProfile FromValues ( $this ->  aValues[1 ] );   398                $aProfil e = $this  -> oPF ->  getProfile FromValues ( $this ->  aValues[1 ] );
399                //create   399                //create
400                list( $i Mem1ID, $s Status1 )  = $oPC ->  createProf ile( $aPro file, fals e, $iMemID  );   400                list( $i Mem1ID, $s Status1 )  = $oPC ->  createProf ile( $aPro file, fals e, $iMemID  );
401                   401                
402                if( !$iM em1ID ) {   402                if( !$iM em1ID ) {
403                    $oPC  -> delete Profile( $ iMemID );   403                    $oPC  -> delete Profile( $ iMemID );
404                    retu rn array(  false, 'Fa il' );   404                    retu rn array(  false, 'Fa il' );
405                }   405                }
406           }   406           }
407              407           
408           // send new u ser notifi cation   408           // send new u ser notifi cation
409           if ( getParam ('newusern otify') ==  'on' )   409           if ( getParam ('newusern otify') ==  'on' )
410                $oPC ->  sendNewUse rNotify( $ iMemID );   410                $oPC ->  sendNewUse rNotify( $ iMemID );
411     411  
412           //  Affiliate  and frien d checking   412           //  Affiliate  and frien d checking
413           if  ( $bEnAff  && $_COOK IE['idAff' ] ) {   413           if  ( $bEnAff  && $_COOK IE['idAff' ] ) {
414                $vRes =  db_res("SE LECT `ID`  FROM `aff`  WHERE `ID ` = {$_COO KIE['idAff ']} AND `S tatus` = ' active'");   414                $vRes =  db_res("SE LECT `ID`  FROM `aff`  WHERE `ID ` = {$_COO KIE['idAff ']} AND `S tatus` = ' active'");
415                if ( mys ql_num_row s( $vRes )  ) {   415                if ( mys ql_num_row s( $vRes )  ) {
416                    $vRe s = db_res ("INSERT I NTO `aff_m embers` (` idAff`,`id Profile`)  VALUES ('{ $_COOKIE[' idAff']}',  '{$iMemID }')");   416                    $vRe s = db_res ("INSERT I NTO `aff_m embers` (` idAff`,`id Profile`)  VALUES ('{ $_COOKIE[' idAff']}',  '{$iMemID }')");
417                }   417                }
418           }   418           }
419              419           
420           if  ( $bEnAff  && $_COOK IE['idFrie nd'] ) {   420           if  ( $bEnAff  && $_COOK IE['idFrie nd'] ) {
421                $iFriend ID = getID ( $_COOKIE ['idFriend '] );   421                $iFriend ID = getID ( $_COOKIE ['idFriend '] );
422                if ( $iF riendID )  {   422                if ( $iF riendID )  {
423                    $vRe s = db_res ( "UPDATE  `Profiles`  SET `aff_ num` = `af f_num` + 1  WHERE `ID ` = '{$iFr iendID}'"  );   423                    $vRe s = db_res ( "UPDATE  `Profiles`  SET `aff_ num` = `af f_num` + 1  WHERE `ID ` = '{$iFr iendID}'"  );
424                    crea teUserData File( $iFr iendID );   424                    crea teUserData File( $iFr iendID );
425                }   425                }
426           }   426           }
427              427           
428           re parseObjTa gs( 'profi le', $iMem ID );   428           re parseObjTa gs( 'profi le', $iMem ID );
429     429  
430           re turn array ( $iMemID,  $sStatus  );   430           re turn array ( $iMemID,  $sStatus  );
431       }   431       }
432          432       
433       functi on showFai lPage() {   433       functi on showFai lPage() {
434           ec ho _t( '_J oin failed ' );   434           ec ho _t( '_J oin failed ' );
435       }   435       }
436          436       
437       functi on showFin ishPage( $ iMemID, $s Status ) {   437       functi on showFin ishPage( $ iMemID, $s Status ) {
438           sw itch( $sSt atus ) {   438           sw itch( $sSt atus ) {
439                case 'Ac tive':       $sStatus Text = ('_ USER_ACTIV ATION_SUCC EEDED'); b reak; //ac tivated au tomaticall y   439                case 'Ac tive':       $sStatus Text = ('_ USER_ACTIV ATION_SUCC EEDED'); b reak; //ac tivated au tomaticall y
440                case 'Ap proval':     $sStatus Text = ('_ USER_CONF_ SUCCEEDED' );       b reak; //au tomaticall y confirme d   440                case 'Ap proval':     $sStatus Text = ('_ USER_CONF_ SUCCEEDED' );       b reak; //au tomaticall y confirme d
441                case 'Un confirmed' : $sStatus Text = ('_ EMAIL_CONF _SENT');            b reak; //co nf mail su ccesfully  sent   441                case 'Un confirmed' : $sStatus Text = ('_ EMAIL_CONF _SENT');            b reak; //co nf mail su ccesfully  sent
442                case 'No tSent':      $sStatus Text = ('_ EMAIL_CONF _NOT_SENT' );       b reak; //fa iled to se nd conf ma il   442                case 'No tSent':      $sStatus Text = ('_ EMAIL_CONF _NOT_SENT' );       b reak; //fa iled to se nd conf ma il
443           }   443           }
444              444           
445           ec ho _t( '_J oin comple te' );   445           ec ho _t( '_J oin comple te' );
446           ec ho '<br /> ';   446           ec ho '<br /> ';
447           ec ho _t( $sS tatusText  );   447           ec ho _t( $sS tatusText  );
448       }   448       }
449          449       
450   }   450   }
451     451  
452   function L oginForm(  $text, $ac tion, $tab le, $login _page, $fo rgot_page,  $template  = '' )   452   function L oginForm(  $text, $ac tion, $tab le, $login _page, $fo rgot_page,  $template  = '' )
453   {   453   {
454       global  $site;   454       global  $site;
455       global  $dir;    
456       global  $tmpl;   455       global  $tmpl;
457     456  
458       $aForm Replace =  array();   457       $aForm Replace =  array();
459          458       
460       $name_ label = _t ("_Nicknam e");   459       $name_ label = _t ("_Nicknam e");
461          460       
462       $aForm Replace['h eader_text ']    = $s ite['title '] . ' ' .  $mem . '  Login';   461       $aForm Replace['h eader_text ']    = $s ite['title '] . ' ' .  $mem . '  Login';
463       if( $a ction == " login" )   462       if( $a ction == " login" )
464       {   463       {
465           $a FormReplac e['warning _text']    = $text;   464           $a FormReplac e['warning _text']    = $text;
466           $a FormReplac e['submit_ label']    = _t("_Log  In");   465           $a FormReplac e['submit_ label']    = _t("_Log  In");
467           $a FormReplac e['form_on submit']   = 'return  true;';   466           $a FormReplac e['form_on submit']   = 'return  true;';
468       }   467       }
469       elseif ( $action  == 'boonex ' )   468       elseif ( $action  == 'boonex ' )
470       {   469       {
471           $a FormReplac e['warning _text']    = $text .   470           $a FormReplac e['warning _text']    = $text .
472                '<div cl ass="id">'  .   471                '<div cl ass="id">'  .
473                    '<a  href="java script:voi d(0);"   472                    '<a  href="java script:voi d(0);"
474                      on click="win dow.open(\ 'http://ww w.boonex.c om/unity/e xpress/XML .php?modul e=form&amp ;action=jo inForm&amp ;community =3\', \'Bo onex_Sign_ Up\', \'wi dth=400,he ight=593,t oolbar=0,d irectories =0,menubar =0,status= 0,location =0,scrollb ars=0,resi zable=0\') ;">' .   473                      on click="win dow.open(\ 'http://ww w.boonex.c om/unity/e xpress/XML .php?modul e=form&amp ;action=jo inForm&amp ;community =3\', \'Bo onex_Sign_ Up\', \'wi dth=400,he ight=593,t oolbar=0,d irectories =0,menubar =0,status= 0,location =0,scrollb ars=0,resi zable=0\') ;">' .
475                         _t( '_Get  BoonEx ID'  ) .   474                         _t( '_Get  BoonEx ID'  ) .
476                    '</a >'.   475                    '</a >'.
477                '</div>' ;   476                '</div>' ;
478              477           
479           $a FormReplac e['submit_ label']    = _t("_Imp ort");   478           $a FormReplac e['submit_ label']    = _t("_Imp ort");
480              479           
481           $a FormReplac e['form_on submit']   = 'getBoon exId( this , document .forms.joi n_form );  return fal se;';   480           $a FormReplac e['form_on submit']   = 'getBoon exId( this , document .forms.joi n_form );  return fal se;';
482       }   481       }
483       $aForm Replace['a ction_url' ]     = $l ogin_page;   482       $aForm Replace['a ction_url' ]     = $l ogin_page;
484       $aForm Replace['r elocate_ur l']   = $_ SERVER['PH P_SELF'];   483       $aForm Replace['r elocate_ur l']   = $_ SERVER['PH P_SELF'];
485       $aForm Replace['n ame_label' ]     = $n ame_label;   484       $aForm Replace['n ame_label' ]     = $n ame_label;
486       $aForm Replace['p assword_la bel'] = _t ("_Passwor d");   485       $aForm Replace['p assword_la bel'] = _t ("_Passwor d");
487          486       
488       if( $f orgot_page  )   487       if( $f orgot_page  )
489       {   488       {
490           $a FormReplac e['forgot_ page_url']  = $forgot _page;   489           $a FormReplac e['forgot_ page_url']  = $forgot _page;
491           $a FormReplac e['forgot_ label']     = _t("_fo rgot_your_ password")  . '?';   490           $a FormReplac e['forgot_ label']     = _t("_fo rgot_your_ password")  . '?';
492       }   491       }
493       else   492       else
494       {   493       {
495           $a FormReplac e['forgot_ page_url']  = '';   494           $a FormReplac e['forgot_ page_url']  = '';
496           $a FormReplac e['forgot_ label']     = '';   495           $a FormReplac e['forgot_ label']     = '';
497       }   496       }
498          497       
499       if( !s trlen( $te mplate ) )   498       if( !s trlen( $te mplate ) )
500            $template   =  
" {$dir['roo t']} templates/ tmpl_{$tmp l}/join_lo gin_form.h tml";
  499            $template   =   BX_DIRECTO RY_PATH_RO OT   .   "
templates/ tmpl_{$tmp l}/join_lo gin_form.h tml";
501          500       
502       $ret =  file_get_ contents(  $template  );   501       $ret =  file_get_ contents(  $template  );
503          502       
504       foreac h( $aFormR eplace as  $key => $v al )   503       foreac h( $aFormR eplace as  $key => $v al )
505           $r et = str_r eplace( "_ _{$key}__" , $val, $r et );   504           $r et = str_r eplace( "_ _{$key}__" , $val, $r et );
506          505       
507       return  $ret;   506       return  $ret;
508   }   507   }