< ? p h p 
 
 
 d e f i n e ( ' I N _ P H P B B ' , t r u e ) ; 
 
 
 $ p h p b b _ r o o t _ p a t h   =   ' . / . . / ' ; 
 
 
 r e q u i r e ( $ p h p b b _ r o o t _ p a t h   .   ' e x t e n s i o n . i n c ' ) ; 
 
 
 i n c l u d e ( ' . / . . / c o m m o n . ' . $ p h p E x ) ; 
 
 
 $ u s e r d a t a = s e s s i o n _ p a g e s t a r t ( $ u s e r _ i p , - 1 4 ) ; 
 
 
 i n i t _ u s e r p r e f s ( $ u s e r d a t a ) ; 
 
 
 i n c l u d e ( ' . / . . / i n c l u d e s / p a g e _ h e a d e r . ' . $ p h p E x ) ; 
 
 
 e c h o   ' < p > ' ; 
 
 
 e c h o   ' < t a b l e   w i d t h = " 1 0 0 % "   c e l l p a d d i n g = " 0 "   c e l l s p a c i n g = " 0 "   b o r d e r = " 0 "   c l a s s = " f o r u m l i n e " > ' ; 
 
 
 $ s e t [ ' t i t l e ' ] = ' 8@>2K5  =>2>AB8' ;   / /   703>;>2>:  AB@0=8FK
 
 
 
 
 
 
 
 
 i f   ( ! e m p t y ( $ _ G E T [ ' c a t ' ] ) )   { 
 
 
 $ c a t = $ _ G E T [ ' c a t ' ] ; 
 
 
 i f   ( $ c a t = = ' a l l ' )   { 
 
 
 $ t i t l e = ' A5  =>2>AB8' ; 
 
 
 }   e l s e   i f   ( $ c a t = = ' 1 ' )   { 
 
 
 $ t i t l e = '    >AA88' ; 
 
 
 }   e l s e   i f   ( $ c a t = = ' 2 ' )   { 
 
 
 $ t i t l e = '   <8@5' ; 
 
 
 }   e l s e   i f   ( $ c a t = = ' 3 ' )   { 
 
 
 $ t i t l e = ' -:>=><8:0' ; 
 
 
 }   e l s e   i f   ( $ c a t = = ' 4 ' )   { 
 
 
 $ t i t l e = ' @8<8=0;' ; 
 
 
 }   e l s e   i f   ( $ c a t = = ' 8 ' )   { 
 
 
 $ t i t l e = ' !?>@B' ; 
 
 
 }   e l s e   i f   ( $ n = = ' 9 ' )   { 
 
 
 $ t i t l e = ' C;LBC@0' ; 
 
 
 }   e l s e   i f   ( $ n = = ' 1 0 ' )   { 
 
 
 $ t i t l e = '  5;838O  8  >1I5AB2>' ; 
 
 
 } }   e l s e   { 
 
 
 $ t i t l e = '  0745;K' ; 
 
 
 } 
 
 
 e c h o   ' < t d   c l a s s = " c a t S i d e s " > < s p a n   c l a s s = " c a t t i t l e " > ' . $ t i t l e . ' < / s p a n > < / t d > < / t r > 
 
 
 < t r > < t d   c l a s s = " r o w 1 " > 
 
 
 
 
 
 
 
 
 ' ; 
 
 
 i f   ( e m p t y ( $ _ G E T [ ' c a t ' ] )   a n d   e m p t y ( $ _ G E T [ ' n e w s ' ] )   a n d   e m p t y ( $ _ G E T [ ' l u ' ] ) )   { 
 
 
 e c h o   ' < d i v   c l a s s = " m e n u " > 
 
 
 < a   h r e f = " ? c a t = a l l " > A5  =>2>AB8< / a > < b r   / > 
 
 
 < a   h r e f = " ? c a t = 1 " >    >AA88< / a > < b r   / > 
 
 
 < a   h r e f = " ? c a t = 2 " >   <8@5< / a > < b r   / > 
 
 
 < a   h r e f = " ? c a t = 3 " > -:>=><8:0< / a > < b r   / > 
 
 
 < a   h r e f = " ? c a t = 4 " > @8<8=0;< / a > < b r   / > 
 
 
 < a   h r e f = " ? c a t = 8 " > !?>@B< / a > < b r   / > 
 
 
 < a   h r e f = " ? c a t = 9 " > C;LBC@0< / a > < b r / > 
 
 
 < a   h r e f = " ? c a t = 1 0 " >  5;838O  8  >1I5AB2>< / a > < b r   / > 
 
 
 < / d i v > 
 
 
 < a   h r e f = " h t t p : / / w r u f . o r g . r u " > & r a q u o ;   ;02=0O< / a > < b r   / > 
 
 
 < t r / > < t d / > 
 
 
 ' ; 
 
 
 }   e l s e   i f   ( ! e m p t y ( $ _ G E T [ ' c a t ' ] ) )   { 
 
 
 i f   ( e m p t y ( $ _ G E T [ ' n e w s ' ] ) )   { 
 
 
 $ f i l e = @ f i l e _ g e t _ c o n t e n t s ( ' h t t p : / / w a p . n e w s r u . c o m / s e c t / ' . $ c a t ) ; 
 
 
 }   e l s e   { 
 
 
 $ n e w s = $ _ G E T [ ' n e w s ' ] ; 
 
 
 $ f i l e = @ f i l e _ g e t _ c o n t e n t s ( ' h t t p : / / w a p . n e w s r u . c o m / s e c t / ' . $ c a t . ' / ' . $ n e w s ) ; 
 
 
 } 
 
 
 i f   ( p r e g _ m a t c h ( ' | ^ ( . * ) < p > ( . * ) < / p > ( . * ) $ | i u s ' , $ f i l e , $ o u t ) )   { 
 
 
 $ f i l e = $ o u t [ 2 ] ; 
 
 
 $ f i l e = s t r _ r e p l a c e ( a r r a y ( " \ r \ n " , " \ n " ) , ' ' , $ f i l e ) ; 
 
 
 $ f i l e = s t r _ r e p l a c e ( ' < b r / > < b r / > ' , ' < b r / > ' , $ f i l e ) ; 
 
 
 $ f i l e = s t r _ r e p l a c e ( ' < b r / > < b r / > ' , ' < b r / > ' , $ f i l e ) ; 
 
 
 $ f i l e = s t r _ r e p l a c e ( ' < b r / > ' , " < b r   / > \ r \ n " , $ f i l e ) ; 
 
 
 $ f i l e = s t r _ r e p l a c e ( ' < b > < a   h r e f = " / " > 0G0;>< / a > < / b > ' , ' ' , $ f i l e ) ; 
 
 
 $ f i l e = p r e g _ r e p l a c e ( ' | < a   h r e f = " / s e c t / ( [ 0 - 9 a - z ] + ) / ( [ 0 - 9 ] + ) / " > 0;55< / a > < b r   / > | u i ' , " < p > \ r \ n < a   h r e f = \ " ? c a t = $ 1 & a m p ; n e w s = $ 2 \ " > 0;55  & g t ; & g t ; < / a > < b r   / > \ r \ n < / p > " , $ f i l e ) ; 
 
 
 $ f i l e = p r e g _ r e p l a c e ( " | ( [ 0 - 9 ] + ) . ( [ 0 - 9 ] + ) . ( [ 0 - 9 ] + )   ( [ 0 - 9 ] + ) : ( [ 0 - 9 ] + ) < b r   / > \ r \ n < a   h r e f = \ " / n e w s / ( [ 0 - 9 ] + ) / \ ? l u = ( [ 0 - 9 ] + ) \ " > ( [ 0 - 9   a - z 0- OQ\ & \ ; \ # \ ` \ ~ \ ! \ @ \ $ \ % \ ^ \ * \ ( \ ) \ _ \ - \ + \ = \ | \ \ \ } \ { \ [ \ ] \ ' \ " \ : \ ? \ / \ . \ , ] + ) < / a > < b r   / > | i u s " , " < d i v   c l a s s = \ " r o w \ " > \ r \ n $ 1 . $ 2 . $ 3   $ 4 : $ 5 < b r   / > \ r \ n < a   h r e f = \ " ? n e w s = $ 6 & a m p ; l u = $ 7 \ " > $ 8 < / a > < b r   / > \ r \ n < / d i v > " , $ f i l e ) ; 
 
 
 e c h o   $ f i l e ; 
 
 
 } }   e l s e   i f   ( ! e m p t y ( $ _ G E T [ ' n e w s ' ] )   a n d   ! e m p t y ( $ _ G E T [ ' l u ' ] ) )   { 
 
 
 $ n e w s = $ _ G E T [ ' n e w s ' ] ; 
 
 
 $ l u = $ _ G E T [ ' l u ' ] ; 
 
 
 i f   ( e m p t y ( $ _ G E T [ ' s i m v ' ] ) )   { 
 
 
 $ f i l e = @ f i l e _ g e t _ c o n t e n t s ( ' h t t p : / / w a p . n e w s r u . c o m / n e w s / ' . $ n e w s . ' / ? l u = ' . $ l u ) ; 
 
 
 }   e l s e   { 
 
 
 $ s i m v = $ _ G E T [ ' s i m v ' ] ; 
 
 
 $ f i l e = @ f i l e _ g e t _ c o n t e n t s ( ' h t t p : / / w a p . n e w s r u . c o m / n e w s / ' . $ n e w s . ' / ' . $ s i m v . ' / ? l u = ' . $ l u ) ; 
 
 
 } 
 
 
 i f   ( p r e g _ m a t c h ( ' | ^ ( . * ) < p > ( . * ) < / p > ( . * ) $ | i u s ' , $ f i l e , $ o u t ) )   { 
 
 
 $ f i l e = $ o u t [ 2 ] ; 
 
 
 $ f i l e = s t r _ r e p l a c e ( a r r a y ( " \ r \ n " , " \ n " ) , ' ' , $ f i l e ) ; 
 
 
 $ f i l e = s t r _ r e p l a c e ( ' < b r / > ' , " \ r \ n " , $ f i l e ) ; 
 
 
 i f   ( p r e g _ m a t c h ( " | < a   h r e f = \ " / s e c t / ( [ 0 - 9 ] + ) / \ " > ( [ 0 - 9   a - z 0- OQ\ & \ ; \ # \ ` \ ~ \ ! \ @ \ $ \ % \ ^ \ * \ ( \ ) \ _ \ - \ + \ = \ | \ \ \ } \ { \ [ \ ] \ ' \ " \ : \ ? \ / \ . \ , ] + ) < / a > \ r \ n | i u " , $ f i l e , $ o u t ) )   { 
 
 
 $ n a v = ' < p > 
 
 
 -   < a   h r e f = " ? c a t = ' . $ o u t [ 1 ] . ' " > ' . $ o u t [ 2 ] . ' < / a > < b r   / > 
 
 
 < / p > 
 
 
 ' ; 
 
 
 $ f i l e = p r e g _ r e p l a c e ( " | < a   h r e f = \ " / s e c t / ( [ 0 - 9 ] + ) / \ " > ( [ 0 - 9   a - z 0- OQ\ & \ ; \ # \ ` \ ~ \ ! \ @ \ $ \ % \ ^ \ * \ ( \ ) \ _ \ - \ + \ = \ | \ \ \ } \ { \ [ \ ] \ ' \ " \ : \ ? \ / \ . \ , ] + ) < / a > \ r \ n | i u " , ' ' , $ f i l e ) ; 
 
 
 } 
 
 
 $ f i l e = s t r _ r e p l a c e ( ' < b > < a   h r e f = " / " > 0G0;>< / a > < / b > ' , ' ' , $ f i l e ) ; 
 
 
 $ f i l e = t r i m ( $ f i l e ) ; 
 
 
 $ f i l e = n l 2 b r ( $ f i l e ) ; 
 
 
 $ f i l e = p r e g _ r e p l a c e ( " | < a   h r e f = \ " / n e w s / ( [ 0 - 9 ] + ) / ( [ 0 - 9 ] + ) / \ ? l u = ( [ 0 - 9 ] + ) \ " > ( [ 0 - 9   a - z 0- OQ\ & \ ; \ # \ ` \ ~ \ ! \ @ \ $ \ % \ ^ \ * \ ( \ ) \ _ \ - \ + \ = \ | \ \ \ } \ { \ [ \ ] \ ' \ " \ : \ ? \ / \ . \ , ] + ) < / a > | i u " , " < a   h r e f = \ " ? n e w s = $ 1 & a m p ; l u = $ 3 & a m p ; s i m v = $ 2 \ " > $ 4 < / a > " , $ f i l e ) ; 
 
 
 e c h o   ' < d i v   c l a s s = " m a i n _ m e n u " > 
 
 
 ' . $ f i l e . ' 
 
 
 < / d i v > 
 
 
 ' . @ $ n a v . ' 
 
 
 ' ; 
 
 
 } } 
 
 
 i f   ( ! e m p t y ( $ _ G E T [ ' c a t ' ] ) )   { 
 
 
 e c h o   '   < a   h r e f = " ? " >   @0745;0<  =>2>AB59< / a > < b r   / > 
 
 
 < a   h r e f = " h t t p : / / w r u f . o r g . r u " > 0  3;02=CN< / a > < b r   / > 
 
 
 ' ; 
 
 
 } 
 
 
 e c h o   ' < / t a b l e > ' ; 
 
 
 e c h o   ' < / p > ' ; 
 
 
 $ t e m p l a t e - > s e t _ f i l e n a m e s ( a r r a y ( ' o a f ' = > ' o v e r a l l _ f o o t e r . t p l ' ) ) ; 
 
 
 $ t e m p l a t e - > p p a r s e ( ' o a f ' ) ; 
 
 
 ? > 
 
 
 