92. File Comparison Report

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

92.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.0.5\groups\orca\classes DbAdmin.php Fri Jan 4 08:25:28 2008 UTC
2 Dolphin-v.6.1.0\groups\orca\classes DbAdmin.php Wed Apr 9 17:44:58 2008 UTC

92.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 10 342
Changed 9 32
Inserted 0 0
Removed 0 0

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

92.4 Active regular expressions

No regular expressions were active.

92.5 Comparison detail

1   <?php   1   <?php
2   /********* ********** ********** ********** ********** ********** ********** ******   2   /********* ********** ********** ********** ********** ********** ********** ******
3   *                              O rca Intera ctive Foru m Script   3   *                              O rca Intera ctive Foru m Script
4   *                                  ---------- -----
  4   *                                  ---------- ----- --
5   *       Start e d                :   Fr   Nov   10   2006   5   *       b e gin                   :   Fr   Nov   10   2006
6   *       C opyright          :   (C)   200 7   BoonEx   Group   6   *       c opyright               :   (C)   200 6   BoonEx   Group
7   *       W ebsite                :   http://www .boonex.co m
  7   *       w ebsite                 :   http://www .boonex.co m /
8   * This fil e is part  of Orca -  Interactiv e Forum Sc ript   8   * This fil e is part  of Orca -  Interactiv e Forum Sc ript
9   *   9   *
10   *   Orca   is   free   software ;   y o u   c a n   r ed
i
s
tribut e   i t   and/ o r   modify   i t   u n d e r  
  10   *   Orca   is   free   software .   This   w o rk   is   li c e n s ed   under   a   Creat i ve   Common s   At tribut
i
o n   3.0   L i ce n s e .  
11   * the term s of the G NU General  Public Li cense as p ublished b y the    11   * http://c reativecom mons.org/l icenses/by /3.0/
12   * Free Sof tware Foun dation; ei ther versi on 2 of th    
13   * License,  or any la ter versio n.          
14   *   12   *
15   * Orca is  distribute d in the h ope that i t will be  useful, bu t WITHOUT  ANY WARRAN TY;   13   * Orca is  distribute d in the h ope that i t will be  useful, bu t WITHOUT  ANY WARRAN TY;
16   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.   14   * without  even the i mplied war ranty of   MERCHANTAB ILITY or F ITNESS FOR  A PARTICU LAR PURPOS E.
17   *   See   the   GNU   G e n e
r al   Pu b l i c   License   for   more   details.  
  15   *   See   the   Cr e ativ e   Commons   Att r i b ut i on   3.0   License   for   more   details.  
18   *   You   should   have   received   a   copy   of   the   GNU   G e n e
r al   Pu b l i c   License   along   with   Orca,  
  16   *   You   should   have   received   a   copy   of   the   Cr e ativ e   Commons   Att r i b ut i on   3.0   License   along   with   Orca,  
19   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m   17   * see lice nse.txt fi le; if not , write to  marketing @boonex.co m
20   ********** ********** ********** ********** ********** ********** ********** *****/   18   ********** ********** ********** ********** ********** ********** ********** *****/
21     19  
22     20  
23   // admin o perations  with datab ase   21   // admin o perations  with datab ase
24     22  
25   if (!defin ed('TF_FOR UM'))        define ( 'TF_FORUM' ,          '`'.$gConf ['db']['pr efix'].'fo rum`');   23   if (!defin ed('TF_FOR UM'))        define ( 'TF_FORUM' ,          '`'.$gConf ['db']['pr efix'].'fo rum`');
26   if (!defin ed('TF_FOR UM_CAT'))    define ( 'TF_FORUM_ CAT',      '`'.$gConf ['db']['pr efix'].'fo rum_cat`') ;   24   if (!defin ed('TF_FOR UM_CAT'))    define ( 'TF_FORUM_ CAT',      '`'.$gConf ['db']['pr efix'].'fo rum_cat`') ;
27   if (!defin ed('TF_FOR UM_POST'))   define ( 'TF_FORUM_ POST',     '`'.$gConf ['db']['pr efix'].'fo rum_post`' );   25   if (!defin ed('TF_FOR UM_POST'))   define ( 'TF_FORUM_ POST',     '`'.$gConf ['db']['pr efix'].'fo rum_post`' );
28   if (!defin ed('TF_FOR UM_TOPIC') ) define ( 'TF_FORUM_ TOPIC',    '`'.$gConf ['db']['pr efix'].'fo rum_topic` ');   26   if (!defin ed('TF_FOR UM_TOPIC') ) define ( 'TF_FORUM_ TOPIC',    '`'.$gConf ['db']['pr efix'].'fo rum_topic` ');
29     27  
30   define ('C AT_ORDER_S TEP', 128) ;   28   define ('C AT_ORDER_S TEP', 128) ;
31     29  
32   class DbAd min extend s BxDb   30   class DbAd min extend s BxDb
33   {   31   {
34     32  
35       /**   33       /**
36        * con structor   34        * con structor
37        */   35        */
38       functi on DbAdmin  ()   36       functi on DbAdmin  ()
39       {   37       {
40           gl obal $gCon f;   38           gl obal $gCon f;
41           pa rent::BxDb  ($gConf[' db']['db'] , $gConf[' db']['user '], $gConf ['db']['pw d'], $gCon f['db']['h ost'], $gC onf['db'][ 'port'], $ gConf['db' ]['sock']) ;   39           pa rent::BxDb  ($gConf[' db']['db'] , $gConf[' db']['user '], $gConf ['db']['pw d'], $gCon f['db']['h ost'], $gC onf['db'][ 'port'], $ gConf['db' ]['sock']) ;
42       }   40       }
43     41  
44       functi on deleteC ategoryAll  ($cat_id)   42       functi on deleteC ategoryAll  ($cat_id)
45       {      43       {   
46           $s ql = "SELE CT `forum_ id` FROM "  . TF_FORU M . " WHER E `cat_id`  = '$cat_i d'";   44           $s ql = "SELE CT `forum_ id` FROM "  . TF_FORU M . " WHER E `cat_id`  = '$cat_i d'";
47           $a  = $this-> getAll ($s ql);   45           $a  = $this-> getAll ($s ql);
48           fo r ( reset( $a) ; list  (, $r) =  each ($a)  ; )   46           fo r ( reset( $a) ; list  (, $r) =  each ($a)  ; )
49           {   47           {
50                $this->d eleteForum Posts ($r[ 'forum_id' ]);   48                $this->d eleteForum Posts ($r[ 'forum_id' ]);
51                $this->d eleteForum Topics ($r ['forum_id ']);   49                $this->d eleteForum Topics ($r ['forum_id ']);
52                $this->d eleteForum  ($r['foru m_id']);                50                $this->d eleteForum  ($r['foru m_id']);             
53           }           51           }        
54           re turn $this ->deleteCa tegory ($c at_id);   52           re turn $this ->deleteCa tegory ($c at_id);
55       }   53       }
56     54  
57        function   getCat Id ByForumId   ($forum_id )   55        function   getCat
ByForumId   ($forum_id )
58       {   56       {
59            $sql   =   "SELECT   `cat_id`  
FROM   "   .   TF_FORUM   .   "  
WHERE   `forum_id`   =   '$forum_id '   LIMIT   1";       
  57            $sql   =   "SELECT   `cat_id` ,   `cat_uri`   FROM   "   .   TF_FORUM   .   "   INNER   JOIN   "   .   TF_FORUM_C AT   .   "   USING   (`cat_id`)   WHERE   `forum_id`   =   '$forum_id '   LIMIT   1";
60            return   $this->get One   ($sql);            58            return   $this->get Row   ($sql);
61       }   59       }
62          60       
63       functi on getCatO rder ($cat _id)   61       functi on getCatO rder ($cat _id)
64       {   62       {
65           if  ($cat_id)   63           if  ($cat_id)
66                $sql = " SELECT `ca t_order` F ROM " . TF _FORUM_CAT  . " WHERE  `cat_id`  = $cat_id  LIMIT 1";   64                $sql = " SELECT `ca t_order` F ROM " . TF _FORUM_CAT  . " WHERE  `cat_id`  = $cat_id  LIMIT 1";
67           el se   65           el se
68                $sql = " SELECT `ca t_order` F ROM  " . T F_FORUM_CA T . " ORDE R BY `cat_ order` DES C LIMIT 1" ;   66                $sql = " SELECT `ca t_order` F ROM  " . T F_FORUM_CA T . " ORDE R BY `cat_ order` DES C LIMIT 1" ;
69           re turn $this ->getOne($ sql);   67           re turn $this ->getOne($ sql);
70       }   68       }
71          69       
72       functi on setNewO rder ($cat _id, $new_ order)   70       functi on setNewO rder ($cat _id, $new_ order)
73       {   71       {
74           $s ql = "UPDA TE " . TF_ FORUM_CAT  . " SET `c at_order`  = '$new_or der' WHERE  `cat_id`  = '$cat_id '";   72           $s ql = "UPDA TE " . TF_ FORUM_CAT  . " SET `c at_order`  = '$new_or der' WHERE  `cat_id`  = '$cat_id '";
75           re turn $this ->query ($ sql);   73           re turn $this ->query ($ sql);
76       }   74       }
77          75       
78       functi on getCats InOrder ($ cat_order,  $dir, $nu m)   76       functi on getCats InOrder ($ cat_order,  $dir, $nu m)
79       {           77       {        
80           $s ql = "SELE CT `cat_id `,`cat_ord er` FROM   " . TF_FOR UM_CAT . "  WHERE `ca t_order` " .($dir ==  'up' ? '<'  : '>')."  $cat_order   ORDER BY   `cat_ord er` " .($d ir == 'up'  ? 'DESC'  : 'ASC').  " LIMIT $n um";            78           $s ql = "SELE CT `cat_id `,`cat_ord er` FROM   " . TF_FOR UM_CAT . "  WHERE `ca t_order` " .($dir ==  'up' ? '<'  : '>')."  $cat_order   ORDER BY   `cat_ord er` " .($d ir == 'up'  ? 'DESC'  : 'ASC').  " LIMIT $n um";         
81           re turn $this ->getAll ( $sql);   79           re turn $this ->getAll ( $sql);
82       }   80       }
83          81       
84       functi on deleteF orumAll ($ forum_id)   82       functi on deleteF orumAll ($ forum_id)
85       {   83       {
86           $t his->delet eForumPost s ($forum_ id);   84           $t his->delet eForumPost s ($forum_ id);
87           $t his->delet eForumTopi cs ($forum _id);   85           $t his->delet eForumTopi cs ($forum _id);
88           re turn $this ->deleteFo rum ($foru m_id);   86           re turn $this ->deleteFo rum ($foru m_id);
89       }   87       }
90          88       
91       functi on deleteC ategory ($ cat_id)   89       functi on deleteC ategory ($ cat_id)
92       {                   90       {                
93           $s ql = "DELE TE FROM "  . TF_FORUM _CAT . " W HERE `cat_ id` = '$ca t_id'";   91           $s ql = "DELE TE FROM "  . TF_FORUM _CAT . " W HERE `cat_ id` = '$ca t_id'";
94           re turn $this ->query ($ sql);   92           re turn $this ->query ($ sql);
95       }   93       }
96     94  
97       functi on deleteF orumPosts  ($forum_id )   95       functi on deleteF orumPosts  ($forum_id )
98       {   96       {
99           $s ql = "DELE TE FROM "  . TF_FORUM _POST . "  WHERE `for um_id` = ' $forum_id' ";   97           $s ql = "DELE TE FROM "  . TF_FORUM _POST . "  WHERE `for um_id` = ' $forum_id' ";
100           re turn $this ->query ($ sql);   98           re turn $this ->query ($ sql);
101       }   99       }
102     100  
103       functi on deleteF orumTopics  ($forum_i d)   101       functi on deleteF orumTopics  ($forum_i d)
104       {   102       {
105           $s ql = "DELE TE FROM "  . TF_FORUM _TOPIC . "  WHERE `fo rum_id` =  '$forum_id '";   103           $s ql = "DELE TE FROM "  . TF_FORUM _TOPIC . "  WHERE `fo rum_id` =  '$forum_id '";
106           re turn $this ->query ($ sql);   104           re turn $this ->query ($ sql);
107       }   105       }
108     106  
109       functi on deleteF orum ($for um_id)   107       functi on deleteF orum ($for um_id)
110       {   108       {
111           $s ql = "DELE TE FROM "  . TF_FORUM  . " WHERE  `forum_id ` = '$foru m_id'";   109           $s ql = "DELE TE FROM "  . TF_FORUM  . " WHERE  `forum_id ` = '$foru m_id'";
112           re turn $this ->query ($ sql);   110           re turn $this ->query ($ sql);
113       }      111       }   
114     112  
115     113  
116       functi on getCatN ame ($cat_ id)   114       functi on getCatN ame ($cat_ id)
117       {   115       {
118           $s ql = "SELE CT `cat_na me` FROM "  . TF_FORU M_CAT . "  WHERE `cat _id` = '$c at_id' LIM IT 1";   116           $s ql = "SELE CT `cat_na me` FROM "  . TF_FORU M_CAT . "  WHERE `cat _id` = '$c at_id' LIM IT 1";
119           re turn $this ->getOne ( $sql);   117           re turn $this ->getOne ( $sql);
120       }   118       }
121     119  
122       functi on editCat egory ($ca t_id, $cat _name)   120       functi on editCat egory ($ca t_id, $cat _name)
123       {   121       {
124           $s ql = "UPDA TE " . TF_ FORUM_CAT  . " SET `c at_name` =  '$cat_nam e' WHERE ` cat_id` =  '$cat_id'" ;   122           $s ql = "UPDA TE " . TF_ FORUM_CAT  . " SET `c at_name` =  '$cat_nam e' WHERE ` cat_id` =  '$cat_id'" ;
125           re turn $this ->query ($ sql);   123           re turn $this ->query ($ sql);
126       }   124       }
127          125       
128        function   insertCate gory   ($cat_name
)
  126        function   insertCate gory   ($cat_name ,   $uri )
129       {   127       {
130            $sql   =   "INSERT   INTO   "   .   TF_FORUM_C AT   .   "   SET   `cat_name`   =   '$cat_name ',   `cat_
order`   =   "   .   ($this->ge tCatOrder   (0)   +   CAT_ORDER_ STEP);
  128            $sql   =   "INSERT   INTO   "   .   TF_FORUM_C AT   .   "   SET   `cat_name`   =   '$cat_name ',   `cat_ uri`   =   '$uri',`ca t_ order`   =   "   .   ($this->ge tCatOrder   (0)   +   CAT_ORDER_ STEP);
131           re turn $this ->query ($ sql);   129           re turn $this ->query ($ sql);
132       }           130       }        
133     131  
134       functi on getForu m ($forum_ id)   132       functi on getForu m ($forum_ id)
135       {   133       {
136           $s ql = "SELE CT `cat_id `, `forum_ title`, `f orum_desc` , `forum_t ype` FROM  " . TF_FOR UM . " WHE RE `forum_ id` = '$fo rum_id' LI MIT 1";   134           $s ql = "SELE CT `cat_id `, `forum_ title`, `f orum_desc` , `forum_t ype` FROM  " . TF_FOR UM . " WHE RE `forum_ id` = '$fo rum_id' LI MIT 1";
137           re turn $this ->getRow ( $sql);   135           re turn $this ->getRow ( $sql);
138       }   136       }
139     137  
140       functi on editFor um ($forum _id, $titl e, $desc,  $type)   138       functi on editFor um ($forum _id, $titl e, $desc,  $type)
141       {   139       {   
142           $s ql = "UPDA TE " . TF_ FORUM . "  SET `forum _title` =  '$title',  `forum_des c` = '$des c', `forum _type` = ' $type'  WH ERE `forum _id` = '$f orum_id'";          140           $s ql = "UPDA TE " . TF_ FORUM . "  SET `forum _title` =  '$title',  `forum_des c` = '$des c', `forum _type` = ' $type'  WH ERE `forum _id` = '$f orum_id'";       
143           re turn $this ->query ($ sql);   141           re turn $this ->query ($ sql);
144       }   142       }
145     143  
146        function   insertForu m   ($cat_id,   $title,   $desc,   $type
)
  144        function   insertForu m   ($cat_id,   $title,   $desc,   $type ,   $uri )
147       {           145       {                
148            $sql   =   "INSERT   INTO   "   .   TF_FORUM   .   "   SET   `cat_id`   =   '$cat_id',   `forum_tit le`   =   '$title',   `forum_des c`   =   '$desc',   `forum_typ e`   =   '$type'
";
  146            $sql   =   "INSERT   INTO   "   .   TF_FORUM   .   "   SET   `cat_id`   =   '$cat_id',   `forum_tit le`   =   '$title',   `forum_des c`   =   '$desc',   `forum_typ e`   =   '$type' ,   `forum_uri `   =   '$uri' ";
149           re turn $this ->query ($ sql);   147           re turn $this ->query ($ sql);
150       }   148       }
151     149  
152       functi on getRepo rtedPosts  ($u)   150       functi on getRepo rtedPosts  ($u)
153       {   151       {
154           gl obal $gCon f;   152           gl obal $gCon f;
155              153           
156           $s ql_add1 =  "'-1' AS ` voted`, 0  as `vote_u ser_point` , ";   154           $s ql_add1 =  "'-1' AS ` voted`, 0  as `vote_u ser_point` , ";
157           $s ql_add2 =  '';   155           $s ql_add2 =  '';
158              156           
159           if  ($u)   157           if  ($u)
160           {   158           {
161                $sql_add 1 = "(1 -  ISNULL(t2. `post_id`) ) AS `vote d`, t2.`vo te_point`  as `vote_u ser_point` , ";   159                $sql_add 1 = "(1 -  ISNULL(t2. `post_id`) ) AS `vote d`, t2.`vo te_point`  as `vote_u ser_point` , ";
162                $sql_add 2 = " LEFT  JOIN " .  TF_FORUM_V OTE . " AS  t2 ON ( t 2.`user_na me` = '$u'  AND t1.`p ost_id` =  t2.`post_i d`) ";   160                $sql_add 2 = " LEFT  JOIN " .  TF_FORUM_V OTE . " AS  t2 ON ( t 2.`user_na me` = '$u'  AND t1.`p ost_id` =  t2.`post_i d`) ";
163           }   161           }
164              162           
165           $s ql =  "SEL ECT `forum _id`, `top ic_id`, t1 .`post_id` , `user`,  `post_text `, `votes` , $sql_add 1 DATE_FOR MAT(FROM_U NIXTIME(t1 .`when`),' {$gConf['d ate_format ']}') AS ` when` FROM  " . TF_FO RUM_POST .  " AS t1 $ sql_add2 W HERE `repo rts` != 0  ORDER BY t 1.`when` A SC";   163           $s ql =  "SEL ECT `forum _id`, `top ic_id`, t1 .`post_id` , `user`,  `post_text `, `votes` , $sql_add 1 DATE_FOR MAT(FROM_U NIXTIME(t1 .`when`),' {$gConf['d ate_format ']}') AS ` when` FROM  " . TF_FO RUM_POST .  " AS t1 $ sql_add2 W HERE `repo rts` != 0  ORDER BY t 1.`when` A SC";
166                       164                    
167           re turn $this ->getAll ( $sql);   165           re turn $this ->getAll ( $sql);
168       }      166       }   
169          167  
170       functi on isLocke d ($topic_ id)            168       functi on isLocke d ($topic_ id)         
171       {   169       {
172           re turn $this ->getOne ( "SELECT `t opic_locke d` FROM "  . TF_FORUM _TOPIC . "  WHERE `to pic_id` =  $topic_id  LIMIT 1");   170           re turn $this ->getOne ( "SELECT `t opic_locke d` FROM "  . TF_FORUM _TOPIC . "  WHERE `to pic_id` =  $topic_id  LIMIT 1");
173       }   171       }
174     172  
175       functi on lock ($ topic_id)            173       functi on lock ($ topic_id)         
176       {   174       {
177           re turn $this ->query (" UPDATE " .  TF_FORUM_ TOPIC . "  SET `topic _locked` =  IF(`topic _locked`,  0, 1) WHER E `topic_i d` = $topi c_id LIMIT  1");   175           re turn $this ->query (" UPDATE " .  TF_FORUM_ TOPIC . "  SET `topic _locked` =  IF(`topic _locked`,  0, 1) WHER E `topic_i d` = $topi c_id LIMIT  1");
178       }   176       }
179     177  
180   // private  functions   178   // private  functions
181     179  
182   }   180   }
183     181  
184     182  
185     183  
186     184  
187     185  
188   ?>   186   ?>