50. File Comparison Report

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

50.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\admin memb_menu.php Thu Sep 20 08:58:42 2007 UTC
2 Mon May 12 13:04:35 2008 UTC

50.2 Comparison summary

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

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

50.4 Active regular expressions

No regular expressions were active.

50.5 Comparison detail

1   <?php    
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   /*    
22    * Page fo r displayi ng and edi ting profi le fields.    
23    */    
24      
25   require_on ce( '../in c/header.i nc.php' );    
26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'd esign.inc. php' );    
27   require_on ce( BX_DIR ECTORY_PAT H_INC . 'p rofiles.in c.php' );    
28   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.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_INC . 'l anguages.i nc.php' );    
31   require_on ce( BX_DIR ECTORY_PAT H_INC . 'm enu.inc.ph p' );    
32      
33   // Check i f administ rator is l ogged in.   If not di splay logi n form.    
34   $logged['a dmin'] = m ember_auth ( 1 );    
35      
36   $_page['he ader'] = ' Member Men u';    
37   $_page['cs s_name'] =  'memb_men u.css';    
38      
39   // Check G ET variabl es.    
40   if ( isset ($_GET['ID ']) && ( ' move_up' = = $_GET['a ction'] )  )    
41   {    
42       move_u p($_GET['I D']);    
43       compil eMenus();    
44       header ('location :' . $_SER VER['PHP_S ELF']);    
45   }    
46      
47   if ( isset ($_GET['ID ']) && ( ' move_down'  == $_GET[ 'action']  ) )    
48   {    
49       move_d own($_GET[ 'ID']);    
50       compil eMenus();    
51       header ('location :' . $_SER VER['PHP_S ELF']);    
52   }    
53      
54   if ( $_GET ['ID'] &&  ( 'delete'  == $_GET[ 'action']  ) )    
55   {    
56       // Pro cess delet ing    
57       delete _item($_GE T['ID'], $ res);    
58       compil eMenus();    
59       header ('location :' . $_SER VER['PHP_S ELF']);    
60   }    
61      
62   if (isset( $_POST['Ad d']))    
63   {    
64       add_or _edit_item ();    
65       compil eMenus();    
66   }    
67      
68   if ('reset ' == $_GET ['action'] )    
69   {    
70       reset_ menu();    
71       compil eMenus();    
72       header ('location :' . $_SER VER['PHP_S ELF']);    
73   }    
74      
75   TopCodeAdm in();    
76   ContentBlo ckHead("Me mber Menu" );    
77      
78       // Get  a list of  all field s.    
79       $query _str = "SE LECT * FRO M `MemberM enu` ORDER  BY `MenuO rder` ASC" ;    
80       $res =  db_res($q uery_str);    
81      
82       if ( $ _GET['acti on'] == 'u pload' )    
83       {    
84           di splay_form ( (int)$_G ET['ID'] ) ;    
85       }    
86       else    
87       {    
88           ec ho "<p cla ss=text><a  href=\"{$ _SERVER['P HP_SELF']} ?action=up load\">Add  new item< /a></p>\n" ;    
89           ec ho "<p cla ss=text><a  href=\"{$ _SERVER['P HP_SELF']} ?action=re set\">Rese t items</a ></p>\n";    
90           di splay_menu ($res);    
91       }    
92      
93      
94   ContentBlo ckFoot();    
95      
96   BottomCode ();    
97      
98      
99   //display  all curren t menu ite ms    
100   function d isplay_men u ($res)    
101   {    
102       ?>    
103       <table  width="59 0" border= "1" class= "profile_f ields">    
104                <tr clas s="section ">    
105                    <th> Name</th>    
106                    <th> Link</th>    
107                    <th> Group</th>    
108                    <th  colspan="2 ">Visible< /th>    
109                    <th  colspan="2 ">Order</t h>    
110                    <th> Del</th>    
111                    <th> Edit</th>    
112                </tr>    
113                <tr clas s="section ">    
114                    <th> &nbsp;</th >    
115                    <th> &nbsp;</th >    
116                    <th> &nbsp;</th >    
117                    <th  aligh>visi tor</th>    
118                    <th> member</th >    
119                    <th> &nbsp;</th >    
120                    <th> &nbsp;</th >    
121                    <th> &nbsp;</th >    
122                    <th> &nbsp;</th >    
123                </tr>    
124       <?    
125           
126       $nums  = 0;    
127       $total _rows = my sql_num_ro ws($res);    
128       while( $arr = mys ql_fetch_a rray($res) )    
129       {    
130           $m ove_up   =  "";    
131           $m ove_down =  "";    
132           $d elete    =  "";    
133           if  ($nums !=  0)    
134                $move_up  = "<a hre f=\"{$_SER VER['PHP_S ELF']}?ID= {$arr['ID' ]}&action= move_up\"> <img src=\ "images/ar row_up.gif \" alt=\"M ove up\" b order=\"0\ "/></a>";    
135           el se    
136                $move_up  = '&nbsp; ';    
137               
138           if  ($nums !=  $total_ro ws - 1)    
139                $move_do wn = "<a h ref=\"{$_S ERVER['PHP _SELF']}?I D={$arr['I D']}&actio n=move_dow n\"><img s rc=\"image s/arrow_do wn.gif\" a lt=\"Move  down\" bor der=\"0\"/ ></a>";    
140           el se    
141                $move_do wn = '&nbs p;';    
142               
143           if  ($arr['Ed itable'] = = '1')    
144                $delete  = "<a href =\"{$_SERV ER['PHP_SE LF']}?ID={ $arr['ID'] }&action=d elete\"><i mg src=\"i mages/dele te.gif\" a lt=\"Delet e\" border =\"0\" tit le=\"Delet e\" /></a> ";    
145           el se    
146                $delete  = '&nbsp;' ;    
147               
148           $e dit =   "< a href=\"{ $_SERVER[' PHP_SELF'] }?ID={$arr ['ID']}&ac tion=uploa d\"><img s rc=\"image s/edit.gif \" alt=\"E dit\" bord er=\"0\" t itle=\"Edi t\" /></a> ";    
149               
150           $v is_vis = ( strpos($ar r['Visible '],"non")! ==FALSE) ?  "yes" : " &nbsp;";    
151           $v is_mem = ( strpos($ar r['Visible '],"mem")! ==FALSE) ?  "yes" : " &nbsp;";    
152           $g roup   = ( $arr['Menu Group'] >  0) ? get_g roup_name( $arr['Menu Group']) :  "&nbsp;";    
153               
154           $t r_class =  ($nums ==  0 || $nums %2 == 0) ?  "odd_row"  : "even_r ow";    
155               
156           $s hort_link  = substr(  $arr['Link '], 0, 35  );    
157           if ( strlen($ short_link ) < strlen ($arr['Lin k']) )    
158                $short_l ink .= '.. .';    
159               
160           ec ho "<tr cl ass=\"$tr_ class\">";    
161           ec ho "<td>". _t($arr['C aption']). "</td>";    
162           ec ho "<td ti tle=\"{$ar r['Link']} \">{$short _link}</td >";    
163           ec ho "<td>$g roup</td>" ;    
164           ec ho "<td al ign=\"cent er\">$vis_ vis</td>";    
165           ec ho "<td al ign=\"cent er\">$vis_ mem</td>";    
166           ec ho "<td>$m ove_up</td >";    
167           ec ho "<td>$m ove_down</ td>";    
168           ec ho "<td>$d elete</td> ";    
169           ec ho "<td>$e dit</td>";    
170           ec ho "</tr>" ;    
171           $n ums++;    
172       }    
173       echo " </table>";    
174   }    
175      
176   //moving u p item ($i d - id of  field)    
177   function m ove_up ($i d)    
178   {    
179       $curr_ up = 0;    
180       $curr_ down_id =  0;    
181      
182       $arr =  db_arr("S ELECT * FR OM `Member Menu` WHER E `ID` = $ id");    
183       $curr_ up = $arr[ 'MenuOrder '];    
184       $curr_ down = $cu rr_up - 1;    
185      
186       $arr =  db_arr("S ELECT * FR OM `Member Menu` WHER E `MenuOrd er` = $cur r_down");    
187       $curr_ down_id =  $arr['ID'] ;    
188      
189       db_res ( "UPDATE  `MemberMen u` set `Me nuOrder` =  $curr_up  WHERE `ID`  = $curr_d own_id" );    
190       db_res ( "UPDATE  `MemberMen u` set `Me nuOrder` =  $curr_dow n WHERE `I D` = $id"  );    
191      
192   }    
193      
194   //moving i tem down ( $id - id o f field)    
195   function m ove_down ( $id)    
196   {    
197       $curr_ up = 0;    
198       $curr_ up_id = 0;    
199      
200       $arr =  db_arr("S ELECT * FR OM `Member Menu` WHER E `ID` = $ id");    
201       $curr_ down = $ar r['MenuOrd er'];    
202       $curr_ up = $curr _down + 1;    
203      
204       $arr =  db_arr("S ELECT * FR OM `Member Menu` WHER E `MenuOrd er` = $cur r_up");    
205       $curr_ up_id = $a rr['ID'];    
206       db_res ("UPDATE ` MemberMenu ` set `Men uOrder` =  $curr_down  WHERE `ID ` = $curr_ up_id");    
207       db_res ("UPDATE ` MemberMenu ` set `Men uOrder` =  $curr_up W HERE `ID`  = $id");    
208   }    
209      
210   //delete i tem ($id -  id of fie ld)    
211   function d elete_item  ($id)    
212   {    
213       $curr_ del = 0;    
214       $arr =  db_arr("S ELECT * FR OM `Member Menu` WHER E `ID` = $ id");    
215       $curr_ del = $arr ['MenuOrde r'];    
216       if ($a rr['MenuTy pe'] == 'g roup')    
217       {    
218           db _res("UPDA TE `Member Menu` set  `MenuGroup ` = 0 WHER E `MenuGro up` = {$ar r['ID']}") ;    
219       }    
220       db_res ("DELETE F ROM `Membe rMenu` WHE RE `ID` =  $id");    
221       db_res ("UPDATE ` MemberMenu ` set `Men uOrder` =  `MenuOrder ` - 1 WHER E `MenuOrd er` > $cur r_del");    
222   }    
223      
224   //insertin g or upldo aing item    
225   function a dd_or_edit _item ()    
226   {    
227       $m_nam e = "";    
228       $m_lin k = "";    
229       $m_ord er = 0;    
230       $m_gro up = "";    
231       $visib le = "";    
232       $m_nam e  = isset ($_POST['N ame']) ? p rocess_db_ input($_PO ST['Name'] ) : proces s_db_input ($_POST['N ameH']);    
233       $m_lin k  = isset ($_POST['L ink']) ? a ddslashes( htmlspecia lchars(pro cess_pass_ data($_POS T['Link']) )) : proce ss_db_inpu t($_POST[' LinkH']);    
234       $m_cap t  = isset ($_POST['C aption'])  ? process_ db_input($ _POST['Cap tion']) :  "" ;    
235       $m_gro up = isset ($_POST['M enuGroup'] ) ? (int)p rocess_db_ input($_PO ST['MenuGr oup']) : 0  ;    
236       $m_ord er = (int) process_db _input($_P OST['MenuO rder']);    
237       $m_typ e  = proce ss_db_inpu t($_POST[' MenuType'] );    
238       $m_tar g  = isset ($_POST['T arget']) & & $m_type  != 'group'  ? '_blank ' : '';    
239       $vis_v is = proce ss_db_inpu t($_POST[' VisibleVis itor']);    
240       $vis_m em = proce ss_db_inpu t($_POST[' VisibleMem ber']);    
241       $vis_v is.= strle n($vis_mem )>0 && str len($vis_v is)>0 ? ", " : "";    
242       $visib le = $vis_ vis.$vis_m em;    
243       $item_ id = proce ss_db_inpu t($_POST[' ItemID']);    
244       $i_ed     = proce ss_db_inpu t($_POST[' Editable'] );    
245      
246       $m_onc l  = $m_ty pe == 'gro up' ? "dis play_node( \'submenu_ {*}\',{URL }); return  false;" :  process_d b_input( $ _POST['Onc lick'] );    
247      
248       $query _tmp = "`M emberMenu`  SET `Name `='$m_name ',`Link`=' $m_link',` Caption`=' $m_capt',` MenuGroup` =$m_group, `MenuType` ='$m_type' ,`Visible` ='$visible ',`Editabl e`='$i_ed' ,`Target`= '$m_targ', `Onclick`= '$m_oncl'" ;    
249      
250       if($it em_id == 0 )    
251       {    
252           db _res("UPDA TE `Member Menu` SET  `MenuOrder ` = `MenuO rder` + 1  WHERE `Men uOrder` >=  $m_order  + 1 ");    
253           $q uery = "IN SERT INTO" .$query_tm p.",`MenuO rder`=$m_o rder+1 ";    
254       }    
255       else    
256       {    
257           $q uery = "UP DATE ".$qu ery_tmp."  WHERE `ID`  = $item_i d";    
258       }    
259      
260       $res =  db_res( $ query );    
261      
262       return  $res;    
263   }    
264      
265   //display  manage for m ($id - i d of editi ng menu, $ id == 0 fo r new item    
266   function d isplay_for m ($id = 0 )    
267   {    
268       $type_ event   =  "onClick=\ "javascrip t: documen t.getEleme ntById('me nu_link'). disabled=" ;    
269       $group _en_sw  =  "document. getElement ById('menu _group').d isabled=";    
270       $group _beg    =  "<select n ame=\"Menu Group\" id =\"menu_gr oup\"";    
271       $group _end    =  "</select> ";    
272      
273       if ($i d != 0)    
274       {    
275           $r es   = db_ arr("SELEC T * FROM ` MemberMenu ` WHERE `I D` = $id") ;    
276           $n ame  = $re s['Name'];    
277           $c apt  = $re s['Caption '];    
278           $l ink  = $re s['Link'];    
279           $g roup = $re s['MenuGro up'];    
280           $v is_v = str pos($res[' Visible'], "non")  != = FALSE ?  "checked"  : "";    
281           $v is_m = str pos($res[' Visible'], "memb") != = FALSE ?  "checked"  : "";    
282           $t ype  = $re s['MenuTyp e'];    
283               
284           $O nclick = h tmlspecial chars_adv(  $res['Onc lick'] );    
285      
286   //hidden p arams of i tem's edit ing    
287           $e d    = $re s['Editabl e'];    
288   //disablin g name and  link for  sript's me nu items    
289           $s et   = $ed  == '0' ?  "disabled"  : "";    
290      
291   //type_gro up/type_li nk - check  for enabl ing group/ link in lo ad process  of curent  item    
292           $t ype_group        = $r es['MenuTy pe'] == 'g roup' ? $t ype_group  = "checked =\"checked \"" : "";    
293           $t ype_link         = $r es['MenuTy pe'] == 'l ink'  ? $t ype_link =  "checked= \"checked\ "" : "";    
294      
295   //enable/d isable of  group and  link for s cript menu  items    
296           $t ype_event_ group = $r es['Editab le'] == '1 ' ? $type_ event."tru e;".$group _en_sw."tr ue;\"" : " ";    
297           $t ype_event_ link  = $r es['Editab le'] == '1 ' ? $type_ event."fal se;".$grou p_en_sw."f alse;\"" :  "";    
298      
299   //enabling  of group  choice    
300           $g roup_en =  $res['Menu Type']=='g roup' ? "d isabled=\" disabled\" >" : ">";    
301   //group bo dy    
302           $g roup_body  = $group_b eg." ".$gr oup_en.get _menu_grou p($res['Me nuGroup']) .$group_en d;    
303               
304           $s TargetChec ked = ( $r es['Target '] == '_bl ank' ) ? '  checked=" checked"'  : '' ;    
305       }    
306       else    
307       {    
308           $n ame   = "" ;    
309           $l ink   = "" ;    
310           $g roup  = "" ;    
311           $v is_v  = "" ;    
312           $v is_m  = "" ;    
313           $s et    = "" ;    
314           $e d     = 1;    
315           $O nclick = " ";    
316      
317           $t ype_group        = "" ;    
318           $t ype_link         = "" ;    
319           $t ype_event_ group =  $ type_event ."true;".$ group_en_s w."true;\" ";    
320           $t ype_event_ link  =  $ type_event ."false;". $group_en_ sw."false; \"";    
321           $g roup_body  = $group_b eg." ".$gr oup_en.get _menu_grou p().$group _end;    
322           $s TargetChec ked = '';    
323       }    
324      
325       echo " <form name =\"add_fie ld\" actio n=\"{$_SER VER['PHP_S ELF']}\" m ethod=\"po st\">\n";    
326       echo " <table sty le=\"font- size: 11px \" width=\ "100%\" ce llspacing= \"10px\">\ n";    
327       echo " <tr>";    
328       echo " <td>Name</ td><td><in put type=\ "text\" na me=\"Name\ " $set val ue=\"$name \" />    
329                <input t ype=\"hidd en\" name= \"NameH\"  value = \" $name\" /> </td></tr>    
330                <input t ype=\"hidd en\" name= \"Onclick\ " value =  \"$Onclick \" /></td> </tr>";    
331       echo " <tr><td>Ty pe</td><td >    
332                <input t ype=\"radi o\" name=\ "MenuType\ " $type_gr oup value= \"group\"  $type_even t_group /> Group    
333                <input t ype=\"radi o\" name=\ "MenuType\ " $type_li nk value=\ "link\" $t ype_event_ link />Lin k    
334              </td></tr> ";    
335       echo " <tr><td>Li nk</td><td ><input ty pe=\"text\ " id=\"men u_link\" n ame=\"Link \" $set va lue=\"$lin k\" />    
336              Use http:/ / prefix i f you want  use URL o ut of your  site    
337              <input typ e=\"hidden \" name=\" LinkH\" va lue = \"$l ink\"/></t d></tr>";    
338       echo " <tr><td>Ca ption</td> <td><input  type=\"te xt\" name= \"Caption\ " value=\" $capt\" />    
339              Don't forg et add Lan guage Key  to your La nguage Fil e ! </td>< /tr>";    
340       echo " <tr><td>Gr oup</td>    
341              <td>$group _body</td> </tr>";    
342      
343       if ($i d == 0)    
344       {    
345           ec ho "<tr><t d>After it em</td><td >".get_men u_list()." </td></tr> ";    
346       }    
347       echo " <tr><td>Vi sible</td> <td>    
348                <input t ype=\"chec kbox\" nam e=\"Visibl eVisitor\"  value=\"n on\" $vis_ v/>Visitor s    
349                <input t ype=\"chec kbox\" nam e=\"Visibl eMember\"  value=\"me mb\" $vis_ m/>Members    
350            < /td></tr>" ;    
351       echo " <tr><td wi dth=\"70\" >Open in n ew window< /td><td st yle=\"padd ing-left:3 5px\">    
352                <input t ype=\"chec kbox\" nam e=\"Target \" $sTarge tChecked / >    
353            < /td></tr>" ;    
354       echo " <input typ e=\"hidden \" name=\" ItemID\" v alue=\"{$i d}\" />";    
355       echo " <input typ e=\"hidden \" name=\" Editable\"  value=\"{ $ed}\" />" ;    
356       echo " <tr><td co lspan=\"2\ " align=\" center\">< input type =\"submit\ " name=\"A dd\" value =\"Add\"/> </td></tr> ";    
357      
358       echo " </form><tr ><td colsp an=\"2\">" ;    
359       echo " <a href=\" {$_SERVER[ 'PHP_SELF' ]}\">Back< /a></td></ tr></table >";    
360   }    
361      
362   //get grou p name    
363   function g et_group_n ame ($gr_i d = 0)    
364   {    
365       $res =  db_arr("S ELECT `Cap tion` FROM  `MemberMe nu` WHERE  `ID` = $gr _id");    
366       $capt  = _t($res[ 'Caption'] );    
367       return  $capt;    
368   }    
369      
370   //get list  of existi ng group    
371   function g et_menu_gr oup ($sCur rent = 0)    
372   {    
373       $res =  db_res( " SELECT `ID `,`Name`,` Caption`,` MenuGroup`  FROM `Mem berMenu` W HERE `Menu Type` = 'g roup' ORDE R BY `Menu Order` ASC " );    
374      
375       if ( m ysql_num_r ows($res)  > 0 )    
376       {    
377           $r et  .= "<o ption valu e=\"\"></o ption>";    
378           wh ile ($arr  = mysql_fe tch_array( $res))    
379           {    
380                $sSel =  $sCurrent  == $arr['I D'] ? ' se lected="se lected" '  : '';    
381                $ret .=  "<option v alue=\"{$a rr['ID']}\ " $sSel>". _t($arr['C aption']). "</option> ";    
382           }    
383       }    
384       else    
385       {    
386           $r et .= "The re is no a ny groups! ";    
387       }    
388       return  $ret;    
389   }    
390      
391   //show all  existing  items in m ember menu    
392   function g et_menu_li st ()    
393   {    
394       $count  = 0;    
395       $min    = 0;    
396      
397       $res    = db_res(  "SELECT ` ID`, `Name `, `MenuOr der` FROM  `MemberMen u` ORDER B Y `MenuOrd er` ASC" ) ;    
398       $ret   .= "<selec t name=\"M enuOrder\" >";    
399       while  ($arr = my sql_fetch_ array($res ))    
400       {    
401           $r et .= "<op tion value =\"{$arr[' MenuOrder' ]}\">{$arr ['Name']}< /option>";    
402           $m in = ($cou nt == 0) ?  $arr['Men uOrder'] :  $min;    
403           db _res( "UPD ATE `Membe rMenu` SET  `MenuOrde r` = $min+ $count WHE RE `ID` =  {$arr['ID' ]}");    
404           $c ount++;    
405       }    
406       $ret . = "</selec t>";    
407      
408       return  $ret;    
409   }    
410      
411   function r eset_menu( )    
412   {    
413       // SQL  script ex ecuting    
414       if ( ! ($f = fope n ( './mem b_menu_dfl .sql', "r"  )) )    
415           re turn false ;    
416           
417       $s_sql  = '';    
418       while  ( $s = fge ts ( $f, 1 0240) )    
419       {    
420           $s  = trim ($ s);    
421               
422           // find comme nt    
423           if  ( $s[0] = = '#' ) co ntinue;    
424           if  ( $s[0] = = '' ) con tinue;    
425           if  ( $s[0].$ s[1] == '- -' ) conti nue;    
426      
427           $s _sql .= $s ;    
428               
429           if  ( $s[strl en($s)-1]  != ';' )    
430                continue ;    
431               
432           db _res( rtri m( $s_sql,  ';' ) );    
433               
434           $s _sql = '';    
435       }    
436       fclose ($f);    
437   }    
438      
439   ?>