10. File Comparison Report

Produced on Thu Jul 17 07:17:06 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.

10.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.2\admin preValues.php Sat Apr 19 12:05:02 2008 UTC
2 Dolphin-v.6.1.3\admin preValues.php Wed Jul 16 09:51:21 2008 UTC

10.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 892
Changed 1 2
Inserted 0 0
Removed 1 2

10.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

10.4 Active regular expressions

No regular expressions were active.

10.5 Comparison detail

1   <?php   1   <?php
2     2  
3   /********* ********** ********** ********** ********** ********** ********** ******   3   /********* ********** ********** ********** ********** ********** ********** ******
4   *                              D olphin Sma rt Communi ty Builder   4   *                              D olphin Sma rt Communi ty Builder
5   *                                 --------- --------   5   *                                 --------- --------
6   *     begi n                 : M on Mar 23  2006   6   *     begi n                 : M on Mar 23  2006
7   *     copy right             : ( C) 2006 Bo onEx Group   7   *     copy right             : ( C) 2006 Bo onEx Group
8   *     webs ite               : h ttp://www. boonex.com /   8   *     webs ite               : h ttp://www. boonex.com /
9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder   9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder
10   *   10   *
11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License.    11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License. 
12   * http://c reativecom mons.org/l icenses/by /3.0/   12   * http://c reativecom mons.org/l icenses/by /3.0/
13   *   13   *
14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;
15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details.    16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details. 
17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin   17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin
18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
19   ********** ********** ********** ********** ********** ********** ********** *****/   19   ********** ********** ********** ********** ********** ********** ********** *****/
20     20  
21   require_on ce( '../in c/header.i nc.php' );   21   require_on ce( '../in c/header.i nc.php' );
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );   22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );
23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );   23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );
24     24  
25     25  
26   $logged['a dmin'] = m ember_auth ( 1, true,  true );   26   $logged['a dmin'] = m ember_auth ( 1, true,  true );
27     27  
28     28  
29     29  
30     30  
31     31  
32   $_page['cs s_name'] =  'preValue s.css';   32   $_page['cs s_name'] =  'preValue s.css';
33     33  
34   $_page['he ader'] = ' Predefined  Lists';   34   $_page['he ader'] = ' Predefined  Lists';
35     35  
36   $_page['ex traCodeInH ead'] = << <EOJ   36   $_page['ex traCodeInH ead'] = << <EOJ
37   <script ty pe="text/j avascript"  src="{$si te['plugin s']}jquery /jquery.js "></script >   37   <script ty pe="text/j avascript"  src="{$si te['plugin s']}jquery /jquery.js "></script >
38   EOJ;   38   EOJ;
39     39  
40     40  
41     41  
42     42  
43   $aFields =  array(   43   $aFields =  array(
44       'Value '  => 'The  value sto red in the  database' ,   44       'Value '  => 'The  value sto red in the  database' ,
45       'LKey'    => 'Pri mary langu age key us ed for dis playing',   45       'LKey'    => 'Pri mary langu age key us ed for dis playing',
46       'LKey2 '  => 'Sec ondary lan guage key  used for d isplaying  in some ot her places ',   46       'LKey2 '  => 'Sec ondary lan guage key  used for d isplaying  in some ot her places ',
47       'LKey3 '  => 'Mis celaniuos  language k ey used fo r displayi ng in some  other pla ces.',   47       'LKey3 '  => 'Mis celaniuos  language k ey used fo r displayi ng in some  other pla ces.',
48       'Extra '  => 'Ext ra paramet er. Used f or example  as link t o profile  image for  Sex list.' ,   48       'Extra '  => 'Ext ra paramet er. Used f or example  as link t o profile  image for  Sex list.' ,
49       'Extra 2' => 'Mis celanious  extra para meter',   49       'Extra 2' => 'Mis celanious  extra para meter',
50       'Extra 3' => 'Mis celanious  extra para meter'   50       'Extra 3' => 'Mis celanious  extra para meter'
51   );   51   );
52     52  
53     53  
54     54  
55     55  
56     56  
57     57  
58   if( isset(  $_REQUEST ['popup']  ) and $_RE QUEST['pop up'] == 1  ) {   58   if( isset(  $_REQUEST ['popup']  ) and $_RE QUEST['pop up'] == 1  ) {
59       $iAmIn Popup = tr ue;   59       $iAmIn Popup = tr ue;
60       TopCod eAdminPopu p();   60       TopCod eAdminPopu p();
61       PageCo mpPageMain Code();   61       PageCo mpPageMain Code();
62       Bottom CodeAdminP opup();   62       Bottom CodeAdminP opup();
63   } else {   63   } else {
64       $iAmIn Popup = fa lse;   64       $iAmIn Popup = fa lse;
65       TopCod eAdmin();   65       TopCod eAdmin();
66       PageCo mpPageMain Code();   66       PageCo mpPageMain Code();
67       Bottom Code();   67       Bottom Code();
68   }   68   }
69     69  
70   function P ageCompPag eMainCode( ) {   70   function P ageCompPag eMainCode( ) {
71       global  $iAmInPop up;   71       global  $iAmInPop up;
72       global  $aFields;   72       global  $aFields;
73          73       
74       $sPopu pAdd = $iA mInPopup ?  '&popup=1 ' : '';   74       $sPopu pAdd = $iA mInPopup ?  '&popup=1 ' : '';
75          75       
76       if( is set( $_POS T['action' ] ) and $_ POST['acti on'] == 'S ave' and i sset( $_PO ST['PreLis t'] ) and  is_array(  $_POST['Pr eList'] )  ) {   76       if( is set( $_POS T['action' ] ) and $_ POST['acti on'] == 'S ave' and i sset( $_PO ST['PreLis t'] ) and  is_array(  $_POST['Pr eList'] )  ) {
77           sa veList( $_ POST['list '], $_POST ['PreList' ] );   77           sa veList( $_ POST['list '], $_POST ['PreList' ] );
78           re turn;   78           re turn;
79       }   79       }
80          80       
81       //get  lists   81       //get  lists
82       $aList s = array(  '' => '-  Select -'  );   82       $aList s = array(  '' => '-  Select -'  );
83       $sQuer y = "SELEC T DISTINCT  `Key` FRO M `PreValu es`";   83       $sQuer y = "SELEC T DISTINCT  `Key` FRO M `PreValu es`";
84       $rList s = db_res ( $sQuery  );   84       $rList s = db_res ( $sQuery  );
85       while(  $aList =  mysql_fetc h_assoc( $ rLists ) )  {   85       while(  $aList =  mysql_fetc h_assoc( $ rLists ) )  {
86           $a Lists[ $aL ist['Key']  ] = $aLis t['Key'];   86           $a Lists[ $aL ist['Key']  ] = $aLis t['Key'];
87       }   87       }
88          88       
89       if( is set( $_REQ UEST['list '] ) ) {   89       if( is set( $_REQ UEST['list '] ) ) {
90           $s List_db =  process_db _input(  $ _REQUEST[' list'] );   90           $s List_db =  process_db _input(  $ _REQUEST[' list'] );
91           $s List    =  process_pa ss_data( $ _REQUEST[' list'] );   91           $s List    =  process_pa ss_data( $ _REQUEST[' list'] );
92              92           
93           $s Query = "S ELECT * FR OM `PreVal ues` WHERE  `Key` = ' $sList_db'  ORDER BY  `Order`";   93           $s Query = "S ELECT * FR OM `PreVal ues` WHERE  `Key` = ' $sList_db'  ORDER BY  `Order`";
94           $r Values = d b_res( $sQ uery );   94           $r Values = d b_res( $sQ uery );
95              95           
96           if ( !mysql_n um_rows( $ rValues )  ) //if no  rows retur ned...   96           if ( !mysql_n um_rows( $ rValues )  ) //if no  rows retur ned...
97                $aLists[  $sList ]  = $sList;  //create n ew list   97                $aLists[  $sList ]  = $sList;  //create n ew list
98       } else  {   98       } else  {
99           $s List = '';   99           $s List = '';
100       }   100       }
101          101       
102       ?>   102       ?>
103       <scrip t type="te xt/javascr ipt">   103       <scrip t type="te xt/javascr ipt">
104           fu nction cre ateNewList () {   104           fu nction cre ateNewList () {
105                var sNew List = pro mpt( 'Plea se enter n ame of new  list' );   105                var sNew List = pro mpt( 'Plea se enter n ame of new  list' );
106                   106                
107                if( sNew List == nu ll )   107                if( sNew List == nu ll )
108                    retu rn false;   108                    retu rn false;
109                   109                
110                sNewList  = $.trim(  sNewList  );   110                sNewList  = $.trim(  sNewList  );
111                   111                
112                if( !sNe wList.leng th ) {   112                if( !sNe wList.leng th ) {
113                    aler t( 'You sh ould enter  correct n ame' );   113                    aler t( 'You sh ould enter  correct n ame' );
114                    retu rn false;   114                    retu rn false;
115                }   115                }
116                   116                
117                window.l ocation =  '<?= $_SER VER['PHP_S ELF'] ?>?l ist=' + en codeURICom ponent( sN ewList ) +  '<?= $sPo pupAdd ?>' ;   117                window.l ocation =  '<?= $_SER VER['PHP_S ELF'] ?>?l ist=' + en codeURICom ponent( sN ewList ) +  '<?= $sPo pupAdd ?>' ;
118           }   118           }
119              119           
120           fu nction add Row( eImg  ) {   120           fu nction add Row( eImg  ) {
121                $( eImg  ).parent() .parent(). before(   121                $( eImg  ).parent() .parent(). before(
122                    '<tr >' +   122                    '<tr >' +
123                    <?   123                    <?
124                    fore ach( $aFie lds as $sF ield => $s Help ) {   124                    fore ach( $aFie lds as $sF ield => $s Help ) {
125                         ?>   125                         ?>
126                         '<td><inpu t type="te xt" class= "value_inp ut" name=" PreList['  + iNextInd  + '][<?=  $sField ?> ]" value=" " /></td>'  +   126                         '<td><inpu t type="te xt" class= "value_inp ut" name=" PreList['  + iNextInd  + '][<?=  $sField ?> ]" value=" " /></td>'  +
127                         <?   127                         <?
128                    }   128                    }
129                    ?>   129                    ?>
130                         '<th>' +   130                         '<th>' +
131                             '<img  src="image s/minus1.g if"     cl ass="row_c ontrol" ti tle="Delet e"    alt= "Delete" o nclick="de lRow( this  );" />' +   131                             '<img  src="image s/minus1.g if"     cl ass="row_c ontrol" ti tle="Delet e"    alt= "Delete" o nclick="de lRow( this  );" />' +
132                             '<img  src="image s/arrow_up .gif"   cl ass="row_c ontrol" ti tle="Move  up"   alt= "Delete" o nclick="mo veUpRow( t his );" /> ' +   132                             '<img  src="image s/arrow_up .gif"   cl ass="row_c ontrol" ti tle="Move  up"   alt= "Delete" o nclick="mo veUpRow( t his );" /> ' +
133                             '<img  src="image s/arrow_do wn.gif" cl ass="row_c ontrol" ti tle="Move  down" alt= "Delete" o nclick="mo veDownRow(  this );"  />' +   133                             '<img  src="image s/arrow_do wn.gif" cl ass="row_c ontrol" ti tle="Move  down" alt= "Delete" o nclick="mo veDownRow(  this );"  />' +
134                         '</th>' +   134                         '</th>' +
135                    '</t r>'   135                    '</t r>'
136                );   136                );
137                   137                
138                iNextInd  ++;   138                iNextInd  ++;
139                   139                
140                sortZebr a();   140                sortZebr a();
141           }   141           }
142              142           
143           fu nction del Row( eImg  ) {   143           fu nction del Row( eImg  ) {
144                $( eImg  ).parent() .parent(). remove();   144                $( eImg  ).parent() .parent(). remove();
145                sortZebr a();   145                sortZebr a();
146           }   146           }
147              147           
148           fu nction mov eUpRow( eI mg ) {   148           fu nction mov eUpRow( eI mg ) {
149                var oCur  = $( eImg  ).parent( ).parent() ;   149                var oCur  = $( eImg  ).parent( ).parent() ;
150                var oPre v = oCur.p rev( ':not (.headers) ' );   150                var oPre v = oCur.p rev( ':not (.headers) ' );
151                if( !oPr ev.length  )   151                if( !oPr ev.length  )
152                    retu rn;   152                    retu rn;
153                   153                
154                // swap  elements v alues   154                // swap  elements v alues
155                var oCur Elems  = $ ('input',  oCur.get(0 ));   155                var oCur Elems  = $ ('input',  oCur.get(0 ));
156                var oPre vElems = $ ('input',  oPrev.get( 0));   156                var oPre vElems = $ ('input',  oPrev.get( 0));
157                   157                
158                oCurElem s.each( fu nction(iIn d) {   158                oCurElem s.each( fu nction(iIn d) {
159                    var  oCurElem   = $( this  );   159                    var  oCurElem   = $( this  );
160                    var  oPrevElem  = oPrevEle ms.filter(  ':eq(' +  iInd + ')'  );   160                    var  oPrevElem  = oPrevEle ms.filter(  ':eq(' +  iInd + ')'  );
161                       161                    
162                    // s wap them   162                    // s wap them
163                    var  sCurValue  = oCurElem .val();   163                    var  sCurValue  = oCurElem .val();
164                    oCur Elem.val(  oPrevElem. val() );   164                    oCur Elem.val(  oPrevElem. val() );
165                    oPre vElem.val(  sCurValue  );   165                    oPre vElem.val(  sCurValue  );
166                } );   166                } );
167           }   167           }
168              168           
169           fu nction mov eDownRow(  eImg ) {   169           fu nction mov eDownRow(  eImg ) {
170                var oCur  = $( eImg  ).parent( ).parent() ;   170                var oCur  = $( eImg  ).parent( ).parent() ;
171                var oPre v = oCur.n ext( ':not (.headers) ' );   171                var oPre v = oCur.n ext( ':not (.headers) ' );
172                if( !oPr ev.length  )   172                if( !oPr ev.length  )
173                    retu rn;   173                    retu rn;
174                   174                
175                // swap  elements v alues   175                // swap  elements v alues
176                var oCur Elems  = $ ('input',  oCur.get(0 ));   176                var oCur Elems  = $ ('input',  oCur.get(0 ));
177                var oPre vElems = $ ('input',  oPrev.get( 0));   177                var oPre vElems = $ ('input',  oPrev.get( 0));
178                   178                
179                oCurElem s.each( fu nction(iIn d) {   179                oCurElem s.each( fu nction(iIn d) {
180                    var  oCurElem   = $( this  );   180                    var  oCurElem   = $( this  );
181                    var  oPrevElem  = oPrevEle ms.filter(  ':eq(' +  iInd + ')'  );   181                    var  oPrevElem  = oPrevEle ms.filter(  ':eq(' +  iInd + ')'  );
182                       182                    
183                    // s wap them   183                    // s wap them
184                    var  sCurValue  = oCurElem .val();   184                    var  sCurValue  = oCurElem .val();
185                    oCur Elem.val(  oPrevElem. val() );   185                    oCur Elem.val(  oPrevElem. val() );
186                    oPre vElem.val(  sCurValue  );   186                    oPre vElem.val(  sCurValue  );
187                } );   187                } );
188           }   188           }
189              189           
190           fu nction sor tZebra() {   190           fu nction sor tZebra() {
191                $( '#lis tEdit tr:e ven' ).rem oveClass(  'even odd'  ).addClas s( 'even'  );   191                $( '#lis tEdit tr:e ven' ).rem oveClass(  'even odd'  ).addClas s( 'even'  );
192                $( '#lis tEdit tr:o dd'  ).rem oveClass(  'even odd'  ).addClas s( 'odd'   );   192                $( '#lis tEdit tr:o dd'  ).rem oveClass(  'even odd'  ).addClas s( 'odd'   );
193           }   193           }
194              194           
195           // just a des ign   195           // just a des ign
196           $(  document  ).ready( s ortZebra ) ;   196           $(  document  ).ready( s ortZebra ) ;
197       </scri pt>   197       </scri pt>
198          198       
199       <form  action="<? = $_SERVER ['PHP_SELF '] ?>" met hod="post" >   199       <form  action="<? = $_SERVER ['PHP_SELF '] ?>" met hod="post" >
200           <t able id="l istEdit" c ellpadding ="0" cells pacing="0" >   200           <t able id="l istEdit" c ellpadding ="0" cells pacing="0" >
201                <tr>   201                <tr>
202                    <th  colspan="< ?= count(  $aFields )  + 1 ?>">   202                    <th  colspan="< ?= count(  $aFields )  + 1 ?>">
203                         Select a l ist:   203                         Select a l ist:
204                         <select na me="list"   204                         <select na me="list"
205                           onchange ="if( this .value !=  '' ) windo w.location  = '<?= $_ SERVER['PH P_SELF'] ? >' + '?lis t=' + enco deURICompo nent( this .value ) +  '<?= $sPo pupAdd ?>' ;">   205                           onchange ="if( this .value !=  '' ) windo w.location  = '<?= $_ SERVER['PH P_SELF'] ? >' + '?lis t=' + enco deURICompo nent( this .value ) +  '<?= $sPo pupAdd ?>' ;">
206                             <?= ge nListOptio ns( $aList s, $sList  ) ?>   206                             <?= ge nListOptio ns( $aList s, $sList  ) ?>
207                         </select>   207                         </select>
208                         <input typ e="button"  value="Cr eate New"  onclick="c reateNewLi st();" />   208                         <input typ e="button"  value="Cr eate New"  onclick="c reateNewLi st();" />
209                    </th >   209                    </th >
210                </tr>   210                </tr>
211       <?   211       <?
212       if( $s List !== ' ' ) {   212       if( $s List !== ' ' ) {
213           $i NextInd =  genListRow s( $sList_ db );   213           $i NextInd =  genListRow s( $sList_ db );
214           ?>   214           ?>
215                <tr>   215                <tr>
216                    <th  colspan="8 ">   216                    <th  colspan="8 ">
217                         <input typ e="hidden"  name="pop up" value= "<?= $iAmI nPopup ?>"  />   217                         <input typ e="hidden"  name="pop up" value= "<?= $iAmI nPopup ?>"  />
218                         <input typ e="submit"  name="act ion" value ="Save" />   218                         <input typ e="submit"  name="act ion" value ="Save" />
219                    </th >   219                    </th >
220                </tr>   220                </tr>
221           <?   221           <?
222       } else   222       } else
223           $i NextInd =  0;   223           $i NextInd =  0;
224       ?>   224       ?>
225           </ table>   225           </ table>
226              226           
227           <s cript type ="text/jav ascript">   227           <s cript type ="text/jav ascript">
228                iNextInd  = <?= $iN extInd ?>;   228                iNextInd  = <?= $iN extInd ?>;
229           </ script>   229           </ script>
230       </form >   230       </form >
231       <?   231       <?
232   }   232   }
233     233  
234   function g enListOpti ons( $aLis ts, $sActi ve ) {   234   function g enListOpti ons( $aLis ts, $sActi ve ) {
235       $sRet  = '';   235       $sRet  = '';
236       foreac h( $aLists  as $sKey  => $sValue  ) {   236       foreac h( $aLists  as $sKey  => $sValue  ) {
237           $s Ret .= '   237           $s Ret .= '
238                <option  value="' .   238                <option  value="' .
239                htmlspec ialchars(  $sKey ) .   239                htmlspec ialchars(  $sKey ) .
240                '"' . (  ( $sKey ==  $sActive  ) ? ' sele cted="sele cted"' : ' ' ) .   240                '"' . (  ( $sKey ==  $sActive  ) ? ' sele cted="sele cted"' : ' ' ) .
241                '>' . ht mlspecialc hars( $sVa lue ) . '< /option>';   241                '>' . ht mlspecialc hars( $sVa lue ) . '< /option>';
242       }   242       }
243          243       
244       return  $sRet;   244       return  $sRet;
245   }   245   }
246     246  
247   function g enListRows ( $sList_d b ) {   247   function g enListRows ( $sList_d b ) {
248       global  $aFields;   248       global  $aFields;
249          249       
250       $sQuer y = "SELEC T * FROM ` PreValues`  WHERE `Ke y` = '$sLi st_db' ORD ER BY `Ord er`";   250       $sQuer y = "SELEC T * FROM ` PreValues`  WHERE `Ke y` = '$sLi st_db' ORD ER BY `Ord er`";
251       $rList  = db_res(  $sQuery ) ;   251       $rList  = db_res(  $sQuery ) ;
252          252       
253       ?>   253       ?>
254           <t r class="h eaders">   254           <t r class="h eaders">
255       <?   255       <?
256       foreac h( $aField s as $sFie ld => $sHe lp ) {   256       foreac h( $aField s as $sFie ld => $sHe lp ) {
257           ?>   257           ?>
258                <th>   258                <th>
259                    <spa n class="t ableLabel"   259                    <spa n class="t ableLabel"
260                      on mouseover= "showFloat Desc( '<?=  addslashe s( htmlspe cialchars(  $sHelp )  ) ?>' );"   260                      on mouseover= "showFloat Desc( '<?=  addslashe s( htmlspe cialchars(  $sHelp )  ) ?>' );"
261                      on mousemove= "moveFloat Desc( even t );"   261                      on mousemove= "moveFloat Desc( even t );"
262                      on mouseout=" hideFloatD esc();">   262                      on mouseout=" hideFloatD esc();">
263                         <?= $sFiel d ?>   263                         <?= $sFiel d ?>
264                    </sp an>   264                    </sp an>
265                </th>   265                </th>
266           <?   266           <?
267       }   267       }
268       ?>   268       ?>
269                <th>&nbs p;</th>   269                <th>&nbs p;</th>
270           </ tr>   270           </ tr>
271       <?   271       <?
272          272       
273       $iCoun ter = 0;   273       $iCoun ter = 0;
274          274       
275       while(  $aRow = m ysql_fetch _assoc( $r List ) ) {   275       while(  $aRow = m ysql_fetch _assoc( $r List ) ) {
276           ?>   276           ?>
277           <t r>   277           <t r>
278           <?   278           <?
279           fo reach( $aF ields as $ sField =>  $sHelp ) {   279           fo reach( $aF ields as $ sField =>  $sHelp ) {
280                ?>   280                ?>
281                <td>   281                <td>
282                    <inp ut type="t ext" class ="value_in put" name= "PreList[< ?= $iCount er ?>][<?=  $sField ? >]" value= "<?= htmls pecialchar s( $aRow[$ sField] )  ?>" />   282                    <inp ut type="t ext" class ="value_in put" name= "PreList[< ?= $iCount er ?>][<?=  $sField ? >]" value= "<?= htmls pecialchar s( $aRow[$ sField] )  ?>" />
283                </td>   283                </td>
284                <?   284                <?
285           }   285           }
286           ?>   286           ?>
287                <th>   287                <th>
288                    <img  src="imag es/minus1. gif"     c lass="row_ control" t itle="Dele te"    alt ="Delete"  onclick="d elRow( thi s );" />   288                    <img  src="imag es/minus1. gif"     c lass="row_ control" t itle="Dele te"    alt ="Delete"  onclick="d elRow( thi s );" />
289                    <img  src="imag es/arrow_u p.gif"   c lass="row_ control" t itle="Move  up"   alt ="Delete"  onclick="m oveUpRow(  this );" / >   289                    <img  src="imag es/arrow_u p.gif"   c lass="row_ control" t itle="Move  up"   alt ="Delete"  onclick="m oveUpRow(  this );" / >
290                    <img  src="imag es/arrow_d own.gif" c lass="row_ control" t itle="Move  down" alt ="Delete"  onclick="m oveDownRow ( this );"  />   290                    <img  src="imag es/arrow_d own.gif" c lass="row_ control" t itle="Move  down" alt ="Delete"  onclick="m oveDownRow ( this );"  />
291                </th>   291                </th>
292           </ tr>   292           </ tr>
293           <?   293           <?
294              294           
295           $i Counter ++ ;   295           $i Counter ++ ;
296       }   296       }
297       ?>   297       ?>
298           <t r class="h eaders">   298           <t r class="h eaders">
299                <td cols pan="<?= c ount( $aFi elds ) ?>" >&nbsp;</t d>   299                <td cols pan="<?= c ount( $aFi elds ) ?>" >&nbsp;</t d>
300                <th>   300                <th>
301                    <img  src="imag es/plus1.g if" class= "row_contr ol" title= "Add" alt= "Add" oncl ick="addRo w( this ); " />   301                    <img  src="imag es/plus1.g if" class= "row_contr ol" title= "Add" alt= "Add" oncl ick="addRo w( this ); " />
302                </th>   302                </th>
303           </ tr>   303           </ tr>
304       <?   304       <?
305          305       
306       return  $iCounter ;   306       return  $iCounter ;
307   }   307   }
308     308  
309     309  
310   function s aveList( $ sList, $aD ata ) {   310   function s aveList( $ sList, $aD ata ) {
311       global  $aFields;   311       global  $aFields;
312       global  $iAmInPop up;   312       global  $iAmInPop up;
313          313       
314       $sList _db = trim ( process_ db_input(  $sList ) ) ;   314       $sList _db = trim ( process_ db_input(  $sList ) ) ;
315          315       
316       if( $s List_db ==  '' )   316       if( $s List_db ==  '' )
317           re turn false ;   317           re turn false ;
318          318       
319       $sQuer y = "DELET E FROM `Pr eValues` W HERE `Key`  = '$sList _db'";   319       $sQuer y = "DELET E FROM `Pr eValues` W HERE `Key`  = '$sList _db'";
320          320       
321       db_res ( $sQuery  );   321       db_res ( $sQuery  );
322          322       
323       $sValu esAlter =  '';   323       $sValu esAlter =  '';
324          324       
325       foreac h( $aData  as $iInd = > $aRow )  {   325       foreac h( $aData  as $iInd = > $aRow )  {
326           $a Row['Value '] = str_r eplace( ', ', '', tri m( $aRow[' Value'] )  );   326           $a Row['Value '] = str_r eplace( ', ', '', tri m( $aRow[' Value'] )  );
327              327           
328           if ( $aRow['V alue'] ==  '' )   328           if ( $aRow['V alue'] ==  '' )
329                continue ;   329                continue ;
330              330           
331           $s ValuesAlte r .= "'" .  process_d b_input( $ aRow['Valu e'] ) . "' , ";   331           $s ValuesAlte r .= "'" .  process_d b_input( $ aRow['Valu e'] ) . "' , ";
332              332           
333           $s InsFields  = '';   333           $s InsFields  = '';
334           $s InsValues  = '';   334           $s InsValues  = '';
335           fo reach( $aF ields as $ sField =>  $sTemp ) {   335           fo reach( $aF ields as $ sField =>  $sTemp ) {
336                $sValue  = trim( pr ocess_db_i nput( $aRo w[$sField]  ) );   336                $sValue  = trim( pr ocess_db_i nput( $aRo w[$sField]  ) );
337                   337                
338                $sInsFie lds .= "`$ sField`, " ;   338                $sInsFie lds .= "`$ sField`, " ;
339                $sInsVal ues .= "'$ sValue', " ;   339                $sInsVal ues .= "'$ sValue', " ;
340           }   340           }
341              341           
342           $s InsFields  = substr(  $sInsField s, 0, -2 ) ; //remove  ', '   342           $s InsFields  = substr(  $sInsField s, 0, -2 ) ; //remove  ', '
343           $s InsValues  = substr(  $sInsValue s, 0, -2 ) ;   343           $s InsValues  = substr(  $sInsValue s, 0, -2 ) ;
344              344           
345           $s Query = "I NSERT INTO  `PreValue s` ( `Key` , $sInsFie lds, `Orde r` ) VALUE S ( '$sLis t_db', $sI nsValues,  $iInd )";   345           $s Query = "I NSERT INTO  `PreValue s` ( `Key` , $sInsFie lds, `Orde r` ) VALUE S ( '$sLis t_db', $sI nsValues,  $iInd )";
346              346           
347           // echo $sQue ry . "<br  />\n";   347           // echo $sQue ry . "<br  />\n";
348           db _res( $sQu ery );   348           db _res( $sQu ery );
349       }   349       }
350          350       
351       //alte r Profiles  table   351       //alte r Profiles  table
352       $sValu esAlter =  substr( $s ValuesAlte r, 0, -2 ) ; //remove  ', '   352       $sValu esAlter =  substr( $s ValuesAlte r, 0, -2 ) ; //remove  ', '
353       $sQuer y = "SELEC T `Name` F ROM `Profi leFields`  WHERE `Typ e` = 'sele ct_set' AN D `Values`  = '#!{$sL ist_db}'";   353       $sQuer y = "SELEC T `Name` F ROM `Profi leFields`  WHERE `Typ e` = 'sele ct_set' AN D `Values`  = '#!{$sL ist_db}'";
354       $rFiel ds = db_re s( $sQuery  );   354       $rFiel ds = db_re s( $sQuery  );
355       while(  $aField =  mysql_fet ch_assoc(  $rFields )  ) {   355       while(  $aField =  mysql_fet ch_assoc(  $rFields )  ) {
356           $s Field = $a Field['Nam e'];   356           $s Field = $a Field['Nam e'];
357              357           
358           $s Query = "A LTER TABLE  `Profiles ` CHANGE ` $sField` ` $sField` s et($sValue sAlter) NO T NULL def ault ''";   358           $s Query = "A LTER TABLE  `Profiles ` CHANGE ` $sField` ` $sField` s et($sValue sAlter) NO T NULL def ault ''";
359           db _res( $sQu ery );   359           db _res( $sQu ery );
360       }   360       }
361          361       
362       compil ePreValues ();   362       compil ePreValues ();
363          363       
364       if( $i AmInPopup  ) {   364       if( $i AmInPopup  ) {
365           ?>   365           ?>
366           <s cript type ="text/jav ascript">w indow.clos e()</scrip t>   366           <s cript type ="text/jav ascript">w indow.clos e()</scrip t>
367           <?   367           <?
368       } else  {   368       } else  {
369           ?>   369           ?>
370           <d iv style=" text-align :center;co lor:green; ">   370           <d iv style=" text-align :center;co lor:green; ">
371                Saved.   371                Saved.
372                <a href= "<?= $_SER VER['PHP_S ELF'] ?>?l ist=<?= ur lencode( p rocess_pas s_data( $s List ) ) ? >">   372                <a href= "<?= $_SER VER['PHP_S ELF'] ?>?l ist=<?= ur lencode( p rocess_pas s_data( $s List ) ) ? >">
373                    Retu rn back   373                    Retu rn back
374                </a>   374                </a>
375           </ div>   375           </ div>
376           <?   376           <?
377       }   377       }
378   }   378   }
379     379  
380   function c ompilePreV alues() {   380   function c ompilePreV alues() {
381       global  $dir;    
382           
383       $sQuer y = "SELEC T DISTINCT  `Key` FRO M `PreValu es`";   381       $sQuer y = "SELEC T DISTINCT  `Key` FRO M `PreValu es`";
384       $rKeys  = db_res(  $sQuery ) ;   382       $rKeys  = db_res(  $sQuery ) ;
385          383       
386        $rProf   =   @fopen(   "{$dir['in c ' ]} prof.inc.p hp " ,   'w'   );   384        $rProf   =   @fopen(   BX_DIRECTO RY_PATH_IN C   .   '
prof.inc.p hp ' ,   'w'   );
387       if( !$ rProf ) {   385       if( !$ rProf ) {
388           ec ho '<b>War ning!</b>  Couldn\'t  compile pr of.inc.php . Please c heck permi ssions.';   386           ec ho '<b>War ning!</b>  Couldn\'t  compile pr of.inc.php . Please c heck permi ssions.';
389           re turn false ;   387           re turn false ;
390       }   388       }
391              389           
392          390       
393       fwrite ( $rProf,  "<?\n\$aPr eValues =  array(\n"  );   391       fwrite ( $rProf,  "<?\n\$aPr eValues =  array(\n"  );
394          392       
395       while(  $aKey = m ysql_fetch _assoc( $r Keys ) ) {   393       while(  $aKey = m ysql_fetch _assoc( $r Keys ) ) {
396           $s Key    = $ aKey['Key' ];   394           $s Key    = $ aKey['Key' ];
397           $s Key_db = a ddslashes(  $sKey );   395           $s Key_db = a ddslashes(  $sKey );
398              396           
399           fw rite( $rPr of, "  '$s Key_db' =>  array(\n"  );   397           fw rite( $rPr of, "  '$s Key_db' =>  array(\n"  );
400              398           
401           $s Query = "S ELECT * FR OM `PreVal ues` WHERE  `Key` = ' $sKey_db'  ORDER BY ` Order`";   399           $s Query = "S ELECT * FR OM `PreVal ues` WHERE  `Key` = ' $sKey_db'  ORDER BY ` Order`";
402           $r Rows  = db _res( $sQu ery );   400           $r Rows  = db _res( $sQu ery );
403              401           
404           wh ile( $aRow  = mysql_f etch_assoc ( $rRows )  ) {   402           wh ile( $aRow  = mysql_f etch_assoc ( $rRows )  ) {
405                $sValue_ db = addsl ashes( $aR ow['Value' ] );   403                $sValue_ db = addsl ashes( $aR ow['Value' ] );
406                fwrite(  $rProf, "     '{$sVal ue_db}' =>  array( "  );   404                fwrite(  $rProf, "     '{$sVal ue_db}' =>  array( "  );
407                   405                
408                foreach(  $aRow as  $sValKey = > $sValue  ) {   406                foreach(  $aRow as  $sValKey = > $sValue  ) {
409                    if(  $sValKey = = 'Key' or  $sValKey  == 'Value'  or $sValK ey == 'Ord er' )   407                    if(  $sValKey = = 'Key' or  $sValKey  == 'Value'  or $sValK ey == 'Ord er' )
410                         continue;  //skip key , value an d order. t hey alread y used   408                         continue;  //skip key , value an d order. t hey alread y used
411                       409                    
412                    if(  !strlen( $ sValue ) )   410                    if(  !strlen( $ sValue ) )
413                         continue;  //skip emp ty values   411                         continue;  //skip emp ty values
414                       412                    
415                    fwri te( $rProf , "'$sValK ey' => '"  . addslash es( $sValu e ) . "',  " );   413                    fwri te( $rProf , "'$sValK ey' => '"  . addslash es( $sValu e ) . "',  " );
416                }   414                }
417                   415                
418                fwrite(  $rProf, ") ,\n" );   416                fwrite(  $rProf, ") ,\n" );
419           }   417           }
420              418           
421           fw rite( $rPr of, "  ),\ n" );   419           fw rite( $rPr of, "  ),\ n" );
422       }   420       }
423          421       
424       fwrite ( $rProf,  ");\n" );   422       fwrite ( $rProf,  ");\n" );
425       fwrite ( $rProf,  '   423       fwrite ( $rProf,  '
426   $aPreValue s[\'Countr y\'] = sor tArrByLang ( $aPreVal ues[\'Coun try\'] );   424   $aPreValue s[\'Countr y\'] = sor tArrByLang ( $aPreVal ues[\'Coun try\'] );
427     425  
428   function s ortArrByLa ng( $aArr  ) {   426   function s ortArrByLa ng( $aArr  ) {
429       if( !f unction_ex ists( \'_t \' ) )   427       if( !f unction_ex ists( \'_t \' ) )
430           re turn $aArr ;   428           re turn $aArr ;
431          429       
432       $aSort Arr = arra y();   430       $aSort Arr = arra y();
433       foreac h( $aArr a s $sKey =>  $aValue )   431       foreac h( $aArr a s $sKey =>  $aValue )
434           $a SortArr[$s Key] = _t(  $aValue[\ 'LKey\'] ) ;   432           $a SortArr[$s Key] = _t(  $aValue[\ 'LKey\'] ) ;
435          433       
436       asort(  $aSortArr  );   434       asort(  $aSortArr  );
437          435       
438       $aNewA rr = array ();   436       $aNewA rr = array ();
439       foreac h( $aSortA rr as $sKe y => $sVal  )   437       foreac h( $aSortA rr as $sKe y => $sVal  )
440           $a NewArr[$sK ey] = $aAr r[$sKey];   438           $a NewArr[$sK ey] = $aAr r[$sKey];
441          439       
442       return  $aNewArr;   440       return  $aNewArr;
443   }   441   }
444       ' );   442       ' );
445     443  
446       fclose ( $rProf ) ;   444       fclose ( $rProf ) ;
447          445       
448       return  true;   446       return  true;
449   }   447   }