236. File Comparison Report

Produced on Mon May 12 13:05:22 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.

236.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\inc menu.inc.php Thu Jan 31 09:17:20 2008 UTC
2 Mon May 12 13:05:22 2008 UTC

236.2 Comparison summary

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

236.3 Comparison options

Whitespace
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

236.4 Active regular expressions

No regular expressions were active.

236.5 Comparison detail

1   <?    
2      
3   /********* ********** ********** ********** ********** ********** ********** ******    
4   *                              D olphin Sma rt Communi ty Builder    
5   *                                 --------- --------    
6   *     begi n                 : M on Mar 23  2006    
7   *     copy right             : ( C) 2006 Bo onEx Group    
8   *     webs ite               : h ttp://www. boonex.com /    
9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder    
10   *    
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/    
13   *    
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.    
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    
18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m    
19   ********** ********** ********** ********** ********** ********** ********** *****/    
20      
21   require_on ce( 'heade r.inc.php'  );    
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin.inc.p hp' );    
23   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd b.inc.php'  );    
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rof.inc.ph p' );    
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'b anners.inc .php' );    
26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm embership_ levels.inc .php' );    
27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p arams.inc. php' );    
28   require_on ce( BX_DIR ECTORY_PAT H_INC . 'l anguages.i nc.php');    
29   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp');    
30   require_on ce( BX_DIR ECTORY_PAT H_ROOT . " templates/ tmpl_{$tmp l}/scripts /functions .php" );    
31   require_on ce( BX_DIR ECTORY_PAT H_ROOT . " templates/ tmpl_{$tmp l}/scripts /BxTemplMe nu.php" );    
32      
33   if( !@eval ( file_get _contents(  BX_DIRECT ORY_PATH_I NC . 'menu _content.i nc.php' )  ) )    
34   {    
35       if( ba sename( di rname( $_S ERVER['PHP _SELF'] )  ) != $admi n_dir )    
36       {    
37           $a TopMenu =  array();    
38           $a Menu    =  array();    
39           ec ho '<b>War ning:</b>  Please reb uild the m enu from A dmin Panel  -> Builde rs -> Navi gation Men u Builder' ;    
40       }    
41   }    
42      
43   $aMenuInfo  = array() ;    
44      
45   function M emberMenuD esign ( $i UserId = 0  )    
46   {    
47       global  $site;    
48       global  $aMenu;    
49       global  $tmpl;    
50      
51      
52       global  $oTemplCo nfig;    
53       $oTemp lMenu = ne w BxTemplM enu( $oTem plConfig ) ;    
54      
55       $aMenu Icon = arr ay(    
56           '1 '=>'_membe r_panel.gi f',    
57           '2 '=>'_profi le_edit.gi f',    
58           '3 '=>'_profi le_customi ze.gif',    
59           '4 '=>'_commu nicator.gi f',    
60           '5 '=>'_chat. gif',    
61           '6 '=>'_forum .gif',    
62           '7 '=>'_membe rship.jpg' ,    
63           '8 '=>'_cart. gif',    
64           '9 '=>'_feedb ack.jpg',    
65           '1 0'=>'_gall ery.gif',    
66           '1 1'=>'_blog .gif',    
67           '1 2'=>'_gall ery.gif',    
68           '1 3'=>'_poll s.gif',    
69           '1 4'=>'_poll s.gif',    
70           '1 5'=>'_spee d_dating.g if',    
71           '1 6'=>'_logo ut.gif',    
72           '1 7'=>'_join .gif',    
73           '1 8'=>'_logi n.gif',    
74           '1 9'=>'_prof ile_photos .gif',    
75           '2 0'=>'_foru m.gif',    
76           '2 1'=>'_chat .gif',    
77           '2 2'=>'_grou ps.gif',    
78       );    
79      
80       $sMenu Link = "";    
81       $sPath  = "";    
82       $sVisi ble = $iUs erId == 0  ? "non": " memb";    
83      
84       $ret . = '<div cl ass="menu_ item_block ">';    
85       foreac h ($aMenu  as $iVal = > $aValue)    
86       {    
87           $s IconName =  $tmpl ==  'dol' ? $a MenuIcon[$ iVal] : '' ;    
88           if  ($aValue[ 'MenuGroup '] != 0) c ontinue;    
89           $s MenuLink =  $iUserId  != 0 ? add _id($aValu e['Link'],  $iUserId)  : $aValue ['Link'];    
90           if  ( strpos( $sMenuLink ,'http://' ) === FALS E )    
91           {    
92                $sPath =   "" ;    
93           }    
94           el se    
95           {    
96                $sPath =  $sMenuLin k;    
97                $sMenuLi nk = "";    
98           }    
99           $j Func = str len($aValu e['Onclick ']) > 0 ?  $aValue['O nclick'] :  "";    
100               
101           $m emberPass  = getPassw ord( $iUse rId );    
102           $j Func = str _replace(  '{*}',           $iVa l,         $jFunc);    
103           $j Func = str _replace(  '{URL}',         $sit e['url'],  $jFunc);    
104           $j Func = str _replace(  '{memberID }',   $iUs erId,      $jFunc);    
105           $j Func = str _replace(  '{memberPa ss}', $mem berPass,   $jFunc);    
106           if  (check_co ndition(st r_replace( '\$','$',$ aValue['Ch eck'])) ==  TRUE && s trrpos($aV alue['Visi ble'],$sVi sible) !==  FALSE)    
107           {    
108                $ret .=  $oTemplMen u -> getMe nuItem( _t ($aValue[' Caption']) , $sMenuLi nk, $sPath , $aValue[ 'Target'],  $jFunc, $ sIconName  );    
109                $ret .=  ('group' = = $aValue[ 'MenuType' ]) ? '<div  id="subme nu_' . $iV al . '" st yle="displ ay: none;"  class="me mber_subme nu"></div> ' : '';    
110           }    
111       }    
112       $ret . = "</div>" ;    
113       return  $ret;    
114   }    
115      
116      
117   function g etMenuInfo ()    
118   {    
119       global  $logged;    
120       global  $aMenuInf o;    
121       global  $p_arr;    
122       global  $aTopMenu ;    
123       global  $site;    
124           
125       if( $l ogged['mem ber'] )    
126       {    
127           $a MenuInfo[' memberID']    = (int) $_COOKIE[' memberID'] ;    
128           $a MenuInfo[' memberNick '] = getNi ckName( $a MenuInfo[' memberID']  );    
129           $a MenuInfo[' memberLink '] = getPr ofileLink(  $aMenuInf o['memberI D'] );    
130           $a MenuInfo[' visible']     = 'memb ';    
131       }    
132       else    
133       {    
134           $a MenuInfo[' memberID']  = 0;    
135           $a MenuInfo[' memberNick '] = '';    
136           $a MenuInfo[' memberLink '] = '';    
137           $a MenuInfo[' visible']   = 'non';    
138       }    
139           
140           
141       $selfF ile = base name( $_SE RVER['PHP_ SELF'] );    
142           
143       //get  viewed pro file ID    
144       if( $p _arr and $ p_arr['ID' ] )    
145       {    
146           $a MenuInfo[' profileID' ]   = (int )$p_arr['I D'];    
147           $a MenuInfo[' profileNic k'] = $p_a rr['NickNa me'];    
148           $a MenuInfo[' profileLin k'] = getP rofileLink ( $aMenuIn fo['profil eID'] );    
149       }    
150       elseif ( $selfFil e == 'brow seVideo.ph p' or $sel fFile == ' browsePhot o.php' or  $selfFile  == 'browse Music.php'  )    
151       {    
152           $a MenuInfo[' profileID' ]   = (int )$_GET['us erID'];    
153           $a MenuInfo[' profileNic k'] = getN ickName( $ aMenuInfo[ 'profileID '] );    
154           $a MenuInfo[' profileLin k'] = getP rofileLink ( $aMenuIn fo['profil eID'] );    
155       }    
156       elseif ( $selfFil e == 'gues tbook.php'  )    
157       {    
158           $a MenuInfo[' profileID' ]   = $_RE QUEST['own er'] ? (in t)$_REQUES T['owner']  : $aMenuI nfo['profi leID'];    
159           $a MenuInfo[' profileNic k'] = getN ickName( $ aMenuInfo[ 'profileID '] );    
160           $a MenuInfo[' profileLin k'] = getP rofileLink ( $aMenuIn fo['profil eID'] );    
161       }    
162       elseif ( $selfFil e == 'blog s.php' )    
163       {    
164           $a MenuInfo[' profileID' ]   = $_RE QUEST['own erID'] ? ( int)$_REQU EST['owner ID'] : $aM enuInfo['p rofileID'] ;    
165           $a MenuInfo[' profileNic k'] = getN ickName( $ aMenuInfo[ 'profileID '] );    
166           $a MenuInfo[' profileLin k'] = getP rofileLink ( $aMenuIn fo['profil eID'] );    
167       }    
168       elseif ( $selfFil e == 'view Friends.ph p' )    
169       {    
170           $a MenuInfo[' profileID' ]   = (int )$_GET['iU ser'];    
171           $a MenuInfo[' profileNic k'] = getN ickName( $ aMenuInfo[ 'profileID '] );    
172           $a MenuInfo[' profileLin k'] = getP rofileLink ( $aMenuIn fo['profil eID'] );    
173       }    
174       elseif ( $selfFil e == 'phot os_gallery .php' )    
175       {    
176           $a MenuInfo[' profileID' ]   = (int )$_GET['ID '];    
177           $a MenuInfo[' profileNic k'] = getN ickName( $ aMenuInfo[ 'profileID '] );    
178           $a MenuInfo[' profileLin k'] = getP rofileLink ( $aMenuIn fo['profil eID'] );    
179       }    
180       else    
181       {    
182           $a MenuInfo[' profileID' ]   = 0;    
183           $a MenuInfo[' profileNic k'] = '';    
184           $a MenuInfo[' profileLin k'] = '';    
185       }    
186           
187       // det ect curren t menu    
188       $aMenu Info['curr entCustom' ] = 0;    
189       $aMenu Info['curr entTop'] =  0;    
190           
191       $aSite Url = pars e_url( $si te['url']  );    
192       $sRequ estUriFile  = htmlspe cialchars_ adv( subst r( $_SERVE R['REQUEST _URI'], st rlen( $aSi teUrl['pat h'] ) ) );    
193           
194       foreac h( $aTopMe nu as $iIt emID => $a Item )    
195       {    
196           if ( $aItem[' Type'] ==  'top' and  $aMenuInfo ['currentT op'] and $ aMenuInfo[ 'currentTo p'] != $iI temID )    
197                break;    
198                    
199           $a ItemUris =  explode(  '|', $aIte m['Link']  );    
200           fo reach( $aI temUris as  $sItemUri  )    
201           {    
202                if( $aMe nuInfo['me mberID'] )    
203                {    
204                    $sIt emUri = st r_replace(  "{memberI D}",    $a MenuInfo[' memberID'] ,    $sIte mUri );    
205                    $sIt emUri = st r_replace(  "{memberN ick}",  $a MenuInfo[' memberNick '],  $sIte mUri );    
206                    $sIt emUri = st r_replace(  "{memberL ink}",  $a MenuInfo[' memberLink '],  $sIte mUri );    
207                }    
208                    
209                if( $aMe nuInfo['pr ofileID']  )    
210                {    
211                    $sIt emUri = st r_replace(  "{profile ID}",   $a MenuInfo[' profileID' ],   $sIte mUri );    
212                    $sIt emUri = st r_replace(  "{profile Nick}", $a MenuInfo[' profileNic k'], $sIte mUri );    
213                    $sIt emUri = st r_replace(  "{profile Link}", $a MenuInfo[' profileLin k'], $sIte mUri );    
214                }    
215                    
216                //echo $ sItemUri .  '<br />';    
217                    
218                if( $sIt emUri == $ sRequestUr iFile or    
219                    ( su bstr( $sRe questUriFi le, 0, str len( $sIte mUri ) ) = = $sItemUr i and !(in t)$aItem[' Strict'] )  )    
220                {    
221                    if(  $aItem['Ty pe'] == 'c ustom' )    
222                    {    
223                         $aMenuInfo ['currentC ustom'] =  $iItemID;    
224                         $aMenuInfo ['currentT op']    =  (int)$aIte m['Parent' ];    
225                         break;    
226                    }    
227                    else  //top or  system    
228                    {    
229                         if( $aMenu Info['curr entTop'] a nd $aMenuI nfo['curre ntTop'] !=  $iItemID  )    
230                         {    
231                             break;    
232                         }    
233                         else    
234                         {    
235                             $aMenu Info['curr entTop'] =  $iItemID;    
236                         }    
237                    }    
238                }    
239           }    
240               
241           if ( $aMenuIn fo['curren tCustom']  )    
242                break;    
243       }    
244      
245       //echo Dbg( $aMen uInfo );    
246   }    
247      
248      
249      
250   function T opMenuDesi gn( $iDivi de, $sDivi der )    
251   {    
252       global  $aTopMenu ;    
253       global  $aMenuInf o;    
254       global  $oTemplCo nfig;    
255           
256       if( !$ aMenuInfo  )    
257           ge tMenuInfo( );    
258           
259       $sScri ptCurrent  = ( $aTopM enu[ $aMen uInfo['cur rentTop']  ]['Link']  == 'index. php' ) ? 0  : $aMenuI nfo['curre ntTop'];    
260           
261       $oTemp lMenu = ne w BxTemplM enu( $oTem plConfig ) ;    
262       $ret =  '    
263           <s cript type ="text/jav ascript">    
264                currentT opItem = '  . $sScrip tCurrent .  ';    
265           </ script>    
266       ';    
267           
268       $iCoun t = 0;    
269           
270       foreac h( $aTopMe nu as $iIt emID => $a Item )    
271       {    
272           if ( $aItem[' Type'] !=  'top' )    
273                continue ;    
274               
275           if ( strpos(  $aItem['Vi sible'], $ aMenuInfo[ 'visible']  ) === fal se )    
276                continue ;    
277               
278           if ( strlen(  $aItem['Ch eck'] ) )    
279           {    
280                $sCheck  = $aItem[' Check'];    
281                $sCheck  = str_repl ace( '\$',  '$', $sCh eck );    
282                    
283                $func =  create_fun ction('',  $sCheck );    
284                if( !$fu nc() )    
285                    cont inue;    
286           }    
287               
288           // generate    
289           li st( $aItem ['Link'] )  = explode ( '|', $aI tem['Link' ] );    
290               
291           $a Item['Link '] = str_r eplace( "{ memberID}" ,    $aMen uInfo['mem berID'],     $aItem[' Link'] );    
292           $a Item['Link '] = str_r eplace( "{ memberNick }",  $aMen uInfo['mem berNick'],   $aItem[' Link'] );    
293               
294           $a Item['Link '] = str_r eplace( "{ profileID} ",   $aMen uInfo['pro fileID'],    $aItem[' Link'] );    
295           $a Item['Link '] = str_r eplace( "{ profileNic k}", $aMen uInfo['pro fileNick'] , $aItem[' Link'] );    
296               
297           $a Item['Oncl ick'] = st r_replace(  "{memberI D}",    $a MenuInfo[' memberID'] ,    $aIte m['Onclick '] );    
298           $a Item['Oncl ick'] = st r_replace(  "{memberN ick}",  $a MenuInfo[' memberNick '],  $aIte m['Onclick '] );    
299           $a Item['Oncl ick'] = st r_replace(  "{memberP ass}",  ge tPassword(  $aMenuInf o['memberI D'] ),  $a Item['Oncl ick'] );    
300               
301           $a Item['Oncl ick'] = st r_replace(  "{profile ID}",   $a MenuInfo[' profileID' ],   $aIte m['Onclick '] );    
302           $a Item['Oncl ick'] = st r_replace(  "{profile Nick}", $a MenuInfo[' profileNic k'], $aIte m['Onclick '] );    
303               
304           $r et .= $oTe mplMenu ->  getTopMen uItem( _t(  $aItem['C aption'] ) , $aItem[' Link'], $a Item['Targ et'], $aIt em['Onclic k'], ( $iI temID == $ aMenuInfo[ 'currentTo p'] ), $iI temID );    
305               
306           if ( $iDivide  > 0 and (  ++$iCount  % $iDivid e ) == 0 )    
307           {    
308                $ret .=  $sDivider;    
309                $iCount  = 0;    
310           }    
311       }    
312           
313       return  $ret;    
314   }    
315      
316   function C ustomMenuD esign( $pa rent = 0 )    
317   {    
318       global  $aTopMenu ;    
319       global  $aMenuInf o;    
320       global  $oTemplCo nfig;    
321           
322       if( !$ aMenuInfo  )    
323           ge tMenuInfo( );    
324           
325       if( !$ parent )    
326           $p arent = $a MenuInfo[' currentTop '];    
327           
328       $oTemp lMenu = ne w BxTemplM enu( $oTem plConfig ) ;    
329       $ret =  '';    
330           
331       foreac h( $aTopMe nu as $iIt emID => $a Item )    
332       {    
333           if ( $aItem[' Type'] !=  'custom' )    
334                continue ;    
335               
336           if ( $aItem[' Parent'] ! = $parent  )    
337                continue ;    
338               
339           if ( strpos(  $aItem['Vi sible'], $ aMenuInfo[ 'visible']  ) === fal se )    
340                continue ;    
341               
342           if ( strlen(  $aItem['Ch eck'] ) )    
343           {    
344                $sCheck  = $aItem[' Check'];    
345                $sCheck  = str_repl ace( '\$',  '$', $sCh eck );    
346                    
347                $func =  create_fun ction('',  $sCheck );    
348                    
349                if( !$fu nc() )    
350                    cont inue;    
351           }    
352               
353           // generate    
354           li st( $aItem ['Link'] )  = explode ( '|', $aI tem['Link' ] );    
355               
356           $a Item['Link '] = str_r eplace( "{ memberID}" ,    $aMen uInfo['mem berID'],     $aItem[' Link'] );    
357           $a Item['Link '] = str_r eplace( "{ memberNick }",  $aMen uInfo['mem berNick'],   $aItem[' Link'] );    
358           $a Item['Link '] = str_r eplace( "{ memberLink }",  $aMen uInfo['mem berLink'],   $aItem[' Link'] );    
359               
360           $a Item['Link '] = str_r eplace( "{ profileID} ",   $aMen uInfo['pro fileID'],    $aItem[' Link'] );    
361           $a Item['Link '] = str_r eplace( "{ profileNic k}", $aMen uInfo['pro fileNick'] , $aItem[' Link'] );    
362           $a Item['Link '] = str_r eplace( "{ profileLin k}", $aMen uInfo['pro fileLink'] , $aItem[' Link'] );    
363               
364           $a Item['Oncl ick'] = st r_replace(  "{memberI D}",    $a MenuInfo[' memberID'] ,    $aIte m['Onclick '] );    
365           $a Item['Oncl ick'] = st r_replace(  "{memberN ick}",  $a MenuInfo[' memberNick '],  $aIte m['Onclick '] );    
366           $a Item['Oncl ick'] = st r_replace(  "{memberP ass}",  ge tPassword(  $aMenuInf o['memberI D'] ),  $a Item['Oncl ick'] );    
367               
368           $a Item['Oncl ick'] = st r_replace(  "{profile ID}",   $a MenuInfo[' profileID' ],   $aIte m['Onclick '] );    
369           $a Item['Oncl ick'] = st r_replace(  "{profile Nick}", $a MenuInfo[' profileNic k'], $aIte m['Onclick '] );    
370               
371           $r et .= $oTe mplMenu ->  getCustom MenuItem(  _t( $aItem ['Caption' ] ), $aIte m['Link'],  $aItem['T arget'], $ aItem['Onc lick'], (  $iItemID = = $aMenuIn fo['curren tCustom']  ) );    
372       }    
373           
374       return  $ret;    
375   }    
376      
377   function g etAllMenus ()    
378   {    
379       global  $aTopMenu ;    
380       global  $aMenuInf o;    
381       global  $oTemplCo nfig;    
382       global  $site;    
383           
384       if( !$ aMenuInfo  )    
385           ge tMenuInfo( );    
386           
387       $aSite Url = pars e_url( $si te['url']  );    
388       $sSelf File = htm lspecialch ars_adv( s ubstr( $_S ERVER['PHP _SELF'], s trlen( $aS iteUrl['pa th'] ) ) ) ;    
389           
390       $oTemp lMenu = ne w BxTemplM enu( $oTem plConfig ) ;    
391       $ret =  '';    
392           
393       $aTTop Menu = $aT opMenu;    
394           
395       foreac h( $aTTopM enu as $iT ItemID =>  $aTItem )    
396       {    
397           if ( $aTItem[ 'Type'] !=  'top' &&  $aTItem['T ype'] !='s ystem')    
398                continue ;    
399               
400           if ( strpos(  $aTItem['V isible'],  $aMenuInfo ['visible' ] ) === fa lse )    
401                continue ;    
402               
403           if ( strlen(  $aTItem['C heck'] ) )    
404           {    
405                $sCheck  = $aTItem[ 'Check'];    
406                $sCheck  = str_repl ace( '\$',  '$', $sCh eck );    
407                    
408                $func =  create_fun ction('',  $sCheck );    
409                if( !$fu nc() )    
410                    cont inue;    
411           }    
412               
413           if ( $aMenuIn fo['curren tTop'] ==  $iTItemID  && $sSelfF ile != 'in dex.php' )    
414                $display  = 'block' ;    
415           el se    
416                $display  = 'none';    
417               
418           $s Caption =  _t( $aTIte m['Caption '] );    
419               
420           $s Caption =  str_replac e( "{membe rNick}",   $aMenuInfo ['memberNi ck'],  $sC aption );    
421           $s Caption =  str_replac e( "{profi leNick}",  $aMenuInfo ['profileN ick'], $sC aption );    
422               
423               
424           // generate    
425           $r et .= '    
426                <div cla ss="hidden Menu" styl e="display :' . $disp lay . ';"  id="hidden Menu_' . $ iTItemID .  '"    
427                  onmous eover="hol dHiddenMen u = ' . $i TItemID .  ';"    
428                  onmous eout="hold HiddenMenu  = current TopItem; h ideHiddenM enu( ' . $ iTItemID .  ' )">    
429                    <div  class="hi ddenMenuBg Cont">    
430                         <div class ="hiddenMe nuCont">    
431                             <div c lass="topP ageHeader" >' . $sCap tion . '</ div>' .    
432                             $oTemp lMenu -> g etCustomMe nu( $iTIte mID ) . '    
433                         </div>    
434                    </di v>    
435                    <div  class="cl ear_both"> </div>    
436                </div>';    
437       }    
438           
439           
440       return  $ret;    
441   }    
442      
443      
444   //-----Rep lacement { ID} on cur rent id in  menu-link  (array of  menu item s, users i d)    
445   function a dd_id ( $s MenuLink =  "", $iId  = 0 )    
446   {    
447       if ( s trpos($sMe nuLink, "{ ID}") !==  FALSE && s trpos($sMe nuLink, "= ") !== FAL SE)    
448       {    
449           $s MenuLink =  str_repla ce("{ID}",  $iId, $sM enuLink);    
450       }    
451       return  $sMenuLin k;    
452   }    
453      
454      
455      
456   //-----Che ck conditi on of menu  item (fun ction from  `Check` f ield of `M emberMenu` )    
457   function c heck_condi tion ( $sC on = "" )    
458   {    
459       if ( s trlen($sCo n) > 0 )    
460       {    
461           $f unc = crea te_functio n('', $sCo n);    
462           re turn $func ();    
463       }    
464       else    
465       {    
466           re turn TRUE;    
467       }    
468   }    
469      
470      
471   function c ompileMenu s()    
472   {    
473       global  $dir;    
474           
475       $fMenu  = @fopen( $dir['inc' ]. "/menu_ content.in c.php", "w ");    
476       if( !$ fMenu )    
477           re turn false ;    
478           
479       //writ e member m enu    
480       fwrite ( $fMenu,  "\$aMenu =  array(\n"  );    
481       $aFiel ds = array ('Name','C aption','L ink','Menu Order','Me nuType','M enuGroup', 'Visible', 'Target',' Onclick',' Check');    
482               
483       $sQuer y = "    
484           SE LECT    
485                `ID`,    
486                `" . imp lode('`,    
487                `', $aFi elds ) . " `    
488           FR OM `Member Menu`    
489           OR DER BY `Me nuOrder`    
490           ";    
491           
492       $rMenu  = db_res(  $sQuery ) ;    
493       while(  $aMenuIte m = mysql_ fetch_asso c( $rMenu  ) )    
494       {    
495           fw rite( $fMe nu, "\t" .  str_pad(  $aMenuItem ['ID'], 2  ) . " => a rray(\n" ) ;    
496           fo reach( $aF ields as $ sKey => $s Field )    
497           {    
498                $sCont =  $aMenuIte m[$sField] ;    
499                    
500                if( $sFi eld == 'Li nk' )    
501                    $sCo nt = htmls pecialchar s_adv( $sC ont );    
502                    
503                $sCont =  str_repla ce( '\\',  '\\\\', $s Cont );    
504                $sCont =  str_repla ce( '"', ' \\"', $sCo nt );    
505                $sCont =  str_repla ce( '$', ' \\$', $sCo nt );    
506                    
507                fwrite(  $fMenu, "\ t\t" . str _pad( "'$s Field'", 1 1 ) . " =>  \"$sCont\ "" );    
508                    
509                if( $sKe y < ( coun t( $aField s ) - 1 )  )    
510                    fwri te( $fMenu , "," );    
511                    
512                fwrite(  $fMenu, "\ n" );    
513           }    
514           fw rite( $fMe nu, "\t),\ n" );    
515       }    
516       fwrite ( $fMenu,  ");\n\n" ) ;    
517           
518       fwrite CompileTop Menu($fMen u);    
519           
520       fwrite ( $fMenu,  "return tr ue;\n" );    
521       fclose ( $fMenu ) ;    
522   }    
523      
524   function f writeCompi leTopMenu( $fMenu)    
525   {    
526       fwrite ( $fMenu,  "\$aTopMen u = array( \n" );    
527       $aFiel ds = array ('Type','C aption','L ink','Visi ble','Targ et','Oncli ck','Check ','Strict' ,'Parent') ;    
528               
529       $sQuer y = "    
530           SE LECT    
531                `ID`,    
532                `" . imp lode('`,    
533                `', $aFi elds ) . " `    
534           FR OM `TopMen u`    
535           WH ERE `Activ e` = 1 AND  ( `Type`  = 'system'  OR `Type`  = 'top' )    
536           OR DER BY `Ty pe`,`Order `    
537           ";    
538           
539       $rMenu  = db_res(  $sQuery ) ;    
540       while(  $aMenuIte m = mysql_ fetch_asso c( $rMenu  ) )    
541       {    
542           fw rite( $fMe nu, "\t" .  str_pad(  $aMenuItem ['ID'], 2  ) . " => a rray(\n" ) ;    
543           fo reach( $aF ields as $ sKey => $s Field )    
544           {    
545                $sCont =  $aMenuIte m[$sField] ;    
546                    
547                if( $sFi eld == 'Li nk' )    
548                    $sCo nt = htmls pecialchar s_adv( $sC ont );    
549                    
550                $sCont =  str_repla ce( '\\',  '\\\\', $s Cont );    
551                $sCont =  str_repla ce( '"', ' \\"', $sCo nt );    
552                $sCont =  str_repla ce( '$', ' \\$', $sCo nt );    
553                    
554                fwrite(  $fMenu, "\ t\t" . str _pad( "'$s Field'", 1 1 ) . " =>  \"$sCont\ "" );    
555                    
556                if( $sKe y < ( coun t( $aField s ) - 1 )  )    
557                    fwri te( $fMenu , "," );    
558                    
559                fwrite(  $fMenu, "\ n" );    
560           }    
561           fw rite( $fMe nu, "\t),\ n" );    
562               
563               
564           //  write it' s children    
565           $s Query = "    
566                SELECT    
567                    `ID` ,    
568                    `" .  implode(' `,    
569                    `',  $aFields )  . "`    
570                FROM `To pMenu`    
571                WHERE `A ctive` = 1  AND `Type ` = 'custo m' AND `Pa rent` = {$ aMenuItem[ 'ID']}    
572                ORDER BY  `Order`    
573                ";    
574               
575           $r CMenu = db _res( $sQu ery );    
576           wh ile( $aMen uItem = my sql_fetch_ assoc( $rC Menu ) )    
577           {    
578                fwrite(  $fMenu, "\ t" . str_p ad( $aMenu Item['ID'] , 2 ) . "  => array(\ n" );    
579                foreach(  $aFields  as $sKey = > $sField  )    
580                {    
581                    $sCo nt = $aMen uItem[$sFi eld];    
582                        
583                    if(  $sField ==  'Link' )    
584                         $sCont = h tmlspecial chars_adv(  $sCont );    
585                        
586                    $sCo nt = str_r eplace( '\ \', '\\\\' , $sCont ) ;    
587                    $sCo nt = str_r eplace( '" ', '\\"',  $sCont );    
588                    $sCo nt = str_r eplace( '$ ', '\\$',  $sCont );    
589                        
590                    fwri te( $fMenu , "\t\t" .  str_pad(  "'$sField' ", 11 ) .  " => \"$sC ont\"" );    
591                        
592                    if(  $sKey < (  count( $aF ields ) -  1 ) )    
593                         fwrite( $f Menu, ","  );    
594                        
595                    fwri te( $fMenu , "\n" );    
596                }    
597                fwrite(  $fMenu, "\ t),\n" );    
598           }    
599               
600               
601       }    
602       fwrite ( $fMenu,  ");\n\n" ) ;    
603   }    
604      
605      
606   function g etTopPageH ead()    
607   {    
608       global  $aMenuInf o;    
609       global  $aTopMenu ;    
610           
611       if( !$ aMenuInfo  )    
612           ge tMenuInfo( );    
613           
614       if( $a TopMenu[ $ aMenuInfo[ 'currentTo p'] ]['Cap tion'] ==  '{profileN ick}' )    
615           re turn $aMen uInfo['pro fileNick'] ;    
616       elseif ( $aTopMen u[ $aMenuI nfo['curre ntTop'] ][ 'Caption']  == '{memb erNick}' )    
617           re turn $aMen uInfo['mem berNick'];    
618       else    
619           re turn _t( $ aTopMenu[  $aMenuInfo ['currentT op'] ]['Ca ption'] );    
620   }    
621           
622      
623   ?>