53. File Comparison Report

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

53.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\install index.php Mon May 12 07:03:58 2008 UTC
2 Dolphin-v.6.1.2\install index.php Mon Jun 16 09:54:23 2008 UTC

53.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 8 3574
Changed 7 14
Inserted 0 0
Removed 0 0

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

53.4 Active regular expressions

No regular expressions were active.

53.5 Comparison detail

1   <?php   1   <?php
2     2  
3   /********* ********** ********** ********** ********** ********** ********** ******   3   /********* ********** ********** ********** ********** ********** ********** ******
4   *                              D olphin Sma rt Communi ty Builder   4   *                              D olphin Sma rt Communi ty Builder
5   *                                 --------- --------   5   *                                 --------- --------
6   *     begi n                 : M on Mar 23  2006   6   *     begi n                 : M on Mar 23  2006
7   *     copy right             : ( C) 2006 Bo onEx Group   7   *     copy right             : ( C) 2006 Bo onEx Group
8   *     webs ite               : h ttp://www. boonex.com /   8   *     webs ite               : h ttp://www. boonex.com /
9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder   9   * This fil e is part  of Dolphin  - Smart C ommunity B uilder
10   *   10   *
11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License.    11   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License. 
12   * http://c reativecom mons.org/l icenses/by /3.0/   12   * http://c reativecom mons.org/l icenses/by /3.0/
13   *   13   *
14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   14   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;
15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   15   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details.    16   * See the  Creative C ommons Att ribution 3 .0 License  for more  details. 
17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin   17   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin
18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   18   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
19   ********** ********** ********** ********** ********** ********** ********** *****/   19   ********** ********** ********** ********** ********** ********** ********** *****/
20     20  
21   error_repo rting(E_AL L & ~E_NOT ICE);   21   error_repo rting(E_AL L & ~E_NOT ICE);
22   set_magic_ quotes_run time(0);   22   set_magic_ quotes_run time(0);
23   ini_set('m agic_quote s_sybase',  0);   23   ini_set('m agic_quote s_sybase',  0);
24     24  
25     25  
26   /*-------- ---------- ---------- --*/   26   /*-------- ---------- ---------- --*/
27   /*-------- --Vars---- ---------- --*/   27   /*-------- --Vars---- ---------- --*/
28       $aConf  = array() ;   28       $aConf  = array() ;
29        $aConf['re lease']   =   '1 2 .0 5 .08';   29        $aConf['re lease']   =   '1 7 .0 6 .08';
30       $aConf ['iVersion '] = '6.1' ;   30       $aConf ['iVersion '] = '6.1' ;
31        $aConf['iP atch']   =   ' 1 ';   31        $aConf['iP atch']   =   ' 2 ';
32       $aConf ['dolFile' ] = '../in c/header.i nc.php';   32       $aConf ['dolFile' ] = '../in c/header.i nc.php';
33       $aConf ['periodic File'] = ' ../periodi c/periodic .file';   33       $aConf ['periodic File'] = ' ../periodi c/periodic .file';
34       $aConf ['cmdFile' ] = '../pe riodic/cmd .php';   34       $aConf ['cmdFile' ] = '../pe riodic/cmd .php';
35       $aConf ['notifies File'] = ' ../periodi c/notifies .php';   35       $aConf ['notifies File'] = ' ../periodi c/notifies .php';
36       $aConf ['cupidFil e'] = '../ periodic/c upid.php';   36       $aConf ['cupidFil e'] = '../ periodic/c upid.php';
37       $aConf ['confDir' ] = '../in c/';   37       $aConf ['confDir' ] = '../in c/';
38       $aConf ['rayHeade r'] = '../ ray/module s/global/i nc/header. inc.php';   38       $aConf ['rayHeade r'] = '../ ray/module s/global/i nc/header. inc.php';
39       $aConf ['headerTe mpl'] = << <EOS   39       $aConf ['headerTe mpl'] = << <EOS
40   <?   40   <?
41     41  
42   /********* ********** ********** ********** ********** ********** ********** ******   42   /********* ********** ********** ********** ********** ********** ********** ******
43   *                              D olphin Sma rt Communi ty Builder   43   *                              D olphin Sma rt Communi ty Builder
44   *                                 --------- --------   44   *                                 --------- --------
45   *     begi n                 : M on Mar 23  2006   45   *     begi n                 : M on Mar 23  2006
46   *     copy right             : ( C) 2006 Bo onEx Group   46   *     copy right             : ( C) 2006 Bo onEx Group
47   *     webs ite               : h ttp://www. boonex.com /   47   *     webs ite               : h ttp://www. boonex.com /
48   * This fil e is part  of Dolphin  - Smart C ommunity B uilder   48   * This fil e is part  of Dolphin  - Smart C ommunity B uilder
49   *   49   *
50   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License.    50   * Dolphin  is free so ftware. Th is work is  licensed  under a Cr eative Com mons Attri bution 3.0  License. 
51   * http://c reativecom mons.org/l icenses/by /3.0/   51   * http://c reativecom mons.org/l icenses/by /3.0/
52   *   52   *
53   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   53   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;
54   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   54   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
55   * See the  Creative C ommons Att ribution 3 .0 License  for more  details.    55   * See the  Creative C ommons Att ribution 3 .0 License  for more  details. 
56   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin   56   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Dolphin
57   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   57   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
58   ********** ********** ********** ********** ********** ********** ********** *****/   58   ********** ********** ********** ********** ********** ********** ********** *****/
59     59  
60   \$site['ve r']                =  '{$aConf[' iVersion'] }';   60   \$site['ve r']                =  '{$aConf[' iVersion'] }';
61   \$site['bu ild']              =  '{$aConf[' iPatch']}' ;   61   \$site['bu ild']              =  '{$aConf[' iPatch']}' ;
62   \$site['ti tle']              =  '%site_tit le%';   62   \$site['ti tle']              =  '%site_tit le%';
63   \$site['ur l']                =  "%site_url %";   63   \$site['ur l']                =  "%site_url %";
64   \$admin_di r                  =  "admin";   64   \$admin_di r                  =  "admin";
65   \$site['ur l_admin']          =  "{\$site[' url']}\$ad min_dir/";   65   \$site['ur l_admin']          =  "{\$site[' url']}\$ad min_dir/";
66   \$site['ur l_aff']            =  "{\$site[' url']}aff/ ";   66   \$site['ur l_aff']            =  "{\$site[' url']}aff/ ";
67   \$site['pr ofileImage ']      =  "{\$site[' url']}medi a/images/p rofile/";   67   \$site['pr ofileImage ']      =  "{\$site[' url']}medi a/images/p rofile/";
68   \$site['pr ofileBackg round'] =  "{\$site[' url']}medi a/images/p rofile_bg/ ";   68   \$site['pr ofileBackg round'] =  "{\$site[' url']}medi a/images/p rofile_bg/ ";
69   \$site['pr ofileSound ']      =  "{\$site[' url']}medi a/sound/";   69   \$site['pr ofileSound ']      =  "{\$site[' url']}medi a/sound/";
70   \$site['pr ofileVideo ']      =  "{\$site[' url']}medi a/video/";   70   \$site['pr ofileVideo ']      =  "{\$site[' url']}medi a/video/";
71   \$site['sh aringImage s']     =  "{\$site[' url']}medi a/images/s haringImag es/";   71   \$site['sh aringImage s']     =  "{\$site[' url']}medi a/images/s haringImag es/";
72     72  
73   \$site['me diaImages' ]       =  "{\$site[' url']}medi a/images/" ;   73   \$site['me diaImages' ]       =  "{\$site[' url']}medi a/images/" ;
74   \$site['ga llery']            =  "{\$site[' url']}medi a/images/g allery/";   74   \$site['ga llery']            =  "{\$site[' url']}medi a/images/g allery/";
75   \$site['fl ags']              =  "{\$site[' url']}medi a/images/f lags/";   75   \$site['fl ags']              =  "{\$site[' url']}medi a/images/f lags/";
76   \$site['bl ogImage']          =  "{\$site[' url']}medi a/images/b log/";   76   \$site['bl ogImage']          =  "{\$site[' url']}medi a/images/b log/";
77   \$site['sd atingImage ']      =  "{\$site[' url']}medi a/images/s dating/";   77   \$site['sd atingImage ']      =  "{\$site[' url']}medi a/images/s dating/";
78   \$site['sm iles']             =  "{\$site[' url']}medi a/images/s miles/";   78   \$site['sm iles']             =  "{\$site[' url']}medi a/images/s miles/";
79   \$site['ba nners']            =  "{\$site[' url']}medi a/images/b anners/";   79   \$site['ba nners']            =  "{\$site[' url']}medi a/images/b anners/";
80   \$site['im agesPromo' ]       =  "{\$site[' url']}medi a/images/p romo/";   80   \$site['im agesPromo' ]       =  "{\$site[' url']}medi a/images/p romo/";
81   \$site['tm p']                =  "{\$site[' url']}tmp/ ";   81   \$site['tm p']                =  "{\$site[' url']}tmp/ ";
82   \$site['pr eCheckout' ]       =  "{\$site[' url']}chec kout/pre_c heckout.ph p";   82   \$site['pr eCheckout' ]       =  "{\$site[' url']}chec kout/pre_c heckout.ph p";
83   \$site['pl ugins']            =  "{\$site[' url']}plug ins/";   83   \$site['pl ugins']            =  "{\$site[' url']}plug ins/";
84   \$site['ba se']               =  "{\$site[' url']}temp lates/base /";   84   \$site['ba se']               =  "{\$site[' url']}temp lates/base /";
85     85  
86     86  
87     87  
88     88  
89   \$site['em ail']              =  "%site_ema il%";   89   \$site['em ail']              =  "%site_ema il%";
90   \$site['em ail_notify ']      =  "%notify_e mail%";   90   \$site['em ail_notify ']      =  "%notify_e mail%";
91   \$site['bu gReportMai l']     =  "%bug_repo rt_email%" ;   91   \$site['bu gReportMai l']     =  "%bug_repo rt_email%" ;
92     92  
93     93  
94     94  
95   \$dir['roo t']                =  "%dir_root %";   95   \$dir['roo t']                =  "%dir_root %";
96   \$dir['inc ']                 =  "{\$dir['r oot']}inc/ ";   96   \$dir['inc ']                 =  "{\$dir['r oot']}inc/ ";
97   \$dir['pro fileImage' ]       =  "{\$dir['r oot']}medi a/images/p rofile/";   97   \$dir['pro fileImage' ]       =  "{\$dir['r oot']}medi a/images/p rofile/";
98   \$dir['pro fileBackgr ound']  =  "{\$dir['r oot']}medi a/images/p rofile_bg/ ";   98   \$dir['pro fileBackgr ound']  =  "{\$dir['r oot']}medi a/images/p rofile_bg/ ";
99   \$dir['pro fileSound' ]       =  "{\$dir['r oot']}medi a/sound/";   99   \$dir['pro fileSound' ]       =  "{\$dir['r oot']}medi a/sound/";
100   \$dir['pro fileVideo' ]       =  "{\$dir['r oot']}medi a/video/";   100   \$dir['pro fileVideo' ]       =  "{\$dir['r oot']}medi a/video/";
101   \$dir['sha ringImages ']      =  "{\$dir['r oot']}medi a/images/s haringImag es/";   101   \$dir['sha ringImages ']      =  "{\$dir['r oot']}medi a/images/s haringImag es/";
102     102  
103   \$dir['med iaImages']         =  "{\$dir['r oot']}medi a/images/" ;   103   \$dir['med iaImages']         =  "{\$dir['r oot']}medi a/images/" ;
104   \$dir['gal lery']             =  "{\$dir['r oot']}medi a/images/g allery/";   104   \$dir['gal lery']             =  "{\$dir['r oot']}medi a/images/g allery/";
105   \$dir['fla gs']               =  "{\$dir['r oot']}medi a/images/f lags/";   105   \$dir['fla gs']               =  "{\$dir['r oot']}medi a/images/f lags/";
106   \$dir['blo gImage']           =  "{\$dir['r oot']}medi a/images/b log/";   106   \$dir['blo gImage']           =  "{\$dir['r oot']}medi a/images/b log/";
107   \$dir['sda tingImage' ]       =  "{\$dir['r oot']}medi a/images/s dating/";   107   \$dir['sda tingImage' ]       =  "{\$dir['r oot']}medi a/images/s dating/";
108   \$dir['smi les']              =  "{\$dir['r oot']}medi a/images/s miles/";   108   \$dir['smi les']              =  "{\$dir['r oot']}medi a/images/s miles/";
109   \$dir['ban ners']             =  "{\$dir['r oot']}medi a/images/b anners/";   109   \$dir['ban ners']             =  "{\$dir['r oot']}medi a/images/b anners/";
110   \$dir['ima gesPromo']         =  "{\$dir['r oot']}medi a/images/p romo/";   110   \$dir['ima gesPromo']         =  "{\$dir['r oot']}medi a/images/p romo/";
111   \$dir['tmp ']                 =  "{\$dir['r oot']}tmp/ ";   111   \$dir['tmp ']                 =  "{\$dir['r oot']}tmp/ ";
112   \$dir['cac he']               =  "{\$dir['r oot']}cach e/";   112   \$dir['cac he']               =  "{\$dir['r oot']}cach e/";
113   \$dir['plu gins']             =  "{\$dir['r oot']}plug ins/";   113   \$dir['plu gins']             =  "{\$dir['r oot']}plug ins/";
114   \$dir['bas e']                =  "{\$dir['r oot']}temp lates/base /";   114   \$dir['bas e']                =  "{\$dir['r oot']}temp lates/base /";
115   \$dir['cla sses']             =  "{\$dir['i nc']}class es/";   115   \$dir['cla sses']             =  "{\$dir['i nc']}class es/";
116     116  
117   \$video_ex t                  =  'avi';   117   \$video_ex t                  =  'avi';
118   \$MOGRIFY                     =  "%dir_mogr ify%";   118   \$MOGRIFY                     =  "%dir_mogr ify%";
119   \$CONVERT                     =  "%dir_conv ert%";   119   \$CONVERT                     =  "%dir_conv ert%";
120   \$COMPOSIT E                  =  "%dir_comp osite%";   120   \$COMPOSIT E                  =  "%dir_comp osite%";
121   \$PHPBIN                      =  "%dir_php% ";   121   \$PHPBIN                      =  "%dir_php% ";
122     122  
123   \$db['host ']                 =  '%db_host% ';   123   \$db['host ']                 =  '%db_host% ';
124   \$db['sock ']                 =  '%db_sock% ';   124   \$db['sock ']                 =  '%db_sock% ';
125   \$db['port ']                 =  '%db_port% ';   125   \$db['port ']                 =  '%db_port% ';
126   \$db['user ']                 =  '%db_user% ';   126   \$db['user ']                 =  '%db_user% ';
127   \$db['pass wd']               =  '%db_passw ord%';   127   \$db['pass wd']               =  '%db_passw ord%';
128   \$db['db']                    =  '%db_name% ';   128   \$db['db']                    =  '%db_name% ';
129     129  
130     130  
131   define('BX _DIRECTORY _PATH_INC' , \$dir['i nc']);   131   define('BX _DIRECTORY _PATH_INC' , \$dir['i nc']);
132   define('BX _DIRECTORY _PATH_ROOT ', \$dir[' root']);   132   define('BX _DIRECTORY _PATH_ROOT ', \$dir[' root']);
133   define('BX _DIRECTORY _PATH_BASE ', \$dir[' base']);   133   define('BX _DIRECTORY _PATH_BASE ', \$dir[' base']);
134   define('BX _DIRECTORY _PATH_CACH E', \$dir[ 'cache']);   134   define('BX _DIRECTORY _PATH_CACH E', \$dir[ 'cache']);
135   define('BX _DIRECTORY _PATH_CLAS SES', \$di r['classes ']);   135   define('BX _DIRECTORY _PATH_CLAS SES', \$di r['classes ']);
136     136  
137   define('DA TABASE_HOS T', \$db[' host']);   137   define('DA TABASE_HOS T', \$db[' host']);
138   define('DA TABASE_SOC K', \$db[' sock']);   138   define('DA TABASE_SOC K', \$db[' sock']);
139   define('DA TABASE_POR T', \$db[' port']);   139   define('DA TABASE_POR T', \$db[' port']);
140   define('DA TABASE_USE R', \$db[' user']);   140   define('DA TABASE_USE R', \$db[' user']);
141   define('DA TABASE_PAS S', \$db[' passwd']);   141   define('DA TABASE_PAS S', \$db[' passwd']);
142   define('DA TABASE_NAM E', \$db[' db']);   142   define('DA TABASE_NAM E', \$db[' db']);
143     143  
144     144  
145     145  
146   //check sa fe_mode   146   //check sa fe_mode
147   if( (int)i ni_get( 's afe_mode'  ) )   147   if( (int)i ni_get( 's afe_mode'  ) )
148   {   148   {
149       echo ' <b>Warning .</b> Dolp hin cannot  work in s afe mode';   149       echo ' <b>Warning .</b> Dolp hin cannot  work in s afe mode';
150       exit;   150       exit;
151   }   151   }
152     152  
153   //check mb string   153   //check mb string
154   if( !exten sion_loade d( 'mbstri ng' ) ) {   154   if( !exten sion_loade d( 'mbstri ng' ) ) {
155       echo ' <b>Warning !</b> Dolp hin cannot  work with out <b>mbs tring</b>  extension.   155       echo ' <b>Warning !</b> Dolp hin cannot  work with out <b>mbs tring</b>  extension.
156           Pl ease go to  the   156           Pl ease go to  the
157           <a  href="htt p://www.bo onex.com/t rac/dolphi n/wiki/Gen DolTShoote r">Dolphin  Troublesh ooter</a>   157           <a  href="htt p://www.bo onex.com/t rac/dolphi n/wiki/Gen DolTShoote r">Dolphin  Troublesh ooter</a>
158           an d solve th e problem. ';   158           an d solve th e problem. ';
159       exit;   159       exit;
160   }   160   }
161     161  
162   //check co rrect host name   162   //check co rrect host name
163   \$aUrl = p arse_url(  \$site['ur l'] );   163   \$aUrl = p arse_url(  \$site['ur l'] );
164   if( isset( \$_SERVER[ 'HTTP_HOST ']) and \$ _SERVER['H TTP_HOST']  != \$aUrl ['host'] a nd \$_SERV ER['HTTP_H OST'] != \ $aUrl['hos t'] . ':80 ' )   164   if( isset( \$_SERVER[ 'HTTP_HOST ']) and \$ _SERVER['H TTP_HOST']  != \$aUrl ['host'] a nd \$_SERV ER['HTTP_H OST'] != \ $aUrl['hos t'] . ':80 ' )
165   {   165   {
166       header ( "Locatio n:http://{ \$aUrl['ho st']}{\$_S ERVER['REQ UEST_URI'] }" );   166       header ( "Locatio n:http://{ \$aUrl['ho st']}{\$_S ERVER['REQ UEST_URI'] }" );
167       exit;   167       exit;
168   }   168   }
169     169  
170     170  
171     171  
172   // check i f install  folder exi sts   172   // check i f install  folder exi sts
173   if ( file_ exists( \$ dir['root' ] . 'insta ll' ) )   173   if ( file_ exists( \$ dir['root' ] . 'insta ll' ) )
174   {   174   {
175       \$ret  = <<<EOJ   175       \$ret  = <<<EOJ
176   <!DOCTYPE  html PUBLI C "-//W3C/ /DTD XHTML  1.0 Trans itional//E N" "http:/ /www.w3.or g/TR/xhtml 1/DTD/xhtm l1-transit ional.dtd" >   176   <!DOCTYPE  html PUBLI C "-//W3C/ /DTD XHTML  1.0 Trans itional//E N" "http:/ /www.w3.or g/TR/xhtml 1/DTD/xhtm l1-transit ional.dtd" >
177       <html  xmlns="htt p://www.w3 .org/1999/ xhtml" xml :lang="en- US" lang=" en-US">   177       <html  xmlns="htt p://www.w3 .org/1999/ xhtml" xml :lang="en- US" lang=" en-US">
178           <h ead>   178           <h ead>
179                <title>D olphin Sma rt Communi ty Builder  Installed </title>   179                <title>D olphin Sma rt Communi ty Builder  Installed </title>
180                <link hr ef="instal l/general. css" rel=" stylesheet " type="te xt/css" />   180                <link hr ef="instal l/general. css" rel=" stylesheet " type="te xt/css" />
181                <meta ht tp-equiv=" Content-Ty pe" conten t="text/ht ml; charse t=UTF-8" / >   181                <meta ht tp-equiv=" Content-Ty pe" conten t="text/ht ml; charse t=UTF-8" / >
182           </ head>   182           </ head>
183           <b ody>   183           <b ody>
184                <div id= "main">   184                <div id= "main">
185                <div id= "header">   185                <div id= "header">
186                    <img  src="inst all/images /boonex_lo go.gif" al t="" /></d iv>   186                    <img  src="inst all/images /boonex_lo go.gif" al t="" /></d iv>
187                <div id= "content">   187                <div id= "content">
188                    <div  class="in stalled_pi c">   188                    <div  class="in stalled_pi c">
189                         <img alt=" Dolphin In stalled" s rc="instal l/images/d olphin_ins talled.jpg " />   189                         <img alt=" Dolphin In stalled" s rc="instal l/images/d olphin_ins talled.jpg " />
190                </div>   190                </div>
191     191  
192                <div cla ss="instal led_text">   192                <div cla ss="instal led_text">
193                    Plea se, remove  INSTALL d irectory f rom your s erver and  reload thi s page to  activate y our commun ity site.   193                    Plea se, remove  INSTALL d irectory f rom your s erver and  reload thi s page to  activate y our commun ity site.
194                </div>   194                </div>
195           </ body>   195           </ body>
196       </html >   196       </html >
197   EOJ;   197   EOJ;
198       echo \ $ret;   198       echo \ $ret;
199       exit() ;   199       exit() ;
200   }   200   }
201     201  
202   // set err or reporti ng level   202   // set err or reporti ng level
203   error_repo rting(E_AL L & ~E_NOT ICE);   203   error_repo rting(E_AL L & ~E_NOT ICE);
204   set_magic_ quotes_run time(0);   204   set_magic_ quotes_run time(0);
205   ini_set('m agic_quote s_sybase',  0);   205   ini_set('m agic_quote s_sybase',  0);
206     206  
207   // set def ault encod ing for mu ltibyte fu nctions   207   // set def ault encod ing for mu ltibyte fu nctions
208   mb_interna l_encoding ('UTF-8');   208   mb_interna l_encoding ('UTF-8');
209     209  
210   //--- Ray  Integratio n ---//   210   //--- Ray  Integratio n ---//
211   require_on ce(\$dir[' root'] . " ray/module s/global/i nc/header. inc.php");   211   require_on ce(\$dir[' root'] . " ray/module s/global/i nc/header. inc.php");
212   require_on ce(\$dir[' root'] . " ray/module s/global/i nc/content .inc.php") ;   212   require_on ce(\$dir[' root'] . " ray/module s/global/i nc/content .inc.php") ;
213   //--- Ray  Integratio n ---//   213   //--- Ray  Integratio n ---//
214   ?>   214   ?>
215   EOS;   215   EOS;
216     216  
217       $aConf ['periodic Templ'] =  <<<EOS   217       $aConf ['periodic Templ'] =  <<<EOS
218   MAILTO=%si te_email%   218   MAILTO=%si te_email%
219   0 0 * * *   %dir_php%  -q %dir_r oot%period ic/cmd.php   219   0 0 * * *   %dir_php%  -q %dir_r oot%period ic/cmd.php
220   */10 * * *  *  %dir_p hp% -q %di r_root%per iodic/noti fies.php   220   */10 * * *  *  %dir_p hp% -q %di r_root%per iodic/noti fies.php
221   * */1 * *  *  %dir_ph p% -q %dir _root%peri odic/cupid .php   221   * */1 * *  *  %dir_ph p% -q %dir _root%peri odic/cupid .php
222     222  
223   EOS;   223   EOS;
224     224  
225   //*/10 * *  * *  %dir _php% -q % dir_root%p eriodic/ta gs.php   225   //*/10 * *  * *  %dir _php% -q % dir_root%p eriodic/ta gs.php
226     226  
227     227  
228       $permD irectories  = array(   228       $permD irectories  = array(
229           'b ackup',   229           'b ackup',
230           'c ache',   230           'c ache',
231           'i nc',   231           'i nc',
232           'l angs',   232           'l angs',
233           'm edia/image s/classifi eds',   233           'm edia/image s/classifi eds',
234           'g roups/gall ery',   234           'g roups/gall ery',
235           'm edia/image s',   235           'm edia/image s',
236           'm edia/image s/banners' ,   236           'm edia/image s/banners' ,
237           'm edia/image s/blog',   237           'm edia/image s/blog',
238           'm edia/image s/gallery' ,   238           'm edia/image s/gallery' ,
239           'm edia/image s/profile' ,   239           'm edia/image s/profile' ,
240           'm edia/image s/profile_ bg',   240           'm edia/image s/profile_ bg',
241           'm edia/image s/sdating' ,   241           'm edia/image s/sdating' ,
242           'm edia/image s/promo',   242           'm edia/image s/promo',
243           'm edia/image s/promo/or iginal',   243           'm edia/image s/promo/or iginal',
244           'm edia/image s/sharingI mages',   244           'm edia/image s/sharingI mages',
245           'm edia/sound ',   245           'm edia/sound ',
246           'm edia/video ',   246           'm edia/video ',
247           'p eriodic',   247           'p eriodic',
248           't mp',   248           't mp',
249           'o rca/classe s',   249           'o rca/classe s',
250           'o rca/conf',   250           'o rca/conf',
251           'o rca/layout ',   251           'o rca/layout ',
252           'o rca/log',   252           'o rca/log',
253           'o rca/js',   253           'o rca/js',
254           'o rca/cachej s',   254           'o rca/cachej s',
255           'g roups/orca /classes',   255           'g roups/orca /classes',
256           'g roups/orca /layout',   256           'g roups/orca /layout',
257           'g roups/orca /log',   257           'g roups/orca /log',
258           'g roups/orca /js',   258           'g roups/orca /js',
259           'g roups/orca /cachejs',   259           'g roups/orca /cachejs',
260       );   260       );
261     261  
262       //'per iodic/tags .php',   262       //'per iodic/tags .php',
263       $permF iles = arr ay(   263       $permF iles = arr ay(
264           'p eriodic/cm d.php',   264           'p eriodic/cm d.php',
265           'p eriodic/no tifies.php ',   265           'p eriodic/no tifies.php ',
266           'p eriodic/cu pid.php',   266           'p eriodic/cu pid.php',
267           'i nc/prof.in c.php',   267           'i nc/prof.in c.php',
268           'i nc/params. inc.php',   268           'i nc/params. inc.php',
269           'i nc/db_cach ed/MenuCon tent.inc',   269           'i nc/db_cach ed/MenuCon tent.inc',
270           'i nc/db_cach ed/PageVie w.inc',   270           'i nc/db_cach ed/PageVie w.inc',
271           'i nc/db_cach ed/SiteSta t.inc',   271           'i nc/db_cach ed/SiteSta t.inc',
272           'i nc/db_cach ed/Profile Fields.inc '   272           'i nc/db_cach ed/Profile Fields.inc '
273       );   273       );
274     274  
275       $aRayF olders = a rray(   275       $aRayF olders = a rray(
276           'r ay/modules /board/fil es',   276           'r ay/modules /board/fil es',
277           'r ay/modules /chat/file s',   277           'r ay/modules /chat/file s',
278           'r ay/modules /im/files' ,   278           'r ay/modules /im/files' ,
279           'r ay/modules /movie/fil es',   279           'r ay/modules /movie/fil es',
280           'r ay/modules /mp3/files ',   280           'r ay/modules /mp3/files ',
281           'r ay/modules /music/fil es'   281           'r ay/modules /music/fil es'
282       );   282       );
283     283  
284       $aRayF iles = arr ay(   284       $aRayF iles = arr ay(
285           'r ay/modules /global/da ta/integra tion.dat',   285           'r ay/modules /global/da ta/integra tion.dat',
286           'r ay/modules /board/xml /config.xm l',   286           'r ay/modules /board/xml /config.xm l',
287           'r ay/modules /board/xml /langs.xml ',   287           'r ay/modules /board/xml /langs.xml ',
288           'r ay/modules /board/xml /main.xml' ,   288           'r ay/modules /board/xml /main.xml' ,
289           'r ay/modules /board/xml /skins.xml ',   289           'r ay/modules /board/xml /skins.xml ',
290           'r ay/modules /chat/xml/ config.xml ',   290           'r ay/modules /chat/xml/ config.xml ',
291           'r ay/modules /chat/xml/ langs.xml' ,   291           'r ay/modules /chat/xml/ langs.xml' ,
292           'r ay/modules /chat/xml/ main.xml',   292           'r ay/modules /chat/xml/ main.xml',
293           'r ay/modules /chat/xml/ skins.xml' ,   293           'r ay/modules /chat/xml/ skins.xml' ,
294           'r ay/modules /desktop/x ml/config. xml',   294           'r ay/modules /desktop/x ml/config. xml',
295           'r ay/modules /desktop/x ml/langs.x ml',   295           'r ay/modules /desktop/x ml/langs.x ml',
296           'r ay/modules /desktop/x ml/main.xm l',   296           'r ay/modules /desktop/x ml/main.xm l',
297           'r ay/modules /desktop/x ml/skins.x ml',   297           'r ay/modules /desktop/x ml/skins.x ml',
298           'r ay/modules /global/ap p/ffmpeg.e xe',   298           'r ay/modules /global/ap p/ffmpeg.e xe',
299           'r ay/modules /global/in c/cron.inc .php',   299           'r ay/modules /global/in c/cron.inc .php',
300           'r ay/modules /global/in c/header.i nc.php',   300           'r ay/modules /global/in c/header.i nc.php',
301           'r ay/modules /global/xm l/config.x ml',   301           'r ay/modules /global/xm l/config.x ml',
302           'r ay/modules /global/xm l/main.xml ',   302           'r ay/modules /global/xm l/main.xml ',
303           'r ay/modules /im/xml/co nfig.xml',   303           'r ay/modules /im/xml/co nfig.xml',
304           'r ay/modules /im/xml/la ngs.xml',   304           'r ay/modules /im/xml/la ngs.xml',
305           'r ay/modules /im/xml/ma in.xml',   305           'r ay/modules /im/xml/ma in.xml',
306           'r ay/modules /im/xml/sk ins.xml',   306           'r ay/modules /im/xml/sk ins.xml',
307           'r ay/modules /movie/xml /config.xm l',   307           'r ay/modules /movie/xml /config.xm l',
308           'r ay/modules /movie/xml /langs.xml ',   308           'r ay/modules /movie/xml /langs.xml ',
309           'r ay/modules /movie/xml /main.xml' ,   309           'r ay/modules /movie/xml /main.xml' ,
310           'r ay/modules /movie/xml /skins.xml ',   310           'r ay/modules /movie/xml /skins.xml ',
311           'r ay/modules /mp3/xml/c onfig.xml' ,   311           'r ay/modules /mp3/xml/c onfig.xml' ,
312           'r ay/modules /mp3/xml/l angs.xml',   312           'r ay/modules /mp3/xml/l angs.xml',
313           'r ay/modules /mp3/xml/m ain.xml',   313           'r ay/modules /mp3/xml/m ain.xml',
314           'r ay/modules /mp3/xml/s kins.xml',   314           'r ay/modules /mp3/xml/s kins.xml',
315           'r ay/modules /music/xml /config.xm l',   315           'r ay/modules /music/xml /config.xm l',
316           'r ay/modules /music/xml /langs.xml ',   316           'r ay/modules /music/xml /langs.xml ',
317           'r ay/modules /music/xml /main.xml' ,   317           'r ay/modules /music/xml /main.xml' ,
318           'r ay/modules /music/xml /skins.xml ',   318           'r ay/modules /music/xml /skins.xml ',
319           'r ay/modules /presence/ xml/config .xml',   319           'r ay/modules /presence/ xml/config .xml',
320           'r ay/modules /presence/ xml/langs. xml',   320           'r ay/modules /presence/ xml/langs. xml',
321           'r ay/modules /presence/ xml/main.x ml',   321           'r ay/modules /presence/ xml/main.x ml',
322           'r ay/modules /presence/ xml/skins. xml',   322           'r ay/modules /presence/ xml/skins. xml',
323           'r ay/modules /shoutbox/ xml/config .xml',   323           'r ay/modules /shoutbox/ xml/config .xml',
324           'r ay/modules /shoutbox/ xml/langs. xml',   324           'r ay/modules /shoutbox/ xml/langs. xml',
325           'r ay/modules /shoutbox/ xml/main.x ml',   325           'r ay/modules /shoutbox/ xml/main.x ml',
326           'r ay/modules /shoutbox/ xml/skins. xml',   326           'r ay/modules /shoutbox/ xml/skins. xml',
327           'r ay/modules /video/xml /config.xm l',   327           'r ay/modules /video/xml /config.xm l',
328           'r ay/modules /video/xml /langs.xml ',   328           'r ay/modules /video/xml /langs.xml ',
329           'r ay/modules /video/xml /main.xml' ,   329           'r ay/modules /video/xml /main.xml' ,
330           'r ay/modules /video/xml /skins.xml '   330           'r ay/modules /video/xml /skins.xml '
331       );   331       );
332          332       
333       $rever salDirecto ries = arr ay(   333       $rever salDirecto ries = arr ay(
334           'i nc',   334           'i nc',
335           'p eriodic'   335           'p eriodic'
336       );   336       );
337     337  
338       //'per iodic/tags .php',   338       //'per iodic/tags .php',
339       $rever salFiles =  array(   339       $rever salFiles =  array(
340           'p eriodic/cm d.php',   340           'p eriodic/cm d.php',
341           'p eriodic/no tifies.php ',   341           'p eriodic/no tifies.php ',
342           'p eriodic/cu pid.php',   342           'p eriodic/cu pid.php',
343           'r ay/modules /global/in c/header.i nc.php',   343           'r ay/modules /global/in c/header.i nc.php',
344       );   344       );
345     345  
346       $confF irst = arr ay();   346       $confF irst = arr ay();
347       $confF irst['site _url'] = a rray(   347       $confF irst['site _url'] = a rray(
348       name = > "Site UR L",   348       name = > "Site UR L",
349       ex =>  "http://ww w.mydomain .com/path/ ",   349       ex =>  "http://ww w.mydomain .com/path/ ",
350       desc = > "Your si te URL her e (backsla sh at the  end requir ed)",   350       desc = > "Your si te URL her e (backsla sh at the  end requir ed)",
351       def =>  "http://" ,   351       def =>  "http://" ,
352       def_ex p => '   352       def_ex p => '
353            $str   =   "http://". $_SERVER[\ 'HTTP_HOST \'].$_SERV ER[\' SCRI P T _ NAM E
\'];
  353            $str   =   "http://". $_SERVER[\ 'HTTP_HOST \'].$_SERV ER[\'
P HP _ S E LF \'];
354           re turn preg_ replace("/ install\/( index\.php $)/","",$s tr);',   354           re turn preg_ replace("/ install\/( index\.php $)/","",$s tr);',
355       check  => 'return  strlen($a rg0) >= 10  ? true :  false;'   355       check  => 'return  strlen($a rg0) >= 10  ? true :  false;'
356       );   356       );
357       $confF irst['dir_ root'] = a rray(   357       $confF irst['dir_ root'] = a rray(
358       name = > "Directo ry root",   358       name = > "Directo ry root",
359       ex =>  "/path/to/ your/scrip t/files/",   359       ex =>  "/path/to/ your/scrip t/files/",
360       desc = > "Path to  directory  where you r php scri pt files s tored.",   360       desc = > "Path to  directory  where you r php scri pt files s tored.",
361       def_ex p => '   361       def_ex p => '
362            $str   =   $_SERVER[\ 'DOCUMENT_ ROOT\'].$_ SERVER[\' SCRI P T _ NAM E
\'];
  362            $str   =   $_SERVER[\ 'DOCUMENT_ ROOT\'].$_ SERVER[\'
P HP _ S E LF \'];
363           re turn preg_ replace("/ install\/( index\.php $)/","",$s tr);',   363           re turn preg_ replace("/ install\/( index\.php $)/","",$s tr);',
364       check  => 'return  strlen($a rg0) >= 1  ? true : f alse;'   364       check  => 'return  strlen($a rg0) >= 1  ? true : f alse;'
365       );   365       );
366       $confF irst['dir_ php'] = ar ray(   366       $confF irst['dir_ php'] = ar ray(
367       name = > "Path to  php binar y",   367       name = > "Path to  php binar y",
368       ex =>  "/usr/loca l/bin/php" ,   368       ex =>  "/usr/loca l/bin/php" ,
369       desc = > "You sho uld specif y full pat h to your  PHP interp reter here .",   369       desc = > "You sho uld specif y full pat h to your  PHP interp reter here .",
370       def =>  "/usr/loc al/bin/php ",   370       def =>  "/usr/loc al/bin/php ",
371       def_ex p => "   371       def_ex p => "
372           if  ( file_ex ists(\"/us r/local/bi n/php\") )  return \" /usr/local /bin/php\" ;   372           if  ( file_ex ists(\"/us r/local/bi n/php\") )  return \" /usr/local /bin/php\" ;
373           \$ fp = popen  ( \"where is php\",  \"r\");   373           \$ fp = popen  ( \"where is php\",  \"r\");
374           if  ( \$fp )   374           if  ( \$fp )
375           {   375           {
376                \$s = fg ets(\$fp);   376                \$s = fg ets(\$fp);
377                \$s = ss canf(\$s,  \"php: %s\ ");   377                \$s = ss canf(\$s,  \"php: %s\ ");
378                if ( fil e_exists(\ "\$s[0]\")  ) return  \"\$s[0]\" ;   378                if ( fil e_exists(\ "\$s[0]\")  ) return  \"\$s[0]\" ;
379           }   379           }
380           re turn '';",   380           re turn '';",
381       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'   381       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'
382       );   382       );
383     383  
384       $confF irst['dir_ mogrify']  = array(   384       $confF irst['dir_ mogrify']  = array(
385       name = > "Path to  mogrify",   385       name = > "Path to  mogrify",
386       ex =>  "/usr/loca l/bin/mogr ify",   386       ex =>  "/usr/loca l/bin/mogr ify",
387       desc = > "If mogr ify binary  doesn't e xist pleas e install  <a href='h ttp://www. imagemagic k.org/'>Im ageMagick< /a>",   387       desc = > "If mogr ify binary  doesn't e xist pleas e install  <a href='h ttp://www. imagemagic k.org/'>Im ageMagick< /a>",
388       def =>  "/usr/loc al/bin/mog rify",   388       def =>  "/usr/loc al/bin/mog rify",
389       def_ex p => "   389       def_ex p => "
390           if  ( file_ex ists(\"/us r/X11R6/bi n/mogrify\ ") ) retur n \"/usr/X 11R6/bin/m ogrify\";   390           if  ( file_ex ists(\"/us r/X11R6/bi n/mogrify\ ") ) retur n \"/usr/X 11R6/bin/m ogrify\";
391           if  ( file_ex ists(\"/us r/local/bi n/mogrify\ ") ) retur n \"/usr/l ocal/bin/m ogrify\";   391           if  ( file_ex ists(\"/us r/local/bi n/mogrify\ ") ) retur n \"/usr/l ocal/bin/m ogrify\";
392           if  ( file_ex ists(\"/us r/bin/mogr ify\") ) r eturn \"/u sr/bin/mog rify\";   392           if  ( file_ex ists(\"/us r/bin/mogr ify\") ) r eturn \"/u sr/bin/mog rify\";
393           if  ( file_ex ists(\"/us r/local/X1 1R6/bin/mo grify\") )  return \" /usr/local /X11R6/bin /mogrify\" ;   393           if  ( file_ex ists(\"/us r/local/X1 1R6/bin/mo grify\") )  return \" /usr/local /X11R6/bin /mogrify\" ;
394           if  ( file_ex ists(\"/us r/bin/X11/ mogrify\")  ) return  \"/usr/bin /X11/mogri fy\";   394           if  ( file_ex ists(\"/us r/bin/X11/ mogrify\")  ) return  \"/usr/bin /X11/mogri fy\";
395           re turn '';",   395           re turn '';",
396       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'   396       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'
397       );   397       );
398     398  
399   $confFirst ['dir_conv ert'] = ar ray(   399   $confFirst ['dir_conv ert'] = ar ray(
400       name = > "Path to  convert",   400       name = > "Path to  convert",
401       ex =>  "/usr/loca l/bin/conv ert",   401       ex =>  "/usr/loca l/bin/conv ert",
402       desc = > "If conv ert binary  doesn't e xist pleas e install  <a href='h ttp://www. imagemagic k.org/'>Im ageMagick< /a>",   402       desc = > "If conv ert binary  doesn't e xist pleas e install  <a href='h ttp://www. imagemagic k.org/'>Im ageMagick< /a>",
403       def =>  "/usr/loc al/bin/con vert",   403       def =>  "/usr/loc al/bin/con vert",
404       def_ex p => "   404       def_ex p => "
405           if  ( file_ex ists(\"/us r/X11R6/bi n/convert\ ") ) retur n \"/usr/X 11R6/bin/c onvert\";   405           if  ( file_ex ists(\"/us r/X11R6/bi n/convert\ ") ) retur n \"/usr/X 11R6/bin/c onvert\";
406           if  ( file_ex ists(\"/us r/local/bi n/convert\ ") ) retur n \"/usr/l ocal/bin/c onvert\";   406           if  ( file_ex ists(\"/us r/local/bi n/convert\ ") ) retur n \"/usr/l ocal/bin/c onvert\";
407           if  ( file_ex ists(\"/us r/bin/conv ert\") ) r eturn \"/u sr/bin/con vert\";   407           if  ( file_ex ists(\"/us r/bin/conv ert\") ) r eturn \"/u sr/bin/con vert\";
408           if  ( file_ex ists(\"/us r/local/X1 1R6/bin/co nvert\") )  return \" /usr/local /X11R6/bin /convert\" ;   408           if  ( file_ex ists(\"/us r/local/X1 1R6/bin/co nvert\") )  return \" /usr/local /X11R6/bin /convert\" ;
409           if  ( file_ex ists(\"/us r/bin/X11/ convert\")  ) return  \"/usr/bin /X11/conve rt\";   409           if  ( file_ex ists(\"/us r/bin/X11/ convert\")  ) return  \"/usr/bin /X11/conve rt\";
410           re turn '';",   410           re turn '';",
411       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'   411       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'
412       );   412       );
413     413  
414   $confFirst ['dir_comp osite'] =  array(   414   $confFirst ['dir_comp osite'] =  array(
415       name = > "Path to  composite ",   415       name = > "Path to  composite ",
416       ex =>  "/usr/loca l/bin/comp osite",   416       ex =>  "/usr/loca l/bin/comp osite",
417       desc = > "If comp osite bina ry doesn't  exist ple ase instal l <a href= 'http://ww w.imagemag ick.org/'> ImageMagic k</a>",   417       desc = > "If comp osite bina ry doesn't  exist ple ase instal l <a href= 'http://ww w.imagemag ick.org/'> ImageMagic k</a>",
418       def =>  "/usr/loc al/bin/com posite",   418       def =>  "/usr/loc al/bin/com posite",
419       def_ex p => "   419       def_ex p => "
420           if  ( file_ex ists(\"/us r/X11R6/bi n/composit e\") ) ret urn \"/usr /X11R6/bin /composite \";   420           if  ( file_ex ists(\"/us r/X11R6/bi n/composit e\") ) ret urn \"/usr /X11R6/bin /composite \";
421           if  ( file_ex ists(\"/us r/local/bi n/composit e\") ) ret urn \"/usr /local/bin /composite \";   421           if  ( file_ex ists(\"/us r/local/bi n/composit e\") ) ret urn \"/usr /local/bin /composite \";
422           if  ( file_ex ists(\"/us r/bin/comp osite\") )  return \" /usr/bin/c omposite\" ;   422           if  ( file_ex ists(\"/us r/bin/comp osite\") )  return \" /usr/bin/c omposite\" ;
423           if  ( file_ex ists(\"/us r/local/X1 1R6/bin/co mposite\")  ) return  \"/usr/loc al/X11R6/b in/composi te\";   423           if  ( file_ex ists(\"/us r/local/X1 1R6/bin/co mposite\")  ) return  \"/usr/loc al/X11R6/b in/composi te\";
424           if  ( file_ex ists(\"/us r/bin/X11/ composite\ ") ) retur n \"/usr/b in/X11/com posite\";   424           if  ( file_ex ists(\"/us r/bin/X11/ composite\ ") ) retur n \"/usr/b in/X11/com posite\";
425           re turn '';",   425           re turn '';",
426       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'   426       check  => 'return  strlen($a rg0) >= 7  ? true : f alse;'
427       );   427       );
428     428  
429       $aDbCo nf = array ();   429       $aDbCo nf = array ();
430       $aDbCo nf['sql_fi le'] = arr ay(   430       $aDbCo nf['sql_fi le'] = arr ay(
431           na me => "SQL  file",   431           na me => "SQL  file",
432           ex  => "/home /dolphin/p ublic_html /install/s ql/vXX.sql ",   432           ex  => "/home /dolphin/p ublic_html /install/s ql/vXX.sql ",
433           de sc => "SQL  file loca tion",   433           de sc => "SQL  file loca tion",
434           de f => "./sq l/vXX.sql" ,   434           de f => "./sq l/vXX.sql" ,
435           de f_exp => '   435           de f_exp => '
436                if ( !(  $dir = ope ndir( "sql /" ) ) )   436                if ( !(  $dir = ope ndir( "sql /" ) ) )
437                    retu rn "";   437                    retu rn "";
438                while (f alse !== ( $file = re addir($dir )))   438                while (f alse !== ( $file = re addir($dir )))
439                    {   439                    {
440                    if (  substr($f ile,-3) !=  \'sql\' )  continue;   440                    if (  substr($f ile,-3) !=  \'sql\' )  continue;
441                    clos edir( $dir  );   441                    clos edir( $dir  );
442                    retu rn "./sql/ $file";   442                    retu rn "./sql/ $file";
443                }   443                }
444                closedir ( $dir );   444                closedir ( $dir );
445                return " ";',   445                return " ";',
446           ch eck => 're turn strle n($arg0) > = 4 ? true  : false;'   446           ch eck => 're turn strle n($arg0) > = 4 ? true  : false;'
447       );   447       );
448     448  
449       $aDbCo nf['db_hos t'] = arra y(   449       $aDbCo nf['db_hos t'] = arra y(
450           na me => "Dat abase host  name",   450           na me => "Dat abase host  name",
451           ex  => "local host",   451           ex  => "local host",
452           de sc => "You r MySQL da tabase hos t name her e.",   452           de sc => "You r MySQL da tabase hos t name her e.",
453           de f => "loca lhost",   453           de f => "loca lhost",
454           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'   454           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'
455       );   455       );
456     456  
457       $aDbCo nf['db_por t'] = arra y(   457       $aDbCo nf['db_por t'] = arra y(
458           na me => "Dat abase host  port numb er",   458           na me => "Dat abase host  port numb er",
459           ex  => "5506" ,   459           ex  => "5506" ,
460           de sc => "Lea ve blank o r specify  MySQL Data base host  port numbe r.",   460           de sc => "Lea ve blank o r specify  MySQL Data base host  port numbe r.",
461           de f => "",   461           de f => "",
462           ch eck => ''   462           ch eck => ''
463       );   463       );
464          464       
465       $aDbCo nf['db_soc k'] = arra y(   465       $aDbCo nf['db_soc k'] = arra y(
466           na me => "Dat abase sock et path",   466           na me => "Dat abase sock et path",
467           ex  => "/tmp/ mysql50.so ck",   467           ex  => "/tmp/ mysql50.so ck",
468           de sc => "Lea ve blank o r specify  MySQL Data base socke t path.",   468           de sc => "Lea ve blank o r specify  MySQL Data base socke t path.",
469           de f => "",   469           de f => "",
470           ch eck => ''   470           ch eck => ''
471       );   471       );
472          472       
473       $aDbCo nf['db_nam e'] = arra y(   473       $aDbCo nf['db_nam e'] = arra y(
474           na me => "Dat abase name ",   474           na me => "Dat abase name ",
475           ex  => "YourD atabaseNam e",   475           ex  => "YourD atabaseNam e",
476           de sc => "You r MySQL da tabase nam e here.",   476           de sc => "You r MySQL da tabase nam e here.",
477           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'   477           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'
478       );   478       );
479     479  
480       $aDbCo nf['db_use r'] = arra y(   480       $aDbCo nf['db_use r'] = arra y(
481           na me => "Dat abase user ",   481           na me => "Dat abase user ",
482           ex  => "YourN ame",   482           ex  => "YourN ame",
483           de sc => "You r MySQL da tabase rea d/write us er name he re.",   483           de sc => "You r MySQL da tabase rea d/write us er name he re.",
484           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'   484           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'
485       );   485       );
486     486  
487       $aDbCo nf['db_pas sword'] =  array(   487       $aDbCo nf['db_pas sword'] =  array(
488           na me => "Dat abase pass word",   488           na me => "Dat abase pass word",
489           ex  => "YourP assword",   489           ex  => "YourP assword",
490           de sc => "You r MySQL da tabase pas sword here .",   490           de sc => "You r MySQL da tabase pas sword here .",
491           ch eck => 're turn strle n($arg0) > = 0 ? true  : false;'   491           ch eck => 're turn strle n($arg0) > = 0 ? true  : false;'
492       );   492       );
493       $aGene ral = arra y();   493       $aGene ral = arra y();
494       $aGene ral['site_ title'] =  array(   494       $aGene ral['site_ title'] =  array(
495           na me => "Sit e Title",   495           na me => "Sit e Title",
496           ex  => "The B est Commun ity",   496           ex  => "The B est Commun ity",
497           de sc => "The  name of y our site",   497           de sc => "The  name of y our site",
498           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'   498           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'
499       );   499       );
500       $aGene ral['site_ email'] =  array(   500       $aGene ral['site_ email'] =  array(
501           na me => "Sit e e-mail",   501           na me => "Sit e e-mail",
502           ex  => "your@ email.here ",   502           ex  => "your@ email.here ",
503           de sc => "You r site e-m ail.",   503           de sc => "You r site e-m ail.",
504           ch eck => 're turn strle n($arg0) >  0 AND str str($arg0, "@") ? tru e : false; '   504           ch eck => 're turn strle n($arg0) >  0 AND str str($arg0, "@") ? tru e : false; '
505       );   505       );
506       $aGene ral['notif y_email']  = array(   506       $aGene ral['notif y_email']  = array(
507           na me => "Not ify e-mail ",   507           na me => "Not ify e-mail ",
508           ex  => "your@ email.here ",   508           ex  => "your@ email.here ",
509           de sc => "Env elope \"Fr om:\" addr ess for no tification  messages" ,   509           de sc => "Env elope \"Fr om:\" addr ess for no tification  messages" ,
510           ch eck => 're turn strle n($arg0) >  0 AND str str($arg0, "@") ? tru e : false; '   510           ch eck => 're turn strle n($arg0) >  0 AND str str($arg0, "@") ? tru e : false; '
511       );   511       );
512       $aGene ral['bug_r eport_emai l'] = arra y(   512       $aGene ral['bug_r eport_emai l'] = arra y(
513           na me => "Bug  report em ail",   513           na me => "Bug  report em ail",
514           ex  => "your@ email.here ",   514           ex  => "your@ email.here ",
515           de sc => "You r email fo r receivin g bug repo rts.",   515           de sc => "You r email fo r receivin g bug repo rts.",
516           ch eck => 're turn strle n($arg0) >  0 AND str str($arg0, "@") ? tru e : false; '   516           ch eck => 're turn strle n($arg0) >  0 AND str str($arg0, "@") ? tru e : false; '
517       );   517       );
518       $aGene ral['admin _username' ] = array(   518       $aGene ral['admin _username' ] = array(
519           na me => "Adm in Usernam e",   519           na me => "Adm in Usernam e",
520           ex  => "admin ",   520           ex  => "admin ",
521           de sc => "Spe cify the a dmin name  here",   521           de sc => "Spe cify the a dmin name  here",
522           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'   522           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'
523           );   523           );
524       $aGene ral['admin _password' ] = array(   524       $aGene ral['admin _password' ] = array(
525           na me => "Adm in Passwor d",   525           na me => "Adm in Passwor d",
526           ex  => "dolph in",   526           ex  => "dolph in",
527           de sc => "Spe cify the a dmin passw ord here",   527           de sc => "Spe cify the a dmin passw ord here",
528           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'   528           ch eck => 're turn strle n($arg0) > = 1 ? true  : false;'
529           );   529           );
530     530  
531   /*-------- --Vars---- ---------- --*/   531   /*-------- --Vars---- ---------- --*/
532   /*-------- ---------- ---------- --*/   532   /*-------- ---------- ---------- --*/
533     533  
534     534  
535   $sAction =  $_REQUEST ['action'] ;   535   $sAction =  $_REQUEST ['action'] ;
536   $sError =  '';   536   $sError =  '';
537     537  
538   $cont = Pa geContent(  $sError ) ;   538   $cont = Pa geContent(  $sError ) ;
539     539  
540   mb_interna l_encoding ('UTF-8');   540   mb_interna l_encoding ('UTF-8');
541     541  
542   echo PageH eader( $sA ction, $sE rror );   542   echo PageH eader( $sA ction, $sE rror );
543   echo $cont ;   543   echo $cont ;
544   echo PageF ooter( $sA ction );   544   echo PageF ooter( $sA ction );
545     545  
546   function P ageContent ( &$sError  )   546   function P ageContent ( &$sError  )
547   {   547   {
548       global  $aConf, $ permDirect ories, $pe rmFiles, $ reversalDi rectories,  $reversal Files;   548       global  $aConf, $ permDirect ories, $pe rmFiles, $ reversalDi rectories,  $reversal Files;
549       global  $confFirs t, $aDbCon f, $aGener al, $aRayF olders, $a RayFiles;   549       global  $confFirs t, $aDbCon f, $aGener al, $aRayF olders, $a RayFiles;
550     550  
551       $ret =  '';   551       $ret =  '';
552       switch ( $_REQUES T['action' ] )   552       switch ( $_REQUES T['action' ] )
553       {   553       {
554           ca se 'step7' :   554           ca se 'step7' :
555                $ret .=  loadDolphi n();   555                $ret .=  loadDolphi n();
556                break;   556                break;
557                   557                
558           ca se 'step6' :   558           ca se 'step6' :
559                $dirName  = '';   559                $dirName  = '';
560                $fileNam e = '';   560                $fileNam e = '';
561                $errorMe ssage = '' ;   561                $errorMe ssage = '' ;
562     562  
563                foreach  ($reversal Directorie s as $dir)   563                foreach  ($reversal Directorie s as $dir)
564                {   564                {
565                    if (  isFullAcc essible('. ./'.$dir)  )   565                    if (  isFullAcc essible('. ./'.$dir)  )
566                    {   566                    {
567                         //$passOk  = false;   567                         //$passOk  = false;
568                         $dirName . = '&nbsp;& nbsp;&nbsp ;' . $dir  . ';<br /> ';   568                         $dirName . = '&nbsp;& nbsp;&nbsp ;' . $dir  . ';<br /> ';
569                    }   569                    }
570                }   570                }
571                if( strl en( $dirNa me ) )   571                if( strl en( $dirNa me ) )
572                {   572                {
573                    $sEr ror = 'err or';   573                    $sEr ror = 'err or';
574                    $err orMessage  .= '<stron g>Next dir ectories h ave inappr opriate pe rmissions< /strong>:< br />' . $ dirName;   574                    $err orMessage  .= '<stron g>Next dir ectories h ave inappr opriate pe rmissions< /strong>:< br />' . $ dirName;
575                }   575                }
576                foreach  ( $reversa lFiles as  $file )   576                foreach  ( $reversa lFiles as  $file )
577                {   577                {
578                    if (  isRWAcces sible ('.. /'.$file)  )   578                    if (  isRWAcces sible ('.. /'.$file)  )
579                    {   579                    {
580                         //$passOk  = false;   580                         //$passOk  = false;
581                         $fileName  .= '&nbsp; &nbsp;&nbs p;' . $fil e . ';<br  /> ';   581                         $fileName  .= '&nbsp; &nbsp;&nbs p;' . $fil e . ';<br  /> ';
582                    }   582                    }
583                }   583                }
584                if( strl en( $fileN ame ) )   584                if( strl en( $fileN ame ) )
585                {   585                {
586                    $sEr ror = 'err or';   586                    $sEr ror = 'err or';
587                    $err orMessage  .= '<stron g>Next fil es have in appropriat e permissi ons</stron g>:<br />'  . $fileNa me;   587                    $err orMessage  .= '<stron g>Next fil es have in appropriat e permissi ons</stron g>:<br />'  . $fileNa me;
588                }   588                }
589     589  
590                if( strl en( $error Message )  )   590                if( strl en( $error Message )  )
591                {   591                {
592                    $ret  .= showPe rmissions  ( $errorMe ssage );   592                    $ret  .= showPe rmissions  ( $errorMe ssage );
593                }   593                }
594                else   594                else
595                {   595                {
596                    $ret  .= loadDo lphin();   596                    $ret  .= loadDo lphin();
597                }   597                }
598           br eak;   598           br eak;
599              599           
600              600           
601              601           
602           ca se 'step5' :   602           ca se 'step5' :
603                $ret .=  showPermis sions();   603                $ret .=  showPermis sions();
604           br eak;   604           br eak;
605     605  
606           ca se 'step4' :   606           ca se 'step4' :
607                $errorMe ssage = '' ;   607                $errorMe ssage = '' ;
608                foreach  ( $aGenera l as $key  => $value  )   608                foreach  ( $aGenera l as $key  => $value  )
609                {   609                {
610                    if (  !strlen($ value['che ck']) ) co ntinue;   610                    if (  !strlen($ value['che ck']) ) co ntinue;
611                    $fun cbody = $v alue['chec k'];   611                    $fun cbody = $v alue['chec k'];
612                    $fun c = create _function( '$arg0', $ funcbody);   612                    $fun c = create _function( '$arg0', $ funcbody);
613     613  
614                    if (  !$func($_ POST[$key] ) )   614                    if (  !$func($_ POST[$key] ) )
615                    {   615                    {
616                         $errorMess age .= "Pl ease, inpu t valid da ta to <b>{ $value['na me']}</b>  field<br / >";   616                         $errorMess age .= "Pl ease, inpu t valid da ta to <b>{ $value['na me']}</b>  field<br / >";
617                         $error_arr [$key] = 1 ;   617                         $error_arr [$key] = 1 ;
618                         $passOk =  false;   618                         $passOk =  false;
619                         unset($_PO ST[$key]);   619                         unset($_PO ST[$key]);
620                    }   620                    }
621                    else   621                    else
622                         $error_arr [$key] = 0 ;   622                         $error_arr [$key] = 0 ;
623                    $con fig_arr[$k ey]['def']  = $_POST[ $key];   623                    $con fig_arr[$k ey]['def']  = $_POST[ $key];
624                }   624                }
625     625  
626                if( strl en( $error Message )  )   626                if( strl en( $error Message )  )
627                {   627                {
628                    $sEr ror = 'err or';   628                    $sEr ror = 'err or';
629                    $ret  .= instal lGeneralIn fo( $error Message );   629                    $ret  .= instal lGeneralIn fo( $error Message );
630                }   630                }
631                else   631                else
632                {   632                {
633                    $ret  .= instal lFinish();   633                    $ret  .= instal lFinish();
634                }   634                }
635           br eak;   635           br eak;
636              636           
637           ca se 'step3' :   637           ca se 'step3' :
638                $errorMe ssage = '' ;   638                $errorMe ssage = '' ;
639                foreach  ( $aDbConf  as $key = > $value )   639                foreach  ( $aDbConf  as $key = > $value )
640                {   640                {
641                    if (  !strlen($ value['che ck']) )   641                    if (  !strlen($ value['che ck']) )
642                         continue;   642                         continue;
643                       643                    
644                    $fun cbody = $v alue['chec k'];   644                    $fun cbody = $v alue['chec k'];
645                    $fun c = create _function( '$arg0', $ funcbody);   645                    $fun c = create _function( '$arg0', $ funcbody);
646     646  
647                    if (  !$func($_ POST[$key] ) )   647                    if (  !$func($_ POST[$key] ) )
648                    {   648                    {
649                         $errorMess age .= "Pl ease, inpu t valid da ta to <b>{ $value['na me']}</b>  field<br / >";   649                         $errorMess age .= "Pl ease, inpu t valid da ta to <b>{ $value['na me']}</b>  field<br / >";
650                         $error_arr [$key] = 1 ;   650                         $error_arr [$key] = 1 ;
651                         $passOk =  false;   651                         $passOk =  false;
652                         unset($_PO ST[$key]);   652                         unset($_PO ST[$key]);
653                    }   653                    }
654                    else   654                    else
655                         $error_arr [$key] = 0 ;   655                         $error_arr [$key] = 0 ;
656                    $con fig_arr[$k ey]['def']  = $_POST[ $key];   656                    $con fig_arr[$k ey]['def']  = $_POST[ $key];
657                }   657                }
658     658  
659                if( strl en( $error Message )  )   659                if( strl en( $error Message )  )
660                {   660                {
661                    $sEr ror = 'err or';   661                    $sEr ror = 'err or';
662                    $ret  .= instal lDBConf( $ errorMessa ge );   662                    $ret  .= instal lDBConf( $ errorMessa ge );
663                }   663                }
664                else   664                else
665                {   665                {
666                    $ret  .= instal lGeneralIn fo();   666                    $ret  .= instal lGeneralIn fo();
667                }   667                }
668           br eak;   668           br eak;
669              669           
670           ca se 'step2' :   670           ca se 'step2' :
671                $errorMe ssage = '' ;   671                $errorMe ssage = '' ;
672                foreach  ( $confFir st as $key  => $value  )   672                foreach  ( $confFir st as $key  => $value  )
673                {   673                {
674                    if (  !strlen($ value['che ck']) ) co ntinue;   674                    if (  !strlen($ value['che ck']) ) co ntinue;
675                    $fun cbody = $v alue['chec k'];   675                    $fun cbody = $v alue['chec k'];
676                    $fun c = create _function( '$arg0', $ funcbody);   676                    $fun c = create _function( '$arg0', $ funcbody);
677     677  
678                    if (  !$func($_ POST[$key] ) )   678                    if (  !$func($_ POST[$key] ) )
679                    {   679                    {
680                         $errorMess age .= "Pl ease, inpu t valid da ta to <b>{ $value['na me']}</b>  field<br / >";   680                         $errorMess age .= "Pl ease, inpu t valid da ta to <b>{ $value['na me']}</b>  field<br / >";
681                         $error_arr [$key] = 1 ;   681                         $error_arr [$key] = 1 ;
682                         $passOk =  false;   682                         $passOk =  false;
683                         unset($_PO ST[$key]);   683                         unset($_PO ST[$key]);
684                    }   684                    }
685                    else   685                    else
686                         $error_arr [$key] = 0 ;   686                         $error_arr [$key] = 0 ;
687                    $con fig_arr[$k ey]['def']  = $_POST[ $key];   687                    $con fig_arr[$k ey]['def']  = $_POST[ $key];
688                }   688                }
689     689  
690                if( strl en( $error Message )  )   690                if( strl en( $error Message )  )
691                {   691                {
692                    $sEr ror = 'err or';   692                    $sEr ror = 'err or';
693                    $ret  .= instal lStepFirst ( $errorMe ssage );   693                    $ret  .= instal lStepFirst ( $errorMe ssage );
694                }   694                }
695                else   695                else
696                {   696                {
697                    $ret  .= instal lDBConf();   697                    $ret  .= instal lDBConf();
698                }   698                }
699     699  
700           br eak;   700           br eak;
701              701           
702           ca se 'step1' :   702           ca se 'step1' :
703                $dirName  = '';   703                $dirName  = '';
704                $errorMe ssage = '' ;   704                $errorMe ssage = '' ;
705                foreach  ($permDire ctories as  $dir)   705                foreach  ($permDire ctories as  $dir)
706                {   706                {
707                    if (  !isFullAc cessible(' ../'.$dir)  )   707                    if (  !isFullAc cessible(' ../'.$dir)  )
708                    {   708                    {
709                         //$passOk  = false;   709                         //$passOk  = false;
710                         $dirName . = '&nbsp;& nbsp;&nbsp ;' . $dir  . ';<br /> ';   710                         $dirName . = '&nbsp;& nbsp;&nbsp ;' . $dir  . ';<br /> ';
711                    }   711                    }
712                }   712                }
713                   713                
714                foreach  ($aRayFold ers as $di r)   714                foreach  ($aRayFold ers as $di r)
715                {   715                {
716                    if (  !isFullAc cessible(' ../'.$dir)  )   716                    if (  !isFullAc cessible(' ../'.$dir)  )
717                    {   717                    {
718                         //$passOk  = false;   718                         //$passOk  = false;
719                         $dirName . = '&nbsp;& nbsp;&nbsp ;' . $dir  . ';<br /> ';   719                         $dirName . = '&nbsp;& nbsp;&nbsp ;' . $dir  . ';<br /> ';
720                    }   720                    }
721                }   721                }
722                   722                
723                if( strl en( $dirNa me ) )   723                if( strl en( $dirNa me ) )
724                {   724                {
725                    $sEr ror = 'err or';   725                    $sEr ror = 'err or';
726                    $err orMessage  .= '<stron g>Next dir ectories h ave inappr opriate pe rmissions< /strong>:< br />' . $ dirName;   726                    $err orMessage  .= '<stron g>Next dir ectories h ave inappr opriate pe rmissions< /strong>:< br />' . $ dirName;
727                }   727                }
728                   728                
729                foreach  ($permFile s as $file )   729                foreach  ($permFile s as $file )
730                {   730                {
731                    if (  !isRWAcce ssible('.. /'.$file)  )   731                    if (  !isRWAcce ssible('.. /'.$file)  )
732                    {   732                    {
733                         //$passOk  = false;   733                         //$passOk  = false;
734                         $fileName  .= '&nbsp; &nbsp;&nbs p;' . $fil e . ';<br  /> ';   734                         $fileName  .= '&nbsp; &nbsp;&nbs p;' . $fil e . ';<br  /> ';
735                    }   735                    }
736                }   736                }
737     737  
738                foreach(  $aRayFile s as $file  )   738                foreach(  $aRayFile s as $file  )
739                {   739                {
740                    if ( strpos($fi le,'ffmpeg ') === FAL SE)   740                    if ( strpos($fi le,'ffmpeg ') === FAL SE)
741                    {   741                    {
742                         if ( !isRW Accessible ('../'.$fi le) )   742                         if ( !isRW Accessible ('../'.$fi le) )
743                         {   743                         {
744                             //$pas sOk = fals e;   744                             //$pas sOk = fals e;
745                             $fileN ame .= '&n bsp;&nbsp; &nbsp;' .  $file . '; <br /> ';   745                             $fileN ame .= '&n bsp;&nbsp; &nbsp;' .  $file . '; <br /> ';
746                         }   746                         }
747                    }   747                    }
748                    else   748                    else
749                    {   749                    {
750                         if ( !isFu llAccessib le('../'.$ file) )   750                         if ( !isFu llAccessib le('../'.$ file) )
751                         {   751                         {
752                             //$pas sOk = fals e;   752                             //$pas sOk = fals e;
753                             $fileN ame .= '&n bsp;&nbsp; &nbsp;' .  $file . '; <br /> ';   753                             $fileN ame .= '&n bsp;&nbsp; &nbsp;' .  $file . '; <br /> ';
754                         }   754                         }
755                    }   755                    }
756                }   756                }
757                   757                
758                if( strl en( $fileN ame ) )   758                if( strl en( $fileN ame ) )
759                {   759                {
760                    $sEr ror = 'err or';   760                    $sEr ror = 'err or';
761                    $err orMessage  .= '<stron g>Next fil es have in appropriat e permissi ons</stron g>:<br />'  . $fileNa me;   761                    $err orMessage  .= '<stron g>Next fil es have in appropriat e permissi ons</stron g>:<br />'  . $fileNa me;
762                }   762                }
763     763  
764                if( strl en( $error Message )  )   764                if( strl en( $error Message )  )
765                {   765                {
766                    $ret  .= PreIns tall( $err orMessage  );   766                    $ret  .= PreIns tall( $err orMessage  );
767                }   767                }
768                else   768                else
769                {   769                {
770                    $ret  .= instal lStepFirst ();   770                    $ret  .= instal lStepFirst ();
771                }   771                }
772           br eak;   772           br eak;
773     773  
774           ca se 'preIns tall':   774           ca se 'preIns tall':
775                $ret .=  PreInstall ();   775                $ret .=  PreInstall ();
776           br eak;   776           br eak;
777              777           
778           de fault:   778           de fault:
779                $ret .=  StartInsta ll();   779                $ret .=  StartInsta ll();
780       }   780       }
781     781  
782     782  
783       return  $ret;   783       return  $ret;
784   }   784   }
785     785  
786   function i nstallFini sh( $error Message =  '' )   786   function i nstallFini sh( $error Message =  '' )
787   {   787   {
788       global  $aConf,   $confFirst , $aDbConf , $aGenera l;   788       global  $aConf,   $confFirst , $aDbConf , $aGenera l;
789       global  $reversal Directorie s, $revers alFiles;   789       global  $reversal Directorie s, $revers alFiles;
790     790  
791       $sAdmi nName = $_ REQUEST['a dmin_usern ame'];   791       $sAdmi nName = $_ REQUEST['a dmin_usern ame'];
792       $sAdmi nPassword  = $_REQUES T['admin_p assword'];   792       $sAdmi nPassword  = $_REQUES T['admin_p assword'];
793       $resRu nSQL = Run SQL( $sAdm inName, $s AdminPassw ord );   793       $resRu nSQL = Run SQL( $sAdm inName, $s AdminPassw ord );
794     794  
795       $sRet  = '';   795       $sRet  = '';
796          796       
797       if( 'd one' ==  $ resRunSQL  )   797       if( 'd one' ==  $ resRunSQL  )
798       {   798       {
799           $s Ret = '   799           $s Ret = '
800           <d iv class=" formKeeper ">   800           <d iv class=" formKeeper ">
801                <form ac tion="' .  $_SERVER[' PHP_SELF']  . '" meth od="post">   801                <form ac tion="' .  $_SERVER[' PHP_SELF']  . '" meth od="post">
802                    <inp ut type="i mage" src= "images/ne xt.gif" />   802                    <inp ut type="i mage" src= "images/ne xt.gif" />
803                    <inp ut type="h idden" nam e="action"  value="st ep5" />   803                    <inp ut type="h idden" nam e="action"  value="st ep5" />
804                </form>   804                </form>
805           </ div>   805           </ div>
806           <d iv class=" clearBoth" ></div>';   806           <d iv class=" clearBoth" ></div>';
807       }   807       }
808       else   808       else
809       {   809       {
810           $s Ret = $res RunSQL;   810           $s Ret = $res RunSQL;
811           $s Ret .= '   811           $s Ret .= '
812           <d iv class=" formKeeper ">   812           <d iv class=" formKeeper ">
813                <form ac tion="' .  $_SERVER[' PHP_SELF']  . '" meth od="post">   813                <form ac tion="' .  $_SERVER[' PHP_SELF']  . '" meth od="post">
814                    <inp ut type="i mage" src= "images/ba ck.gif" /> ';   814                    <inp ut type="i mage" src= "images/ba ck.gif" /> ';
815           fo reach( $_P OST as $sK ey => $sVa lue )   815           fo reach( $_P OST as $sK ey => $sVa lue )
816           {   816           {
817                if( $sKe y != "acti on" )   817                if( $sKe y != "acti on" )
818                    $sRe t .= '<inp ut type="h idden" nam e="' . $sK ey . '" va lue="' . $ sValue . ' " />';   818                    $sRe t .= '<inp ut type="h idden" nam e="' . $sK ey . '" va lue="' . $ sValue . ' " />';
819           }   819           }
820                $sRet .=  '<input t ype="hidde n" name="a ction" val ue="step2"  />   820                $sRet .=  '<input t ype="hidde n" name="a ction" val ue="step2"  />
821                </form>   821                </form>
822           </ div>   822           </ div>
823           <d iv class=" clearBoth" ></div>';   823           <d iv class=" clearBoth" ></div>';
824           re turn $sRet ;   824           re turn $sRet ;
825       }   825       }
826          826       
827       foreac h ( $confF irst as $k ey => $val  )   827       foreac h ( $confF irst as $k ey => $val  )
828       {   828       {
829           $a Conf['head erTempl']  = str_repl ace ( "%$k ey%", $_PO ST[$key],  $aConf['he aderTempl' ] );   829           $a Conf['head erTempl']  = str_repl ace ( "%$k ey%", $_PO ST[$key],  $aConf['he aderTempl' ] );
830       }   830       }
831       foreac h ( $aDbCo nf as $key  => $val )   831       foreac h ( $aDbCo nf as $key  => $val )
832       {   832       {
833           $a Conf['head erTempl']  = str_repl ace ( "%$k ey%", $_PO ST[$key],  $aConf['he aderTempl' ] );   833           $a Conf['head erTempl']  = str_repl ace ( "%$k ey%", $_PO ST[$key],  $aConf['he aderTempl' ] );
834       }   834       }
835       foreac h ( $aGene ral as $ke y => $val  )   835       foreac h ( $aGene ral as $ke y => $val  )
836       {   836       {
837           $a Conf['head erTempl']  = str_repl ace ( "%$k ey%", $_PO ST[$key],  $aConf['he aderTempl' ] );   837           $a Conf['head erTempl']  = str_repl ace ( "%$k ey%", $_PO ST[$key],  $aConf['he aderTempl' ] );
838       }   838       }
839     839  
840       $aConf ['periodic Templ'] =  str_replac e ( "%site _email%",  $_POST['si te_email'] , $aConf[' periodicTe mpl'] );   840       $aConf ['periodic Templ'] =  str_replac e ( "%site _email%",  $_POST['si te_email'] , $aConf[' periodicTe mpl'] );
841       $aConf ['periodic Templ'] =  str_replac e ( "%dir_ root%",    $_POST['di r_root'],    $aConf[' periodicTe mpl'] );   841       $aConf ['periodic Templ'] =  str_replac e ( "%dir_ root%",    $_POST['di r_root'],    $aConf[' periodicTe mpl'] );
842       $aConf ['periodic Templ'] =  str_replac e ( "%dir_ php%",     $_POST['di r_php'],     $aConf[' periodicTe mpl'] );   842       $aConf ['periodic Templ'] =  str_replac e ( "%dir_ php%",     $_POST['di r_php'],     $aConf[' periodicTe mpl'] );
843     843  
844       $ret =  '';   844       $ret =  '';
845       $ret . = '<div cl ass="posit ion">Cron  Jobs</div> ';   845       $ret . = '<div cl ass="posit ion">Cron  Jobs</div> ';
846       $ret . = '<div cl ass="LeftR irght">';   846       $ret . = '<div cl ass="LeftR irght">';
847                    $fp  = fopen (  $aConf['do lFile'], ' w');   847                    $fp  = fopen (  $aConf['do lFile'], ' w');
848                    if (  $fp )   848                    if (  $fp )
849                    {   849                    {
850                         fputs ( $f p, $aConf[ 'headerTem pl'] );   850                         fputs ( $f p, $aConf[ 'headerTem pl'] );
851                         fclose ( $ fp );   851                         fclose ( $ fp );
852                         chmod( $aC onf['dolFi le'], 0666  );   852                         chmod( $aC onf['dolFi le'], 0666  );
853                         //$ret .=' Config fil e was succ essfully w ritten to  <strong>'  . $aConf[' dolFile']  . '</stron g><br />';   853                         //$ret .=' Config fil e was succ essfully w ritten to  <strong>'  . $aConf[' dolFile']  . '</stron g><br />';
854                    }   854                    }
855                    else   855                    else
856                    {   856                    {
857                         $text = 'W arning!!!  can not ge t write ac cess to co nfig file  ' . $aConf ['dolFile' ] . '. Her e is confi g file</fo nt><br>';   857                         $text = 'W arning!!!  can not ge t write ac cess to co nfig file  ' . $aConf ['dolFile' ] . '. Her e is confi g file</fo nt><br>';
858                         $ret .= pr intInstall Error( $te xt );   858                         $ret .= pr intInstall Error( $te xt );
859                         $trans = g et_html_tr anslation_ table(HTML _ENTITIES) ;   859                         $trans = g et_html_tr anslation_ table(HTML _ENTITIES) ;
860                         $templ = s trtr($aCon f['headerT empl'], $t rans);   860                         $templ = s trtr($aCon f['headerT empl'], $t rans);
861                         $ret .= '< textarea c ols="20" r ows="10" c lass="head erTextarea ">' . $aCo nf['header Templ'] .  '</textare a>';   861                         $ret .= '< textarea c ols="20" r ows="10" c lass="head erTextarea ">' . $aCo nf['header Templ'] .  '</textare a>';
862                    }   862                    }
863                    $fp  = fopen (  $aConf['pe riodicFile '], 'w');   863                    $fp  = fopen (  $aConf['pe riodicFile '], 'w');
864                    if (  $fp )   864                    if (  $fp )
865                    {   865                    {
866                         fputs ( $f p, $aConf[ 'periodicT empl'] );   866                         fputs ( $f p, $aConf[ 'periodicT empl'] );
867                         fclose ( $ fp );   867                         fclose ( $ fp );
868                         chmod( $aC onf['dolFi le'], 0666  );   868                         chmod( $aC onf['dolFi le'], 0666  );
869                         //$ret .=' Config fil e was succ essfully w ritten to  <strong>'  . $aConf[' periodicFi le'] . '</ strong><br  />';   869                         //$ret .=' Config fil e was succ essfully w ritten to  <strong>'  . $aConf[' periodicFi le'] . '</ strong><br  />';
870                         $ret .= '< div class= "left">   870                         $ret .= '< div class= "left">
871                                 Pl ease, setu p Cron Job s as speci fied below . Helpful  info about  Cron Jobs  is <a hre f="http:// www.boonex .net/dolph in/wiki/De tailedInst all#Settin gupCronjob s">availab le here</a >.';   871                                 Pl ease, setu p Cron Job s as speci fied below . Helpful  info about  Cron Jobs  is <a hre f="http:// www.boonex .net/dolph in/wiki/De tailedInst all#Settin gupCronjob s">availab le here</a >.';
872                         $ret .= '< /div>';   872                         $ret .= '< /div>';
873     873  
874                         $ret .= '< div class= "debug">';   874                         $ret .= '< div class= "debug">';
875                             $aFile Lines = fi le( $aConf ['periodic File'] );   875                             $aFile Lines = fi le( $aConf ['periodic File'] );
876                             foreac h( $aFileL ines as $s Line )   876                             foreac h( $aFileL ines as $s Line )
877                                 $r et .= $sLi ne . '<br  />';   877                                 $r et .= $sLi ne . '<br  />';
878                         $ret .= '< /div>';   878                         $ret .= '< /div>';
879                    }   879                    }
880                    else   880                    else
881                    {   881                    {
882                         $text = '< font color =red>Warni ng!!! can  not get wr ite access  to config  file ' .  $aConf['pe riodicFile '] . '. He re is conf ig file</f ont><br>';   882                         $text = '< font color =red>Warni ng!!! can  not get wr ite access  to config  file ' .  $aConf['pe riodicFile '] . '. He re is conf ig file</f ont><br>';
883                         $ret .= pr intInstall Error( $te xt );   883                         $ret .= pr intInstall Error( $te xt );
884                         $trans = g et_html_tr anslation_ table(HTML _ENTITIES) ;   884                         $trans = g et_html_tr anslation_ table(HTML _ENTITIES) ;
885                         $templ = s trtr($aCon f['periodi cTempl'],  $trans);   885                         $templ = s trtr($aCon f['periodi cTempl'],  $trans);
886                         $ret .= '< textarea c ols="20" r ows="10" c lass="head erTextarea ">' . $aCo nf['period icTempl']  . '</texta rea>';   886                         $ret .= '< textarea c ols="20" r ows="10" c lass="head erTextarea ">' . $aCo nf['period icTempl']  . '</texta rea>';
887                    }   887                    }
888                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'cmdFile']  );   888                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'cmdFile']  );
889                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'notifiesF ile'] );   889                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'notifiesF ile'] );
890                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'cupidFile '] );   890                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'cupidFile '] );
891                    //@r ewriteFile ( '[path_t o]', $_POS T['dir_roo t'], $aCon f['tagsFil e'] );   891                    //@r ewriteFile ( '[path_t o]', $_POS T['dir_roo t'], $aCon f['tagsFil e'] );
892                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'rayHeader '] );   892                    @rew riteFile(  '[path_to] ', $_POST[ 'dir_root' ], $aConf[ 'rayHeader '] );
893     893  
894                    $ret  .= $sRet;   894                    $ret  .= $sRet;
895                       895                    
896                $ret .=  '</div>';   896                $ret .=  '</div>';
897     897  
898       return  $ret;   898       return  $ret;
899   }   899   }
900     900  
901   function s howPermiss ions( $err orMessage= '' )   901   function s howPermiss ions( $err orMessage= '' )
902   {   902   {
903       global  $reversal Directorie s, $revers alFiles;   903       global  $reversal Directorie s, $revers alFiles;
904          904       
905       $ret . = '<div cl ass="posit ion">Permi ssions Rev ersal</div >';   905       $ret . = '<div cl ass="posit ion">Permi ssions Rev ersal</div >';
906     906  
907       if( st rlen( $err orMessage  ) )   907       if( st rlen( $err orMessage  ) )
908       {   908       {
909           $r et .= prin tInstallEr ror( $erro rMessage ) ;   909           $r et .= prin tInstallEr ror( $erro rMessage ) ;
910       }   910       }
911     911  
912       $ret . = '<div cl ass="LeftR ight">';   912       $ret . = '<div cl ass="LeftR ight">';
913       $ret . = '<div cl ass="clear Both"></di v>';       913       $ret . = '<div cl ass="clear Both"></di v>';    
914       $ret . = '<div cl ass="left" >Now, when  Dolphin c ompleted i nstallatio n, you sho uld change  permissio ns for som e files to  keep your  site secu re. Please , change p ermissions  as specif ied in the  chart bel ow. Helpfu l info abo ut permiss ions is <a  href="htt p://www.bo onex.net/c gi-bin/tra c_dolphin. cgi/wiki/D etailedIns tall#Permi ssions" ta rget="_bla nk">availa ble here</ a>.</div>' ;   914       $ret . = '<div cl ass="left" >Now, when  Dolphin c ompleted i nstallatio n, you sho uld change  permissio ns for som e files to  keep your  site secu re. Please , change p ermissions  as specif ied in the  chart bel ow. Helpfu l info abo ut permiss ions is <a  href="htt p://www.bo onex.net/c gi-bin/tra c_dolphin. cgi/wiki/D etailedIns tall#Permi ssions" ta rget="_bla nk">availa ble here</ a>.</div>' ;
915           $r et .= '<di v class="r ight">   915           $r et .= '<di v class="r ight">
916                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">   916                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">
917                <tr clas s="head">   917                <tr clas s="head">
918                    <td> Directorie s</td>   918                    <td> Directorie s</td>
919                    <td> Current Le vel</td>   919                    <td> Current Le vel</td>
920                    <td> Desired Le vel</td>   920                    <td> Desired Le vel</td>
921                </tr>';   921                </tr>';
922                   922                
923                $i = 0;   923                $i = 0;
924                foreach( $reversalD irectories  as $dir)   924                foreach( $reversalD irectories  as $dir)
925                {   925                {
926                    if(  ($i%2) ==  0 )   926                    if(  ($i%2) ==  0 )
927                    {   927                    {
928                         $styleAdd  = 'backgro und-color: #ede9e9;';   928                         $styleAdd  = 'backgro und-color: #ede9e9;';
929                    }   929                    }
930                    else   930                    else
931                    {   931                    {
932                         $styleAdd  = 'backgro und-color: #fff;';   932                         $styleAdd  = 'backgro und-color: #fff;';
933                    }   933                    }
934                    $ret  .= '<tr s tyle="' .  $styleAdd  . '" class ="cont">';   934                    $ret  .= '<tr s tyle="' .  $styleAdd  . '" class ="cont">';
935                         $ret .= '< td>' . $di r . '</td> ';   935                         $ret .= '< td>' . $di r . '</td> ';
936                         $ret .= '< td class=" span">';   936                         $ret .= '< td class=" span">';
937                             if ( i sFullAcces sible('../ '.$dir) )   937                             if ( i sFullAcces sible('../ '.$dir) )
938                             {   938                             {
939                                 $r et .= '<sp an class=" unwritable ">' . getP ermissions ( '../' .  $dir ) . ' </span><sp an>Writabl e</span>';   939                                 $r et .= '<sp an class=" unwritable ">' . getP ermissions ( '../' .  $dir ) . ' </span><sp an>Writabl e</span>';
940                             }   940                             }
941                             else   941                             else
942                             {   942                             {
943                                 $r et .= '<sp an class=" writable"> ' . getPer missions(  '../' . $d ir ) . '</ span><span >Non-writa ble</span> ';   943                                 $r et .= '<sp an class=" writable"> ' . getPer missions(  '../' . $d ir ) . '</ span><span >Non-writa ble</span> ';
944                             }   944                             }
945                         $ret .= '< /td>';   945                         $ret .= '< /td>';
946                         $ret .= '< td class=" span">';   946                         $ret .= '< td class=" span">';
947                             $ret . = '<span c lass="desi red">755</ span><span >Non-writa ble</span> ';   947                             $ret . = '<span c lass="desi red">755</ span><span >Non-writa ble</span> ';
948                         $ret .= '< /td>';   948                         $ret .= '< /td>';
949                    $ret  .= '</tr> ';   949                    $ret  .= '</tr> ';
950                    $i + +;   950                    $i + +;
951                }   951                }
952                   952                
953                $ret .=  '<tr class ="head">   953                $ret .=  '<tr class ="head">
954                    <td> Files</td>   954                    <td> Files</td>
955                    <td> Current Le vel</td>   955                    <td> Current Le vel</td>
956                    <td> Desired Le vel</td>   956                    <td> Desired Le vel</td>
957                </tr>   957                </tr>
958                ';   958                ';
959                $i = 0;   959                $i = 0;
960                foreach( $reversalF iles as $f ile)   960                foreach( $reversalF iles as $f ile)
961                {   961                {
962     962  
963                     $str   =   $_SERVER[' DOCUMENT_R OOT']   .   $_SERVER[' SCRI P T _ NAM E
'];
  963                     $str   =   $_SERVER[' DOCUMENT_R OOT']   .   $_SERVER['
P HP _ S E LF '];
964                    $dir  = preg_re place("/in stall\/(in dex\.php$) /","",$str );   964                    $dir  = preg_re place("/in stall\/(in dex\.php$) /","",$str );
965     965  
966                    if(  file_exist s(  $dir .  $file) )   966                    if(  file_exist s(  $dir .  $file) )
967                    {   967                    {
968                         if( ($i%2)  == 0 )   968                         if( ($i%2)  == 0 )
969                         {   969                         {
970                             $style Add = 'bac kground-co lor:#ede9e 9;';   970                             $style Add = 'bac kground-co lor:#ede9e 9;';
971                         }   971                         }
972                         else   972                         else
973                         {   973                         {
974                             $style Add = 'bac kground-co lor:#fff;' ;   974                             $style Add = 'bac kground-co lor:#fff;' ;
975                         }   975                         }
976                         $ret .= '< tr style=" ' . $style Add . '" c lass="cont ">';   976                         $ret .= '< tr style=" ' . $style Add . '" c lass="cont ">';
977                             $ret . = '<td>' .  $file . ' </td>';   977                             $ret . = '<td>' .  $file . ' </td>';
978                             $ret . = '<td cla ss="span"> ';   978                             $ret . = '<td cla ss="span"> ';
979                             if ( i sRWAccessi ble('../'. $file) )   979                             if ( i sRWAccessi ble('../'. $file) )
980                             {   980                             {
981                                 $r et .= '<sp an class=" unwritable ">' . getP ermissions ( '../' .  $file ) .  '</span><s pan>Writab le</span>' ;   981                                 $r et .= '<sp an class=" unwritable ">' . getP ermissions ( '../' .  $file ) .  '</span><s pan>Writab le</span>' ;
982                             }   982                             }
983                             else   983                             else
984                             {   984                             {
985                                 $r et .= '<sp an class=" writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Non-writ able</span >';   985                                 $r et .= '<sp an class=" writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Non-writ able</span >';
986                             }   986                             }
987                             $ret . = '</td>';   987                             $ret . = '</td>';
988                             $ret . = '<td cla ss="span"> ';   988                             $ret . = '<td cla ss="span"> ';
989                                 $r et .= '<sp an class=" desired">6 44</span>< span>Non-w ritable</s pan>';   989                                 $r et .= '<sp an class=" desired">6 44</span>< span>Non-w ritable</s pan>';
990                             $ret . = '</td>';   990                             $ret . = '</td>';
991                         $ret .= '< /tr>';   991                         $ret .= '< /tr>';
992                         $i ++;   992                         $i ++;
993                    }   993                    }
994                }   994                }
995                $ret .=  '   995                $ret .=  '
996                         </table>   996                         </table>
997                         <div class ="formKeep er1">   997                         <div class ="formKeep er1">
998                             <div c lass="butt on_area_1" >   998                             <div c lass="butt on_area_1" >
999                                 <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">   999                                 <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">
1000                                      <input i d="button"  type="ima ge" src="i mages/chec k.gif" />   1000                                      <input i d="button"  type="ima ge" src="i mages/chec k.gif" />
1001                                      <input t ype="hidde n" name="a ction" val ue="step5"  />   1001                                      <input t ype="hidde n" name="a ction" val ue="step5"  />
1002                                 </ form>   1002                                 </ form>
1003                             </div> ';   1003                             </div> ';
1004                         $ret .= '   1004                         $ret .= '
1005                             <div c lass="butt on_area_1" >   1005                             <div c lass="butt on_area_1" >
1006                                 <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">   1006                                 <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">
1007                                      <input i d="button"  type="ima ge" src="i mages/next .gif" />   1007                                      <input i d="button"  type="ima ge" src="i mages/next .gif" />
1008                                      <input t ype="hidde n" name="a ction" val ue="step6"  />   1008                                      <input t ype="hidde n" name="a ction" val ue="step6"  />
1009                                 </ form>   1009                                 </ form>
1010                             </div> ';   1010                             </div> ';
1011                         $ret .= '   1011                         $ret .= '
1012                             <div c lass="butt on_area_2" >   1012                             <div c lass="butt on_area_2" >
1013                                 <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">   1013                                 <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">
1014                                      <input i d="button"  type="ima ge" src="i mages/skip .gif" />   1014                                      <input i d="button"  type="ima ge" src="i mages/skip .gif" />
1015                                      <input t ype="hidde n" name="a ction" val ue="step7"  />   1015                                      <input t ype="hidde n" name="a ction" val ue="step7"  />
1016                                 </ form>   1016                                 </ form>
1017                             </div>   1017                             </div>
1018                         </div>   1018                         </div>
1019                    </di v>   1019                    </di v>
1020           <d iv class=" clearBoth" ></div>   1020           <d iv class=" clearBoth" ></div>
1021       </div> ';   1021       </div> ';
1022          1022       
1023       return  $ret;   1023       return  $ret;
1024   }   1024   }
1025     1025  
1026   function i nstallGene ralInfo( $ errorMessa ge = '' )   1026   function i nstallGene ralInfo( $ errorMessa ge = '' )
1027   {   1027   {
1028       global  $aGeneral ;   1028       global  $aGeneral ;
1029     1029  
1030       $ret =  '';   1030       $ret =  '';
1031       $ret . = '<div cl ass="posit ion">Confi guration</ div>';   1031       $ret . = '<div cl ass="posit ion">Confi guration</ div>';
1032       if( st rlen( $err orMessage  ) )   1032       if( st rlen( $err orMessage  ) )
1033       {   1033       {
1034           $r et .= prin tInstallEr ror( $erro rMessage ) ;   1034           $r et .= prin tInstallEr ror( $erro rMessage ) ;
1035           un set($_POST ['site_tit le']);   1035           un set($_POST ['site_tit le']);
1036           un set($_POST ['site_ema il']);   1036           un set($_POST ['site_ema il']);
1037           un set($_POST ['notify_e mail']);   1037           un set($_POST ['notify_e mail']);
1038           un set($_POST ['bug_repo rt_email'] );   1038           un set($_POST ['bug_repo rt_email'] );
1039       }   1039       }
1040       $ret . = '<div cl ass="LeftR irght">   1040       $ret . = '<div cl ass="LeftR irght">
1041           <d iv class=" clearBoth" ></div>   1041           <d iv class=" clearBoth" ></div>
1042           <d iv class=" left">   1042           <d iv class=" left">
1043           </ div>   1043           </ div>
1044           <d iv class=" right">   1044           <d iv class=" right">
1045           <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">   1045           <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">
1046                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">   1046                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">
1047                    <tr  class="hea d">   1047                    <tr  class="hea d">
1048                         <td>&nbsp; </td>   1048                         <td>&nbsp; </td>
1049                         <td>&nbsp; </td>   1049                         <td>&nbsp; </td>
1050                    </tr >';   1050                    </tr >';
1051                    $ret  .= create Table( $aG eneral );   1051                    $ret  .= create Table( $aG eneral );
1052           $r et .= '</t able>   1052           $r et .= '</t able>
1053           <d iv class=" formKeeper ">   1053           <d iv class=" formKeeper ">
1054                <input i d="button"  type="ima ge" src="i mages/next .gif" />   1054                <input i d="button"  type="ima ge" src="i mages/next .gif" />
1055                <input t ype="hidde n" name="a ction" val ue="step4"  />';   1055                <input t ype="hidde n" name="a ction" val ue="step4"  />';
1056                foreach( $_POST as  $postKey = > $postVal ue)   1056                foreach( $_POST as  $postKey = > $postVal ue)
1057                {   1057                {
1058                    if(  'action' = = $postKey  || isset(  $aGeneral [$postKey]  ) )   1058                    if(  'action' = = $postKey  || isset(  $aGeneral [$postKey]  ) )
1059                    {   1059                    {
1060                         $ret .= '' ;   1060                         $ret .= '' ;
1061                    }   1061                    }
1062                    else   1062                    else
1063                    {   1063                    {
1064                         $ret .= '< input type ="hidden"  name="' .  $postKey .  '" value= "' . $post Value . '"  />';   1064                         $ret .= '< input type ="hidden"  name="' .  $postKey .  '" value= "' . $post Value . '"  />';
1065                    }   1065                    }
1066     1066  
1067                }   1067                }
1068           $r et .= '</d iv>   1068           $r et .= '</d iv>
1069           </ form>   1069           </ form>
1070           </ div>   1070           </ div>
1071           ';   1071           ';
1072       $ret . = '<div cl ass="clear Both"></di v>   1072       $ret . = '<div cl ass="clear Both"></di v>
1073       </div> ';   1073       </div> ';
1074     1074  
1075       return  $ret;   1075       return  $ret;
1076   }   1076   }
1077     1077  
1078     1078  
1079   function i nstallDBCo nf( $error Message =  '')   1079   function i nstallDBCo nf( $error Message =  '')
1080   {   1080   {
1081       global  $aDbConf;   1081       global  $aDbConf;
1082     1082  
1083       $ret =  '';   1083       $ret =  '';
1084       $ret . = '<div cl ass="posit ion">Datab ase</div>' ;   1084       $ret . = '<div cl ass="posit ion">Datab ase</div>' ;
1085       if( st rlen( $err orMessage  ) )   1085       if( st rlen( $err orMessage  ) )
1086       {   1086       {
1087           $r et .= prin tInstallEr ror( $erro rMessage ) ;   1087           $r et .= prin tInstallEr ror( $erro rMessage ) ;
1088           un set($_POST ['db_name' ]);   1088           un set($_POST ['db_name' ]);
1089           un set($_POST ['db_user' ]);   1089           un set($_POST ['db_user' ]);
1090           un set($_POST ['db_passw ord']);   1090           un set($_POST ['db_passw ord']);
1091       }   1091       }
1092       $ret . = '<div cl ass="LeftR irght">   1092       $ret . = '<div cl ass="LeftR irght">
1093           <d iv class=" clearBoth" ></div>   1093           <d iv class=" clearBoth" ></div>
1094           <d iv class=" left">   1094           <d iv class=" left">
1095           Pl ease <a hr ef="http:/ /www.boone x.net/cgi- bin/trac_d olphin.cgi /wiki/Deta iledInstal l#Step2:Cr eateaDatab aseandaUse r">create  a database </a> and t ell Dolphi n about it .        1095           Pl ease <a hr ef="http:/ /www.boone x.net/cgi- bin/trac_d olphin.cgi /wiki/Deta iledInstal l#Step2:Cr eateaDatab aseandaUse r">create  a database </a> and t ell Dolphi n about it .     
1096           </ div>   1096           </ div>
1097           <d iv class=" right">   1097           <d iv class=" right">
1098           <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">   1098           <f orm action ="' . $_SE RVER['PHP_ SELF'] . ' " method=" post">
1099                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">   1099                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">
1100                    <tr  class="hea d">   1100                    <tr  class="hea d">
1101                         <td>&nbsp; </td>   1101                         <td>&nbsp; </td>
1102                         <td>&nbsp; </td>   1102                         <td>&nbsp; </td>
1103                    </tr >';   1103                    </tr >';
1104                    $ret  .= create Table( $aD bConf );   1104                    $ret  .= create Table( $aD bConf );
1105           $r et .= '</t able>   1105           $r et .= '</t able>
1106           <d iv class=" formKeeper ">   1106           <d iv class=" formKeeper ">
1107                <input i d="button"  type="ima ge" src="i mages/next .gif" />   1107                <input i d="button"  type="ima ge" src="i mages/next .gif" />
1108                <input t ype="hidde n" name="a ction" val ue="step3"  />';   1108                <input t ype="hidde n" name="a ction" val ue="step3"  />';
1109                foreach( $_POST as  $postKey = > $postVal ue)   1109                foreach( $_POST as  $postKey = > $postVal ue)
1110                {   1110                {
1111                    if(  'action' = = $postKey  || isset(  $aDbConf[ $postKey]  ) )   1111                    if(  'action' = = $postKey  || isset(  $aDbConf[ $postKey]  ) )
1112                    {   1112                    {
1113                         $ret .= '' ;   1113                         $ret .= '' ;
1114                    }   1114                    }
1115                    else   1115                    else
1116                    {   1116                    {
1117                         $ret .= '< input type ="hidden"  name="' .  $postKey .  '" value= "' . $post Value . '"  />';   1117                         $ret .= '< input type ="hidden"  name="' .  $postKey .  '" value= "' . $post Value . '"  />';
1118                    }   1118                    }
1119     1119  
1120                }   1120                }
1121           $r et .= '</d iv>   1121           $r et .= '</d iv>
1122           </ form>   1122           </ form>
1123           </ div>   1123           </ div>
1124           ';   1124           ';
1125       $ret . = '<div cl ass="clear Both"></di v>   1125       $ret . = '<div cl ass="clear Both"></di v>
1126       </div> ';   1126       </div> ';
1127     1127  
1128     1128  
1129       return  $ret;   1129       return  $ret;
1130   }   1130   }
1131     1131  
1132   function i nstallStep First( $er rorMessage  = '' )   1132   function i nstallStep First( $er rorMessage  = '' )
1133   {   1133   {
1134       global   $aConf,  $confFirst ;   1134       global   $aConf,  $confFirst ;
1135     1135  
1136   /*-------- ---------- ---------- ---*/   1136   /*-------- ---------- ---------- ---*/
1137     1137  
1138     1138  
1139   /*-------- ---------- ---------- ---*/   1139   /*-------- ---------- ---------- ---*/
1140     1140  
1141       $ret =  '';   1141       $ret =  '';
1142       $ret . = '<div cl ass="posit ion">Paths  Check</di v>';   1142       $ret . = '<div cl ass="posit ion">Paths  Check</di v>';
1143       if( st rlen( $err orMessage  ) )   1143       if( st rlen( $err orMessage  ) )
1144       {   1144       {
1145           $r et .= prin tInstallEr ror( $erro rMessage ) ;   1145           $r et .= prin tInstallEr ror( $erro rMessage ) ;
1146       }   1146       }
1147       $ret . = '<div cl ass="LeftR irght">';   1147       $ret . = '<div cl ass="LeftR irght">';
1148           $r et .= '<di v class="c learBoth"> </div>';   1148           $r et .= '<di v class="c learBoth"> </div>';
1149           $r et .= '<di v class="l eft">';   1149           $r et .= '<di v class="l eft">';
1150                $ret .=  'Dolphin c hecks gene ral script  paths.';   1150                $ret .=  'Dolphin c hecks gene ral script  paths.';
1151           $r et .= '</d iv>';   1151           $r et .= '</d iv>';
1152           $r et .= '<di v class="r ight">   1152           $r et .= '<di v class="r ight">
1153                <form ac tion="' .  $_SERVER[' PHP_SELF']  . '" meth od="post">   1153                <form ac tion="' .  $_SERVER[' PHP_SELF']  . '" meth od="post">
1154           ';   1154           ';
1155           $r et .= '<ta ble cellpa dding="0"  cellspacin g="1" widt h="100%" b order="0"  style="bac kground-co lor:silver ;">   1155           $r et .= '<ta ble cellpa dding="0"  cellspacin g="1" widt h="100%" b order="0"  style="bac kground-co lor:silver ;">
1156                    <tr  class="hea d">   1156                    <tr  class="hea d">
1157                         <td>&nbsp; </td>   1157                         <td>&nbsp; </td>
1158                         <td>&nbsp; </td>   1158                         <td>&nbsp; </td>
1159                    </tr >';   1159                    </tr >';
1160                    $ret  .= create Table( $co nfFirst );   1160                    $ret  .= create Table( $co nfFirst );
1161                    $ret  .= '   1161                    $ret  .= '
1162                         <tr class= "cont" sty le="backgr ound-color :#ede9e9;" >   1162                         <tr class= "cont" sty le="backgr ound-color :#ede9e9;" >
1163                             <td>   1163                             <td>
1164                                 Ch eck GD Ins talled   1164                                 Ch eck GD Ins talled
1165                             </td>   1165                             </td>
1166                             <td>';   1166                             <td>';
1167                                 if  ( extensi on_loaded(  'gd' ) )   1167                                 if  ( extensi on_loaded(  'gd' ) )
1168                                 {   1168                                 {
1169                                      $ret .=  '<span cla ss="writab le">GD lib rary insta lled</span >';   1169                                      $ret .=  '<span cla ss="writab le">GD lib rary insta lled</span >';
1170                                 }   1170                                 }
1171                                 el se   1171                                 el se
1172                                 {   1172                                 {
1173                                      $ret .=  '<span cla ss="unwrit able">GD l ibrary NOT  installed </span>';   1173                                      $ret .=  '<span cla ss="unwrit able">GD l ibrary NOT  installed </span>';
1174                                 }   1174                                 }
1175     1175  
1176                    $ret  .= '</td>   1176                    $ret  .= '</td>
1177                         </tr>   1177                         </tr>
1178                    ';   1178                    ';
1179     1179  
1180           $r et .= '</t able>   1180           $r et .= '</t able>
1181           <d iv class=" formKeeper ">   1181           <d iv class=" formKeeper ">
1182                <input i d="button"  type="ima ge" src="i mages/next .gif" />   1182                <input i d="button"  type="ima ge" src="i mages/next .gif" />
1183                    <inp ut type="h idden" nam e="action"  value="st ep2" />   1183                    <inp ut type="h idden" nam e="action"  value="st ep2" />
1184                </div>   1184                </div>
1185                    </fo rm>';   1185                    </fo rm>';
1186           $r et .= '</d iv>';   1186           $r et .= '</d iv>';
1187           $r et .= '<di v class="c learBoth"> </div>';   1187           $r et .= '<di v class="c learBoth"> </div>';
1188     1188  
1189     1189  
1190       $ret . = '</div>' ;   1190       $ret . = '</div>' ;
1191     1191  
1192       return  $ret;   1192       return  $ret;
1193   }   1193   }
1194     1194  
1195     1195  
1196   function P reInstall(  $errorMes sage = ''  )   1196   function P reInstall(  $errorMes sage = ''  )
1197   {   1197   {
1198       global  $aConf, $ permFiles,  $permDire ctories, $ aRayFolder s, $aRayFi les;   1198       global  $aConf, $ permFiles,  $permDire ctories, $ aRayFolder s, $aRayFi les;
1199          1199       
1200       if ( i ni_get('sa fe_mode')  == 1 || in i_get('saf e_mode') = = 'On' )   1200       if ( i ni_get('sa fe_mode')  == 1 || in i_get('saf e_mode') = = 'On' )
1201       {   1201       {
1202           $e rrorMessag e .= "Plea se turn of f <b>safe_ mode</b> i n your php .ini file  configurat ion";   1202           $e rrorMessag e .= "Plea se turn of f <b>safe_ mode</b> i n your php .ini file  configurat ion";
1203       }   1203       }
1204     1204  
1205       $ret =  '';   1205       $ret =  '';
1206       $ret . = '<div cl ass="posit ion">Permi ssions</di v>';   1206       $ret . = '<div cl ass="posit ion">Permi ssions</di v>';
1207       if( st rlen( $err orMessage  ) )   1207       if( st rlen( $err orMessage  ) )
1208       {   1208       {
1209           $r et .= prin tInstallEr ror( $erro rMessage ) ;   1209           $r et .= prin tInstallEr ror( $erro rMessage ) ;
1210       }   1210       }
1211       $ret . = '<div cl ass="LeftR irght">';   1211       $ret . = '<div cl ass="LeftR irght">';
1212           $r et .= '<di v class="c learBoth"> </div>';   1212           $r et .= '<di v class="c learBoth"> </div>';
1213           $r et .= '<di v class="l eft">   1213           $r et .= '<di v class="l eft">
1214                Dolphin  needs spec ial access  for certa in files a nd directo ries. Plea se, change  permissio ns as    1214                Dolphin  needs spec ial access  for certa in files a nd directo ries. Plea se, change  permissio ns as 
1215   specified  in the cha rt below.  Helpful in fo about p ermissions  is <a hre f="http:// www.boonex .net/cgi-b in/trac_do lphin.cgi/ wiki/Detai ledInstall #Permissio ns" target ="_blank"> available  here</a>.   1215   specified  in the cha rt below.  Helpful in fo about p ermissions  is <a hre f="http:// www.boonex .net/cgi-b in/trac_do lphin.cgi/ wiki/Detai ledInstall #Permissio ns" target ="_blank"> available  here</a>.
1216           </ div>';   1216           </ div>';
1217           $r et .= '<di v class="c lear_both" ></div>';   1217           $r et .= '<di v class="c lear_both" ></div>';
1218           $r et .= '<di v class="r ight">   1218           $r et .= '<di v class="r ight">
1219                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">   1219                <table c ellpadding ="0" cells pacing="1"  width="10 0%" border ="0" style ="backgrou nd-color:s ilver;">
1220                    <tr  class="hea d">   1220                    <tr  class="hea d">
1221                         <td>Direct ories</td>   1221                         <td>Direct ories</td>
1222                         <td>Curren t Level</t d>   1222                         <td>Curren t Level</t d>
1223                         <td>Desire d Level</t d>   1223                         <td>Desire d Level</t d>
1224                    </tr >';   1224                    </tr >';
1225                    $i =  0;   1225                    $i =  0;
1226                    asor t( $permDi rectories  );   1226                    asor t( $permDi rectories  );
1227                    asor t( $permFi les );   1227                    asor t( $permFi les );
1228                    fore ach($permD irectories  as $dir)   1228                    fore ach($permD irectories  as $dir)
1229                    {   1229                    {
1230                         if( ($i%2)  == 0 )   1230                         if( ($i%2)  == 0 )
1231                         {   1231                         {
1232                             $style Add = 'bac kground-co lor:#ede9e 9;';   1232                             $style Add = 'bac kground-co lor:#ede9e 9;';
1233                         }   1233                         }
1234                         else   1234                         else
1235                         {   1235                         {
1236                             $style Add = 'bac kground-co lor:#fff;' ;   1236                             $style Add = 'bac kground-co lor:#fff;' ;
1237                         }   1237                         }
1238                         $ret .= '< tr style=" ' . $style Add . '" c lass="cont ">';   1238                         $ret .= '< tr style=" ' . $style Add . '" c lass="cont ">';
1239                             $ret . = '<td>' .  $dir . '< /td>';   1239                             $ret . = '<td>' .  $dir . '< /td>';
1240                             $ret . = '<td cla ss="span"> ';   1240                             $ret . = '<td cla ss="span"> ';
1241                                 if  ( isFullA ccessible( '../'.$dir ) )   1241                                 if  ( isFullA ccessible( '../'.$dir ) )
1242                                 {   1242                                 {
1243                                      $ret .=  '<span cla ss="writab le">' . ge tPermissio ns( '../'  . $dir ) .  '</span>< span>Writa ble</span> ';   1243                                      $ret .=  '<span cla ss="writab le">' . ge tPermissio ns( '../'  . $dir ) .  '</span>< span>Writa ble</span> ';
1244                                 }   1244                                 }
1245                                 el se   1245                                 el se
1246                                 {   1246                                 {
1247                                      $ret .=  '<span cla ss="unwrit able">' .  getPermiss ions( '../ ' . $dir )  . '</span ><span>Non -writable< /span>';   1247                                      $ret .=  '<span cla ss="unwrit able">' .  getPermiss ions( '../ ' . $dir )  . '</span ><span>Non -writable< /span>';
1248                                 }   1248                                 }
1249                             $ret . = '</td>';   1249                             $ret . = '</td>';
1250                             $ret . = '<td cla ss="span"> ';   1250                             $ret . = '<td cla ss="span"> ';
1251                                 $r et .= '<sp an class=" desired">7 77</span>< span>Writa ble</span> ';   1251                                 $r et .= '<sp an class=" desired">7 77</span>< span>Writa ble</span> ';
1252                             $ret . = '</td>';   1252                             $ret . = '</td>';
1253                         $ret .= '< /tr>';   1253                         $ret .= '< /tr>';
1254                         $i ++;   1254                         $i ++;
1255                    }   1255                    }
1256                    $ret  .= '<tr c lass="head ">   1256                    $ret  .= '<tr c lass="head ">
1257                         <td>Files< /td>   1257                         <td>Files< /td>
1258                         <td>Curren t Level</t d>   1258                         <td>Curren t Level</t d>
1259                         <td>Desire d Level</t d>   1259                         <td>Desire d Level</t d>
1260                    </tr >   1260                    </tr >
1261                    ';   1261                    ';
1262                    $i =  0;   1262                    $i =  0;
1263                    fore ach($permF iles as $f ile)   1263                    fore ach($permF iles as $f ile)
1264                    {   1264                    {
1265                         $str   =   $_SERVER[' DOCUMENT_R OOT']   .   $_SERVER[' SCRI P T _ NAM E
'];
  1265                         $str   =   $_SERVER[' DOCUMENT_R OOT']   .   $_SERVER['
P HP _ S E LF '];
1266                         $dir = pre g_replace( "/install\ /(index\.p hp$)/","", $str);   1266                         $dir = pre g_replace( "/install\ /(index\.p hp$)/","", $str);
1267     1267  
1268                         if( file_e xists(  $d ir . $file ) )   1268                         if( file_e xists(  $d ir . $file ) )
1269                         {   1269                         {
1270                             if( ($ i%2) == 0  )   1270                             if( ($ i%2) == 0  )
1271                             {   1271                             {
1272                                 $s tyleAdd =  'backgroun d-color:#e de9e9;';   1272                                 $s tyleAdd =  'backgroun d-color:#e de9e9;';
1273                             }   1273                             }
1274                             else   1274                             else
1275                             {   1275                             {
1276                                 $s tyleAdd =  'backgroun d-color:#f ff;';   1276                                 $s tyleAdd =  'backgroun d-color:#f ff;';
1277                             }   1277                             }
1278                             $ret . = '<tr sty le="' . $s tyleAdd .  '" class=" cont">';   1278                             $ret . = '<tr sty le="' . $s tyleAdd .  '" class=" cont">';
1279                                 $r et .= '<td >' . $file  . '</td>' ;   1279                                 $r et .= '<td >' . $file  . '</td>' ;
1280                                 $r et .= '<td  class="sp an">';   1280                                 $r et .= '<td  class="sp an">';
1281                                      if ( isR WAccessibl e('../'.$f ile) )   1281                                      if ( isR WAccessibl e('../'.$f ile) )
1282                                      {   1282                                      {
1283                                          $ret  .= '<span  class="wr itable">'  . getPermi ssions( '. ./' . $fil e ) . '</s pan><span> Writable</ span>';   1283                                          $ret  .= '<span  class="wr itable">'  . getPermi ssions( '. ./' . $fil e ) . '</s pan><span> Writable</ span>';
1284                                      }   1284                                      }
1285                                      else   1285                                      else
1286                                      {   1286                                      {
1287                                          $ret  .= '<span  class="un writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Non-writ able</span >';   1287                                          $ret  .= '<span  class="un writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Non-writ able</span >';
1288                                      }   1288                                      }
1289                                 $r et .= '</t d>';   1289                                 $r et .= '</t d>';
1290                                 $r et .= '<td  class="sp an">';   1290                                 $r et .= '<td  class="sp an">';
1291                                      $ret .=  '<span cla ss="desire d">666</sp an><span>W ritable</s pan>';   1291                                      $ret .=  '<span cla ss="desire d">666</sp an><span>W ritable</s pan>';
1292                                 $r et .= '</t d>';   1292                                 $r et .= '</t d>';
1293                             $ret . = '</tr>';   1293                             $ret . = '</tr>';
1294                             $i ++;   1294                             $i ++;
1295                         }   1295                         }
1296                    }   1296                    }
1297                       1297                    
1298                    $ret  .= '<tr c lass="head ">   1298                    $ret  .= '<tr c lass="head ">
1299                         <td>Ray Fo lders</td>   1299                         <td>Ray Fo lders</td>
1300                         <td>Curren t Level</t d>   1300                         <td>Curren t Level</t d>
1301                         <td>Desire d Level</t d>   1301                         <td>Desire d Level</t d>
1302                    </tr >';   1302                    </tr >';
1303                    $i =  0;   1303                    $i =  0;
1304                    fore ach($aRayF olders as  $dir)   1304                    fore ach($aRayF olders as  $dir)
1305                    {   1305                    {
1306                         if( ($i%2)  == 0 )   1306                         if( ($i%2)  == 0 )
1307                         {   1307                         {
1308                             $style Add = 'bac kground-co lor:#ede9e 9;';   1308                             $style Add = 'bac kground-co lor:#ede9e 9;';
1309                         }   1309                         }
1310                         else   1310                         else
1311                         {   1311                         {
1312                             $style Add = 'bac kground-co lor:#fff;' ;   1312                             $style Add = 'bac kground-co lor:#fff;' ;
1313                         }   1313                         }
1314                         $ret .= '< tr style=" ' . $style Add . '" c lass="cont ">';   1314                         $ret .= '< tr style=" ' . $style Add . '" c lass="cont ">';
1315                             $ret . = '<td>' .  $dir . '< /td>';   1315                             $ret . = '<td>' .  $dir . '< /td>';
1316                             $ret . = '<td cla ss="span"> ';   1316                             $ret . = '<td cla ss="span"> ';
1317                                 if  ( isFullA ccessible( '../'.$dir ) )   1317                                 if  ( isFullA ccessible( '../'.$dir ) )
1318                                 {   1318                                 {
1319                                      $ret .=  '<span cla ss="writab le">' . ge tPermissio ns( '../'  . $dir ) .  '</span>< span>Writa ble</span> ';   1319                                      $ret .=  '<span cla ss="writab le">' . ge tPermissio ns( '../'  . $dir ) .  '</span>< span>Writa ble</span> ';
1320                                 }   1320                                 }
1321                                 el se   1321                                 el se
1322                                 {   1322                                 {
1323                                      $ret .=  '<span cla ss="unwrit able">' .  getPermiss ions( '../ ' . $dir )  . '</span ><span>Non -writable< /span>';   1323                                      $ret .=  '<span cla ss="unwrit able">' .  getPermiss ions( '../ ' . $dir )  . '</span ><span>Non -writable< /span>';
1324                                 }   1324                                 }
1325                             $ret . = '</td>';   1325                             $ret . = '</td>';
1326                             $ret . = '<td cla ss="span"> ';   1326                             $ret . = '<td cla ss="span"> ';
1327                                 $r et .= '<sp an class=" desired">7 77</span>< span>Writa ble</span> ';   1327                                 $r et .= '<sp an class=" desired">7 77</span>< span>Writa ble</span> ';
1328                             $ret . = '</td>';   1328                             $ret . = '</td>';
1329                         $ret .= '< /tr>';   1329                         $ret .= '< /tr>';
1330                         $i ++;   1330                         $i ++;
1331                    }   1331                    }
1332                       1332                    
1333                    $ret  .= '<tr c lass="head ">   1333                    $ret  .= '<tr c lass="head ">
1334                         <td>Ray Fi les</td>   1334                         <td>Ray Fi les</td>
1335                         <td>Curren t Level</t d>   1335                         <td>Curren t Level</t d>
1336                         <td>Desire d Level</t d>   1336                         <td>Desire d Level</t d>
1337                    </tr >   1337                    </tr >
1338                    ';   1338                    ';
1339                    $i =  0;   1339                    $i =  0;
1340                    fore ach( $aRay Files as $ file )   1340                    fore ach( $aRay Files as $ file )
1341                    {   1341                    {
1342                         $str   =   $_SERVER[' DOCUMENT_R OOT']   .   $_SERVER[' SCRI P T _ NAM E
'];
  1342                         $str   =   $_SERVER[' DOCUMENT_R OOT']   .   $_SERVER['
P HP _ S E LF '];
1343                         $dir = pre g_replace( "/install\ /(index\.p hp$)/","", $str);   1343                         $dir = pre g_replace( "/install\ /(index\.p hp$)/","", $str);
1344     1344  
1345                         if( file_e xists(  $d ir . $file ) )   1345                         if( file_e xists(  $d ir . $file ) )
1346                         {   1346                         {
1347                             if( ($ i%2) == 0  )   1347                             if( ($ i%2) == 0  )
1348                             {   1348                             {
1349                                 $s tyleAdd =  'backgroun d-color:#e de9e9;';   1349                                 $s tyleAdd =  'backgroun d-color:#e de9e9;';
1350                             }   1350                             }
1351                             else   1351                             else
1352                             {   1352                             {
1353                                 $s tyleAdd =  'backgroun d-color:#f ff;';   1353                                 $s tyleAdd =  'backgroun d-color:#f ff;';
1354                             }   1354                             }
1355                             $ret . = '<tr sty le="' . $s tyleAdd .  '" class=" cont">';   1355                             $ret . = '<tr sty le="' . $s tyleAdd .  '" class=" cont">';
1356                                 $r et .= '<td >' . $file  . '</td>' ;   1356                                 $r et .= '<td >' . $file  . '</td>' ;
1357                                 $r et .= '<td  class="sp an">';   1357                                 $r et .= '<td  class="sp an">';
1358                                 if  ( strpos( $file,'ffm peg') ===  FALSE )   1358                                 if  ( strpos( $file,'ffm peg') ===  FALSE )
1359                                 {   1359                                 {
1360                                      if ( isR WAccessibl e('../'.$f ile) )   1360                                      if ( isR WAccessibl e('../'.$f ile) )
1361                                      {   1361                                      {
1362                                          $ret  .= '<span  class="wr itable">'  . getPermi ssions( '. ./' . $fil e ) . '</s pan><span> Writable</ span>';   1362                                          $ret  .= '<span  class="wr itable">'  . getPermi ssions( '. ./' . $fil e ) . '</s pan><span> Writable</ span>';
1363                                      }   1363                                      }
1364                                      else   1364                                      else
1365                                      {   1365                                      {
1366                                          $ret  .= '<span  class="un writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Non-writ able</span >';   1366                                          $ret  .= '<span  class="un writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Non-writ able</span >';
1367                                      }   1367                                      }
1368                                 }   1368                                 }
1369                                 el se   1369                                 el se
1370                                 {   1370                                 {
1371                                      if ( isF ullAccessi ble('../'. $file) )   1371                                      if ( isF ullAccessi ble('../'. $file) )
1372                                      {   1372                                      {
1373                                          $ret  .= '<span  class="wr itable">'  . getPermi ssions( '. ./' . $fil e ) . '</s pan><span> Executable </span>';   1373                                          $ret  .= '<span  class="wr itable">'  . getPermi ssions( '. ./' . $fil e ) . '</s pan><span> Executable </span>';
1374                                      }   1374                                      }
1375                                      else   1375                                      else
1376                                      {   1376                                      {
1377                                          $ret  .= '<span  class="un writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Unexecut able</span >';   1377                                          $ret  .= '<span  class="un writable"> ' . getPer missions(  '../' . $f ile ) . '< /span><spa n>Unexecut able</span >';
1378                                          $bEr ror = TRUE ;   1378                                          $bEr ror = TRUE ;
1379                                      }   1379                                      }
1380                                 }   1380                                 }
1381                                 $r et .= '</t d>';   1381                                 $r et .= '</t d>';
1382                                 $r et .= '<td  class="sp an">';   1382                                 $r et .= '<td  class="sp an">';
1383                                      if ( str pos($file, 'ffmpeg')  === FALSE  )   1383                                      if ( str pos($file, 'ffmpeg')  === FALSE  )
1384                                      {   1384                                      {
1385                                          $ret  .= '<span  class="de sired">666 </span><sp an>Writabl e</span>';   1385                                          $ret  .= '<span  class="de sired">666 </span><sp an>Writabl e</span>';
1386                                      }   1386                                      }
1387                                      else    1387                                      else 
1388                                      {   1388                                      {
1389                                          $ret  .= '<span  class="de sired">777 </span><sp an>Executa ble</span> ';   1389                                          $ret  .= '<span  class="de sired">777 </span><sp an>Executa ble</span> ';
1390                                      }   1390                                      }
1391                                 $r et .= '</t d>';   1391                                 $r et .= '</t d>';
1392                             $ret . = '</tr>';   1392                             $ret . = '</tr>';
1393                             $i ++;   1393                             $i ++;
1394                         }   1394                         }
1395                    }   1395                    }
1396                       1396                    
1397                       1397                    
1398     1398  
1399                $ret .=  '   1399                $ret .=  '
1400                </table>   1400                </table>
1401                <div cla ss="formKe eper">   1401                <div cla ss="formKe eper">
1402                    <div  class="bu tton_area_ 1">   1402                    <div  class="bu tton_area_ 1">
1403                         <form acti on="' . $_ SERVER['PH P_SELF'] .  '" method ="post">   1403                         <form acti on="' . $_ SERVER['PH P_SELF'] .  '" method ="post">
1404                             <input  id="butto n" type="i mage" src= "images/ch eck.gif" / >   1404                             <input  id="butto n" type="i mage" src= "images/ch eck.gif" / >
1405                             <input  type="hid den" name= "action" v alue="preI nstall" />   1405                             <input  type="hid den" name= "action" v alue="preI nstall" />
1406                         </form>   1406                         </form>
1407                    </di v>';   1407                    </di v>';
1408                $ret .=  '   1408                $ret .=  '
1409                    <div  class="bu tton_area_ 2">   1409                    <div  class="bu tton_area_ 2">
1410                         <form acti on="' . $_ SERVER['PH P_SELF'] .  '" method ="post">   1410                         <form acti on="' . $_ SERVER['PH P_SELF'] .  '" method ="post">
1411                             <input  id="butto n" type="i mage" src= "images/ne xt.gif" />   1411                             <input  id="butto n" type="i mage" src= "images/ne xt.gif" />
1412                             <input  type="hid den" name= "action" v alue="step 1" />   1412                             <input  type="hid den" name= "action" v alue="step 1" />
1413                         </form>   1413                         </form>
1414                    </di v>   1414                    </di v>
1415                    <div  class="cl earBoth">< /div>   1415                    <div  class="cl earBoth">< /div>
1416                </div>   1416                </div>
1417           </ div>';   1417           </ div>';
1418     1418  
1419       $ret . = '</div>' ;   1419       $ret . = '</div>' ;
1420     1420  
1421       return  $ret;   1421       return  $ret;
1422   }   1422   }
1423     1423  
1424   function S tartInstal l()   1424   function S tartInstal l()
1425   {   1425   {
1426       global  $aConf;   1426       global  $aConf;
1427          1427       
1428       $ret . = '<div cl ass="insta ll_pic">';   1428       $ret . = '<div cl ass="insta ll_pic">';
1429           $r et .= 'Dol phin ' . $ aConf['iVe rsion'] .  '.' . $aCo nf['iPatch '];   1429           $r et .= 'Dol phin ' . $ aConf['iVe rsion'] .  '.' . $aCo nf['iPatch '];
1430       $ret . = '</div>' ;   1430       $ret . = '</div>' ;
1431     1431  
1432       $ret . = '<div cl ass="insta ll_text">' ;   1432       $ret . = '<div cl ass="insta ll_text">' ;
1433           $r et .= 'Tha nk you for  choosing  Dolphin Sm art Commun ity Builde r!<br />';   1433           $r et .= 'Tha nk you for  choosing  Dolphin Sm art Commun ity Builde r!<br />';
1434           $r et .= 'Cli ck the but ton below  to create  your own c ommunity.' ;   1434           $r et .= 'Cli ck the but ton below  to create  your own c ommunity.' ;
1435       $ret . = '</div>' ;   1435       $ret . = '</div>' ;
1436          1436       
1437       $ret . = '<div cl ass="insta ll_button" >';   1437       $ret . = '<div cl ass="insta ll_button" >';
1438           $r et .= '<fo rm action= "' . $_SER VER['PHP_S ELF'] . '"  method="p ost">';   1438           $r et .= '<fo rm action= "' . $_SER VER['PHP_S ELF'] . '"  method="p ost">';
1439           $r et .= '<in put id="bu tton" type ="image" s rc="images /install.g if" />';   1439           $r et .= '<in put id="bu tton" type ="image" s rc="images /install.g if" />';
1440           $r et .= '<in put type=" hidden" na me="action " value="p reInstall"  />';   1440           $r et .= '<in put type=" hidden" na me="action " value="p reInstall"  />';
1441           $r et .= '</f orm>';   1441           $r et .= '</f orm>';
1442       $ret . = '</div>' ;   1442       $ret . = '</div>' ;
1443          1443       
1444       return  $ret;   1444       return  $ret;
1445   }   1445   }
1446     1446  
1447   function l oadDolphin ()   1447   function l oadDolphin ()
1448   {   1448   {
1449       $ret . = '<script  type="tex t/javascri pt">   1449       $ret . = '<script  type="tex t/javascri pt">
1450                window.l ocation =  "../index. php";   1450                window.l ocation =  "../index. php";
1451                </script >';   1451                </script >';
1452       return  $ret;   1452       return  $ret;
1453   }   1453   }
1454     1454  
1455   function P ageHeader(  $sAction  = '', $sEr ror = '' )   1455   function P ageHeader(  $sAction  = '', $sEr ror = '' )
1456   {   1456   {
1457       global  $aConf;   1457       global  $aConf;
1458          1458       
1459       $aActi ons = arra y(   1459       $aActi ons = arra y(
1460           "s tartInstal l" => "Dol phin Insta llation",   1460           "s tartInstal l" => "Dol phin Insta llation",
1461           "p reInstall"  => "Permi ssions",   1461           "p reInstall"  => "Permi ssions",
1462           "s tep1" => " Paths",   1462           "s tep1" => " Paths",
1463           "s tep2" => " Database",   1463           "s tep2" => " Database",
1464           "s tep3" => " Configurat ion",   1464           "s tep3" => " Configurat ion",
1465           "s tep4" => " Cron Jobs" ,   1465           "s tep4" => " Cron Jobs" ,
1466           "s tep5" => " Permission s Reversal "   1466           "s tep5" => " Permission s Reversal "
1467       );   1467       );
1468       if( !s trlen( $sA ction ) )   1468       if( !s trlen( $sA ction ) )
1469           $s Action = " startInsta ll";   1469           $s Action = " startInsta ll";
1470     1470  
1471       $ret =  <<<EOJ   1471       $ret =  <<<EOJ
1472   <!DOCTYPE  html PUBLI C "-//W3C/ /DTD XHTML  1.0 Trans itional//E N" "http:/ /www.w3.or g/TR/xhtml 1/DTD/xhtm l1-transit ional.dtd" >   1472   <!DOCTYPE  html PUBLI C "-//W3C/ /DTD XHTML  1.0 Trans itional//E N" "http:/ /www.w3.or g/TR/xhtml 1/DTD/xhtm l1-transit ional.dtd" >
1473       <html  xmlns="htt p://www.w3 .org/1999/ xhtml" xml :lang="en- US" lang=" en-US">   1473       <html  xmlns="htt p://www.w3 .org/1999/ xhtml" xml :lang="en- US" lang=" en-US">
1474           <h ead>   1474           <h ead>
1475                <title>D olphin Sma rt Communi ty Builder  Installat ion Script </title>   1475                <title>D olphin Sma rt Communi ty Builder  Installat ion Script </title>
1476                <link hr ef="genera l.css" rel ="styleshe et" type=" text/css"  />   1476                <link hr ef="genera l.css" rel ="styleshe et" type=" text/css"  />
1477                <meta ht tp-equiv=" Content-Ty pe" conten t="text/ht ml; charse t=UTF-8" / >   1477                <meta ht tp-equiv=" Content-Ty pe" conten t="text/ht ml; charse t=UTF-8" / >
1478                <script  src="../in c/js/funct ions.js" t ype="text/ javascript " language ="javascri pt"></scri pt>   1478                <script  src="../in c/js/funct ions.js" t ype="text/ javascript " language ="javascri pt"></scri pt>
1479                <!--[if  lt IE 7.]>   1479                <!--[if  lt IE 7.]>
1480                <script  defer type ="text/jav ascript" s rc="../inc /js/pngfix .js"></scr ipt>   1480                <script  defer type ="text/jav ascript" s rc="../inc /js/pngfix .js"></scr ipt>
1481                <![endif ]-->   1481                <![endif ]-->
1482           </ head>   1482           </ head>
1483           <b ody>   1483           <b ody>
1484                <div id= "main">   1484                <div id= "main">
1485   EOJ;   1485   EOJ;
1486          1486       
1487       if( $s Action ==  "step5" )   1487       if( $s Action ==  "step5" )
1488           $r et .= '<di v id="topM enuActive" >';   1488           $r et .= '<di v id="topM enuActive" >';
1489       else   1489       else
1490           $r et .= '<di v id="topM enuInactiv e">';   1490           $r et .= '<di v id="topM enuInactiv e">';
1491     1491  
1492       $iCoun terCurrent  = 1;   1492       $iCoun terCurrent  = 1;
1493       $iCoun terActive   = 1;   1493       $iCoun terActive   = 1;
1494     1494  
1495       foreac h ( $aActi ons as $sA ctionKey = > $sAction Value )   1495       foreac h ( $aActi ons as $sA ctionKey = > $sAction Value )
1496       {   1496       {
1497           if ( $sAction  != $sActi onKey )   1497           if ( $sAction  != $sActi onKey )
1498           {   1498           {
1499                $iCounte rActive++;   1499                $iCounte rActive++;
1500           }   1500           }
1501           el se   1501           el se
1502                break;   1502                break;
1503       }   1503       }
1504     1504  
1505       if( st rlen( $sEr ror ) )   1505       if( st rlen( $sEr ror ) )
1506           $i CounterAct ive--;   1506           $i CounterAct ive--;
1507                       1507                    
1508       foreac h ( $aActi ons as $sA ctionKey = > $sAction Value )   1508       foreac h ( $aActi ons as $sA ctionKey = > $sAction Value )
1509       {   1509       {
1510           if ( $iCounte rActive ==  $iCounter Current )   1510           if ( $iCounte rActive ==  $iCounter Current )
1511           {   1511           {
1512                $ret .=  '<div id=" topActive" >';   1512                $ret .=  '<div id=" topActive" >';
1513                    $ret  .= $sActi onValue;   1513                    $ret  .= $sActi onValue;
1514                $ret .=  '</div>';   1514                $ret .=  '</div>';
1515           }   1515           }
1516     1516  
1517           el seif( ($iC ounterActi ve - $iCou nterCurren t) == -1 )   1517           el seif( ($iC ounterActi ve - $iCou nterCurren t) == -1 )
1518           {   1518           {
1519                    $ret  .= '<img  src="image s/active_i nactive.gi f" />';   1519                    $ret  .= '<img  src="image s/active_i nactive.gi f" />';
1520                $ret .=  '<div id=" topInactiv e">';   1520                $ret .=  '<div id=" topInactiv e">';
1521                    $ret  .= $sActi onValue;   1521                    $ret  .= $sActi onValue;
1522                $ret .=  '</div>';   1522                $ret .=  '</div>';
1523                $ret .=  '<img src= "images/in active_ina ctive.gif"  />';   1523                $ret .=  '<img src= "images/in active_ina ctive.gif"  />';
1524           }   1524           }
1525     1525  
1526           el seif( ($iC ounterActi ve - $iCou nterCurren t) == 1 )   1526           el seif( ($iC ounterActi ve - $iCou nterCurren t) == 1 )
1527           {   1527           {
1528                $ret .=  '<div id=" topInactiv e">';   1528                $ret .=  '<div id=" topInactiv e">';
1529                    $ret  .= $sActi onValue;   1529                    $ret  .= $sActi onValue;
1530                $ret .=  '</div>';   1530                $ret .=  '</div>';
1531                $ret .=  '<img src= "images/in active_act ive.gif" / >';   1531                $ret .=  '<img src= "images/in active_act ive.gif" / >';
1532           }   1532           }
1533              1533           
1534           el se   1534           el se
1535           {   1535           {
1536                $ret .=  '<div id=" topInactiv e">';   1536                $ret .=  '<div id=" topInactiv e">';
1537                    $ret  .= $sActi onValue;   1537                    $ret  .= $sActi onValue;
1538                $ret .=  '</div>';   1538                $ret .=  '</div>';
1539                if( $sAc tionKey !=  "step5" )   1539                if( $sAc tionKey !=  "step5" )
1540                    $ret  .= '<img  src="image s/inactive _inactive. gif" />';                    1540                    $ret  .= '<img  src="image s/inactive _inactive. gif" />';                 
1541           }   1541           }
1542              1542           
1543           $i CounterCur rent++;   1543           $i CounterCur rent++;
1544       }   1544       }
1545              1545           
1546          1546       
1547       $ret . = '   1547       $ret . = '
1548                    </di v>   1548                    </di v>
1549                <div id= "header">   1549                <div id= "header">
1550                    <img  src="imag es/boonex_ logo.gif"  alt="" />< /div>   1550                    <img  src="imag es/boonex_ logo.gif"  alt="" />< /div>
1551                <div id= "content"> ';   1551                <div id= "content"> ';
1552     1552  
1553          1553       
1554       return  $ret;   1554       return  $ret;
1555   }   1555   }
1556     1556  
1557   function P ageFooter(  $sAction  )   1557   function P ageFooter(  $sAction  )
1558   {   1558   {
1559       $ret =  '   1559       $ret =  '
1560                </div>';   1560                </div>';
1561          1561       
1562       if( $s Action )   1562       if( $s Action )
1563           $r et .= '   1563           $r et .= '
1564                <div id= "footer">   1564                <div id= "footer">
1565                    <img  src="imag es/dolphin _transpare nt.jpg" al t="" />   1565                    <img  src="imag es/dolphin _transpare nt.jpg" al t="" />
1566                </div>';   1566                </div>';
1567          1567       
1568       $ret . = '   1568       $ret . = '
1569           </ div>   1569           </ div>
1570       </body >   1570       </body >
1571   </html>';   1571   </html>';
1572     1572  
1573       return  $ret;   1573       return  $ret;
1574   }   1574   }
1575     1575  
1576   function p rintInstal lError( $t ext )   1576   function p rintInstal lError( $t ext )
1577   {   1577   {
1578     1578  
1579       $ret . = '<div cl ass="error ">';   1579       $ret . = '<div cl ass="error ">';
1580       $ret . = $text;   1580       $ret . = $text;
1581       $ret . = '</div>' ;   1581       $ret . = '</div>' ;
1582     1582  
1583     1583  
1584     1584  
1585       return  $ret;   1585       return  $ret;
1586   }   1586   }
1587     1587  
1588   function g etPermissi ons( $file name )   1588   function g etPermissi ons( $file name )
1589   {   1589   {
1590       clears tatcache() ;   1590       clears tatcache() ;
1591       $perms  = fileper ms($filena me);   1591       $perms  = fileper ms($filena me);
1592       $ret =  substr( d ecoct( $pe rms ), -3  );   1592       $ret =  substr( d ecoct( $pe rms ), -3  );
1593       return  $ret;   1593       return  $ret;
1594   }   1594   }
1595     1595  
1596   function i sFullAcces sible($fil ename)   1596   function i sFullAcces sible($fil ename)
1597   {   1597   {
1598       clears tatcache() ;   1598       clears tatcache() ;
1599       $perms  = fileper ms($filena me);   1599       $perms  = fileper ms($filena me);
1600       return  ($perms &  0x0004 &&  $perms &  0x0002 &&  $perms & 0 x0001 && ! ($perms &  0x0200)) ?  true : fa lse;   1600       return  ($perms &  0x0004 &&  $perms &  0x0002 &&  $perms & 0 x0001 && ! ($perms &  0x0200)) ?  true : fa lse;
1601   }   1601   }
1602     1602  
1603   function i sRWAccessi ble($filen ame)   1603   function i sRWAccessi ble($filen ame)
1604   {   1604   {
1605       clears tatcache() ;   1605       clears tatcache() ;
1606       $perms  = fileper ms($filena me);   1606       $perms  = fileper ms($filena me);
1607       return  ($perms &  0x0004 &&  $perms &  0x0002) ?  true : fal se;   1607       return  ($perms &  0x0004 &&  $perms &  0x0002) ?  true : fal se;
1608   }   1608   }
1609     1609  
1610   function c reateTable ( $arr )   1610   function c reateTable ( $arr )
1611   {   1611   {
1612       $ret =  '';   1612       $ret =  '';
1613       $i = ' ';   1613       $i = ' ';
1614       foreac h($arr as  $key => $v alue)   1614       foreac h($arr as  $key => $v alue)
1615       {   1615       {
1616           if ( ($i%2) = = 0 )   1616           if ( ($i%2) = = 0 )
1617           {   1617           {
1618                $styleAd d = 'backg round-colo r:#ede9e9; ';   1618                $styleAd d = 'backg round-colo r:#ede9e9; ';
1619           }   1619           }
1620           el se   1620           el se
1621           {   1621           {
1622                $styleAd d = 'backg round-colo r:#fff;';   1622                $styleAd d = 'backg round-colo r:#fff;';
1623           }   1623           }
1624     1624  
1625           $d ef_exp_tex t = "";   1625           $d ef_exp_tex t = "";
1626           if  ( strlen( $value['de f_exp']) )   1626           if  ( strlen( $value['de f_exp']) )
1627           {   1627           {
1628                $funcbod y = $value ['def_exp' ];   1628                $funcbod y = $value ['def_exp' ];
1629                $func =  create_fun ction("",  $funcbody) ;   1629                $func =  create_fun ction("",  $funcbody) ;
1630                $def_exp  = $func() ;   1630                $def_exp  = $func() ;
1631                if ( str len($def_e xp) )   1631                if ( str len($def_e xp) )
1632                {   1632                {
1633                    $def _exp_text  = "&nbsp;< font color =green>fou nd</font>" ;   1633                    $def _exp_text  = "&nbsp;< font color =green>fou nd</font>" ;
1634                    $val ue['def']  = $def_exp ;   1634                    $val ue['def']  = $def_exp ;
1635                }   1635                }
1636                else   1636                else
1637                {   1637                {
1638                    $def _exp_text  = "&nbsp;< font color =red>not f ound</font >";   1638                    $def _exp_text  = "&nbsp;< font color =red>not f ound</font >";
1639                }   1639                }
1640     1640  
1641           }   1641           }
1642     1642  
1643           if  ( $error_ arr[$key]  == 1 )   1643           if  ( $error_ arr[$key]  == 1 )
1644           {   1644           {
1645                $st_err  = ' style= "backgroun d-color:#F FDDDD;" ';   1645                $st_err  = ' style= "backgroun d-color:#F FDDDD;" ';
1646           }   1646           }
1647           el se $st_err  = '';   1647           el se $st_err  = '';
1648           $r et .= '   1648           $r et .= '
1649           <t r class="c ont" style ="' . $sty leAdd . '" >   1649           <t r class="c ont" style ="' . $sty leAdd . '" >
1650                <td>   1650                <td>
1651                <div>   1651                <div>
1652                ' . $val ue['name']  . '   1652                ' . $val ue['name']  . '
1653                </div>   1653                </div>
1654                <div>   1654                <div>
1655                    Desc ription:   1655                    Desc ription:
1656                </div>   1656                </div>
1657                <div>   1657                <div>
1658                    Exam ple:   1658                    Exam ple:
1659                </div>   1659                </div>
1660                </td>   1660                </td>
1661                <td>   1661                <td>
1662                    <div >   1662                    <div >
1663                         <input ' .  $st_err .  ' size="3 0" name="'  . $key .  '" value=" ' . $value ['def'] .  '" />' . $ def_exp_te xt . '   1663                         <input ' .  $st_err .  ' size="3 0" name="'  . $key .  '" value=" ' . $value ['def'] .  '" />' . $ def_exp_te xt . '
1664                    </di v>   1664                    </di v>
1665                    <div >   1665                    <div >
1666                         ' .  $valu e['desc']  . '   1666                         ' .  $valu e['desc']  . '
1667                    </di v>   1667                    </di v>
1668                    <div >   1668                    <div >
1669                         ' . $value ['ex'] . '   1669                         ' . $value ['ex'] . '
1670                    </di v>   1670                    </di v>
1671                </td>   1671                </td>
1672           </ tr>';   1672           </ tr>';
1673           $i  ++;   1673           $i  ++;
1674       }   1674       }
1675     1675  
1676       return  $ret;   1676       return  $ret;
1677   }   1677   }
1678     1678  
1679   function r ewriteFile ($sCode, $ sReplace,  $sFile)   1679   function r ewriteFile ($sCode, $ sReplace,  $sFile)
1680   {   1680   {
1681       $ret =  '';   1681       $ret =  '';
1682       $fs =  filesize(  $sFile );   1682       $fs =  filesize(  $sFile );
1683       $fp =  fopen ( $s File, 'r'  );   1683       $fp =  fopen ( $s File, 'r'  );
1684       if ( $ fp )   1684       if ( $ fp )
1685       {   1685       {
1686           $f content =  fread( $fp , $fs );   1686           $f content =  fread( $fp , $fs );
1687           $f content =  str_replac e( $sCode,  $sReplace , $fconten t );   1687           $f content =  str_replac e( $sCode,  $sReplace , $fconten t );
1688           fc lose( $fp  );   1688           fc lose( $fp  );
1689           $f p = fopen  ( $sFile,  'w' );   1689           $f p = fopen  ( $sFile,  'w' );
1690           if  ( $fp )   1690           if  ( $fp )
1691           {   1691           {
1692                if( fput s ( $fp, $ fcontent )  )   1692                if( fput s ( $fp, $ fcontent )  )
1693                {   1693                {
1694                    $ret  .= true;   1694                    $ret  .= true;
1695                }   1695                }
1696                else   1696                else
1697                {   1697                {
1698                    $ret  .= false;   1698                    $ret  .= false;
1699                }   1699                }
1700                fclose (  $fp );   1700                fclose (  $fp );
1701           }   1701           }
1702           el se   1702           el se
1703           {   1703           {
1704                $ret .=  false;   1704                $ret .=  false;
1705           }   1705           }
1706       }   1706       }
1707       else   1707       else
1708       {   1708       {
1709           $r et .= fals e;   1709           $r et .= fals e;
1710       }   1710       }
1711     1711  
1712       return  $ret;   1712       return  $ret;
1713   }   1713   }
1714     1714  
1715   function R unSQL( $sA dminName,  $sAdminPas sword )   1715   function R unSQL( $sA dminName,  $sAdminPas sword )
1716   {   1716   {
1717       $db['h ost']         = $_POS T['db_host '];   1717       $db['h ost']         = $_POS T['db_host '];
1718       $db['s ock']         = $_POS T['db_sock '];   1718       $db['s ock']         = $_POS T['db_sock '];
1719       $db['p ort']         = $_POS T['db_port '];   1719       $db['p ort']         = $_POS T['db_port '];
1720       $db['u ser']         = $_POS T['db_user '];   1720       $db['u ser']         = $_POS T['db_user '];
1721       $db['p asswd']       = $_POS T['db_pass word'];   1721       $db['p asswd']       = $_POS T['db_pass word'];
1722       $db['d b']           = $_POS T['db_name '];   1722       $db['d b']           = $_POS T['db_name '];
1723          1723       
1724       $db['h ost'] .= (  $db['port '] ? ":{$d b['port']} " : '' ) .  ( $db['so ck'] ? ":{ $db['sock' ]}" : '' ) ;   1724       $db['h ost'] .= (  $db['port '] ? ":{$d b['port']} " : '' ) .  ( $db['so ck'] ? ":{ $db['sock' ]}" : '' ) ;
1725          1725       
1726       $pass  = true;   1726       $pass  = true;
1727       $error Mes = '';   1727       $error Mes = '';
1728       $filen ame = $_PO ST['sql_fi le'];   1728       $filen ame = $_PO ST['sql_fi le'];
1729     1729  
1730       $link  = @mysql_c onnect ( $ db['host'] , $db['use r'], $db[' passwd']   );   1730       $link  = @mysql_c onnect ( $ db['host'] , $db['use r'], $db[' passwd']   );
1731     1731  
1732       if( !$ link )   1732       if( !$ link )
1733           re turn print InstallErr or( mysql_ error() );   1733           re turn print InstallErr or( mysql_ error() );
1734           // return ("< font color =red>Could  not conne ct to MySQ L server:  " . mysql_ error()."< /font>");   1734           // return ("< font color =red>Could  not conne ct to MySQ L server:  " . mysql_ error()."< /font>");
1735     1735  
1736       if (!m ysql_selec t_db ($db[ 'db'], $li nk))   1736       if (!m ysql_selec t_db ($db[ 'db'], $li nk))
1737           re turn print InstallErr or( $db['d b'] . ': '  . mysql_e rror() );   1737           re turn print InstallErr or( $db['d b'] . ': '  . mysql_e rror() );
1738           // return ("< font color =red>Could  not selec t database  '{$db['db ']}': " .  mysql_erro r()."</fon t>");   1738           // return ("< font color =red>Could  not selec t database  '{$db['db ']}': " .  mysql_erro r()."</fon t>");
1739     1739  
1740       if ( ! ($f = fope n ( $filen ame, "r" ) ) )   1740       if ( ! ($f = fope n ( $filen ame, "r" ) ) )
1741           re turn print InstallErr or( 'Could  not open  file with  sql instru ctions:' .  $filename   );   1741           re turn print InstallErr or( 'Could  not open  file with  sql instru ctions:' .  $filename   );
1742          //r eturn ("<f ont color= red>Could  not open f ile with s ql instruc tions: $fi lename </f ont>");   1742          //r eturn ("<f ont color= red>Could  not open f ile with s ql instruc tions: $fi lename </f ont>");
1743     1743  
1744     1744  
1745       //Begi n SQL scri pt executi ng   1745       //Begi n SQL scri pt executi ng
1746       $s_sql  = "";   1746       $s_sql  = "";
1747       while  ( $s = fge ts ( $f, 1 0240) )   1747       while  ( $s = fge ts ( $f, 1 0240) )
1748       {   1748       {
1749           $s  = trim( $ s ); //Utf  with BOM  only   1749           $s  = trim( $ s ); //Utf  with BOM  only
1750     1750  
1751           if ( !strlen(  $s ) ) co ntinue;   1751           if ( !strlen(  $s ) ) co ntinue;
1752           if  ( mb_subs tr( $s, 0,  1 ) == '# '  ) conti nue; //pas s comments   1752           if  ( mb_subs tr( $s, 0,  1 ) == '# '  ) conti nue; //pas s comments
1753           if  ( mb_subs tr( $s, 0,  2 ) == '- -' ) conti nue;   1753           if  ( mb_subs tr( $s, 0,  2 ) == '- -' ) conti nue;
1754           if  ( substr(  $s, 0, 5  ) == "\xEF \xBB\xBF\x 2D\x2D" )  continue;   1754           if  ( substr(  $s, 0, 5  ) == "\xEF \xBB\xBF\x 2D\x2D" )  continue;
1755              1755           
1756           $s _sql .= $s ;   1756           $s _sql .= $s ;
1757              1757           
1758           if  ( mb_subs tr( $s, -1  ) != ';'     ) conti nue;   1758           if  ( mb_subs tr( $s, -1  ) != ';'     ) conti nue;
1759              1759           
1760           $r es = mysql _query ( $ s_sql, $li nk );   1760           $r es = mysql _query ( $ s_sql, $li nk );
1761           if  ( !$res )   1761           if  ( !$res )
1762                $errorMe s .= 'Erro r while ex ecuting: '  . $s_sql   . '<br /> ' . mysql_ error() .  '<hr />';   1762                $errorMe s .= 'Erro r while ex ecuting: '  . $s_sql   . '<br /> ' . mysql_ error() .  '<hr />';
1763              1763           
1764           $s _sql = "";   1764           $s _sql = "";
1765       }   1765       }
1766       mysql_ query ( "U PDATE `Adm ins` SET ` Name`='{$s AdminName} ', `Passwo rd`=md5( ' {$sAdminPa ssword}' )  WHERE `Na me`='admin '", $link  );   1766       mysql_ query ( "U PDATE `Adm ins` SET ` Name`='{$s AdminName} ', `Passwo rd`=md5( ' {$sAdminPa ssword}' )  WHERE `Na me`='admin '", $link  );
1767       if ( ! $res )   1767       if ( ! $res )
1768           $e rrorMes .=  'Error wh ile execut ing: ' . $ s_sql  . ' <br />' .  mysql_erro r() . '<hr  />';   1768           $e rrorMes .=  'Error wh ile execut ing: ' . $ s_sql  . ' <br />' .  mysql_erro r() . '<hr  />';
1769     1769  
1770       fclose ($f);   1770       fclose ($f);
1771     1771  
1772       $enabl e_gd_value  = extensi on_loaded(  'gd' ) ?  'on' : '';   1772       $enabl e_gd_value  = extensi on_loaded(  'gd' ) ?  'on' : '';
1773       if ( ! (mysql_que ry ( "UPDA TE `GlPara ms` SET `V ALUE`='$en able_gd_va lue' WHERE  `Name`='e nable_gd'" , $link )  ) )   1773       if ( ! (mysql_que ry ( "UPDA TE `GlPara ms` SET `V ALUE`='$en able_gd_va lue' WHERE  `Name`='e nable_gd'" , $link )  ) )
1774           $r et .= "<fo nt color=r ed><i><b>E rror</b>:< /i> ".mysq l_error(). "</font><h r>";   1774           $r et .= "<fo nt color=r ed><i><b>E rror</b>:< /i> ".mysq l_error(). "</font><h r>";
1775     1775  
1776       mysql_ close($lin k);   1776       mysql_ close($lin k);
1777     1777  
1778       $error Mes .= $re t;   1778       $error Mes .= $re t;
1779     1779  
1780       if( st rlen( $err orMes ) )   1780       if( st rlen( $err orMes ) )
1781       {   1781       {
1782           re turn print InstallErr or( $error Mes );   1782           re turn print InstallErr or( $error Mes );
1783       }   1783       }
1784       else   1784       else
1785       {   1785       {
1786           re turn 'done ';   1786           re turn 'done ';
1787       }   1787       }
1788     1788  
1789   //    retu rn $ret."T runcating  tables fin ished.<br> ";   1789   //    retu rn $ret."T runcating  tables fin ished.<br> ";
1790   }   1790   }
1791     1791  
1792   // set err or reporti ng level   1792   // set err or reporti ng level
1793   error_repo rting(E_AL L & ~E_NOT ICE);   1793   error_repo rting(E_AL L & ~E_NOT ICE);
1794   ?>   1794   ?>