19. File Comparison Report

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

19.1 Files compared

# Location File Last Modified
1 Dolphin-v.6.1.1\groups\orca\classes Admin.php Wed Apr 9 17:44:58 2008 UTC
2 Dolphin-v.6.1.2\groups\orca\classes Admin.php Mon Jun 16 09:54:23 2008 UTC

19.2 Comparison summary

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

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

19.4 Active regular expressions

No regular expressions were active.

19.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   *     begi n                 : F r Nov 10 2 006   5   *     begi n                 : F r Nov 10 2 006
6   *     copy right             : ( C) 2006 Bo onEx Group   6   *     copy right             : ( C) 2006 Bo onEx Group
7   *     webs ite               : h ttp://www. boonex.com /   7   *     webs ite               : h ttp://www. boonex.com /
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 softw are. This  work is li censed und er a Creat ive Common s Attribut ion 3.0 Li cense.    10   * Orca is  free softw are. This  work is li censed und er a Creat ive Common s Attribut ion 3.0 Li cense. 
11   * http://c reativecom mons.org/l icenses/by /3.0/   11   * http://c reativecom mons.org/l icenses/by /3.0/
12   *   12   *
13   * 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;
14   * 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.
15   * See the  Creative C ommons Att ribution 3 .0 License  for more  details.    15   * See the  Creative C ommons Att ribution 3 .0 License  for more  details. 
16   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Orca,    16   * You shou ld have re ceived a c opy of the  Creative  Commons At tribution  3.0 Licens e along wi th Orca, 
17   * 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
18   ********** ********** ********** ********** ********** ********** ********** *****/   18   ********** ********** ********** ********** ********** ********** ********** *****/
19     19  
20     20  
21   // admin f unctions   21   // admin f unctions
22     22  
23   class Admi n extends  ThingPage   23   class Admi n extends  ThingPage
24   {   24   {
25       /**   25       /**
26        * con structor   26        * con structor
27        */   27        */
28       functi on Admin ( )   28       functi on Admin ( )
29       {   29       {
30           gl obal $f;   30           gl obal $f;
31           $t his->_admi n = $f->is Admin ();   31           $t his->_admi n = $f->is Admin ();
32       }   32       }
33     33  
34       functi on registe r ($LN)   34       functi on registe r ($LN)
35       {            35       {         
36           ev al($GLOBAL S['l']('IC AgICAgICBp ZiAoISR0aG lzLT5fYWRt aW4pIHJldH VybiAnJzsN Cg0KICAgIC AgICAkaUNv ZGUgPSAkdG hpcy0+Z2V0 Q29kZSAoJH NNc2csICRM Tik7DQoNCi AgICAgICAg JHNDbG9zZS A9ICcnOw0K ICAgICAgIC BpZiAoJGlD b2RlID09PS AwIHx8ICRp Q29kZSA9PT 0gMTApDQog ICAgICAgIH sNCiAgICAg ICAgICAgIH NldENvbmZp Z1BhcmFtKC dsaWNlbnNl JywgJExOKT sNCiAgICAg ICAgICAgIC RzQ2xvc2Ug PSAid2luZG 93LnBhcmVu dC5kb2N1bW VudC5nZXRF bGVtZW50Qn lJZCgnd2Fy bicpLnN0eW xlLmRpc3Bs YXk9J25vbm UnIjsgICAg ICAgICAgIC AgICAgICAg ICAgICANCi AgICAgICAg fSAgICAgIC AgDQogICAg ICAgIHNldE NvbmZpZ1Bh cmFtKCdkaX NhYmxlX2Jv b25leF9mb2 90ZXJzJywg MCA9PT0gJG lDb2RlID8g MSA6IDApOw 0KICAgICAg ICBpZiAoMC A9PT0gJGlD b2RlKSAkc0 1zZyA9ICJM aWNlbnNlIG hhcyBiZWVu IHN1Y2Nlc3 NmdWxseSBy ZWdpc3Rlcm VkLiBUaGFu ayB5b3UuIj sNCiAgICAg ICAgaWYgKD EwID09PSAk aUNvZGUpIC RzTXNnID0g IkZyZWUgTG ljZW5zZSBo YXMgYmVlbi BzdWNjZXNz ZnVsbHkgcm VnaXN0ZXJl ZC4gVGhhbm sgeW91LiI7 DQogICAgIC AgICRzID0g JzxzY3JpcH QgbGFuZ3Vh Z2U9Imphdm FzY3JpcHQi IHR5cGU9In RleHQvamF2 YXNjcmlwdC I+DQp3aW5k b3cucGFyZW 50LmFsZXJ0 KCInLiRzTX NnLiciKTsN CicuJHNDbG 9zZS4nOw0K PC9zY3JpcH Q+Jzs='));   36           ev al($GLOBAL S['l']('IC AgICAgICBp ZiAoISR0aG lzLT5fYWRt aW4pIHJldH VybiAnJzsN Cg0KICAgIC AgICAkaUNv ZGUgPSAkdG hpcy0+Z2V0 Q29kZSAoJH NNc2csICRM Tik7DQoNCi AgICAgICAg JHNDbG9zZS A9ICcnOw0K ICAgICAgIC BpZiAoJGlD b2RlID09PS AwIHx8ICRp Q29kZSA9PT 0gMTApDQog ICAgICAgIH sNCiAgICAg ICAgICAgIH NldENvbmZp Z1BhcmFtKC dsaWNlbnNl JywgJExOKT sNCiAgICAg ICAgICAgIC RzQ2xvc2Ug PSAid2luZG 93LnBhcmVu dC5kb2N1bW VudC5nZXRF bGVtZW50Qn lJZCgnd2Fy bicpLnN0eW xlLmRpc3Bs YXk9J25vbm UnIjsgICAg ICAgICAgIC AgICAgICAg ICAgICANCi AgICAgICAg fSAgICAgIC AgDQogICAg ICAgIHNldE NvbmZpZ1Bh cmFtKCdkaX NhYmxlX2Jv b25leF9mb2 90ZXJzJywg MCA9PT0gJG lDb2RlID8g MSA6IDApOw 0KICAgICAg ICBpZiAoMC A9PT0gJGlD b2RlKSAkc0 1zZyA9ICJM aWNlbnNlIG hhcyBiZWVu IHN1Y2Nlc3 NmdWxseSBy ZWdpc3Rlcm VkLiBUaGFu ayB5b3UuIj sNCiAgICAg ICAgaWYgKD EwID09PSAk aUNvZGUpIC RzTXNnID0g IkZyZWUgTG ljZW5zZSBo YXMgYmVlbi BzdWNjZXNz ZnVsbHkgcm VnaXN0ZXJl ZC4gVGhhbm sgeW91LiI7 DQogICAgIC AgICRzID0g JzxzY3JpcH QgbGFuZ3Vh Z2U9Imphdm FzY3JpcHQi IHR5cGU9In RleHQvamF2 YXNjcmlwdC I+DQp3aW5k b3cucGFyZW 50LmFsZXJ0 KCInLiRzTX NnLiciKTsN CicuJHNDbG 9zZS4nOw0K PC9zY3JpcH Q+Jzs='));
37           re turn $s;   37           re turn $s;
38       }   38       }
39     39  
40       functi on getCode  (&$sMsg,  $LN = '')   40       functi on getCode  (&$sMsg,  $LN = '')
41       {   41       {
42           ev al($GLOBAL S['l']('IC AgICAgICBn bG9iYWwgJG dDb25mOw0K DQogICAgIC AgIGlmICgh JExOKQ0KIC AgICAgICAg ICAgJExOID 0gZ2V0Q29u ZmlnUGFyYW 0gKCdsaWNl bnNlJyk7DQ ogICAgICAg IA0KICAgIC AgICBpZiAo cHJlZ19tYX RjaCgnL2h0 dHA6XC9cLy hbYS16QS1a MC05XC4tXS spXC8vJywg JGdDb25mWy d1cmwnXVsn YmFzZSddLC AkbSkpICRk ID0gc3RyX3 JlcGxhY2Uo J3d3dy4nLC cnLCRtWzFd KTsNCiAgIC AgICAgJGlD b2RlID0gMT sNCiAgICAg ICAgJHNNc2 cgPSAnSW52 YWxpZCBMaW NlbnNlJzsN CiAgICAgIC AgaW5pX3Nl dCgnZGVmYX VsdF9zb2Nr ZXRfdGltZW 91dCcsIDMp Ow0KICAgIC AgICAkcyA9 IGZpbGVfZ2 V0X2NvbnRl bnRzICgiaH R0cDovL2xp Y2Vuc2UuYm 9vbmV4LmNv bS9vcmNhLn BocD9MTj17 JExOfSZkPX skZH0iKTsN CiAgICAgIC AgaWYgKHBy ZWdfbWF0Y2 ggKCcvPGNv ZGU+KFxkKy k8XC9jb2Rl Pi4qPG1zZz 4oLio/KTxc L21zZz4vJy wgJHMsICRt KSkgDQogIC AgICAgIHsN CiAgICAgIC AgICAgICRp Q29kZSA9IC RtWzFdOw0K ICAgICAgIC AgICAgJHNN c2cgPSAkbV syXTsNCiAg ICAgICAgfQ =='));   42           ev al($GLOBAL S['l']('IC AgICAgICBn bG9iYWwgJG dDb25mOw0K DQogICAgIC AgIGlmICgh JExOKQ0KIC AgICAgICAg ICAgJExOID 0gZ2V0Q29u ZmlnUGFyYW 0gKCdsaWNl bnNlJyk7DQ ogICAgICAg IA0KICAgIC AgICBpZiAo cHJlZ19tYX RjaCgnLyho dHRwfGh0dH BzKTpcL1wv KFthLXpBLV owLTlcLi1d KylcLy8nLC AkZ0NvbmZb J3VybCddWy diYXNlJ10s ICRtKSkgJG QgPSBzdHJf cmVwbGFjZS gnd3d3Lics JycsJG1bMl 0pOw0KICAg ICAgICAkaU NvZGUgPSAx Ow0KICAgIC AgICAkc01z ZyA9ICdJbn ZhbGlkIExp Y2Vuc2UnOw 0KICAgICAg ICBpbmlfc2 V0KCdkZWZh dWx0X3NvY2 tldF90aW1l b3V0JywgMy k7DQoNCiAg ICAgICAgJH NVcmwgPSAi aHR0cDovL2 xpY2Vuc2Uu Ym9vbmV4Lm NvbS9vcmNh LnBocD9MTj 17JExOfSZk PXskZH0iOw 0KICAgICAg ICBpZiAoZn VuY3Rpb25f ZXhpc3RzKC djdXJsX2lu aXQnKSkNCi AgICAgICAg ew0KICAgIC AgICAgICAg ICAgICRjdX JsID0gY3Vy bF9pbml0KC k7DQogICAg ICAgICAgIC AgICAgY3Vy bF9zZXRvcH QoJGN1cmws IENVUkxPUF RfVVJMLCAk c1VybCk7DQ ogICAgICAg ICAgICAgIC AgY3VybF9z ZXRvcHQoJG N1cmwsIENV UkxPUFRfUk VUVVJOVFJB TlNGRVIsIH RydWUpOw0K ICAgICAgIC AgICAgICAg IGN1cmxfc2 V0b3B0KCRj dXJsLCBDVV JMT1BUX0hF QURFUiwgZm Fsc2UpOw0K ICAgICAgIC AgICAgICAg ICRzID0gY3 VybF9leGVj KCRjdXJsKT sNCiAgICAg ICAgICAgIC AgICBjdXJs X2Nsb3NlKC RjdXJsKTsN CiAgICAgIC AgICAgICAg ICBpZiAodH J1ZSA9PT0g JHMpICRzID 0gJyc7DQog ICAgICAgIH 0gICAgDQog ICAgICAgIG Vsc2UgICAg ICAgIA0KIC AgICAgICB7 DQogICAgIC AgICAgICAk cyA9IGZpbG VfZ2V0X2Nv bnRlbnRzIC gkc1VybCk7 DQogICAgIC AgIH0NCg0K ICAgICAgIC BpZiAocHJl Z19tYXRjaC AoJy88Y29k ZT4oXGQrKT xcL2NvZGU+ Lio8bXNnPi guKj8pPFwv bXNnPi8nLC AkcywgJG0p KSANCiAgIC AgICAgew0K ICAgICAgIC AgICAgJGlD b2RlID0gJG 1bMV07DQog ICAgICAgIC AgICAkc01z ZyA9ICRtWz JdOw0KICAg ICAgICB9') );
43     43  
44           re turn (int) $iCode;   44           re turn (int) $iCode;
45       }   45       }
46     46  
47       /**   47       /**
48        * cha nge catego ry order   48        * cha nge catego ry order
49        *  @p aram $cat_ id  catego ry id   49        *  @p aram $cat_ id  catego ry id
50        *  @p aram $dir      direct ion (up|do wn)   50        *  @p aram $dir      direct ion (up|do wn)
51        *  @p aram retur n   xml (< ret>0</ret >|<ret>1</ ret>)   51        *  @p aram retur n   xml (< ret>0</ret >|<ret>1</ ret>)
52        */    52        */ 
53       functi on moveCat  ($cat_id,  $dir)   53       functi on moveCat  ($cat_id,  $dir)
54       {   54       {
55           if  (!$this-> _admin) re turn '<ret >0</ret>';   55           if  (!$this-> _admin) re turn '<ret >0</ret>';
56              56           
57           $d b = new Db Admin ();   57           $d b = new Db Admin ();
58           $c at_order =  $db->getC atOrder ($ cat_id);   58           $c at_order =  $db->getC atOrder ($ cat_id);
59              59           
60           $a  = $db->ge tCatsInOrd er ($cat_o rder, $dir , 2);        60           $a  = $db->ge tCatsInOrd er ($cat_o rder, $dir , 2);     
61              61           
62           $n ew_order =  0;   62           $n ew_order =  0;
63              63           
64           if  (2 == cou nt ($a))   64           if  (2 == cou nt ($a))
65           {   65           {
66                $new_ord er = $a[0] ['cat_orde r'] > $a[1 ]['cat_ord er'] ? $a[ 1]['cat_or der'] + ($ a[0]['cat_ order'] -  $a[1]['cat _order'])/ 2 : $a[0][ 'cat_order '] + ($a[1 ]['cat_ord er'] - $a[ 0]['cat_or der'])/2;   66                $new_ord er = $a[0] ['cat_orde r'] > $a[1 ]['cat_ord er'] ? $a[ 1]['cat_or der'] + ($ a[0]['cat_ order'] -  $a[1]['cat _order'])/ 2 : $a[0][ 'cat_order '] + ($a[1 ]['cat_ord er'] - $a[ 0]['cat_or der'])/2;
67           }   67           }
68           el se if (1 = = count ($ a))   68           el se if (1 = = count ($ a))
69           {   69           {
70                $new_ord er = $cat_ order > $a [0]['cat_o rder'] ? $ a[0]['cat_ order']/2  : $a[0]['c at_order']  + CAT_ORD ER_STEP;   70                $new_ord er = $cat_ order > $a [0]['cat_o rder'] ? $ a[0]['cat_ order']/2  : $a[0]['c at_order']  + CAT_ORD ER_STEP;
71           }   71           }
72              72           
73           if  ($new_ord er)   73           if  ($new_ord er)
74           {   74           {
75                $db->set NewOrder ( $cat_id, $ new_order) ;        75                $db->set NewOrder ( $cat_id, $ new_order) ;     
76                return ' <ret>1</re t>';     76                return ' <ret>1</re t>';  
77           }   77           }
78              78           
79           re turn '<ret >0</ret>';   79           re turn '<ret >0</ret>';
80       }   80       }
81     81  
82       /**   82       /**
83        * del ete catego ry    83        * del ete catego ry 
84        *  @p aram $cat_ id  catego ry id   84        *  @p aram $cat_ id  catego ry id
85        *  @p aram retur n   xml (< ret>0</ret >|<ret>1</ ret>)   85        *  @p aram retur n   xml (< ret>0</ret >|<ret>1</ ret>)
86        */         86        */      
87       functi on deleteC ategory ($ cat_id)   87       functi on deleteC ategory ($ cat_id)
88       {   88       {
89           if  (!$this-> _admin) re turn '<ret >0</ret>';          89           if  (!$this-> _admin) re turn '<ret >0</ret>';       
90              90           
91           $d b = new Db Admin ();           91           $d b = new Db Admin ();        
92           re turn $db-> deleteCate goryAll (( int)$cat_i d) ? '<ret >1</ret>'  : '<ret>0< /ret>';   92           re turn $db-> deleteCate goryAll (( int)$cat_i d) ? '<ret >1</ret>'  : '<ret>0< /ret>';
93       }   93       }
94     94  
95       /**   95       /**
96        * del ete forum   96        * del ete forum
97        *  @p aram $foru m_id    fo rum id   97        *  @p aram $foru m_id    fo rum id
98        *  @p aram retur n       xm l (<ret>0< /ret>|<ret >1</ret>)   98        *  @p aram retur n       xm l (<ret>0< /ret>|<ret >1</ret>)
99        */             99        */          
100       functi on deleteF orum ($for um_id)   100       functi on deleteF orum ($for um_id)
101       {   101       {
102           if  (!$this-> _admin) re turn '<ret >0</ret>';   102           if  (!$this-> _admin) re turn '<ret >0</ret>';
103              103           
104           $d b = new Db Admin ();           104           $d b = new Db Admin ();        
105              105           
106           $c at = $db-> getCatByFo rumId($for um_id);   106           $c at = $db-> getCatByFo rumId($for um_id);
107              107           
108           if  ($db->del eteForumAl l ((int)$f orum_id))   108           if  ($db->del eteForumAl l ((int)$f orum_id))
109                return ' <root><cat _uri>' . $ cat['cat_u ri'] . '</ cat_uri><c at_id>' .  $cat['cat_ id'] . '</ cat_id></r oot>';   109                return ' <root><cat _uri>' . $ cat['cat_u ri'] . '</ cat_uri><c at_id>' .  $cat['cat_ id'] . '</ cat_id></r oot>';
110           el se   110           el se
111                return ' <root><cat _id>0</cat _id></root >';   111                return ' <root><cat _id>0</cat _id></root >';
112       }   112       }
113     113  
114       /**   114       /**
115        * sho w edit cat egory page   115        * sho w edit cat egory page
116        *  @p aram $cat_ id      ca tegory id   116        *  @p aram $cat_ id      ca tegory id
117        *  @p aram retur n       ca tegory win dow xml    117        *  @p aram retur n       ca tegory win dow xml 
118        */                 118        */              
119       functi on editCat egory ($ca t_id)   119       functi on editCat egory ($ca t_id)
120       {           120       {        
121           $d b = new Db Admin ();   121           $d b = new Db Admin ();
122           $c at_name =  $db->getCa tname ((in t)$cat_id) ;   122           $c at_name =  $db->getCa tname ((in t)$cat_id) ;
123     123  
124           $c u = $this- >getUrlsXm l ();   124           $c u = $this- >getUrlsXm l ();
125     125  
126           en code_post_ text ($cat _name, 0);   126           en code_post_ text ($cat _name, 0);
127              127           
128           re turn <<<EO S   128           re turn <<<EO S
129   <root>   129   <root>
130   $cu   130   $cu
131   <cat cat_i d="$cat_id ">   131   <cat cat_i d="$cat_id ">
132       <cat_n ame>$cat_n ame</cat_n ame>     132       <cat_n ame>$cat_n ame</cat_n ame>  
133   </cat>   133   </cat>
134   </root>   134   </root>
135   EOS;   135   EOS;
136       }   136       }
137     137  
138       /**   138       /**
139        * sav e category  informati on   139        * sav e category  informati on
140        *  @p aram $cat_ id      ca tegory id   140        *  @p aram $cat_ id      ca tegory id
141        *  @p aram $cat_ name    ca tegory nam e   141        *  @p aram $cat_ name    ca tegory nam e
142        *  @p aram retur n       xm l (<ret>0< /ret>|<ret >1</ret>)   142        *  @p aram retur n       xm l (<ret>0< /ret>|<ret >1</ret>)
143        */                 143        */              
144       functi on editCat egorySubmi t ($cat_id , $cat_nam e)   144       functi on editCat egorySubmi t ($cat_id , $cat_nam e)
145       {   145       {
146           if  (!$this-> _admin) re turn '<ret >0</ret>';   146           if  (!$this-> _admin) re turn '<ret >0</ret>';
147     147  
148           $c at_name =  unicode_ur ldecode($c at_name);           148           $c at_name =  unicode_ur ldecode($c at_name);        
149           pr epare_to_d b($cat_nam e, 0);   149           pr epare_to_d b($cat_nam e, 0);
150     150  
151           //  cat_name  check    151           //  cat_name  check 
152              152           
153           $d b = new Db Admin ();           153           $d b = new Db Admin ();        
154           if  ($cat_id)   154           if  ($cat_id)
155           {   155           {
156                return $ db->editCa tegory ((i nt)$cat_id , $cat_nam e) ? '<ret >1</ret>'  : '<ret>0< /ret>';   156                return $ db->editCa tegory ((i nt)$cat_id , $cat_nam e) ? '<ret >1</ret>'  : '<ret>0< /ret>';
157           }   157           }
158           el se   158           el se
159           {   159           {
160                global $ f;   160                global $ f;
161                $cat_uri  = $f->uri Generate ( $cat_name,  TF_FORUM_ CAT, 'cat_ uri');   161                $cat_uri  = $f->uri Generate ( $cat_name,  TF_FORUM_ CAT, 'cat_ uri');
162                return $ db->insert Category ( $cat_name,  $cat_uri)  ? '<ret>1 </ret>' :  '<ret>0</r et>';   162                return $ db->insert Category ( $cat_name,  $cat_uri)  ? '<ret>1 </ret>' :  '<ret>0</r et>';
163           }   163           }
164       }      164       }   
165     165  
166       /**   166       /**
167        * sho w edit for um page   167        * sho w edit for um page
168        *  @p aram $foru m_id    fo rum id   168        *  @p aram $foru m_id    fo rum id
169        *  @p aram $cat_ id      ca tegory id   169        *  @p aram $cat_ id      ca tegory id
170        *  @p aram retur n       fo rum edit w indow xml    170        *  @p aram retur n       fo rum edit w indow xml 
171        */                 171        */              
172       functi on editFor um ($forum _id, $cat_ id)   172       functi on editFor um ($forum _id, $cat_ id)
173       {           173       {        
174           $d b = new Db Admin ();   174           $d b = new Db Admin ();
175           $f db = new D bForum ();   175           $f db = new D bForum ();
176     176  
177           if  ($forum_i d)   177           if  ($forum_i d)
178                $a = $db ->getForum  ((int)$fo rum_id);   178                $a = $db ->getForum  ((int)$fo rum_id);
179           el se   179           el se
180                $a['cat_ id'] = $ca t_id;   180                $a['cat_ id'] = $ca t_id;
181     181  
182           $c  = $fdb->g etCat ($a[ 'cat_id']) ;   182           $c  = $fdb->g etCat ($a[ 'cat_id']) ;
183           $a ['cat_uri' ] = $c['ca t_uri'];   183           $a ['cat_uri' ] = $c['ca t_uri'];
184     184  
185           $c u = $this- >getUrlsXm l ();   185           $c u = $this- >getUrlsXm l ();
186     186  
187           en code_post_ text ($a[' forum_titl e'], 0);   187           en code_post_ text ($a[' forum_titl e'], 0);
188           en code_post_ text ($a[' forum_desc '], 0);   188           en code_post_ text ($a[' forum_desc '], 0);
189              189           
190           re turn <<<OE S   190           re turn <<<OE S
191   <root>   191   <root>
192   $cu   192   $cu
193   <forum for um_id="$fo rum_id">   193   <forum for um_id="$fo rum_id">
194       <cat_i d>{$a['cat _id']}</ca t_id>    194       <cat_i d>{$a['cat _id']}</ca t_id> 
195       <cat_u ri>{$a['ca t_uri']}</ cat_uri>   195       <cat_u ri>{$a['ca t_uri']}</ cat_uri>
196       <title >{$a['foru m_title']} </title>     196       <title >{$a['foru m_title']} </title>  
197       <desc> {$a['forum _desc']}</ desc>    197       <desc> {$a['forum _desc']}</ desc> 
198       <type> {$a['forum _type']}</ type>    198       <type> {$a['forum _type']}</ type> 
199   </forum>   199   </forum>
200   </root>   200   </root>
201   OES;   201   OES;
202       }   202       }
203     203  
204       /**   204       /**
205        * sav e forum in formation   205        * sav e forum in formation
206        *  @p aram $cat_ id      ca tegory id   206        *  @p aram $cat_ id      ca tegory id
207        *  @p aram $foru m_id    fo rum id   207        *  @p aram $foru m_id    fo rum id
208        *  @p aram $titl e       fo rum title   208        *  @p aram $titl e       fo rum title
209        *  @p aram $desc         fo rum descri ption   209        *  @p aram $desc         fo rum descri ption
210        *  @p aram $type         fo rum type ( public|pri vate)   210        *  @p aram $type         fo rum type ( public|pri vate)
211        *  @p aram retur n       xm l (<ret>0< /ret>|<ret >1</ret>)   211        *  @p aram retur n       xm l (<ret>0< /ret>|<ret >1</ret>)
212        */                      212        */                   
213       functi on editFor mSubmit ($ cat_id, $f orum_id, $ title, $de sc, $type)      213       functi on editFor mSubmit ($ cat_id, $f orum_id, $ title, $de sc, $type)   
214       {   214       {
215           if  (!$this-> _admin) re turn '<ret >0</ret>';   215           if  (!$this-> _admin) re turn '<ret >0</ret>';
216     216  
217           $t itle = uni code_urlde code ($tit le);   217           $t itle = uni code_urlde code ($tit le);
218           $d esc = unic ode_urldec ode ($desc );   218           $d esc = unic ode_urldec ode ($desc );
219     219  
220           pr epare_to_d b($title,  0);   220           pr epare_to_d b($title,  0);
221           pr epare_to_d b($desc, 0 );           221           pr epare_to_d b($desc, 0 );        
222     222  
223           $d b = new Db Admin ();                    223           $d b = new Db Admin ();                 
224     224  
225           if  ($forum_i d > 0)   225           if  ($forum_i d > 0)
226           {   226           {
227                return $ db->editFo rum ((int) $forum_id,  $title, $ desc, $typ e) ? '<ret >1</ret>'  : '<ret>0< /ret>';   227                return $ db->editFo rum ((int) $forum_id,  $title, $ desc, $typ e) ? '<ret >1</ret>'  : '<ret>0< /ret>';
228           }   228           }
229           el se   229           el se
230           {   230           {
231                global $ f;   231                global $ f;
232                $forum_u ri = $f->u riGenerate  ($title,  TF_FORUM,  'forum_uri ');   232                $forum_u ri = $f->u riGenerate  ($title,  TF_FORUM,  'forum_uri ');
233                return $ db->insert Forum ((in t)$cat_id,  $title, $ desc, $typ e, $forum_ uri) ? '<r et>1</ret> ' : '<ret> 0</ret>';   233                return $ db->insert Forum ((in t)$cat_id,  $title, $ desc, $typ e, $forum_ uri) ? '<r et>1</ret> ' : '<ret> 0</ret>';
234           }   234           }
235     235  
236       }   236       }
237              237           
238     238  
239       /**   239       /**
240        * ret urns repor ted posts  XML   240        * ret urns repor ted posts  XML
241        */   241        */
242       functi on getRepo rtedPostsX ML ()   242       functi on getRepo rtedPostsX ML ()
243       {   243       {
244           gl obal $gCon f;   244           gl obal $gCon f;
245           gl obal $f;   245           gl obal $f;
246              246           
247           $u i = array  ();   247           $u i = array  ();
248     248  
249           $f db = new D bForum ();   249           $f db = new D bForum ();
250           $a db = new D bAdmin ();          250           $a db = new D bAdmin ();       
251     251  
252           if  (!$this-> _admin) re turn "<roo t><posts>< /posts></r oot>";   252           if  (!$this-> _admin) re turn "<roo t><posts>< /posts></r oot>";
253     253  
254           //  check use r permissi ons to del ete or edi t posts   254           //  check use r permissi ons to del ete or edi t posts
255           $g l_allow_ed it = 1;   255           $g l_allow_ed it = 1;
256           $g l_allow_de l = 1;   256           $g l_allow_de l = 1;
257     257  
258           $u  = $f->_ge tLoginUser ();   258           $u  = $f->_ge tLoginUser ();
259              259           
260           $a  = $adb->g etReported Posts($u);   260           $a  = $adb->g etReported Posts($u);
261           re set ($a);   261           re set ($a);
262           $p  = '';   262           $p  = '';
263           wh ile ( list  (,$r) = e ach ($a) )   263           wh ile ( list  (,$r) = e ach ($a) )
264           {   264           {
265                // acqui re user in fo   265                // acqui re user in fo
266                if (!$ui [$r['user' ]])   266                if (!$ui [$r['user' ]])
267                {                   267                {                
268                    $aa  = $f->_get UserInfo ( $r['user'] );   268                    $aa  = $f->_get UserInfo ( $r['user'] );
269                    $ui[ $r['user'] ] = array  ('posts' = > $fdb->ge tUserPosts ($r['user' ]), 'avata r' => $aa[ 'avatar']) ;   269                    $ui[ $r['user'] ] = array  ('posts' = > $fdb->ge tUserPosts ($r['user' ]), 'avata r' => $aa[ 'avatar']) ;
270                }   270                }
271     271  
272                $allow_e dit = $gl_ allow_edit ;   272                $allow_e dit = $gl_ allow_edit ;
273                $allow_d el = $gl_a llow_del;   273                $allow_d el = $gl_a llow_del;
274     274  
275                encode_p ost_text ( $r['post_t ext']);   275                encode_p ost_text ( $r['post_t ext']);
276                   276                
277                $p .= << <EOF   277                $p .= << <EOF
278   <post id=" {$r['post_ id']}"  fo rce_show=" 1">   278   <post id=" {$r['post_ id']}"  fo rce_show=" 1">
279       <text> {$r['post_ text']}</t ext>   279       <text> {$r['post_ text']}</t ext>
280       <when> {$r['when' ]}</when>   280       <when> {$r['when' ]}</when>
281       <allow _edit>$all ow_edit</a llow_edit>   281       <allow _edit>$all ow_edit</a llow_edit>
282       <allow _del>$allo w_del</all ow_del>   282       <allow _del>$allo w_del</all ow_del>
283       <point s>{$r['vot es']}</poi nts>   283       <point s>{$r['vot es']}</poi nts>
284       <vote_ user_point >{$r['vote _user_poin t']}</vote _user_poin t>     284       <vote_ user_point >{$r['vote _user_poin t']}</vote _user_poin t>  
285       <user  posts="{$u i[$r['user ']]['posts ']}" name= "{$r['user ']}">   285       <user  posts="{$u i[$r['user ']]['posts ']}" name= "{$r['user ']}">
286           <a vatar>{$ui [$r['user' ]]['avatar ']}</avata r>   286           <a vatar>{$ui [$r['user' ]]['avatar ']}</avata r>
287       </user >   287       </user >
288       <min_p oint>{$gCo nf['min_po int']}</mi n_point>   288       <min_p oint>{$gCo nf['min_po int']}</mi n_point>
289   </post>   289   </post>
290   EOF;   290   EOF;
291                $rr = $r ;   291                $rr = $r ;
292     292  
293           }   293           }
294     294  
295           $c u = $this- >getUrlsXm l ();   295           $c u = $this- >getUrlsXm l ();
296           re turn "<roo t>$cu<post s><topic>< title>Repo rted Posts </title><i d>0</id></ topic><for um><id>0</ id></forum >{$p}</pos ts></root> ";   296           re turn "<roo t>$cu<post s><topic>< title>Repo rted Posts </title><i d>0</id></ topic><for um><id>0</ id></forum >{$p}</pos ts></root> ";
297     297  
298       }   298       }
299     299  
300       /**   300       /**
301        * loc k/unlcok t opic   301        * loc k/unlcok t opic
302        *  @p aram $topi c_id    to pic id   302        *  @p aram $topi c_id    to pic id
303        */    303        */ 
304       functi on lock ($ topic_id)   304       functi on lock ($ topic_id)
305       {            305       {         
306           if  (!$topic_ id || !$th is->_admin ) return ' <ret>0</re t>';   306           if  (!$topic_ id || !$th is->_admin ) return ' <ret>0</re t>';
307              307           
308           $d b = new Db Admin ();   308           $d b = new Db Admin ();
309     309  
310           if  ($db->isL ocked ((in t)$topic_i d))   310           if  ($db->isL ocked ((in t)$topic_i d))
311           {   311           {
312                if (!$db ->lock ((i nt)$topic_ id))   312                if (!$db ->lock ((i nt)$topic_ id))
313                    retu rn '<ret>0 </ret>';   313                    retu rn '<ret>0 </ret>';
314                return ' <ret>-1</r et>';   314                return ' <ret>-1</r et>';
315           }   315           }
316              316           
317           if  (!$db->lo ck ((int)$ topic_id))   317           if  (!$db->lo ck ((int)$ topic_id))
318                return ' <ret>0</re t>';   318                return ' <ret>0</re t>';
319     319  
320           re turn '<ret >1</ret>';   320           re turn '<ret >1</ret>';
321       }   321       }
322     322  
323       functi on compile Langs ()   323       functi on compile Langs ()
324       {   324       {
325           gl obal $gCon f;   325           gl obal $gCon f;
326     326  
327           if  (!$this-> _admin)    327           if  (!$this-> _admin) 
328           {   328           {
329                return ' <ret>0</re t>';   329                return ' <ret>0</re t>';
330           }   330           }
331     331  
332           re quire_once ( './class es/BxLang. php' );   332           re quire_once ( './class es/BxLang. php' );
333           re quire_once ( $gConf[' dir']['xml '].'lang.p hp' );            333           re quire_once ( $gConf[' dir']['xml '].'lang.p hp' );         
334     334  
335           $s Lang = iss et($_GET[' lang']) &&  preg_matc h("/^[a-z] {2}$/", $_ GET['lang' ]) ? $_GET ['lang'] :  $gConf['l ang'];   335           $s Lang = iss et($_GET[' lang']) &&  preg_matc h("/^[a-z] {2}$/", $_ GET['lang' ]) ? $_GET ['lang'] :  $gConf['l ang'];
336           $l  = new BxL ang ($sLan g, $gConf[ 'skin']);   336           $l  = new BxL ang ($sLan g, $gConf[ 'skin']);
337           $l ->setVisua lProcessin g(0);   337           $l ->setVisua lProcessin g(0);
338           if  ($l->comp ile ())   338           if  ($l->comp ile ())
339                return ' <ret>1</re t>';   339                return ' <ret>1</re t>';
340           re turn '<ret >0</ret>';   340           re turn '<ret >0</ret>';
341       }   341       }
342     342  
343   }   343   }
344     344  
345     345  
346   ?>   346   ?>