228. File Comparison Report

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

228.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\inc db.inc.php Fri Nov 9 08:05:32 2007 UTC
2 Dolphin-v.6.1.0\inc db.inc.php Sat Apr 19 12:05:00 2008 UTC

228.2 Comparison summary

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

228.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

228.4 Active regular expressions

No regular expressions were active.

228.5 Comparison detail

1   <?   1   <?
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   require_on ce("header .inc.php") ;   21   require_on ce("header .inc.php") ;
22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );   22   require_on ce( BX_DIR ECTORY_PAT H_INC . 'u tils.inc.p hp' );
23     23  
24   define( 'D B_FULL_VIS UAL_PROCES SING', tru e );   24   define( 'D B_FULL_VIS UAL_PROCES SING', tru e );
25   define( 'D B_FULL_DEB UG_MODE',  false );   25   define( 'D B_FULL_DEB UG_MODE',  false );
26   define( 'D B_DO_EMAIL _ERROR_REP ORT', true  );   26   define( 'D B_DO_EMAIL _ERROR_REP ORT', true  );
27     27  
28     28  
29   $MySQL = n ew CMySQL;   29   $MySQL = n ew CMySQL;
30     30  
31   if( !$MySQ L->connect () )   31   if( !$MySQ L->connect () )
32       genMyS QLErr( 'Da tabase con nect faile d' );   32       genMyS QLErr( 'Da tabase con nect faile d' );
33     33  
34   if( !$MySQ L->select_ db() )   34   if( !$MySQ L->select_ db() )
35       genMyS QLErr( 'Da tabase sel ect failed ' );   35       genMyS QLErr( 'Da tabase sel ect failed ' );
36     36  
37   db_res( "S ET NAMES ' utf8'" );   37   db_res( "S ET NAMES ' utf8'" );
38     38  
39   $cachePara m = array( );   39   $cachePara m = array( );
40     40  
41     41  
42     42  
43     43  
44   class CMyS QL   44   class CMyS QL
45   {   45   {
46       var $h ost      =  DATABASE_ HOST;   46       var $h ost      =  DATABASE_ HOST;
47       var $s ock      =  DATABASE_ SOCK;   47       var $s ock      =  DATABASE_ SOCK;
48       var $p ort      =  DATABASE_ PORT;   48       var $p ort      =  DATABASE_ PORT;
49       var $u ser      =  DATABASE_ USER;   49       var $u ser      =  DATABASE_ USER;
50       var $p asswd    =  DATABASE_ PASS;   50       var $p asswd    =  DATABASE_ PASS;
51       var $d b        =  DATABASE_ NAME;   51       var $d b        =  DATABASE_ NAME;
52       var $c onnected =  false;   52       var $c onnected =  false;
53       var $l ink      =  null;   53       var $l ink      =  null;
54          54       
55       functi on connect ()   55       functi on connect ()
56       {   56       {
57           if  ( $this-> connected  )   57           if  ( $this-> connected  )
58                return;   58                return;
59     59  
60           if ( strlen($ this->port ) )   60           if ( strlen($ this->port ) )
61                $this->p ort = ":". $this->por t;   61                $this->p ort = ":". $this->por t;
62     62  
63           if  ( strlen( $this->soc k) )   63           if  ( strlen( $this->soc k) )
64                $this->s ock = ":". $this->soc k;   64                $this->s ock = ":". $this->soc k;
65     65  
66           $t his->link  = @mysql_p connect( $ this->host  . $this-> port . $th is->sock,  $this->use r, $this-> passwd );   66           $t his->link  = @mysql_p connect( $ this->host  . $this-> port . $th is->sock,  $this->use r, $this-> passwd );
67     67  
68           if  ( $this-> link )   68           if  ( $this-> link )
69                $this->c onnected =  true;   69                $this->c onnected =  true;
70     70  
71           re turn $this ->connecte d;   71           re turn $this ->connecte d;
72       }   72       }
73     73  
74       functi on select_ db()   74       functi on select_ db()
75       {   75       {
76           re turn @mysq l_select_d b( $this-> db );   76           re turn @mysq l_select_d b( $this-> db );
77       }   77       }
78   }   78   }
79     79  
80   function d b_list_tab les( $erro r_checking  = true )   80   function d b_list_tab les( $erro r_checking  = true )
81   {   81   {
82       global  $MySQL;   82       global  $MySQL;
83     83  
84       $res =  mysql_lis t_tables($ MySQL->db) ;   84       $res =  mysql_lis t_tables($ MySQL->db) ;
85       if ( $ error_chec king && !$ res )   85       if ( $ error_chec king && !$ res )
86           ge nMySQLErr(  'Database  list tabl es failed'  );   86           ge nMySQLErr(  'Database  list tabl es failed'  );
87     87  
88       return  $res;   88       return  $res;
89   }   89   }
90     90  
91   function d b_get_enco ding ( $er ror_checki ng = true  )   91   function d b_get_enco ding ( $er ror_checki ng = true  )
92   {   92   {
93       global  $MySQL;   93       global  $MySQL;
94     94  
95       $res =  mysql_cli ent_encodi ng($MySQL- >link);   95       $res =  mysql_cli ent_encodi ng($MySQL- >link);
96       if ( $ error_chec king && !$ res )   96       if ( $ error_chec king && !$ res )
97           ge nMySQLErr(  'Database  get encod ing error'  );   97           ge nMySQLErr(  'Database  get encod ing error'  );
98     98  
99       return  $res;   99       return  $res;
100   }   100   }
101     101  
102   function d b_res( $qu ery, $erro r_checking  = true )   102   function d b_res( $qu ery, $erro r_checking  = true )
103   {   103   {
104       global  $MySQL;   104       global  $MySQL;
105     105  
106       $res =  mysql_que ry( $query , $MySQL-> link );   106       $res =  mysql_que ry( $query , $MySQL-> link );
107       if ( $ error_chec king && !$ res )   107       if ( $ error_chec king && !$ res )
108           ge nMySQLErr(  'Database  query err or', $quer y );   108           ge nMySQLErr(  'Database  query err or', $quer y );
109     109  
110       return  $res;   110       return  $res;
111   }   111   }
112     112  
113   function d b_arr( $qu ery, $erro r_checking  = true )   113   function d b_arr( $qu ery, $erro r_checking  = true )
114   {   114   {
115       $res =  db_res( $ query, $er ror_checki ng );   115       $res =  db_res( $ query, $er ror_checki ng );
116       if( !$ res )   116       if( !$ res )
117           re turn false ;   117           re turn false ;
118       $arr =  mysql_fet ch_array(  $res );   118       $arr =  mysql_fet ch_array(  $res );
119       return  $arr;   119       return  $arr;
120   }   120   }
121     121  
122   function d b_assoc_ar r( $query,  $error_ch ecking = t rue )   122   function d b_assoc_ar r( $query,  $error_ch ecking = t rue )
123   {   123   {
124       $res =  db_res( $ query, $er ror_checki ng );   124       $res =  db_res( $ query, $er ror_checki ng );
125       if( !$ res )   125       if( !$ res )
126           re turn false ;   126           re turn false ;
127       $arr =  mysql_fet ch_assoc(  $res );   127       $arr =  mysql_fet ch_assoc(  $res );
128       return  $arr;   128       return  $arr;
129   }   129   }
130     130  
131   function d b_value( $ query, $er ror_checki ng = true,  $index =  0 )   131   function d b_value( $ query, $er ror_checki ng = true,  $index =  0 )
132   {   132   {
133       $arr =  db_arr( $ query, $er ror_checki ng );   133       $arr =  db_arr( $ query, $er ror_checki ng );
134       $val =  $arr[$ind ex];   134       $val =  $arr[$ind ex];
135       return  $val;   135       return  $val;
136   }   136   }
137     137  
138   function f ill_array(  $res )   138   function f ill_array(  $res )
139   {   139   {
140       global  $MySQL;   140       global  $MySQL;
141     141  
142       if (!$ res)   142       if (!$ res)
143           re turn false ;   143           re turn false ;
144     144  
145       $i = 0 ;   145       $i = 0 ;
146       $arr =  array();   146       $arr =  array();
147       while(  $r = mysq l_fetch_ar ray( $res  ) )   147       while(  $r = mysq l_fetch_ar ray( $res  ) )
148           $a rr[$i++] =  $r;   148           $a rr[$i++] =  $r;
149     149  
150       return  $arr;   150       return  $arr;
151   }   151   }
152     152  
153   function f ill_assoc_ array( $re s )   153   function f ill_assoc_ array( $re s )
154   {   154   {
155       global  $MySQL;   155       global  $MySQL;
156     156  
157       if (!$ res)   157       if (!$ res)
158           re turn false ;   158           re turn false ;
159     159  
160       $i = 0 ;   160       $i = 0 ;
161       $arr =  array();   161       $arr =  array();
162       while(  $r = mysq l_fetch_as soc( $res  ) )   162       while(  $r = mysq l_fetch_as soc( $res  ) )
163           $a rr[$i++] =  $r;   163           $a rr[$i++] =  $r;
164     164  
165       return  $arr;   165       return  $arr;
166   }   166   }
167     167  
168   function g etParam( $ param_name , $use_cac he = true  )   168   function g etParam( $ param_name , $use_cac he = true  )
169   {   169   {
170       global  $cachePar am;   170       global  $cachePar am;
171     171  
172       if ( $ use_cache  && isset($ cacheParam [$param_na me]) )   172       if ( $ use_cache  && isset($ cacheParam [$param_na me]) )
173           re turn $cach eParam[$pa ram_name];   173           re turn $cach eParam[$pa ram_name];
174       elseif  ( !$line  = db_assoc _arr( "SEL ECT `VALUE ` FROM `Gl Params` WH ERE `Name`  = '$param _name'" )  )   174       elseif  ( !$line  = db_assoc _arr( "SEL ECT `VALUE ` FROM `Gl Params` WH ERE `Name`  = '$param _name'" )  )
175           re turn false ;   175           re turn false ;
176       $cache Param[$par am_name] =  $line['VA LUE'];   176       $cache Param[$par am_name] =  $line['VA LUE'];
177       return  $line['VA LUE'];   177       return  $line['VA LUE'];
178   }   178   }
179     179  
180   function g etParamDes c( $param_ name )   180   function g etParamDes c( $param_ name )
181   {   181   {
182       if ( ! $line = db _assoc_arr ( "SELECT  `desc` FRO M `GlParam s` WHERE ` Name` = '$ param_name '" ) )   182       if ( ! $line = db _assoc_arr ( "SELECT  `desc` FRO M `GlParam s` WHERE ` Name` = '$ param_name '" ) )
183           re turn false ;   183           re turn false ;
184       return  $line['de sc'];   184       return  $line['de sc'];
185   }   185   }
186     186  
187   function s etParam( $ param_name , $param_v al )   187   function s etParam( $ param_name , $param_v al )
188   {   188   {
189       global  $cachePar am;   189       global  $cachePar am;
190          190       
191       if ( ! $res = db_ res( "UPDA TE `GlPara ms` SET `V ALUE` = '" .process_d b_input($p aram_val). "' WHERE ` Name` = '$ param_name '" ) )   191       if ( ! $res = db_ res( "UPDA TE `GlPara ms` SET `V ALUE` = '" .process_d b_input($p aram_val). "' WHERE ` Name` = '$ param_name '" ) )
192           re turn false ;   192           re turn false ;
193          193       
194       $cache Param[$par am_name] =  $line[$pa ram_val];   194       $cache Param[$par am_name] =  $line[$pa ram_val];
195       return  true;   195       return  true;
196   }   196   }
197     197  
198   function m ysqlErrorR eport()   198   function m ysqlErrorR eport()
199   {   199   {
200           ma il( $site[ 'bugReport Mail'], "E rror", "Er ror in $_S ERVER[PHP_ SELF]: " .  mysql_err or() . "\n Query: '$q uery'" );   200           ma il( $site[ 'bugReport Mail'], "E rror", "Er ror in $_S ERVER[PHP_ SELF]: " .  mysql_err or() . "\n Query: '$q uery'" );
201   }   201   }
202     202  
203   function g enMySQLErr ( $out, $q uery ='' )   203   function g enMySQLErr ( $out, $q uery ='' )
204   {   204   {
205       global  $site;   205       global  $site;
206          206       
207       $aBack Trace = de bug_backtr ace();   207       $aBack Trace = de bug_backtr ace();
208       unset(  $aBackTra ce[0] );   208       unset(  $aBackTra ce[0] );
209          209       
210       if( $q uery )   210       if( $q uery )
211       {   211       {
212           // try help t o find err or   212           // try help t o find err or
213              213           
214           $a FoundError  = array() ;   214           $a FoundError  = array() ;
215              215           
216           fo reach( $aB ackTrace a s $aCall )   216           fo reach( $aB ackTrace a s $aCall )
217           {   217           {
218                foreach(  $aCall['a rgs'] as $ argNum =>  $argVal )   218                foreach(  $aCall['a rgs'] as $ argNum =>  $argVal )
219                {   219                {
220                     if(  
strcmp(   $argVal,   $query   )   ==   0   )
  220                     if(   is_string( $argVal)   and   strcmp(   $argVal,   $query   )   ==   0   )
221                    {   221                    {
222                         $aFoundErr or['file']      = $aC all['file' ];   222                         $aFoundErr or['file']      = $aC all['file' ];
223                         $aFoundErr or['line']      = $aC all['line' ];   223                         $aFoundErr or['line']      = $aC all['line' ];
224                         $aFoundErr or['functi on'] = $aC all['funct ion'];   224                         $aFoundErr or['functi on'] = $aC all['funct ion'];
225                         $aFoundErr or['arg']       = $ar gNum;   225                         $aFoundErr or['arg']       = $ar gNum;
226                    }   226                    }
227                }   227                }
228           }   228           }
229              229           
230           if ( $aFoundE rror )   230           if ( $aFoundE rror )
231           {   231           {
232                $sFoundE rror = <<< EOJ   232                $sFoundE rror = <<< EOJ
233   <b>Found e rror</b> i n file <b> {$aFoundEr ror['file' ]}</b><br  />   233   <b>Found e rror</b> i n file <b> {$aFoundEr ror['file' ]}</b><br  />
234   at line <b >{$aFoundE rror['line ']}</b>. C alled <b>{ $aFoundErr or['functi on']}</b>  function    234   at line <b >{$aFoundE rror['line ']}</b>. C alled <b>{ $aFoundErr or['functi on']}</b>  function 
235   with erron eous argum ent #<b>{$ aFoundErro r['arg']}< /b><br />   235   with erron eous argum ent #<b>{$ aFoundErro r['arg']}< /b><br />
236   <br />   236   <br />
237     237  
238   EOJ;   238   EOJ;
239           }   239           }
240       }   240       }
241     241  
242          242       
243       if( DB _FULL_VISU AL_PROCESS ING )   243       if( DB _FULL_VISU AL_PROCESS ING )
244       {   244       {
245           ?>   245           ?>
246                <div sty le="border :2px solid  red;paddi ng:4px;wid th:600px;m argin:0px  auto;">   246                <div sty le="border :2px solid  red;paddi ng:4px;wid th:600px;m argin:0px  auto;">
247                    <div  style="te xt-align:c enter;back ground-col or:red;col or:white;f ont-weight :bold;">Er ror</div>   247                    <div  style="te xt-align:c enter;back ground-col or:red;col or:white;f ont-weight :bold;">Er ror</div>
248                    <div  style="te xt-align:c enter;"><? =$out?></d iv>   248                    <div  style="te xt-align:c enter;"><? =$out?></d iv>
249           <?   249           <?
250           if ( DB_FULL_ DEBUG_MODE  )   250           if ( DB_FULL_ DEBUG_MODE  )
251           {   251           {
252                if( strl en( $query  ) )   252                if( strl en( $query  ) )
253                    echo  "<div><b> Query:</b> <br />{$qu ery}</div> ";   253                    echo  "<div><b> Query:</b> <br />{$qu ery}</div> ";
254                   254                
255                echo '<d iv><b>Mysq l error:</ b><br />'. mysql_erro r().'</div >';   255                echo '<d iv><b>Mysq l error:</ b><br />'. mysql_erro r().'</div >';
256                echo '<d iv style=" overflow:s croll;heig ht:300px;b order:1px  solid gray ;">';   256                echo '<d iv style=" overflow:s croll;heig ht:300px;b order:1px  solid gray ;">';
257                    echo  $sFoundEr ror;   257                    echo  $sFoundEr ror;
258                    echo  "<b>Debug  backtrace :</b><br / >";   258                    echo  "<b>Debug  backtrace :</b><br / >";
259                    echo Dbg( $aBac kTrace );   259                    echo Dbg( $aBac kTrace );
260                       260                    
261                    echo  "<b>Calle d script:< /b> {$_SER VER['PHP_S ELF']}<br  />";   261                    echo  "<b>Calle d script:< /b> {$_SER VER['PHP_S ELF']}<br  />";
262                    echo  "<b>Reque st paramet ers:</b><b r />";   262                    echo  "<b>Reque st paramet ers:</b><b r />";
263                    echo Dbg( $_REQ UEST );   263                    echo Dbg( $_REQ UEST );
264                echo '</ div>';   264                echo '</ div>';
265           }   265           }
266           ?>   266           ?>
267                </div>   267                </div>
268           <?   268           <?
269       }   269       }
270       else   270       else
271           ec ho $out;   271           ec ho $out;
272          272       
273       if( DB _DO_EMAIL_ ERROR_REPO RT )   273       if( DB _DO_EMAIL_ ERROR_REPO RT )
274       {   274       {
275           $s MailBody =  "Database  error in  <SiteName> \n";   275           $s MailBody =  "Database  error in  <SiteName> \n";
276     276  
277           if ( strlen(  $query ) )   277           if ( strlen(  $query ) )
278                $sMailBo dy .= "Que ry:\n{$que ry}\n\n";   278                $sMailBo dy .= "Que ry:\n{$que ry}\n\n";
279              279           
280           $s MailBody . = "Mysql e rror:\n" .  mysql_err or() . "\n \n";   280           $s MailBody . = "Mysql e rror:\n" .  mysql_err or() . "\n \n";
281              281           
282           $s MailBody . = strip_ta gs( $sFoun dError );   282           $s MailBody . = strip_ta gs( $sFoun dError );
283              283           
284           $s MailBody . = "Debug b acktrace:\ n" . print _r( $aBack Trace, tru e ) . "\n\ n";   284           $s MailBody . = "Debug b acktrace:\ n" . print _r( $aBack Trace, tru e ) . "\n\ n";
285           $s MailBody . = "Called  script: {$ _SERVER['P HP_SELF']} \n\n";   285           $s MailBody . = "Called  script: {$ _SERVER['P HP_SELF']} \n\n";
286           $s MailBody . = "Request  parameter s:\n" . pr int_r( $_R EQUEST, tr ue ) . "\n \n";   286           $s MailBody . = "Request  parameter s:\n" . pr int_r( $_R EQUEST, tr ue ) . "\n \n";
287              287           
288           $s MailBody . = "--\nAut o-report s ystem\n";   288           $s MailBody . = "--\nAut o-report s ystem\n";
289              289           
290           se ndMail( $s ite['bugRe portMail'] , "Databas e error in  <SiteName >", $sMail Body );   290           se ndMail( $s ite['bugRe portMail'] , "Databas e error in  <SiteName >", $sMail Body );
291       }   291       }
292          292       
293       exit;   293       exit;
294   }   294   }
295     295  
296   ?>   296   ?>