61. File Comparison Report

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

61.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\admin pageComposer.php Mon Dec 24 09:44:18 2007 UTC
2 Dolphin-v.6.1.0\admin pageComposer.php Sat Apr 19 12:05:02 2008 UTC

61.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 26 906
Changed 16 108
Inserted 9 11
Removed 1 1

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

61.4 Active regular expressions

No regular expressions were active.

61.5 Comparison detail

1   <?
  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   }
2     71  
3   if( $_REQU EST['actio n'] )   72   if( $_REQU EST['actio n'] )
4   {   73   {
5       switch ( $_REQUES T['action' ] )   74       switch ( $_REQUES T['action' ] )
6       {   75       {
7           ca se 'edit_f orm':   76           ca se 'edit_f orm':
8                $id = (i nt)$_REQUE ST['id'];   77                $id = (i nt)$_REQUE ST['id'];
9                   78                
10                $aItem =  db_assoc_ arr( "SELE CT * FROM  `$sTableNa me` WHERE  `ID` = $id ", 0 );   79                $aItem =  db_assoc_ arr( "SELE CT * FROM  `$sTableNa me` WHERE  `ID` = $id ", 0 );
11     80  
12                if( $aIt em )   81                if( $aIt em )
13                {   82                {
14                    $aIt em['Deleta ble'] = fa lse;   83                    $aIt em['Deleta ble'] = fa lse;
15                    if(  $aItem['Fu nc'] == 'E cho' )   84                    if(  $aItem['Fu nc'] == 'E cho' )
16                         $aItem['De letable']  = true;   85                         $aItem['De letable']  = true;
17                    else   86                    else if( $aItem ['Func'] ! = 'PFBlock ' ) {
18                    {    
19                         $iTypeNum  = (int)db_ value( "SE LECT COUNT ( * ) FROM  `$sTableN ame` WHERE  `Func` =  '{$aItem[' Func']}'"  );   87                         $iTypeNum  = (int)db_ value( "SE LECT COUNT ( * ) FROM  `$sTableN ame` WHERE  `Func` =  '{$aItem[' Func']}'"  );
20                         if( $iType Num > 1 )   88                         if( $iType Num > 1 )
21                             $aItem ['Deletabl e'] = true ;   89                             $aItem ['Deletabl e'] = true ;
22                    }   90                    }
    91                    
23                    show EditForm(  $aItem );   92                    show EditForm(  $aItem );
24                }   93                }
25                else   94                else
26                    echo MenuEditMs g( 'Error' , 'red' );   95                    echo MenuEditMs g( 'Error' , 'red' );
27           ex it;   96           ex it;
    97           
28           ca se 'create _item':   98           ca se 'create _item':
29                $newID =  createNew Element( ( int)$_GET[ 'source']  );   99                $newID =  createNew Element( ( int)$_GET[ 'source']  );
30                echo $ne wID;   100                echo $ne wID;
31           ex it;   101           ex it;
    102           
32           ca se 'deacti vate_item' :   103           ca se 'deacti vate_item' :
33                echo "OK "; //moved  it to Col  0   104                echo "OK "; //moved  it to Col  0
34           ex it;   105           ex it;
    106           
35           ca se 'save_i tem':   107           ca se 'save_i tem':
36                $id = (i nt)$_POST[ 'id'];   108                $id = (i nt)$_POST[ 'id'];
37                 if(   !$id   )
  109                 if(   !$id   )   {
38                {    
39                    echo MenuEditMs g( 'Error' , 'red' );   110                    echo MenuEditMs g( 'Error' , 'red' );
40                    exit ;   111                    exit ;
41                }   112                }
42                   113                
43                $aItemFi elds = arr ay( 'Title ', 'Captio n', 'Conte nt' );   114                $aItemFi elds = arr ay( 'Title ', 'Captio n', 'Conte nt' );
44                $aItem =  array();   115                $aItem =  array();
45                foreach(  $aItemFie lds as $fi eld )   116                foreach(  $aItemFie lds as $fi eld )
46                    $aIt em[$field]  = $_POST[ $field];   117                    $aIt em[$field]  = $_POST[ $field];
47                   118                
48                $aVis =  array();   119                $aVis =  array();
49                if( (int )$_POST['V isible_non '] )   120                if( (int )$_POST['V isible_non '] )
50                    $aVi s[] = 'non ';   121                    $aVi s[] = 'non ';
51                if( (int )$_POST['V isible_mem b'] )   122                if( (int )$_POST['V isible_mem b'] )
52                    $aVi s[] = 'mem b';   123                    $aVi s[] = 'mem b';
53                   124                
54                if( isse t( $_POST[ 'Url'] ) a nd isset(  $_POST['Nu m'] ) )   125                if( isse t( $_POST[ 'Url'] ) a nd isset(  $_POST['Nu m'] ) )
55                {    
56                    $aIt em['Conten t'] = $_PO ST['Url']  . '#' . (i nt)$_POST[ 'Num'];   126                    $aIt em['Conten t'] = $_PO ST['Url']  . '#' . (i nt)$_POST[ 'Num'];
57                 }   127  
             
58                   128                
59                $aItem[' Visible']  = implode(  ',', $aVi s );   129                $aItem[' Visible']  = implode(  ',', $aVi s );
60                $res = s aveItem( $ id, $aItem  );   130                $res = s aveItem( $ id, $aItem  );
61                updateLa ngFile( $_ POST['Capt ion'], $_P OST['LangC aption'] ) ;   131                updateLa ngFile( $_ POST['Capt ion'], $_P OST['LangC aption'] ) ;
62                echo $re s;   132                echo $re s;
63           ex it;   133           ex it;
    134           
64           ca se 'delete _item':   135           ca se 'delete _item':
65                $id = (i nt)$_GET[' id'];   136                $id = (i nt)$_GET[' id'];
66                echo del eteItem( $ id );   137                echo del eteItem( $ id );
67           ex it;   138           ex it;
    139           
68           ca se 'save_o rders':   140           ca se 'save_o rders':
69                $sTop =  $_GET['top '];   141                $sTop =  $_GET['top '];
70                $aCustom  = $_GET[' custom'];   142                $aCustom  = $_GET[' custom'];
71                saveOrde rs( $sTop,  $aCustom  );   143                saveOrde rs( $sTop,  $aCustom  );
72                echo 'OK ';   144                echo 'OK ';
73           ex it;   145           ex it;
    146           
74           ca se 'reset' :   147           ca se 'reset' :
75                $res = e xecSqlFile ( "{$site[ 'url_admin ']}builder s_dfl/{$sT ableName}. sql" );   148                $res = e xecSqlFile ( "{$site[ 'url_admin ']}builder s_dfl/{$sT ableName}. sql" );
    149                
76                if( $res  )   150                if( $res  )
77                     header(   "Location: {$_SERVER[ 'PHP_SELF' ]}
"   );
  151                     header(   "Location: {$_SERVER[ 'PHP_SELF' ]} ?page=$sMy Page "   );
78                else   152                else
79                    echo  'Sorry, s ome error  occurred';   153                    echo  'Sorry, s ome error  occurred';
80           ex it;   154           ex it;
81       }   155       }
82   }   156   }
83     157  
84     158  
85   $sAllQuery  = "SELECT  `ID`, `Ti tle` FROM  `$sTableNa me`";   159   $sAllQuery  = "SELECT  `ID`, `Ti tle` FROM  `$sTableNa me`";
86   $rAllItems  = db_res(  $sAllQuer y );   160   $rAllItems  = db_res(  $sAllQuer y );
87     161  
88   $sComposer Init = "   162   $sComposer Init = "
89       <scrip t type=\"t ext/javasc ript\">   163       <scrip t type=\"t ext/javasc ript\">
90           to pParentID  = 'menu_ap p_wrapper' ;   164           to pParentID  = 'menu_ap p_wrapper' ;
91           ur lIconLoadi ng = '{$si te['url_ad min']}imag es/loading .gif';   165           ur lIconLoadi ng = '{$si te['url_ad min']}imag es/loading .gif';
92            parserUrl   =   '{$_SERVER ['PHP_SELF ']}
';
  166            parserUrl   =   '{$_SERVER ['PHP_SELF ']} ?page=$sMy Page ';
93           al lowNewItem  = true;   167           al lowNewItem  = true;
94           al lowAddToTo p = false;   168           al lowAddToTo p = false;
95           iI nactivePer Row = 4;   169           iI nactivePer Row = 4;
96           se ndSystemOr der = true ;   170           se ndSystemOr der = true ;
97           sN ewItemTitl e = 'NEW B LOCK';   171           sN ewItemTitl e = 'NEW B LOCK';
98              172           
99           aC oords = ne w Array();   173           aC oords = ne w Array();
100           aC oords['sta rtX'] = 27 5;   174           aC oords['sta rtX'] = 27 5;
101           aC oords['sta rtY'] = 20 0;   175           aC oords['sta rtY'] = 20 0;
102           aC oords['wid th']  = 11 7;   176           aC oords['wid th']  = 11 7;
103           aC oords['hei ght'] = 21 ;   177           aC oords['hei ght'] = 21 ;
104           aC oords['dif fX']  = 14 5;   178           aC oords['dif fX']  = 14 5;
105           aC oords['dif fY']  = 32 ;   179           aC oords['dif fY']  = 32 ;
106              180           
107           aT opItems =  new Array( );   181           aT opItems =  new Array( );
108           aC ustomItems  = new Arr ay();   182           aC ustomItems  = new Arr ay();
109           aS ystemItems  = new Arr ay();   183           aS ystemItems  = new Arr ay();
110           aA llItems =  new Array( );   184           aA llItems =  new Array( );
111   ";   185   ";
112              186           
113   for(   $iColumn   =   1;   $iColumn   <=   2;   $iColumn   ++   )
  187   for(   $iColumn   =   1;   $iColumn   <=   2;   $iColumn   ++   )   {
114   {    
115       $sComp oserInit . = "   188       $sComp oserInit . = "
116              189           
117           aS ystemItems [100{$iCol umn}] = '' ;   190           aS ystemItems [100{$iCol umn}] = '' ;
118           aC ustomItems [100{$iCol umn}] = ne w Array(); ";   191           aC ustomItems [100{$iCol umn}] = ne w Array(); ";
119          192       
120       $sQuer y = "SELEC T `ID`, `T itle` FROM  `$sTableN ame` WHERE  `Column`  = $iColumn  ORDER BY  `Order`";   193       $sQuer y = "SELEC T `ID`, `T itle` FROM  `$sTableN ame` WHERE  `Column`  = $iColumn  ORDER BY  `Order`";
121          194       
122       $rCust omItems =  db_res( $s Query );   195       $rCust omItems =  db_res( $s Query );
123       while(  $aCustomI tem = mysq l_fetch_as soc( $rCus tomItems )  )   196       while(  $aCustomI tem = mysq l_fetch_as soc( $rCus tomItems )  )
124       {   197       {
125           $s ComposerIn it .= "   198           $s ComposerIn it .= "
126           aC ustomItems [100{$iCol umn}][{$aC ustomItem[ 'ID']}] =  '" . addsl ashes( _t(  $aCustomI tem['Title '] ) ) . " ';";   199           aC ustomItems [100{$iCol umn}][{$aC ustomItem[ 'ID']}] =  '" . addsl ashes( _t(  $aCustomI tem['Title '] ) ) . " ';";
127       }   200       }
128   }   201   }
129     202  
130   $sComposer Init .= "\ n";   203   $sComposer Init .= "\ n";
131   while( $aA llItem = m ysql_fetch _assoc( $r AllItems )  )   204   while( $aA llItem = m ysql_fetch _assoc( $r AllItems )  )
132   {   205   {
133       $sComp oserInit . = "   206       $sComp oserInit . = "
134           aA llItems[{$ aAllItem[' ID']}] = ' " . addsla shes( _t(  $aAllItem[ 'Title'] )  ) . "';";   207           aA llItems[{$ aAllItem[' ID']}] = ' " . addsla shes( _t(  $aAllItem[ 'Title'] )  ) . "';";
135   }   208   }
136     209  
137       $sComp oserInit . = "   210       $sComp oserInit . = "
138       </scri pt>   211       </scri pt>
139   ";   212   ";
140     213  
141     214  
142   $_page['ex traCodeInH ead'] = << <EOJ   215   $_page['ex traCodeInH ead'] = << <EOJ
143       $sComp oserInit   216       $sComp oserInit
144       <scrip t type="te xt/javascr ipt" src=" {$site['ur l']}inc/js /classes/B xDolMenu.j s"></scrip t>   217       <scrip t type="te xt/javascr ipt" src=" {$site['ur l']}inc/js /classes/B xDolMenu.j s"></scrip t>
145       <scrip t type="te xt/javascr ipt" src=" menu_compo se.js"></s cript>   218       <scrip t type="te xt/javascr ipt" src=" menu_compo se.js"></s cript>
146          219       
147       <!-- t inyMCE gz  -->   220       <!-- t inyMCE gz  -->
148       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ti ny_mce/tin y_mce_gzip .js"></scr ipt>   221       <scrip t type="te xt/javascr ipt" src=" {$site['pl ugins']}ti ny_mce/tin y_mce_gzip .js"></scr ipt>
149       <scrip t type="te xt/javascr ipt">   222       <scrip t type="te xt/javascr ipt">
150           ti nyMCE_GZ.i nit({   223           ti nyMCE_GZ.i nit({
151                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",   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",
152                themes :  "simple,a dvanced",   225                themes :  "simple,a dvanced",
153                language s : "en",   226                language s : "en",
154                disk_cac he : true,   227                disk_cac he : true,
155                debug :  false   228                debug :  false
156           }) ;   229           }) ;
157       </scri pt>   230       </scri pt>
158     231  
159       <scrip t language ="javascri pt" type=" text/javas cript">   232       <scrip t language ="javascri pt" type=" text/javas cript">
160           ti nyMCE.init ({   233           ti nyMCE.init ({
161                mode : " textareas" ,   234                mode : " textareas" ,
162                theme :  "advanced" ,   235                theme :  "advanced" ,
163                   236                
164                editor_s elector :  "form_inpu t_html",   237                editor_s elector :  "form_inpu t_html",
165                content_ css : "{$s ite['plugi ns']}tiny_ mce/dolphi n.css",   238                content_ css : "{$s ite['plugi ns']}tiny_ mce/dolphi n.css",
166                   239                
167                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",   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",
168                relative _urls : fa lse,   241                relative _urls : fa lse,
169                   242                
170                theme_ad vanced_but tons1 : "b old,italic ,underline ,strikethr ough,|,jus tifyleft,j ustifycent er,justify right,just ifyfull,|, fontselect ,fontsizes elect",   243                theme_ad vanced_but tons1 : "b old,italic ,underline ,strikethr ough,|,jus tifyleft,j ustifycent er,justify right,just ifyfull,|, fontselect ,fontsizes elect",
171                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",   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",
172                theme_ad vanced_but tons3 : "c harmap,emo tions,|,ci te,abbr,ac ronym,attr ibs,|,prev iew,remove format,|,c ode,help",   245                theme_ad vanced_but tons3 : "c harmap,emo tions,|,ci te,abbr,ac ronym,attr ibs,|,prev iew,remove format,|,c ode,help",
173                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",   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",
174                theme_ad vanced_too lbar_locat ion : "top ",   247                theme_ad vanced_too lbar_locat ion : "top ",
175                theme_ad vanced_too lbar_align  : "center ",   248                theme_ad vanced_too lbar_align  : "center ",
176                extended _valid_ele ments : "a [name|href |title],im g[class|sr c|border=0 |alt|title |hspace|vs pace|width |height|al ign|name], hr[class|w idth|size| noshade],f ont[face|s ize|color| style],spa n[class|al ign|style] ,script[ty pe|languag e|src],div [class|ali gn|style|i d],table[c lass|id|st yle|cellsp acing|cell padding|bo rder|bgcol or|backgro und],tbody ,tr[id|cla ss|style], td[id|clas s|style],f orm[id|nam e|action|s tyle|metho d],input[i d|type|nam e|value|st yle|class| onclick|on change|onf ocus|onblu r],select[ id|name|va lue|style| class|oncl ick|onchan ge],textar ea[id|name |value|sty le|class|o nclick|onc hange],ul[ style|id|c lass],ol[s tyle|id|cl ass],li[st yle|id|cla ss],label[ for|style| class]"   249                valid_el ements : " *[*]"
177           }) ;   250           }) ;
178       </scri pt>   251       </scri pt>
179   EOJ;   252   EOJ;
180     253  
181     254  
182   $_page['ex traCodeInB ody'] = << <EOJ   255   $_page['ex traCodeInB ody'] = << <EOJ
183       <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();">   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();">
184           <d iv id="edi t_form_con t"></div>   257           <d iv id="edi t_form_con t"></div>
185       </div>   258       </div>
186       <div i d="menu_ap p_wrapper" ></div>   259       <div i d="menu_ap p_wrapper" ></div>
187   EOJ;   260   EOJ;
188     261  
189   TopCodeAdm in();   262   TopCodeAdm in();
190       ?>   263       ?>
191       <div c lass="pseu do_wrapper ">   264       <div c lass="pseu do_wrapper ">
192           <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>   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>
193           <d iv id="pse udo1">   266           <d iv id="pse udo1">
194                <img src ="<?= $sit e['url_adm in'] . 'im ages/loadi ng.gif' ?> " />   267                <img src ="<?= $sit e['url_adm in'] . 'im ages/loadi ng.gif' ?> " />
195           </ div>   268           </ div>
196           <d iv class=" pseudo_hea d">All Ite ms</div>   269           <d iv class=" pseudo_hea d">All Ite ms</div>
197           <d iv id="pse udo2">   270           <d iv id="pse udo2">
198                <img src ="<?= $sit e['url_adm in'] . 'im ages/loadi ng.gif' ?> " />   271                <img src ="<?= $sit e['url_adm in'] . 'im ages/loadi ng.gif' ?> " />
199           </ div>   272           </ div>
200       </div>   273       </div>
201       <?   274       <?
202   BottomCode ();   275   BottomCode ();
203     276  
204     277  
205     278  
206   function s howEditFor m( $aItem  )   279   function s howEditFor m( $aItem  )
207   {   280   {
208       ?>   281       ?>
209   <form   282   <form
210     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;"   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;"
211     onreset= "if( this. form_input _html ) ti nyMCE.exec Command('m ceRemoveCo ntrol', fa lse, 'form _input_htm l'); hideE ditForm();  return fa lse;"   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;"
212     name="fo rmItemEdit " id="form ItemEdit">   285     name="fo rmItemEdit " id="form ItemEdit">
213       <table  class="po pup_form_w rapper">   286       <table  class="po pup_form_w rapper">
214           <t r>   287           <t r>
215                <td clas s="corner" ><img src= "images/op _cor_tl.pn g" /></td>   288                <td clas s="corner" ><img src= "images/op _cor_tl.pn g" /></td>
216                 <td   class="sid e_ver"><im g   src="image s/spacer.g if"  
/></td>
  289                 <td   class="sid e_ver"><im g   src="image s/spacer.g if"   alt=""   /></td>
217                <td clas s="corner" ><img src= "images/op _cor_tr.pn g" /></td>   290                <td clas s="corner" ><img src= "images/op _cor_tr.pn g" /></td>
218           </ tr>   291           </ tr>
219           <t r>   292           <t r>
220                 <td   class="sid e"><img   src="image s/spacer.g if"  
/></td>
  293                 <td   class="sid e"><img   src="image s/spacer.g if"   alt=""   /></td>
221                   294                
222                <td clas s="contain er">   295                <td clas s="contain er">
223                    <div  class="ed it_item_ta ble_cont">   296                    <div  class="ed it_item_ta ble_cont">
224                       297                    
225                         <table cla ss="edit_i tem_table"  id="tmp_i d_name" >   298                         <table cla ss="edit_i tem_table"  id="tmp_i d_name" >
226                             <tr>   299                             <tr>
227                                 <t d class="f orm_label" >System Na me:</td>   300                                 <t d class="f orm_label" >System Na me:</td>
228                                 <t d>   301                                 <t d>
229                                       <input   type="text "   class="for m_input_te xt"   name="Titl e"   value="<?=   $aItem['Ti tle']   ?>"   />   302                                       <input   type="text "   class="for m_input_te xt"   name="Titl e"   value="<?=   $aItem['Ti tle']   ?>"
    303                                        <?= $a Item['Func '] == 'PFB lock' ? 'r eadonly="r eadonly"'  : '' ?> />
230                                 </ td>   304                                 </ td>
231                             </tr>   305                             </tr>
232                             <tr>   306                             <tr>
233                                 <t d class="f orm_label" >Descripti on:</td>   307                                 <t d class="f orm_label" >Descripti on:</td>
234                                 <t d><?= $aIt em['Desc']  ?></td>   308                                 <t d><?= $aIt em['Desc']  ?></td>
235                             </tr>   309                             </tr>
236                             <tr>   310                             <tr>
237                                 <t d class="f orm_label" >Language  Key:</td>   311                                 <t d class="f orm_label" >Language  Key:</td>
238                                 <t d>   312                                 <t d>
239                                       <input   type="text "   class="for m_input_te xt"   name="Capt ion"   value="<?=   $aItem['Ca ption']   ?>"   />   313                                       <input   type="text "   class="for m_input_te xt"   name="Capt ion"   value="<?=   $aItem['Ca ption']   ?>"
    314                                        <?= $a Item['Func '] == 'PFB lock' ? 'r eadonly="r eadonly"'  : '' ?> />
240                                 </ td>   315                                 </ td>
241                             </tr>   316                             </tr>
242                             <tr>   317                             <tr>
243                                 <t d class="f orm_label" >Default N ame:</td>   318                                 <t d class="f orm_label" >Default N ame:</td>
244                                 <t d>   319                                 <t d>
245                                      <input t ype="text"  class="fo rm_input_t ext" name= "LangCapti on" value= "<?= _t( $ aItem['Cap tion'] ) ? >" />   320                                      <input t ype="text"  class="fo rm_input_t ext" name= "LangCapti on" value= "<?= _t( $ aItem['Cap tion'] ) ? >" />
246                                 </ td>   321                                 </ td>
247                             </tr>   322                             </tr>
248                             <tr>   323                             <tr>
249                                 <t d class="f orm_label" >Visible f or:</td>   324                                 <t d class="f orm_label" >Visible f or:</td>
250                                 <t d>   325                                 <t d>
251                                      <input t ype="check box" name= "Visible_n on"  value ="on" <?=  ( ( strpos ( $aItem[' Visible'],  'non'  )  === false  ) ? '' : ' checked="c hecked"' )  ?> /> Gue st   326                                      <input t ype="check box" name= "Visible_n on"  value ="on" <?=  ( ( strpos ( $aItem[' Visible'],  'non'  )  === false  ) ? '' : ' checked="c hecked"' )  ?> /> Gue st
252                                      <input t ype="check box" name= "Visible_m emb" value ="on" <?=  ( ( strpos ( $aItem[' Visible'],  'memb' )  === false  ) ? '' : ' checked="c hecked"' )  ?> /> Mem ber   327                                      <input t ype="check box" name= "Visible_m emb" value ="on" <?=  ( ( strpos ( $aItem[' Visible'],  'memb' )  === false  ) ? '' : ' checked="c hecked"' )  ?> /> Mem ber
253                                 </ td>   328                                 </ td>
254                             </tr>   329                             </tr>
255       <?   330       <?
256       if( $a Item['Func '] == 'Ech o' )   331       if( $a Item['Func '] == 'Ech o' )
257       {   332       {
258           ?>   333           ?>
259                             <tr>   334                             <tr>
260                                 <t d class="f orm_label" >HTML-cont ent:</td>   335                                 <t d class="f orm_label" >HTML-cont ent:</td>
261                                 <t d>&nbsp;</ td>   336                                 <t d>&nbsp;</ td>
262                             </tr>   337                             </tr>
263                             <tr>   338                             <tr>
264                                 <t d class="f orm_colspa n" colspan ="2">   339                                 <t d class="f orm_colspa n" colspan ="2">
265                                      <textare a class="f orm_input_ html" id=" form_input _html" nam e="Content "><?= html specialcha rs_adv( $a Item['Cont ent'] ) ?> </textarea >   340                                      <textare a class="f orm_input_ html" id=" form_input _html" nam e="Content "><?= html specialcha rs_adv( $a Item['Cont ent'] ) ?> </textarea >
266                                 </ td>   341                                 </ td>
267                             </tr>   342                             </tr>
268           <?   343           <?
269       }   344       }
270       elseif ( $aItem[' Func'] ==  'RSS' )   345       elseif ( $aItem[' Func'] ==  'RSS' )
271       {   346       {
272           li st( $sUrl,  $iNum ) =  explode(  '#', $aIte m['Content '] );   347           li st( $sUrl,  $iNum ) =  explode(  '#', $aIte m['Content '] );
273           $i Num = (int )$iNum;   348           $i Num = (int )$iNum;
274              349           
275           ?>   350           ?>
276                             <tr>   351                             <tr>
277                                 <t d class="f orm_label" >Url of RS S feed:</t d>   352                                 <t d class="f orm_label" >Url of RS S feed:</t d>
278                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Url" valu e="<?= $sU rl ?>" />< /td>   353                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Url" valu e="<?= $sU rl ?>" />< /td>
279                             </tr>   354                             </tr>
280                             <tr>   355                             <tr>
281                                 <t d class="f orm_label" >Number of  RSS items  (0 - all) :</td>   356                                 <t d class="f orm_label" >Number of  RSS items  (0 - all) :</td>
282                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Num" valu e="<?= $iN um ?>" />< /td>   357                                 <t d><input t ype="text"  class="fo rm_input_t ext" name= "Num" valu e="<?= $iN um ?>" />< /td>
283                             </tr>   358                             </tr>
284           <?   359           <?
285       }   360       }
286       ?>   361       ?>
287                             <tr>   362                             <tr>
288                                 <t d class="f orm_colspa n" colspan ="2">   363                                 <t d class="f orm_colspa n" colspan ="2">
289                                      <input t ype="submi t" value=" Save" />   364                                      <input t ype="submi t" value=" Save" />
290       <?   365       <?
291       if( $a Item['Dele table'] )   366       if( $a Item['Dele table'] )
292       {   367       {
293           ?>   368           ?>
294                                      <input t ype="butto n"   369                                      <input t ype="butto n"
295                                        onclic k="if( del eteItem( < ?= $aItem[ 'ID'] ?> )  && this.f orm.form_i nput_html  ) tinyMCE. execComman d('mceRemo veControl' , false, ' form_input _html');"   370                                        onclic k="if( del eteItem( < ?= $aItem[ 'ID'] ?> )  && this.f orm.form_i nput_html  ) tinyMCE. execComman d('mceRemo veControl' , false, ' form_input _html');"
296                                        value= "Delete" / >   371                                        value= "Delete" / >
297           <?   372           <?
298       }   373       }
299       ?>   374       ?>
300                                      <input t ype="reset " value="C ancel" />   375                                      <input t ype="reset " value="C ancel" />
301                                 </ td>   376                                 </ td>
302                             </tr>   377                             </tr>
303                         </table>   378                         </table>
304                       379                    
305                    </di v>   380                    </di v>
306                </td>   381                </td>
307                   382                
308                 <td   class="sid e"><img   src="image s/spacer.g if"  
/></td>
  383                 <td   class="sid e"><img   src="image s/spacer.g if"   alt=""   /></td>
309           </ tr>   384           </ tr>
310           <t r>   385           <t r>
311                <td clas s="corner" ><img src= "images/op _cor_bl.pn g" /></td>   386                <td clas s="corner" ><img src= "images/op _cor_bl.pn g" /></td>
312                 <td   class="sid e_ver"><im g   src="image s/spacer.g if"  
/></td>
  387                 <td   class="sid e_ver"><im g   src="image s/spacer.g if"   alt=""   /></td>
313                <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>   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>
314           </ tr>   389           </ tr>
315       </tabl e>   390       </tabl e>
316   </form>   391   </form>
317   <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>   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>
318       <?   393       <?
319   }   394   }
320     395  
321   function c reateNewEl ement( $so urce )   396   function c reateNewEl ement( $so urce )
322   {   397   {
323       global  $sTableNa me;   398       global  $sTableNa me;
324     399  
325       if( $s ource )   400       if( $s ource )
326       {   401       {
327            $ s ource Active   =   (int) db_ v a lue (   "SELECT   `Column`  
FROM   `$sTableNa me`   WHERE   `ID`=$sour ce"   );
  402            $ aS ource  
=  
db_
a ssoc_arr (   "SELECT   `Column` ,   `Func`   FROM   `$sTableNa me`   WHERE   `ID`=$sour ce"   );
328            if(   $ s ource Active   )   403            if(   $ aS ource ['Column']   )
329           {   404           {
    405                if( $aSo urce['Func '] == 'PFB lock' )
    406                    retu rn 0; // d o not let  copy profi le blocks
    407                
330                $sQuery  = "   408                $sQuery  = "
331                    INSE RT INTO `$ sTableName `   409                    INSE RT INTO `$ sTableName `
332                         ( `Title`,  `Desc`, ` Caption`,  `Func`, `C ontent`, ` Visible` )   410                         ( `Title`,  `Desc`, ` Caption`,  `Func`, `C ontent`, ` Visible` )
333                    SELE CT   411                    SELE CT
334                           `Title`,  `Desc`, ` Caption`,  `Func`, `C ontent`, ` Visible`   412                           `Title`,  `Desc`, ` Caption`,  `Func`, `C ontent`, ` Visible`
335                    FROM  `$sTableN ame`   413                    FROM  `$sTableN ame`
336                    WHER E `ID` = $ source   414                    WHER E `ID` = $ source
337                    ";   415                    ";
338                       416                    
339                db_res(  $sQuery );   417                db_res(  $sQuery );
340                   418                
341                $newID =  mysql_ins ert_id();   419                $newID =  mysql_ins ert_id();
342           }   420           }
343           el se   421           el se
344                 $newID   =   $source;
  422                 $newID   =   $source;   //return   the   source
345       }   423       }
346       else   424       else
347       {   425       {
348           $s Query = "   426           $s Query = "
349                INSERT I NTO `$sTab leName` SE T   427                INSERT I NTO `$sTab leName` SE T
350                    `Tit le` = 'NEW  BLOCK',   428                    `Tit le` = 'NEW  BLOCK',
351                    `Des c`  = 'Pla ce here yo ur custom  HTML-block ',   429                    `Des c`  = 'Pla ce here yo ur custom  HTML-block ',
352                    `Vis ible` = 'n on,memb',   430                    `Vis ible` = 'n on,memb',
353                    `Fun c`  = 'Ech o'   431                    `Fun c`  = 'Ech o'
354                ";   432                ";
355              433           
356           db _res( $sQu ery );   434           db _res( $sQu ery );
357              435           
358           $n ewID = mys ql_insert_ id();   436           $n ewID = mys ql_insert_ id();
359       }   437       }
360          438       
361       return  $newID;   439       return  $newID;
362   }   440   }
363     441  
364   function e choMenuEdi tMsg( $tex t, $color  = 'black'  )   442   function e choMenuEdi tMsg( $tex t, $color  = 'black'  )
365   {   443   {
366       ?>   444       ?>
367           <d iv onclick ="hideEdit Form();" s tyle="colo r:<?= $col or ?>;text -align:cen ter;"><?=  $text ?></ div>   445           <d iv onclick ="hideEdit Form();" s tyle="colo r:<?= $col or ?>;text -align:cen ter;"><?=  $text ?></ div>
368           <s cript type ="text/jav ascript">s etTimeout(  'hideEdit Form();',  1000 )</sc ript>   446           <s cript type ="text/jav ascript">s etTimeout(  'hideEdit Form();',  1000 )</sc ript>
369       <?   447       <?
370   }   448   }
371     449  
372   function s aveItem( $ id, $aItem  )   450   function s aveItem( $ id, $aItem  )
373   {   451   {
374       global  $sTableNa me;   452       global  $sTableNa me;
375     453  
376       $aOldI tem = db_a rr( "SELEC T * FROM ` $sTableNam e` WHERE ` ID`=$id" ) ;   454       $aOldI tem = db_a rr( "SELEC T * FROM ` $sTableNam e` WHERE ` ID`=$id" ) ;
377          455       
378       if( !$ aOldItem )   456       if( !$ aOldItem )
379           re turn echoM enuEditMsg ( 'Error.  Item not f ound', 're d' );   457           re turn echoM enuEditMsg ( 'Error.  Item not f ound', 're d' );
380          458       
381       $sQuer ySet = '';   459       $sQuer ySet = '';
382       foreac h( $aItem  as $field  => $value  )   460       foreac h( $aItem  as $field  => $value  )
383           $s QuerySet . = ", `$fie ld`='" . p rocess_db_ input( $va lue ) ."'" ;   461           $s QuerySet . = ", `$fie ld`='" . p rocess_db_ input( $va lue ) ."'" ;
384          462       
385       $sQuer ySet = sub str( $sQue rySet, 1 ) ;   463       $sQuer ySet = sub str( $sQue rySet, 1 ) ;
386          464       
387       $sQuer y = "UPDAT E `$sTable Name` SET  $sQuerySet  WHERE `ID ` = $id";   465       $sQuer y = "UPDAT E `$sTable Name` SET  $sQuerySet  WHERE `ID ` = $id";
388          466       
389       db_res ( $sQuery  );   467       db_res ( $sQuery  );
390          468       
391       $ret =  echoMenuE ditMsg( 'S aved', 'gr een' );   469       $ret =  echoMenuE ditMsg( 'S aved', 'gr een' );
392       $ret . = '<script  type="tex t/javascri pt">update Item( ' .  $id . ', \ '' . proce ss_db_inpu t( $aItem[ 'Title'] )  . '\' );< /script>';   470       $ret . = '<script  type="tex t/javascri pt">update Item( ' .  $id . ', \ '' . proce ss_db_inpu t( $aItem[ 'Title'] )  . '\' );< /script>';
393       return  $ret;   471       return  $ret;
394   }   472   }
395     473  
396   function d eleteItem(  $id )   474   function d eleteItem(  $id )
397   {   475   {
398       global  $sTableNa me;   476       global  $sTableNa me;
399     477  
400       if( !$ id )   478       if( !$ id )
401           re turn 'ID n ot specifi ed';   479           re turn 'ID n ot specifi ed';
402          480       
403       $aItem  = db_arr(  "SELECT *  FROM `$sT ableName`  WHERE `ID`  = $id" );   481       $aItem  = db_arr(  "SELECT *  FROM `$sT ableName`  WHERE `ID`  = $id" );
404          482       
405       if( !$ aItem )   483       if( !$ aItem )
406           re turn 'Item  not found ';   484           re turn 'Item  not found ';
407          485       
408       db_res ( "DELETE  FROM `$sTa bleName` W HERE `ID`  = $id" );   486       db_res ( "DELETE  FROM `$sTa bleName` W HERE `ID`  = $id" );
409          487       
410       if( my sql_affect ed_rows()  )   488       if( my sql_affect ed_rows()  )
411           re turn 'OK';   489           re turn 'OK';
412       else   490       else
413           re turn 'Unkn own error' ;   491           re turn 'Unkn own error' ;
414   }   492   }
415     493  
416   function u pdateLangF ile( $key,  $string )   494   function u pdateLangF ile( $key,  $string )
417   {   495   {
418       global  $sTableNa me;   496       global  $sTableNa me;
419     497  
420       $langN ame = getP aram( 'lan g_default'  );   498       $langN ame = getP aram( 'lan g_default'  );
421       $langI D = db_val ue( "SELEC T `ID` FRO M `Localiz ationLangu ages` WHER E `Name` =  '" . adds lashes( $l angName )  . "'" );   499       $langI D = db_val ue( "SELEC T `ID` FRO M `Localiz ationLangu ages` WHER E `Name` =  '" . adds lashes( $l angName )  . "'" );
422          500       
423       $keyID  = db_valu e( "SELECT  `ID` FROM  `Localiza tionKeys`  WHERE `Key ` = '" . p rocess_db_ input( $ke y ) . "'"  );   501       $keyID  = db_valu e( "SELECT  `ID` FROM  `Localiza tionKeys`  WHERE `Key ` = '" . p rocess_db_ input( $ke y ) . "'"  );
424       if( $k eyID )   502       if( $k eyID )
425       {   503       {
426           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" );   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" );
427       }   505       }
428       else   506       else
429       {   507       {
430           db _res( "INS ERT INTO ` Localizati onKeys` SE T `IDCateg ory` = 2,  `Key` = '"  . process _db_input(  $key ) .  "'" );   508           db _res( "INS ERT INTO ` Localizati onKeys` SE T `IDCateg ory` = 2,  `Key` = '"  . process _db_input(  $key ) .  "'" );
431           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 ) .  "'" );   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 ) .  "'" );
432       }   510       }
433          511       
434       compil eLanguage( $langID);   512       compil eLanguage( $langID);
435   }   513   }
436     514  
437     515  
438   function s aveOrders(  $sTop, $a Custom )   516   function s aveOrders(  $sTop, $a Custom )
439   {   517   {
440       global  $sTableNa me;   518       global  $sTableNa me;
441     519  
442       db_res ( "UPDATE  `$sTableNa me` SET `C olumn` = 0 , `Order`  = 0" );   520       db_res ( "UPDATE  `$sTableNa me` SET `C olumn` = 0 , `Order`  = 0" );
443          521       
444       $sTop  = trim( $s Top, ' ,'  );   522       $sTop  = trim( $s Top, ' ,'  );
445       $aTopI Ds = explo de( ',', $ sTop );   523       $aTopI Ds = explo de( ',', $ sTop );
446       foreac h( $aTopID s as $iCol  => $iID )   524       foreac h( $aTopID s as $iCol  => $iID )
447       {   525       {
448           $i ID = trim(  $iID, ' , ' );   526           $i ID = trim(  $iID, ' , ' );
449           $i ID = (int) $iID;   527           $i ID = (int) $iID;
450              528           
451           if ( !$iID )   529           if ( !$iID )
452                continue ;   530                continue ;
453              531           
454           $i Col ++;   532           $i Col ++;
455              533           
456           $s Custom = $ aCustom[$i ID];   534           $s Custom = $ aCustom[$i ID];
457              535           
458           $s Custom = t rim( $sCus tom, ' ,'  );   536           $s Custom = t rim( $sCus tom, ' ,'  );
459           $a CustomIDs  = explode(  ',', $sCu stom );   537           $a CustomIDs  = explode(  ',', $sCu stom );
460              538           
461           fo reach( $aC ustomIDs a s $iOrd =>  $iCID )   539           fo reach( $aC ustomIDs a s $iOrd =>  $iCID )
462           {   540           {
463                $iCID =  trim( $iCI D, ' ,' );   541                $iCID =  trim( $iCI D, ' ,' );
464                $iCID =  (int)$iCID ;   542                $iCID =  (int)$iCID ;
465                   543                
466                if( !$iC ID )   544                if( !$iC ID )
467                    cont inue;   545                    cont inue;
468                   546                
469                db_res(  "UPDATE `$ sTableName ` SET `Col umn` = $iC ol, `Order ` = $iOrd  WHERE `ID`  = $iCID"  );   547                db_res(  "UPDATE `$ sTableName ` SET `Col umn` = $iC ol, `Order ` = $iOrd  WHERE `ID`  = $iCID"  );
470           }   548           }
471       }   549       }
472   }   550   }
473     551  
474   ?>   552   ?>