14. File Comparison Report

Produced on Wed Jun 18 08:01:26 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.

14.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\admin pageComposer.php Sat Apr 19 12:05:02 2008 UTC
2 Wed Jun 18 08:01:26 2008 UTC

14.2 Comparison summary

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

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

14.4 Active regular expressions

No regular expressions were active.

14.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   require_on ce( '../in c/header.i nc.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 . 'p rofiles.in c.php' );    
24   require_on ce( BX_DIR ECTORY_PAT H_INC . 'a dmin_desig n.inc.php'  );    
25   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );    
26   require_on ce( BX_DIR ECTORY_PAT H_INC . 'l anguages.i nc.php' );    
27      
28   // Check i f administ rator is l ogged in.   If not di splay logi n form.    
29   $logged['a dmin'] = m ember_auth ( 1, true,  true );    
30      
31   $_page['cs s_name'] =  'pageComp ose.css';    
32      
33   $sMyPage =  $_REQUEST ['page'];    
34   switch( $s MyPage ) {    
35       case ' account':    
36           $_ page['head er'] = 'Ac count Page  Builder';    
37           $s TableName  = 'Account Compose';    
38       break;    
39           
40       case ' profile':    
41           $_ page['head er'] = 'Pr ofile Page  Builder';    
42           $s TableName  = 'Profile Compose';    
43       break;    
44           
45       case ' photo':    
46           $_ page['head er'] = 'Ph oto File P age Builde r';    
47           $s TableName  = 'sharePh otoCompose ';    
48       break;    
49           
50       case ' music':    
51           $_ page['head er'] = 'Mu sic File P age Builde r';    
52           $s TableName  = 'shareMu sicCompose ';    
53       break;    
54           
55       case ' video':    
56           $_ page['head er'] = 'Vi deo File P age Builde r';    
57           $s TableName  = 'shareVi deoCompose ';    
58       break;    
59           
60       case ' ads':    
61           $_ page['head er'] = 'Cl assifieds  Advertisem ent Page B uilder';    
62           $s TableName  = 'ClsAdvC ompose';    
63       break;    
64           
65       case ' index':    
66       defaul t:    
67           $_ page['head er'] = 'In dex Page B uilder';    
68           $s TableName  = 'IndexCo mpose';    
69           $s MyPage = ' index';    
70   }    
71      
72   if( $_REQU EST['actio n'] )    
73   {    
74       switch ( $_REQUES T['action' ] )    
75       {    
76           ca se 'edit_f orm':    
77                $id = (i nt)$_REQUE ST['id'];    
78                    
79                $aItem =  db_assoc_ arr( "SELE CT * FROM  `$sTableNa me` WHERE  `ID` = $id ", 0 );    
80      
81                if( $aIt em )    
82                {    
83                    $aIt em['Deleta ble'] = fa lse;    
84                    if(  $aItem['Fu nc'] == 'E cho' )    
85                         $aItem['De letable']  = true;    
86                    else if( $aItem ['Func'] ! = 'PFBlock ' ) {    
87                         $iTypeNum  = (int)db_ value( "SE LECT COUNT ( * ) FROM  `$sTableN ame` WHERE  `Func` =  '{$aItem[' Func']}'"  );    
88                         if( $iType Num > 1 )    
89                             $aItem ['Deletabl e'] = true ;    
90                    }    
91                        
92                    show EditForm(  $aItem );    
93                }    
94                else    
95                    echo MenuEditMs g( 'Error' , 'red' );    
96           ex it;    
97               
98           ca se 'create _item':    
99                $newID =  createNew Element( ( int)$_GET[ 'source']  );    
100                echo $ne wID;    
101           ex it;    
102               
103           ca se 'deacti vate_item' :    
104                echo "OK "; //moved  it to Col  0    
105           ex it;    
106               
107           ca se 'save_i tem':    
108                $id = (i nt)$_POST[ 'id'];    
109                if( !$id  ) {    
110                    echo MenuEditMs g( 'Error' , 'red' );    
111                    exit ;    
112                }    
113                    
114                $aItemFi elds = arr ay( 'Title ', 'Captio n', 'Conte nt' );    
115                $aItem =  array();    
116                foreach(  $aItemFie lds as $fi eld )    
117                    $aIt em[$field]  = $_POST[ $field];    
118                    
119                $aVis =  array();    
120                if( (int )$_POST['V isible_non '] )    
121                    $aVi s[] = 'non ';    
122                if( (int )$_POST['V isible_mem b'] )    
123                    $aVi s[] = 'mem b';    
124                    
125                if( isse t( $_POST[ 'Url'] ) a nd isset(  $_POST['Nu m'] ) )    
126                    $aIt em['Conten t'] = $_PO ST['Url']  . '#' . (i nt)$_POST[ 'Num'];    
127                    
128                    
129                $aItem[' Visible']  = implode(  ',', $aVi s );    
130                $res = s aveItem( $ id, $aItem  );    
131                updateLa ngFile( $_ POST['Capt ion'], $_P OST['LangC aption'] ) ;    
132                echo $re s;    
133           ex it;    
134               
135           ca se 'delete _item':    
136                $id = (i nt)$_GET[' id'];    
137                echo del eteItem( $ id );    
138           ex it;    
139               
140           ca se 'save_o rders':    
141                $sTop =  $_GET['top '];    
142                $aCustom  = $_GET[' custom'];    
143                saveOrde rs( $sTop,  $aCustom  );    
144                echo 'OK ';    
145           ex it;    
146               
147           ca se 'reset' :    
148                $res = e xecSqlFile ( "{$site[ 'url_admin ']}builder s_dfl/{$sT ableName}. sql" );    
149                    
150                if( $res  )    
151                    head er( "Locat ion:{$_SER VER['PHP_S ELF']}?pag e=$sMyPage " );    
152                else    
153                    echo  'Sorry, s ome error  occurred';    
154           ex it;    
155       }    
156   }    
157      
158      
159   $sAllQuery  = "SELECT  `ID`, `Ti tle` FROM  `$sTableNa me`";    
160   $rAllItems  = db_res(  $sAllQuer y );    
161      
162   $sComposer Init = "    
163       <scrip t type=\"t ext/javasc ript\">    
164           to pParentID  = 'menu_ap p_wrapper' ;    
165           ur lIconLoadi ng = '{$si te['url_ad min']}imag es/loading .gif';    
166           pa rserUrl =  '{$_SERVER ['PHP_SELF ']}?page=$ sMyPage';    
167           al lowNewItem  = true;    
168           al lowAddToTo p = false;    
169           iI nactivePer Row = 4;    
170           se ndSystemOr der = true ;    
171           sN ewItemTitl e = 'NEW B LOCK';    
172               
173           aC oords = ne w Array();    
174           aC oords['sta rtX'] = 27 5;    
175           aC oords['sta rtY'] = 20 0;    
176           aC oords['wid th']  = 11 7;    
177           aC oords['hei ght'] = 21 ;    
178           aC oords['dif fX']  = 14 5;    
179           aC oords['dif fY']  = 32 ;    
180               
181           aT opItems =  new Array( );    
182           aC ustomItems  = new Arr ay();    
183           aS ystemItems  = new Arr ay();    
184           aA llItems =  new Array( );    
185   ";    
186               
187   for( $iCol umn = 1; $ iColumn <=  2; $iColu mn ++ ) {    
188       $sComp oserInit . = "    
189               
190           aS ystemItems [100{$iCol umn}] = '' ;    
191           aC ustomItems [100{$iCol umn}] = ne w Array(); ";    
192           
193       $sQuer y = "SELEC T `ID`, `T itle` FROM  `$sTableN ame` WHERE  `Column`  = $iColumn  ORDER BY  `Order`";    
194           
195       $rCust omItems =  db_res( $s Query );    
196       while(  $aCustomI tem = mysq l_fetch_as soc( $rCus tomItems )  )    
197       {    
198           $s ComposerIn it .= "    
199           aC ustomItems [100{$iCol umn}][{$aC ustomItem[ 'ID']}] =  '" . addsl ashes( _t(  $aCustomI tem['Title '] ) ) . " ';";    
200       }    
201   }    
202      
203   $sComposer Init .= "\ n";    
204   while( $aA llItem = m ysql_fetch _assoc( $r AllItems )  )    
205   {    
206       $sComp oserInit . = "    
207           aA llItems[{$ aAllItem[' ID']}] = ' " . addsla shes( _t(  $aAllItem[ 'Title'] )  ) . "';";    
208   }    
209      
210       $sComp oserInit . = "    
211       </scri pt>    
212   ";    
213      
214      
215   $_page['ex traCodeInH ead'] = << <EOJ    
216       $sComp oserInit    
217       <scrip t type="te xt/javascr ipt" src=" {$site['ur l']}inc/js /classes/B xDolMenu.j s"></scrip t>    
218       <scrip t type="te xt/javascr ipt" src=" menu_compo se.js"></s cript>    
219           
220       <!-- t inyMCE gz  -->    
221       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ti ny_mce/tin y_mce_gzip .js"></scr ipt>    
222       <scrip t type="te xt/javascr ipt">    
223           ti nyMCE_GZ.i nit({    
224                plugins  : "style,l ayer,table ,save,advh r,advimage ,advlink,e motions,ie spell,inse rtdatetime ,preview,m edia,searc hreplace,p rint,conte xtmenu,pas te,directi onality,fu llscreen,n oneditable ,visualcha rs,nonbrea king,xhtml xtras",    
225                themes :  "simple,a dvanced",    
226                language s : "en",    
227                disk_cac he : true,    
228                debug :  false    
229           }) ;    
230       </scri pt>    
231      
232       <scrip t language ="javascri pt" type=" text/javas cript">    
233           ti nyMCE.init ({    
234                mode : " textareas" ,    
235                theme :  "advanced" ,    
236                    
237                editor_s elector :  "form_inpu t_html",    
238                content_ css : "{$s ite['plugi ns']}tiny_ mce/dolphi n.css",    
239                    
240                plugins  : "style,l ayer,table ,save,advh r,advimage ,advlink,e motions,ie spell,inse rtdatetime ,preview,z oom,media, searchrepl ace,print, contextmen u,paste,di rectionali ty,fullscr een,visual chars,nonb reaking,xh tmlxtras",    
241                relative _urls : fa lse,    
242                    
243                theme_ad vanced_but tons1 : "b old,italic ,underline ,strikethr ough,|,jus tifyleft,j ustifycent er,justify right,just ifyfull,|, fontselect ,fontsizes elect",    
244                theme_ad vanced_but tons2 : "f orecolor,b ackcolor,| ,bullist,n umlist,|,o utdent,ind ent,|,link ,unlink,im age,hr,|,s ub,sup,|,i nsertdate, inserttime ,|,stylepr ops",    
245                theme_ad vanced_but tons3 : "c harmap,emo tions,|,ci te,abbr,ac ronym,attr ibs,|,prev iew,remove format,|,c ode,help",    
246                theme_ad vanced_but tons4 : "t able,row_p rops,cell_ props,dele te_col,del ete_row,de lete_table ,col_after ,col_befor e,row_afte r,row_befo re,row_aft er,row_bef ore,split_ cells,merg e_cells",    
247                theme_ad vanced_too lbar_locat ion : "top ",    
248                theme_ad vanced_too lbar_align  : "center ",    
249                valid_el ements : " *[*]"    
250           }) ;    
251       </scri pt>    
252   EOJ;    
253      
254      
255   $_page['ex traCodeInB ody'] = << <EOJ    
256       <div i d="edit_fo rm_wrapper " style="d isplay:non e;" onclic k="e = eve nt; t = (  e.target | | e.srcEle ment ); if  ( t.id ==  this.id )  hideEditF orm();">    
257           <d iv id="edi t_form_con t"></div>    
258       </div>    
259       <div i d="menu_ap p_wrapper" ></div>    
260   EOJ;    
261      
262   TopCodeAdm in();    
263       ?>    
264       <div c lass="pseu do_wrapper ">    
265           <d iv class=" pseudo_hea d">Active  items (<a  href="java script:voi d(0);" onc lick="rese tItems();r eturn fals e;">Reset< /a>)</div>    
266           <d iv id="pse udo1">    
267                <img src ="<?= $sit e['url_adm in'] . 'im ages/loadi ng.gif' ?> " />    
268           </ div>    
269           <d iv class=" pseudo_hea d">All Ite ms</div>    
270           <d iv id="pse udo2">    
271                <img src ="<?= $sit e['url_adm in'] . 'im ages/loadi ng.gif' ?> " />    
272           </ div>    
273       </div>    
274       <?    
275   BottomCode ();    
276      
277      
278      
279   function s howEditFor m( $aItem  )    
280   {    
281       ?>    
282   <form    
283     onsubmit ="if( this .form_inpu t_html ) t inyMCE.exe cCommand(' mceRemoveC ontrol', f alse, 'for m_input_ht ml'); save ItemByPost ( <?= $aIt em['ID'] ? > ); retur n false;"    
284     onreset= "if( this. form_input _html ) ti nyMCE.exec Command('m ceRemoveCo ntrol', fa lse, 'form _input_htm l'); hideE ditForm();  return fa lse;"    
285     name="fo rmItemEdit " id="form ItemEdit">    
286       <table  class="po pup_form_w rapper">    
287           <t r>    
288                <td clas s="corner" ><img src= "images/op _cor_tl.pn g" /></td>    
289                <td clas s="side_ve r"><img sr c="images/ spacer.gif " alt="" / ></td>    
290                <td clas s="corner" ><img src= "images/op _cor_tr.pn g" /></td>    
291           </ tr>    
292           <t r>    
293                <td clas s="side">< img src="i mages/spac er.gif" al t="" /></t d>    
294                    
295                <td clas s="contain er">    
296                    <div  class="ed it_item_ta ble_cont">    
297                        
298                         <table cla ss="edit_i tem_table"  id="tmp_i d_name" >    
299                             <tr>    
300                                 <t d class="f orm_label" >System Na me:</td>    
301                                 <t d>    
302                                      <input t ype="text"  class="fo rm_input_t ext" name= "Title" va lue="<?= $ aItem['Tit le'] ?>"    
303                                        <?= $a Item['Func '] == 'PFB lock' ? 'r eadonly="r eadonly"'  : '' ?> />    
304                                 </ td>    
305                             </tr>    
306                             <tr>    
307                                 <t d class="f orm_label" >Descripti on:</td>    
308                                 <t d><?= $aIt em['Desc']  ?></td>    
309                             </tr>    
310                             <tr>    
311                                 <t d class="f orm_label" >Language  Key:</td>    
312                                 <t d>    
313                                      <input t ype="text"  class="fo rm_input_t ext" name= "Caption"  value="<?=  $aItem['C aption'] ? >"    
314                                        <?= $a Item['Func '] == 'PFB lock' ? 'r eadonly="r eadonly"'  : '' ?> />    
315                                 </ td>    
316                             </tr>    
317                             <tr>    
318                                 <t d class="f orm_label" >Default N ame:</td>    
319                                 <t d>    
320                                      <input t ype="text"  class="fo rm_input_t ext" name= "LangCapti on" value= "<?= _t( $ aItem['Cap tion'] ) ? >" />    
321                                 </ td>    
322                             </tr>    
323                             <tr>    
324                                 <t d class="f orm_label" >Visible f or:</td>    
325                                 <t d>    
326                                      <input t ype="check box" name= "Visible_n on"  value ="on" <?=  ( ( strpos ( $aItem[' Visible'],  'non'  )  === false  ) ? '' : ' checked="c hecked"' )  ?> /> Gue st    
327                                      <input t ype="check box" name= "Visible_m emb" value ="on" <?=  ( ( strpos ( $aItem[' Visible'],  'memb' )  === false  ) ? '' : ' checked="c hecked"' )  ?> /> Mem ber    
328                                 </ td>    
329                             </tr>    
330       <?    
331       if( $a Item['Func '] == 'Ech o' )    
332       {    
333           ?>    
334                             <tr>    
335                                 <t d class="f orm_label" >HTML-cont ent:</td>    
336                                 <t d>&nbsp;</ td>    
337                             </tr>    
338                             <tr>    
339                                 <t d class="f orm_colspa n" colspan ="2">    
340                                      <textare a class="f orm_input_ html" id=" form_input _html" nam e="Content "><?= html specialcha rs_adv( $a Item['Cont ent'] ) ?> </textarea >    
341                                 </ td>    
342                             </tr>    
343           <?    
344       }    
345       elseif ( $aItem[' Func'] ==  'RSS' )    
346       {    
347           li st( $sUrl,  $iNum ) =  explode(  '#', $aIte m['Content '] );    
348           $i Num = (int )$iNum;    
349               
350           ?>    
351                             <tr>    
352                                 <t d class="f orm_label" >Url of RS S feed:</t d>    
353                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Url" valu e="<?= $sU rl ?>" />< /td>    
354                             </tr>    
355                             <tr>    
356                                 <t d class="f orm_label" >Number of  RSS items  (0 - all) :</td>    
357                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Num" valu e="<?= $iN um ?>" />< /td>    
358                             </tr>    
359           <?    
360       }    
361       ?>    
362                             <tr>    
363                                 <t d class="f orm_colspa n" colspan ="2">    
364                                      <input t ype="submi t" value=" Save" />    
365       <?    
366       if( $a Item['Dele table'] )    
367       {    
368           ?>    
369                                      <input t ype="butto n"    
370                                        onclic k="if( del eteItem( < ?= $aItem[ 'ID'] ?> )  && this.f orm.form_i nput_html  ) tinyMCE. execComman d('mceRemo veControl' , false, ' form_input _html');"    
371                                        value= "Delete" / >    
372           <?    
373       }    
374       ?>    
375                                      <input t ype="reset " value="C ancel" />    
376                                 </ td>    
377                             </tr>    
378                         </table>    
379                        
380                    </di v>    
381                </td>    
382                    
383                <td clas s="side">< img src="i mages/spac er.gif" al t="" /></t d>    
384           </ tr>    
385           <t r>    
386                <td clas s="corner" ><img src= "images/op _cor_bl.pn g" /></td>    
387                <td clas s="side_ve r"><img sr c="images/ spacer.gif " alt="" / ></td>    
388                <td clas s="corner" ><img src= "images/op _cor_br.pn g" onload= "if( navig ator.appNa me == 'Mic rosoft Int ernet Expl orer' && v ersion >=  5.5 && ver sion < 7 )  png_fix() ;" /></td>    
389           </ tr>    
390       </tabl e>    
391   </form>    
392   <script ty pe="text/j avascript" >if( docum ent.forms. formItemEd it.form_in put_html )  tinyMCE.e xecCommand ('mceAddCo ntrol', fa lse, 'form _input_htm l');</scri pt>    
393       <?    
394   }    
395      
396   function c reateNewEl ement( $so urce )    
397   {    
398       global  $sTableNa me;    
399      
400       if( $s ource )    
401       {    
402           $a Source = d b_assoc_ar r( "SELECT  `Column`,  `Func` FR OM `$sTabl eName` WHE RE `ID`=$s ource" );    
403           if ( $aSource ['Column']  )    
404           {    
405                if( $aSo urce['Func '] == 'PFB lock' )    
406                    retu rn 0; // d o not let  copy profi le blocks    
407                    
408                $sQuery  = "    
409                    INSE RT INTO `$ sTableName `    
410                         ( `Title`,  `Desc`, ` Caption`,  `Func`, `C ontent`, ` Visible` )    
411                    SELE CT    
412                           `Title`,  `Desc`, ` Caption`,  `Func`, `C ontent`, ` Visible`    
413                    FROM  `$sTableN ame`    
414                    WHER E `ID` = $ source    
415                    ";    
416                        
417                db_res(  $sQuery );    
418                    
419                $newID =  mysql_ins ert_id();    
420           }    
421           el se    
422                $newID =  $source;  //return t he source    
423       }    
424       else    
425       {    
426           $s Query = "    
427                INSERT I NTO `$sTab leName` SE T    
428                    `Tit le` = 'NEW  BLOCK',    
429                    `Des c`  = 'Pla ce here yo ur custom  HTML-block ',    
430                    `Vis ible` = 'n on,memb',    
431                    `Fun c`  = 'Ech o'    
432                ";    
433               
434           db _res( $sQu ery );    
435               
436           $n ewID = mys ql_insert_ id();    
437       }    
438           
439       return  $newID;    
440   }    
441      
442   function e choMenuEdi tMsg( $tex t, $color  = 'black'  )    
443   {    
444       ?>    
445           <d iv onclick ="hideEdit Form();" s tyle="colo r:<?= $col or ?>;text -align:cen ter;"><?=  $text ?></ div>    
446           <s cript type ="text/jav ascript">s etTimeout(  'hideEdit Form();',  1000 )</sc ript>    
447       <?    
448   }    
449      
450   function s aveItem( $ id, $aItem  )    
451   {    
452       global  $sTableNa me;    
453      
454       $aOldI tem = db_a rr( "SELEC T * FROM ` $sTableNam e` WHERE ` ID`=$id" ) ;    
455           
456       if( !$ aOldItem )    
457           re turn echoM enuEditMsg ( 'Error.  Item not f ound', 're d' );    
458           
459       $sQuer ySet = '';    
460       foreac h( $aItem  as $field  => $value  )    
461           $s QuerySet . = ", `$fie ld`='" . p rocess_db_ input( $va lue ) ."'" ;    
462           
463       $sQuer ySet = sub str( $sQue rySet, 1 ) ;    
464           
465       $sQuer y = "UPDAT E `$sTable Name` SET  $sQuerySet  WHERE `ID ` = $id";    
466           
467       db_res ( $sQuery  );    
468           
469       $ret =  echoMenuE ditMsg( 'S aved', 'gr een' );    
470       $ret . = '<script  type="tex t/javascri pt">update Item( ' .  $id . ', \ '' . proce ss_db_inpu t( $aItem[ 'Title'] )  . '\' );< /script>';    
471       return  $ret;    
472   }    
473      
474   function d eleteItem(  $id )    
475   {    
476       global  $sTableNa me;    
477      
478       if( !$ id )    
479           re turn 'ID n ot specifi ed';    
480           
481       $aItem  = db_arr(  "SELECT *  FROM `$sT ableName`  WHERE `ID`  = $id" );    
482           
483       if( !$ aItem )    
484           re turn 'Item  not found ';    
485           
486       db_res ( "DELETE  FROM `$sTa bleName` W HERE `ID`  = $id" );    
487           
488       if( my sql_affect ed_rows()  )    
489           re turn 'OK';    
490       else    
491           re turn 'Unkn own error' ;    
492   }    
493      
494   function u pdateLangF ile( $key,  $string )    
495   {    
496       global  $sTableNa me;    
497      
498       $langN ame = getP aram( 'lan g_default'  );    
499       $langI D = db_val ue( "SELEC T `ID` FRO M `Localiz ationLangu ages` WHER E `Name` =  '" . adds lashes( $l angName )  . "'" );    
500           
501       $keyID  = db_valu e( "SELECT  `ID` FROM  `Localiza tionKeys`  WHERE `Key ` = '" . p rocess_db_ input( $ke y ) . "'"  );    
502       if( $k eyID )    
503       {    
504           db _res( "UPD ATE `Local izationStr ings` SET  `String` =  '" .proce ss_db_inpu t( $string  ) . "' WH ERE `IDKey `=$keyID A ND `IDLang uage`=$lan gID" );    
505       }    
506       else    
507       {    
508           db _res( "INS ERT INTO ` Localizati onKeys` SE T `IDCateg ory` = 2,  `Key` = '"  . process _db_input(  $key ) .  "'" );    
509           db _res( "INS ERT INTO ` Localizati onStrings`  SET `IDKe y` = " . m ysql_inser t_id() . " , `IDLangu age` = $la ngID, `Str ing` = '"  .process_d b_input( $ string ) .  "'" );    
510       }    
511           
512       compil eLanguage( $langID);    
513   }    
514      
515      
516   function s aveOrders(  $sTop, $a Custom )    
517   {    
518       global  $sTableNa me;    
519      
520       db_res ( "UPDATE  `$sTableNa me` SET `C olumn` = 0 , `Order`  = 0" );    
521           
522       $sTop  = trim( $s Top, ' ,'  );    
523       $aTopI Ds = explo de( ',', $ sTop );    
524       foreac h( $aTopID s as $iCol  => $iID )    
525       {    
526           $i ID = trim(  $iID, ' , ' );    
527           $i ID = (int) $iID;    
528               
529           if ( !$iID )    
530                continue ;    
531               
532           $i Col ++;    
533               
534           $s Custom = $ aCustom[$i ID];    
535               
536           $s Custom = t rim( $sCus tom, ' ,'  );    
537           $a CustomIDs  = explode(  ',', $sCu stom );    
538               
539           fo reach( $aC ustomIDs a s $iOrd =>  $iCID )    
540           {    
541                $iCID =  trim( $iCI D, ' ,' );    
542                $iCID =  (int)$iCID ;    
543                    
544                if( !$iC ID )    
545                    cont inue;    
546                    
547                db_res(  "UPDATE `$ sTableName ` SET `Col umn` = $iC ol, `Order ` = $iOrd  WHERE `ID`  = $iCID"  );    
548           }    
549       }    
550   }    
551      
552   ?>