191. File Comparison Report

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

191.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\inc\classes BxDolDb.php Thu Sep 20 08:58:32 2007 UTC
2 Dolphin-v.6.1.0\inc\classes BxDolDb.php Tue Apr 15 11:33:44 2008 UTC

191.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 4 440
Changed 1 2
Inserted 2 10
Removed 0 0

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

191.4 Active regular expressions

No regular expressions were active.

191.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) 2007 Bo onEx Group   7   *     copy right             : ( C) 2007 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; yo u can redi stribute i t and/or m odify it u nder   11   * Dolphin  is free so ftware; yo u can redi stribute i t and/or m odify it u nder
12   * the term s of the G NU General  Public Li cense as p ublished b y the   12   * the term s of the G NU General  Public Li cense as p ublished b y the
13   * Free Sof tware Foun dation; ei ther versi on 2 of th e   13   * Free Sof tware Foun dation; ei ther versi on 2 of th e
14   * License,  or  any l ater versi on.   14   * License,  or  any l ater versi on.
15   *   15   *
16   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;   16   * Dolphin  is distrib uted in th e hope tha t it will  be useful,  but WITHO UT ANY WAR RANTY;
17   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   17   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
18   * See the  GNU Genera l Public L icense for  more deta ils.   18   * See the  GNU Genera l Public L icense for  more deta ils.
19   * You shou ld have re ceived a c opy of the  GNU Gener al Public  License al ong with D olphin,   19   * You shou ld have re ceived a c opy of the  GNU Gener al Public  License al ong with D olphin,
20   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   20   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
21   ********** ********** ********** ********** ********** ********** ********** *****/   21   ********** ********** ********** ********** ********** ********** ********** *****/
22     22  
23   define('BX _DOL_TABLE _PROFILES' , '`Profil es`');   23   define('BX _DOL_TABLE _PROFILES' , '`Profil es`');
24     24  
25     25  
26   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolMi stake.php'  );   26   require_on ce( BX_DIR ECTORY_PAT H_CLASSES  . 'BxDolMi stake.php'  );
27     27  
28   class BxDo lDb extend s BxDolMis take   28   class BxDo lDb extend s BxDolMis take
29   {   29   {
30       var $h ost, $port , $socket,  $dbname,  $user, $pa ssword, $l ink;   30       var $h ost, $port , $socket,  $dbname,  $user, $pa ssword, $l ink;
31       var $c urrent_res , $current _arr_type;   31       var $c urrent_res , $current _arr_type;
32     32  
33       /*   33       /*
34       *set d atabase pa rameters a nd connect  to it   34       *set d atabase pa rameters a nd connect  to it
35       */   35       */
36       functi on BxDolDb ()   36       functi on BxDolDb ()
37       {   37       {
38           $t his->host  = DATABASE _HOST;   38           $t his->host  = DATABASE _HOST;
39           $t his->port  = DATABASE _PORT;   39           $t his->port  = DATABASE _PORT;
40           $t his->socke t = DATABA SE_SOCK;   40           $t his->socke t = DATABA SE_SOCK;
41           $t his->dbnam e = DATABA SE_NAME;   41           $t his->dbnam e = DATABA SE_NAME;
42           $t his->user  = DATABASE _USER;   42           $t his->user  = DATABASE _USER;
43           $t his->passw ord = DATA BASE_PASS;   43           $t his->passw ord = DATA BASE_PASS;
44           $t his->curre nt_arr_typ e = MYSQL_ ASSOC;   44           $t his->curre nt_arr_typ e = MYSQL_ ASSOC;
45     45  
46           //   connect  to db auto matically   46           //   connect  to db auto matically
47           $t his->conne ct();   47           $t his->conne ct();
48       }   48       }
49     49  
50       /**   50       /**
51        * con nect to da tabase wit h appointe d paramete rs   51        * con nect to da tabase wit h appointe d paramete rs
52        */   52        */
53       functi on connect ()   53       functi on connect ()
54       {   54       {
55           $f ull_host =  $this->ho st;   55           $f ull_host =  $this->ho st;
56           $f ull_host . = $this->p ort ? ':'. $this->por t : '';   56           $f ull_host . = $this->p ort ? ':'. $this->por t : '';
57           $f ull_host . = $this->s ocket ? ': '.$this->s ocket : '' ;   57           $f ull_host . = $this->s ocket ? ': '.$this->s ocket : '' ;
58     58  
59           $t his->link  = @mysql_p connect($f ull_host,  $this->use r, $this-> password)  or $this-> error('Can not connec t to datab ase');   59           $t his->link  = @mysql_p connect($f ull_host,  $this->use r, $this-> password)  or $this-> error('Can not connec t to datab ase');
60           if  (!$this-> link)   60           if  (!$this-> link)
61           {   61           {
62                echo 'Co uld not co nnect to M ySQL datab ase. <br / >Did you p roperly ed it <b>inc/ header.inc .php</b> f ile ?';   62                echo 'Co uld not co nnect to M ySQL datab ase. <br / >Did you p roperly ed it <b>inc/ header.inc .php</b> f ile ?';
63                 exit; ;   63                 exit;
64           }   64           }
65     65  
66           if  (!$this-> select_db( ))   66           if  (!$this-> select_db( ))
67           {   67           {
68                echo 'Co uld not se lect MySQL  database.  <br />Did  you prope rly edit < b>inc/head er.inc.php </b> file  ?';   68                echo 'Co uld not se lect MySQL  database.  <br />Did  you prope rly edit < b>inc/head er.inc.php </b> file  ?';
69                exit;   69                exit;
70           }   70           }
    71           
    72           if ( !mysql_q uery( "SET  NAMES 'ut f8'", $thi s -> link  ) ) {
    73                echo 'Co uld not ma ke SET NAM ES. Please  upgrade y our server .';
    74                exit;
    75           }
71       }   76       }
72     77  
73       functi on select_ db()   78       functi on select_ db()
74       {   79       {
75           re turn @mysq l_select_d b($this->d bname, $th is->link)  or $this-> error('Can not comple te query ( select_db) ');   80           re turn @mysq l_select_d b($this->d bname, $th is->link)  or $this-> error('Can not comple te query ( select_db) ');
76       }   81       }
77     82  
78       /**   83       /**
79        * clo se mysql c onnection   84        * clo se mysql c onnection
80        */   85        */
81       functi on close()   86       functi on close()
82       {   87       {
83           my sql_close( $this->lin k);   88           my sql_close( $this->lin k);
84       }   89       }
85     90  
86     91  
87     92  
88     93  
89       /**   94       /**
90        * exe cute sql q uery and r eturn one  row result   95        * exe cute sql q uery and r eturn one  row result
91        */   96        */
92       functi on getRow( $query, $a rr_type =  MYSQL_ASSO C)   97       functi on getRow( $query, $a rr_type =  MYSQL_ASSO C)
93       {   98       {
94           if (!$query)   99           if (!$query)
95                return a rray();   100                return a rray();
96           if ($arr_type  != MYSQL_ ASSOC && $ arr_type ! = MYSQL_NU M)   101           if ($arr_type  != MYSQL_ ASSOC && $ arr_type ! = MYSQL_NU M)
97                $arr_typ e = MYSQL_ ASSOC;   102                $arr_typ e = MYSQL_ ASSOC;
98           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror('Canno t complete  query (ge tRow)');   103           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror('Canno t complete  query (ge tRow)');
99           $a rr_res = a rray();   104           $a rr_res = a rray();
100           if ($res && m ysql_num_r ows($res))   105           if ($res && m ysql_num_r ows($res))
101           {   106           {
102                $arr_res  = mysql_f etch_array ($res, $ar r_type);   107                $arr_res  = mysql_f etch_array ($res, $ar r_type);
103                mysql_fr ee_result( $res);   108                mysql_fr ee_result( $res);
104           }   109           }
105           re turn $arr_ res;   110           re turn $arr_ res;
106       }   111       }
107     112  
108       /**   113       /**
109        * exe cute sql q uery and r eturn one  value resu lt   114        * exe cute sql q uery and r eturn one  value resu lt
110        */   115        */
111       functi on getOne( $query)   116       functi on getOne( $query)
112       {   117       {
113           if (!$query)   118           if (!$query)
114                return f alse;   119                return f alse;
115           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror("Canno t complete  query [$q uery] (get One)");   120           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror("Canno t complete  query [$q uery] (get One)");
116           $a rr_res = a rray();   121           $a rr_res = a rray();
117           if ($res && m ysql_num_r ows($res))   122           if ($res && m ysql_num_r ows($res))
118                $arr_res  = mysql_f etch_array ($res);   123                $arr_res  = mysql_f etch_array ($res);
119           if (count($ar r_res))   124           if (count($ar r_res))
120                return $ arr_res[0] ;   125                return $ arr_res[0] ;
121           el se   126           el se
122                return f alse;   127                return f alse;
123       }   128       }
124     129  
125       /**   130       /**
126        * exe cute sql q uery and r eturn the  first row  of result   131        * exe cute sql q uery and r eturn the  first row  of result
127        * and  keep $arr ay type an d poiter t o all data   132        * and  keep $arr ay type an d poiter t o all data
128        */   133        */
129       functi on getFirs tRow($quer y, $arr_ty pe = MYSQL _ASSOC)   134       functi on getFirs tRow($quer y, $arr_ty pe = MYSQL _ASSOC)
130       {   135       {
131           if (!$query)   136           if (!$query)
132                return a rray();   137                return a rray();
133           if ($arr_type  != MYSQL_ ASSOC && $ arr_type ! = MYSQL_NU M)   138           if ($arr_type  != MYSQL_ ASSOC && $ arr_type ! = MYSQL_NU M)
134                $this->c urrent_arr _type = MY SQL_ASSOC;   139                $this->c urrent_arr _type = MY SQL_ASSOC;
135           el se   140           el se
136                $this->c urrent_arr _type = $a rr_type;   141                $this->c urrent_arr _type = $a rr_type;
137           $t his->curre nt_res = m ysql_query ($query, $ this->link ) or $this ->error('C annot comp lete query  (getFirst Row)');   142           $t his->curre nt_res = m ysql_query ($query, $ this->link ) or $this ->error('C annot comp lete query  (getFirst Row)');
138           $a rr_res = a rray();   143           $a rr_res = a rray();
139           if ($this->cu rrent_res  && mysql_n um_rows($t his->curre nt_res))   144           if ($this->cu rrent_res  && mysql_n um_rows($t his->curre nt_res))
140                $arr_res  = mysql_f etch_array ($this->cu rrent_res,  $this->cu rrent_arr_ type);   145                $arr_res  = mysql_f etch_array ($this->cu rrent_res,  $this->cu rrent_arr_ type);
141           re turn $arr_ res;   146           re turn $arr_ res;
142       }   147       }
143     148  
144       /**   149       /**
145        * ret urn next r ow of poin ted last g etFirstRow  calling d ata   150        * ret urn next r ow of poin ted last g etFirstRow  calling d ata
146        */   151        */
147       functi on getNext Row()   152       functi on getNext Row()
148       {   153       {
149           $a rr_res = m ysql_fetch _array($th is->curren t_res, $th is->curren t_arr_type );   154           $a rr_res = m ysql_fetch _array($th is->curren t_res, $th is->curren t_arr_type );
150           if ($arr_res)   155           if ($arr_res)
151                return $ arr_res;   156                return $ arr_res;
152           el se   157           el se
153           {   158           {
154                mysql_fr ee_result( $this->cur rent_res);   159                mysql_fr ee_result( $this->cur rent_res);
155                $this->c urrent_arr _type = MY SQL_ASSOC;   160                $this->c urrent_arr _type = MY SQL_ASSOC;
156                return a rray();   161                return a rray();
157           }   162           }
158       }   163       }
159     164  
160       /**   165       /**
161        * ret urn number  of affect ed rows in  current m ysql resul t   166        * ret urn number  of affect ed rows in  current m ysql resul t
162        */   167        */
163       functi on getNumR ows($res =  false)   168       functi on getNumR ows($res =  false)
164       {   169       {
165           if (!$res)   170           if (!$res)
166                $res = @ mysql_num_ rows($this ->current_ res);   171                $res = @ mysql_num_ rows($this ->current_ res);
167     172  
168           if ((int)$res  > 0)   173           if ((int)$res  > 0)
169                return ( int)$res;   174                return ( int)$res;
170           el se   175           el se
171                return 0 ;   176                return 0 ;
172       }   177       }
173     178  
174     179  
175       /**   180       /**
176        * exe cute any q uery retur n number o f rows aff ected/fals e   181        * exe cute any q uery retur n number o f rows aff ected/fals e
177        */   182        */
178       functi on query($ query)   183       functi on query($ query)
179       {   184       {
180           if (!$query)   185           if (!$query)
181                return f alse;   186                return f alse;
182           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror('Canno t complete  query (qu ery)');   187           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror('Canno t complete  query (qu ery)');
183     188  
184           if ($res)   189           if ($res)
185                return m ysql_affec ted_rows() ;   190                return m ysql_affec ted_rows() ;
186           el se   191           el se
187                return f alse;   192                return f alse;
188       }   193       }
189     194  
190       /**   195       /**
191        * exe cute sql q uery and r eturn tabl e of recor ds as resu lt   196        * exe cute sql q uery and r eturn tabl e of recor ds as resu lt
192        */   197        */
193       functi on getAll( $query, $a rr_type =  MYSQL_ASSO C)   198       functi on getAll( $query, $a rr_type =  MYSQL_ASSO C)
194       {   199       {
195           if (!$query)   200           if (!$query)
196                return a rray();   201                return a rray();
197           if ($arr_type  != MYSQL_ ASSOC && $ arr_type ! = MYSQL_NU M)   202           if ($arr_type  != MYSQL_ ASSOC && $ arr_type ! = MYSQL_NU M)
198                $arr_typ e = MYSQL_ ASSOC;   203                $arr_typ e = MYSQL_ ASSOC;
199     204  
200           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror('Canno t complete  query ['  . $query .  '] (getAl l) ');   205           $r es = mysql _query($qu ery, $this ->link) or  $this->er ror('Canno t complete  query ['  . $query .  '] (getAl l) ');
201           $a rr_res = a rray();   206           $a rr_res = a rray();
202           if ($res)   207           if ($res)
203           {   208           {
204                while($r ow = mysql _fetch_arr ay($res, $ arr_type))   209                while($r ow = mysql _fetch_arr ay($res, $ arr_type))
205                {   210                {
206                    $arr _res[] = $ row;   211                    $arr _res[] = $ row;
207                }   212                }
208                mysql_fr ee_result( $res);   213                mysql_fr ee_result( $res);
209           }   214           }
210           re turn $arr_ res;   215           re turn $arr_ res;
211       }   216       }
212     217  
    218       functi on lastId( )
    219       {
    220           re turn mysql _insert_id ($this->li nk);
    221       }
    222  
213       functi on error($ text)   223       functi on error($ text)
214       {   224       {
215           $t his->log($ text.': '. mysql_erro r($this->l ink));   225           $t his->log($ text.': '. mysql_erro r($this->l ink));
216           // echoDbg( d ebug_backt race() );  //output d ebug infor mation   226           // echoDbg( d ebug_backt race() );  //output d ebug infor mation
217       }   227       }
218     228  
219   }   229   }
220     230  
221   ?>   231   ?>