Done ! 403WebShell
403Webshell
Server IP : 46.105.57.169  /  Your IP : 216.73.217.35
Web Server : Apache
System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : verseaumee ( 152031)
PHP Version : 8.5.7
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/verseaumee/123click/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/verseaumee/123click/assets/com_k2.tar
images/videobg.gif000060400000004652150751650340010130 0ustar00GIF89a��


222111---///000(((+++!!!$$$...'''))),,,%%%&&&***###"""     112221


,++**+//0++,))*&''010101$$%001..-,-,)()00/ !!	
	/./*)*%&%()()((122$###"" ! -.-,+,,,-%%&&%&#"#/..$%%
	
./.&%%+*+212!"!!""""!0// ++*%&&+** ##"&&'&'&(('0/0121--,

.--110../-,,'&'  !! !
-..100			.-.	

		

	.////.,--
  ))(*))('('((211$#$#$#%$$"##''&&&%%%$,,+##$/0/)*))****)-,-())#$$(''!!""!!"!"""#+,,

--.011/00'('''((()*+**++  '&&$%$%$%"#"!  !! !�,��!	�����*\�a�!��q�Ŋ!>���cƍ9z�ɓ&�L�E�C,+Y�a�P�̛-��óeK�@�
��'OE�-�IR< �T�h�NH��ARFjT]�B�J�lT,�~�u �h��4-\�o���w ��� �})ғH�#�f�aH��|`��'W�V�sg�C��iҦOHͺ��֬_�xfZ�l�iL�{a��l��ȝ����ŏ7����ʙ370�Ԩ�ש[�^�;�$�����~���N�:�|�R§Or�L�����_`S����ɀ�'`&��\� 
�`����`�d$#�pH�&ɐA$�@"�f�H�
*��.���/�`�8ƈ�
�����,�"|"��E��+���P��SJ�d�VZ	ʖTn��`�R(�#(G��ʚ�
!�Q�ԉJ��IH�|�):u�'���i���$�(���S����LUT�C�R�Ncp:ƥ� ��j��ۜ�ꩨn����k���j��^��6�亍&�Za�`�&��,����f-�fR��b{���R���wdr�0�f��wl �!�P��TPq��{H���A�vl�ɻ�l�����C����.�0�8��%�P��_rN0'\2�	��s��������$11,Q1Đ,�� �0"�s�;�s�77�\��\ 'Epbt��1��L
��1�\_�u�\Wr���p��7�Xb��x`I%� "�\{`�s�}77:p�c���+�A�$>x���?:��W�A!�w#��r���P���B%��:��R��%{��.���>p�������o����@� �԰C
��C�<��� H5p��������(�PG=㧏�	(���|�oB+&La�&1I�����0!�`��D?�1JD��B��'HA
bC�� A��6��
�F��k��$	�@7��$���A�[� *�B�Ї[�3���� ���>�!��(�� pb��C(�"
���2@ 	P����hA1�Q�9�1r �0�`c�p�8���l
������.p�	L���5(RL��p��1(�����(i@�?�����$a?�~X%
�P`��4xev��j��D,* `£�% d�X���lf4�لhZ��Ь���'x�@B��WX`���4,`Np�����<g OX�S���>-��g��̀�,Ќ,���`�@�	�hB?���y��E
�5�`
{�� �@ �#5�I�ҖB h��(�2��Kc�������@x*�h��B=jQ���h��E}�~��<b[X~�l��P��U��b=�Z͚����ABA
0��`;@
�5��`�J�����E��4P@	_H�РG(A	h@d�U�"�P�#8KZ�*����C����
p@��؇�6�A d��8�0��o���=�l�\��<p�������q���X@#��Q,��
�xϫ���"�)h/|S��D�W�PA
f(@��H����l`C
�@A��p��+  ;images/system/stripes.png000060400000000167150751650340011542 0ustar00�PNG


IHDR

PX�>IDAT�}�	0C���E]�^,E���#D�7���b�z2���n$u���kɓ830 �
�>�IEND�B`�images/system/feed-icon-14x14.gif000060400000001760150751650340012442 0ustar00GIF89a��W����s6�"�W�\贌�}"��8�]�!쾔��/�C�Ф�r(���݂F�ˢ�u�\�s��9�\��͠���:�L��J�p��2�(�o����d#�e"��>��>�o�Gߍ5�Ө�~"컌�5�{�*�v'�~I�2�S�p!�q"��%��ɡ�̩�p&���� �Z��w"�` �|?߀�J�!�!� �h"���9�}���:���6���� �S�W�I�Z�V
�ѳ�Y"�^�j�Ѥ�x)�Q�!�H�k%�T�a�O�n1�ț�6��<���-�y����[�v�.��}*��6����.��1�Ê�R�ٺۆF�B�,�~�ά�r&�"�3�V�׿�Z"�y�`"�]�o1�M���!�,�!��BC
(p(��A�| #�:u�9D���D a#�����0��A 34Ac�����D+L(��'�([\����
�],���/��AD��R��HtgH�D,��*�Y�"D��Hĥ�>�ΠH���5s@~��"��: ��AB"T�PC��A��89Rd��@l )��G�C�b˞�0 ;images/system/featuredItem.png000060400000006427150751650340012474 0ustar00�PNG


IHDR44�x�tEXtSoftwareAdobe ImageReadyq�e<�IDATx�ܚ	�����3�;��r�J�TT��J�L)�J%�*XAH%QP�*�]�)Д
��1�

��K�U) ��,������L���۽;�@��j��MO�������}����|�7��̄B~GÀ�	{opJ�{#=�ޣe�r|�m�;�:n��oU#��0G���<ovTzw�0/4�@��DM�W�q�eB�
㜤�����XA�2ĶW�ƌ�y���ƒ-V#Ea��DnF��|�Nz6�*��
����/(%�7dz0�d�maZh��eo�����^=�c��/����&U� ���$�en�2[�8% }�V���B���
#���IC�&nO�1)��<�3�0EC�v�z� T~yYB��O����P�U�0Q�F�{�P��4��C
ʕe�߼G4o�B|���]f<���s�ں��{�Z�ȐA���V�[�*"�__��aU׶��B�ǭXxQ�c�D)�=cP�V��ɹ����V�q�
��7�o��Dc��93O��7_F�qW�T��r��C*��x��D�[�y\F��ߪ(:�s)�_*5��'�rm]u�
��w�wϖD��7o(0�͔2�G�C]��m��/�5=f����(��Z�'�����Jo�E��������b�7���
���EZ[g�6׈�Tk��� "��h��6�QJe*�fqf�Ë�G��,̶ɿ�����iM��e������舟�Z@���op�R�a���Ky��7��V�����(^ᕸe��B?�T��½�l#�R�im_��Uv�.�x3�T�]��0�(�=!��>�g�X��K��HTq�n��1q���H�E7>���Z$�3Q|�ި̮��DĆr�^&�X�C��U(�p=j�~ߞl��F��3���X1�VaǕDW���0��(���+�Զ)͜
��1B���7w�i$o�`]��.���9��)��m7c���Pu�#�7w~*i��<t�
��dV���j��Y�L�f":3�-��G�Õ)�P�0�r*4�
u=�B�"��)u��,Fo]�t�6�Pl�W|�1t�BM_lD�n���폏���
K�!�?y*L���/<���Mudm>~ӅJU�}��k�	(+��ԧ�V1e��>��;��g_ɵ�q�����l��@6n2�J4��7]�NSoG!]Έ�z�k�0s
��}
tAyO�O�E��FӒ優m���x�΄��Ȋ�㣖C��RP���R&�@WP��';y�ő\��e����Dе&�}��J$v�B�	`/��y�6�R)���5�v5
�8���x�
e�����@_��P���<>�	?�64	��fa=Q+�Ü�/8�7��|���]5Z&Ǿ؀o�_���+�er�F����^��@�vb�W��2�r����B>V]]D� r�����J��@�)V�y���|�R�2�5V��Fs�/N2ȉ��Q$����20��	L���i��O�:�$�3Lfө�+v�����9�����d���u<	�s�0�27�HVTv�K�j���S|�� �l��L�V0�곧���td�T;I�V(u�Z�x!�z]�Tu�!��b��W���R)ɨ�(��O-Y$��v��@�7	ũ�՞�v=�l�̒:�V0�H�nI;?V�j���9k������6K�JE��~ı���-m�1�� �&y\����	d�F��d`,{�J�cD�U��˴]�F�tXB+��2�N]�I�U�—-B��5�2�=
rh�4~7�^����^�4���qƔ���	�3N9)�[��9�Mgx�I��R�8*j����3�=�l�0z}��N ��=�*�4D��vC;v��
O�B��BZ\��p��0�I"
˖���[!
��#��5�s����[��+�|�؂X��cT��t[�4�\k�>Sy����Kq������l��p-�N[m�oK�d;=y
�&)�a;��)c�y+�Pƀլ�oa/����TF�ᱮ%{�\�uUQ�q'��.�3
S��O������{o
���%T
9J�|N6�+���?5^w�Լ��-@h����i�<g�ƿ���O�a�<
�/�Q�g+�
��ץ�n5����N���;с�)e��v�
$�~���;�N0y6���ˬ�n��l��j&�(LGi�R����մ:N8�fלGqd�����haV��k��,��ٰ�RG�[�շ;+�hJ��L��F�(��ȯ��0UT&�η����w�g�Æ�_���i��'�L��XX�z�ٴ.�9�¸��UE�S�C,gI��ug��gA{���8��4f��;�H��SnNJ�C�[%tR8�ƘZlj�fL�[2�u�sԹJ�����4��Th��Y�R(�錛�r޳�rNc�|�-�T?d����]˪�;��L��_S�	L��v/'�(�=��yd.�׭��Yecȏse%���s����U�8ѡe}I�o*�m�U}�#�,WD�K�Z�]^��9ۉa�JB�E��>�K�Xf���lԦ��G�׋�l�h8���
51U7��կ��?5_ϝg�h�=H��1��9�	�)k=�Obt��e�*�yY�4��"��0c1�"vR��ɔ]�]�5*$αB�gM��l8~[ dh5��d$�-7�I�=�]θM��s�PK?%����&��1a
�-�B�Yu�m�.i-᮴ʹKf�:d����$�5�2�jH��mSQx�d6��窴�u�p���*X���f��?�d�\��~;�@J�̨tZ�)�1��W����Du��ۯ]�Y�� Zz!]���z9Ip�HwT�y�R����U�Jg��>U
�]B��Ur���!T$�\);S�H����¯�D`)��������/���i��v�s���2	��Tb�6Ea�C��$Q犥���z ���|ֺ(�a��,Q��%)��nf��\
�?
\�z�ؘ��*}/b(��Ry;X���(zO+�ϛ�*3n��#]·�v3�:Ο:2]�r�*����
M�)3�MZ&�V�ܜ�a��G�����A%n���Z�홁q�V�r30*��P�щ�aZ�OD����S��_��F��x0hF��ھ�uL�r��q�F	����&�;9v?��&)��Q�Tp�HW�n�,���͔�Cu��T��{&�X��ӄR
?$�����P�u1TIEND�B`�images/system/star.gif000060400000002140150751650340010774 0ustar00GIF89aK���5����������6��m�̙������N��J��r��O���N����a��i���\����������A�������R��q��3��������i��Y�������������J��J��y����C���:��ޘ�����������Y��f��Q�ئ����E��C���c��>��O���S����L����s��������e������9�ޔ��y��B��]��S��X��u����;��Q��l���������݇��;���j����լ�����3!�c,K���������G����GH#>���G���>H��G�����H2����2��2�2#��G$2>�>#�GŲ��’Ѭ��і����G2߇�2#��爸�#��ӍH��H���Ɓ�6ȇ��t� �v�,��c���GL��(��:~U�\Ik(S�v�#Wb@�$�N�H�[E�H H��lU��
�t�-Z�9��A>�aa�&r��1��#)<�`�c	b��r�"!�Ve��E��AT�4�L��ǏWP�$8�+E
��RTp��S��Pt^���5������۷�PP�P�14�1�����R�I�!��IN�TJ\)�cG��6I������p8|)�
hk�9nN#Q�*��!a�Ie�-�+%��� ��3��ȓ��P������B�¡#�|���2V�`�	0$!c>��A
S	$`@>��ifu�
�Ф�E�\�Ó8DEjŤW.0%'tyB`�0@G���_��,[i\VA�2��l
�#�O� h�M�=��Z>�e=t�C?� 1l:�!t�†�@A��j�Ȑ�!�PP*7P�� ͪ��HA.xKET�	���� I�������#� �$i1����Ӓ-#2��;images/system/videoplayer-bg.gif000060400000004652150751650340012746 0ustar00GIF89a��


222111---///000(((+++!!!$$$...'''))),,,%%%&&&***###"""     112221


,++**+//0++,))*&''010101$$%001..-,-,)()00/ !!	
	/./*)*%&%()()((122$###"" ! -.-,+,,,-%%&&%&#"#/..$%%
	
./.&%%+*+212!"!!""""!0// ++*%&&+** ##"&&'&'&(('0/0121--,

.--110../-,,'&'  !! !
-..100			.-.	

		

	.////.,--
  ))(*))('('((211$#$#$#%$$"##''&&&%%%$,,+##$/0/)*))****)-,-())#$$(''!!""!!"!"""#+,,

--.011/00'('''((()*+**++  '&&$%$%$%"#"!  !! !�,��!	�����*\�a�!��q�Ŋ!>���cƍ9z�ɓ&�L�E�C,+Y�a�P�̛-��óeK�@�
��'OE�-�IR< �T�h�NH��ARFjT]�B�J�lT,�~�u �h��4-\�o���w ��� �})ғH�#�f�aH��|`��'W�V�sg�C��iҦOHͺ��֬_�xfZ�l�iL�{a��l��ȝ����ŏ7����ʙ370�Ԩ�ש[�^�;�$�����~���N�:�|�R§Or�L�����_`S����ɀ�'`&��\� 
�`����`�d$#�pH�&ɐA$�@"�f�H�
*��.���/�`�8ƈ�
�����,�"|"��E��+���P��SJ�d�VZ	ʖTn��`�R(�#(G��ʚ�
!�Q�ԉJ��IH�|�):u�'���i���$�(���S����LUT�C�R�Ncp:ƥ� ��j��ۜ�ꩨn����k���j��^��6�亍&�Za�`�&��,����f-�fR��b{���R���wdr�0�f��wl �!�P��TPq��{H���A�vl�ɻ�l�����C����.�0�8��%�P��_rN0'\2�	��s��������$11,Q1Đ,�� �0"�s�;�s�77�\��\ 'Epbt��1��L
��1�\_�u�\Wr���p��7�Xb��x`I%� "�\{`�s�}77:p�c���+�A�$>x���?:��W�A!�w#��r���P���B%��:��R��%{��.���>p�������o����@� �԰C
��C�<��� H5p��������(�PG=㧏�	(���|�oB+&La�&1I�����0!�`��D?�1JD��B��'HA
bC�� A��6��
�F��k��$	�@7��$���A�[� *�B�Ї[�3���� ���>�!��(�� pb��C(�"
���2@ 	P����hA1�Q�9�1r �0�`c�p�8���l
������.p�	L���5(RL��p��1(�����(i@�?�����$a?�~X%
�P`��4xev��j��D,* `£�% d�X���lf4�لhZ��Ь���'x�@B��WX`���4,`Np�����<g OX�S���>-��g��̀�,Ќ,���`�@�	�hB?���y��E
�5�`
{�� �@ �#5�I�ҖB h��(�2��Kc�������@x*�h��B=jQ���h��E}�~��<b[X~�l��P��U��b=�Z͚����ABA
0��`;@
�5��`�J�����E��4P@	_H�РG(A	h@d�U�"�P�#8KZ�*����C����
p@��؇�6�A d��8�0��o���=�l�\��<p�������q���X@#��Q,��
�xϫ���"�)h/|S��D�W�PA
f(@��H����l`C
�@A��p��+  ;images/system/blank.gif000060400000000053150751650340011113 0ustar00GIF89a����!�,D;images/system/searchLoader.gif000060400000001323150751650340012421 0ustar00GIF89a�������������...���```���"""JJJ���ddd���&&&NNN���������888�����򶶶���������!�NETSCAPE2.0!�Created with ajaxload.info!�	,-  �di���
���@�8�5p�{�۸�����@�.s��
E��B!�	,$`a`��i�����©�ҧ����X/(��;�!�	,6  ��a,�$	"c�b�(�ϴ��2�����[��K���ӸN��U*�N�!�	,5  ��ET��4b$I��<��uy�;�
�Ȅ>b�G��̑s9y�֋�*�R!!�	,2  �di�ֲX�DQ��H�bRUEɴ]�:^��f�_Q�#����c�J��!�	,7  �di�$q]���b�iمa�h㢶m�] ��a�.�M$��4_-66ˠ��R!�	,/  �di��DQ����r%R�
�5���p���Ěq��^-4CY��!�	,/  �di��DQ����r%R�
�5���p���Ěq��^-4CY��;images/system/transparent_star.gif000060400000002000150751650340013410 0ustar00GIF89aK�`����������������������������E����J��Q��J��C��9��\��;����A��C�������a��J��Y��Y��L��N����R��B��:��5����c�����O��6��j�ޘ�����i�����������y��S��q��X�̙���;��]����Q����������u��y��3��O��S�ئ�������r����N����e���݇�լ����������m����l��s��i������������!�`,K��`������������_��__����_���_	�`	���������������ž��̽����_��Ȉ��ۋ��Ǐ��	����ʧ�_���`
@lS"��+$�����"J�H�"�%@���L(z�#����J�p���Q��ܸ�.�	���B�@�@@�RF0Hp��
�PS����—K�|R2%��`�6#�O;����m[��
H`aF�$��+�Œ��Z��p��:.tL R��"Gn���#p.�m��󖗉 H��1\��p�XV�A��
'#xA��F�aV�'��
Pz-��L�������سk�.ZN��U��*wD&��P�qA-�}�$`��{�0��\ P�`tE��wĘ�P���
h��d�N
'P�� :���EFH���P�AH(��\LXA~"��~'(��!�@CDF�N�]q\�� r0D���_�؁2h�
&=2�^F`�Y|Q�"���B_�B,h�/O�`A*`A	��	�K�+Tr�'�H��E*)w�;images/system/font_increase.gif000060400000000305150751650340012643 0ustar00GIF89a

����������������������������������������������������������Կ����������������!�,

B�&:D(Q!���p�"��=x?Y8b�	ocC�8���!�5pLw���˅��V$S���;images/system/featuredItem_withShadow.png000060400000007251150751650340014671 0ustar00�PNG


IHDR44�x�tEXtSoftwareAdobe ImageReadyq�e<KIDATx�Ԛ	��}ƿ��s�5;��,ˡ	�u9�HX�!'6�S��VJ�S��)W���Rƪ�N�%��T���U��	�0f)�$.��UXv�e���ٝ���{=ݳ=�3h�u���NO�L���?_����@ƴ�:+Qդ��a��B
�Uw��b�U�9W�]������rW�Zń<���
2���ķ��Zh^k��Kܙ�����	�2r�=�t�1��9V7wR'{�����C�p�J�j���(�g�6����y�P�M',�h���ꄸ�\.�&ݰ\+�x�~y@�9v�S�a�=���_�5�\o��!�m�G��D@����v���[cчd�U�g���kJ+���FM[֗��-���k%wب�D�-E��1�PC�^�C�*9� �5
?z�BBC�|J��roUA������_����D�5X#��fa,�3Ӂ6�_�\J���0K��/���\{
��z�T�/��9�#��M��7�7��Y�_�	RgJ_�.��f�#�FB��=f��w�|�V3�gǧ(S��$�y�14�x���C�i;겞�h�qe�V��a
���Lʸ<푝��P��9(����,g؁�4��z�Mӻ�f&Ԫ��`�)��z2�́�?��E�T%�ľ����ntn�C;�ŬM�`��7�c���" G�4@_�H�nT7e`]��3O!u|:J��H���Zh�ٚ�x�ʄ"BG@�)j)_���Mh�2ifiNvp�sE0���۶�G�ScbO	P~_8�U��3h�0".CM��O�C0�8�IƬA	g������zg�?���^�w�ji���FYӫe�N�!:oR]�ڎh��vPnXs+ji~��cè	�s�α�^z�
�;��M@n:��3�gX�e����ʕ�T��q�i���7��H�؏\�WǺ<�dN��a�͈��9{��?z�ޅ��WA��H)��ۯ4���/1���	�!��A�m�~l�͕SJ�M��d
�����J-��+4���!*���zJ����[���C�w���-�
��Kl���0GF��{��ᘞ(1��T�y��L��Y���Y��N��]��Φ���)�b����sљBom�Ѭʖ���R��;�BR K3����C�C�#��]�Q��j������� ��3��f)��<�F�z�%��3�_�E�X�yP&�|J�c����7%P�T(3�<�)�v��x�Ӻ�`�oܼ�t��ᖛм�6�irz$���c���1���	�f�z��Qص�P�)0�f�z������,��p7��w�Ѭ�/�B�P	�bz����iiY �����[+!�PQNR��z�=�"}t���ch�R*�}�mj
�v�j�w�f�-6��@y7Yɂ�R�f��d��pIDhU׉�ߴ�'8wi�x��@yU���(d�-�{s��@��V�DՔBV���'��He��V��ӿ�����<��'/G��/�\�_���6T)���{���(�	�l�J��-�C뭑1M��gS#�T	��N����R�qRZ{.�j����)%�@�� ĉ���?!�vo�����C�ڈj��?�
��Y�*t�3n)>.�|�������D]���
5�(�UJ�H��
B�9����h�yG���IN�w�r�$�Aj�^ۜ�J`����їί�`�R��rL�P��y�G��%B�|���j��s���s�R'�;����ͪ�W�	ū�cӂI����6�~iFIe����ݕP-i�`�a��D�0��NåD�)f��
+��J�����{!"�~~��VZ(m�\�r���� �S���t�W(�Gƽ�*���1�~�v��K�}s�BI�(��D�w����÷���~�F��;@��&hznx��@έ��݁�[��{����Ȣ�)mK�2*���T�
�e�@f��T�[�-�Q�4k6|��"��O*_�b̛��EY�$��ӗ������P��Cd���(+�s3��p6���d���"{?�R0���a��f�ʍn}�U+��*�قX`�>*h�E��x�����؛F��?�G�`\�r�y�/����W[� '���>�-1��*�r0�;�E��c��nNQ�۾�o?j=Em�]���X�	c�>Ɛ/��l�^��(U"�W���d{�ʛ쪢�5�iV�{~U�qK�^�y�>T!�SJE��6��쿐~�,r�+� wQ)�)m�9Yf��U�=A�e������vԬZYd~����Y-�|#p�S*�J���F�[�s�_�յ�&�\��ңP��4I�\x�7�NJ<��%�s?��zD�n��#����1�S>��@U�'P	�U��4GG Õ�`�"��Pm���M�&'��[vPWF��ǟ����t��
j�r�g��a���lE�;�3$L�0ʩ��~lh?�cÐ';�ͼ��S�ț]���5���ȷ��0�T&��7�vd�'�7�ӆI��[D��K���_�-"���G�
P8��m�	V�M�"�GVU�L�B���}�Mhg����T�!��f�0j��"������O����}��R�9�\<	��
�Ԏ@�Be�V5��'�S;��w"����BSair�˖��G\�|�3�4E[��0OtAo����E��߰���f�%OP))ꨖ2//��Xx�u�~�~��oF^{��ju4�>ȍ�Js���p.n��A��,jo���5T���o3&�S�-�y��.���m����G��8�����'s�.X�h~|Л*P�I��NTݶ�Uj��e9��Ec>�8��G�?�B�N#�h���O�`+�o�j�(�3�G���C��?p��F���f?�������l�w�K�*(� �U�.�I�:M�9Mu\SHft���TH|
�(�;JU9JE�Z�0:�"��,��s
B�c[�q�''n�H�1er���>���S
���_VomBC�@g���b���G���Dq�m:&��yH��B�Q�l��}Ȟ`���+B�c2�_c4���Uڒ�˰��@ևTU��;@�V�!��iAm��w�(՜�UPFM�*&�:�}�#z�Fц:�\_�<C��f�9�32���y|i���Zn�}D@e�_�Zd�=' �aT�8��V�d��C>0�&�ee?B���O�ɲ�"�R�L^���nb��J.�By��"���z�@O%�*�Q��!���!!�3	u C�(|��*�2�2PfIǤ�L��1��f��qJ�ҘZx����
J�^�S0��Ǜ4�f���
�Z�p�R#�2�G�_�G:c��:F�9�jj'ԛ�$�����>v@�x�&� �ǥ�
��ho1�8�KA� ��s��n�[��x��.�KO~�Nⓞ�IL��v�Y��7f�}�[�~��/�	�Xp��[�"�k�7��aJ���\F�Y
Up��v�L��ob@Z#�#,fkH<S��n�H%�r �S�,���t�	a��T�,����I|/�,����u��j��x�@��л��s�/��.KJ���jf�@�1Ӂq�q�mC�{�$�07��wQ$��
����e��èv�0(dIEND�B`�images/system/k2CalendarLoader.gif000060400000023452150751650340013131 0ustar00GIF89a0������������켾���������̼������������������������!�NETSCAPE2.0!�,0��#�di�hz���F�-��
�E�2��"U�(����@	�R�
�\�V8���3�lBb�@J�3��yg$
~$~Oui#�K#pu
�l�"�~�"�u�a�#��#��tln$�V
|~	�W&�a
�$�\��\r'�V'���	�
;(��L�h�$	�*��1��7���!!�,0������̴����줦�����������Լ������������������Դ����쬪��������������ܼ����#�di�hz^EV]�4��C5�"@��jhH����D$IA�& �X
��I2�����T��Z`jD���a���_��P��$GyPy%w�P~j
$�Ir$QqpH�j$���q�"v��q�A�oH��v��qi��#�����#�wr�a��מ�w�H�D#nȄt%�^�<�~�#]o�	+�p�� �CQAC�8
r�p�ԔdcA��T\hp�	o��!�,0�tvt�����䜚������􌊌��������������������|~|������|z|���������������������������������&�di�hzٕ1�XLS���T��D����CM��% H1(
��`M@��2ʃ4sbH�ʍ�`�n���i"M���)aNjfpZ�Zd$HQ%
}�Qm��$�Jx$RwvI��nr#��
�wM#|��woY�$�u��"|��w

��Z�#�ȱȟ#�}x���#H�¥�}�Il��0$tՋz%�a�<�A]N���lA�����������Ν
�L<Y����\HLQ@��*L0�˗1B!�,0�\Z\������|~|�����Ĕ��ljl���������̼����䄆���trt\^\�����܄�����������������Ԝ��tvtΠ&�di�hzZ�=�h%��Y��eb@��cC%�d�H)6e`Q�4��JH����M2l�Hv]1%�҄�O"��~QB֗%Izk$�I$��Z$
�$t���@��r#�����#��#��H�|$~u��X�&���%�e0�k�%^p'�R�	��&��bQJ<$�7��		��$!!�,0�<:<������dfd��켾�LNL|~|��������\Z\���lnlDBD��������TVT��������Լ��<><���ljl������TRT�����������\^\���trt�@�pH,���Q�% ʡ���D�ZD`�cbEz
�4��H**"5�Sa8�@P�rrG
�iVaaz#F�rF�i�{�	Eh�kE�i!���D�iD�y��D�D��"|��}�—Cƪ��{�C¶C���ˠz�Ǩ�ʡ
F��"�E҈"P��E� pB)A"��x����Fd0���i"p!B���W@x��<lɲ� !�,0�������TRT��촲�<><��������ljl464��Լ��LNL$&$���DFD�����tvt$"$������\Z\��촶�DBD���������ܼ��|~|���pH,�����!�ӁD�Z�(*��#dEv@�t�Hz.uAP�0a� ?rrG�i
Vzy�F�rF�i 	���Eh�kE�i`��D�q�D���k�{aD�qqimC�j����a�z�C���q�B��i�q�ЫCr��߶C����q ҝa�D���@�Jì�D+`@:a�ڵ�T�R3p�&\��h�nD\���H���7�K9
FBS������B"�I2 @�S	�\���J!�,0����������<:<��������$&$TVT���������DBD�������464dbd
��������촶������,.,���������DFDljl��pH,����R�<<ʡg0�F���`�$`�H�tAIj:uaa�t��r���GiOy�F�rF�i
��Eh�kEL���D�ieC�
�yD�mC�������B�����C��B��
�ɜD�������E�ْEƅ�x��Dq�G�r�_ac�G�a�gD�yip)�B�gJt��d@��W2j�!�,0�������TRT��촲�<><��������ljl464�����Լ��LNL$&$���DFD�����tvt���$"$���\Z\��촶�DBD������������ܼ��|~|�@�pH,��� ��!!"D��R\`�(���#��`6�xA@6`����'i�Gr�dzy�F!��lE��"	���E��E��!_��D��~B��q"�{`D��iD�r�p��`�z�CĂ#��C��q�p�ЭR�iD����p"Ҟ`�D�iإ�Rq�p��b �8�UK�A�L���DG��+bh��B�X��
���@���0h���<���D> ����D<(�Ri�+J�!�,0�<:<������dfd��켾�|~|LNL���trt�����\Z\������DBD���lnl�����TVT���|z|��Լ��<><���ljl�����Ą��TRT���tvt�����\^\���������pH,����))$�!�rAD�DZDX`���I^���!J..���!*5@F�T�!��Gs�ea�z	F��j	�mE��`{��
Eh���E��$��|D���i�VC��|�aD"��j��B��s%{���C"�	��i�#��r�ٷ�C��м!�B��
��|z������B
�nE��נ䦝+EÁda�8�!�CF$ V���e0a�U��,@�@D�9�!P�D�+#�A/
 t]��H!�,0�\Z\������|~|�����씒�ljl����������������䄆������trt\^\�����܄�������������������tvt� '�di�hzb
�A��\W�Z��eb@���I]$A���Zl�(EQ5��Z�d��ӂ 
HE���.� �t��s ��Ɓ
%kq%vxwP@$�@$Ry�Q�$�$u������#���#u��w���#�����x~�$X���Q�lo������0�I'qbP��"	Y�'��&N��T&<bȐ�ҍ	$Xp��Æ!!�,0�<:<������tvt�����쌊������������TVT������������|~|�����������<><���|z|�����씒������������\Z\���������pH,���Q��<<��@xD�E!a,80�0��E@�"$=�	gΡH�xo�Fki�Gttw{}a!Fk�jjnEsr���|�|VDh��iE���r���"Di��Dt��s����C��D�����{�D�ę�C��ܢ��|�C�װ�Cܶ���j5�95���b���H�R��Bn�5�%Sƌ����s$��s��x� �]
X�P�Б	,.Ȩ2N�	v�H�Ħ���E��A��W�J�!�,0������̬����䤢���ܼ���􌎌�����Դ�����<><�����������$"$�����̴����줦��������������Լ�������$�di�hzn�m�X��t!��@
ECY�$�aIm��q(a6��@X,�4ҁ�SE`��8�Y�(����
�jp�Y%acIc%~�Q�rY$w���R��4Zq[[{#x�I$}���
�Yq�"���#}��o���2�c�62����Ί$H��E"�Ȩ�Yt$��Ŷ���<W�UJlH@-Os#6���@�>�(8���qb<؀0!���@a��*<� �c�
 �x�eM!!�,0���������������Դ��|~|����������$&$����������ܴ��������������%�di�hz.ʠ,�XIR���Dr����4H@C�Z(�C�0"0�@�p$����cP2�a�|�f�a"�:PQ:“
%
z?i�6#	o	$�P�l#�_$t��z�"��H�#���z�"�����y�}��$���d&����z"��;&�'�j#�A�'~H
�&����)	�*��7���!!�,0������̬����䤢���ܼ���􌎌�����Դ�����<><�����������$"$�����̴����줦��������������Լ�������$�di�hzntm�X���A��	�����,�త6�4@�4F�&�hz��0&�'ă�
��d\F�dY��|T��u[w[q$ceJe%��nStyx�$~��$l���x�][{#�J$��R
���B�"���#��t��x�2�e�6#����v�\AW���F"�њs[�z|��ξ�o=
<�q䋉
	�J�˃p�@P��
K<HR��
E ���A:��!b��B���!�,e�!�,0�<:<������tvt�����쌊������������TVT������������|~|�����������<><���|z|�����씒������������\Z\���������pH,����SP<��@xD��G�!1J:��3@�`��3�c���0�9	Gmk�G
t�a~Fm�llpE!t����}�}yDj��kE�����d�Dk��Dv����}�C��D!�ލљ��b�B�ȟ�C
�����Ӯ��C�ٵ�C"�u�a���A?a4Q��
."���R`��L(��B;n�����@�h	aa]"/P�c�`H
�&\8sd�"�>z�O!	>8�"���L=\� @�Q�X�	!�,0�\Z\������|~|�����씒�ljl����������������䄆������trt\^\�����܄�������������������tvt� '�di�hz.Z�-��\W�˖m��=����P	`	�R�΄	0$F�p(� '
�8a���Yd���˸�.i�d�/%p[r[%J~M%�KotD�
$�K$�s�][v#�$}��s�rB�"���#h�A[�s�#�����q�\A=$���n���#x��$�y=��_'~'�l"
�EG'�L�>cW%	\�! CM7 \��o�Ç(B!�,0�<:<������dfd��켾�|~|LNL���trt�����������\Z\DBD���lnl��������|z|��Լ��<><���ljl�����Ą��TVT���tvt�����������\^\�@�pH,���qAAP���bAD�c�1n����EZ�t�JnH�`�
7��>\( ��Gss"{�F��j	�mE	r��r��Eh���
E
s����{�B���i�vB
���s%#�{�C!��j��"�ǡ��a�B!�	��i��Ŋ���Ի�Ҽ �"��r%������	q��ؙ*P)Z/A	�	� �"�ض���#�I3d�B"�"až!>"	�J?E��
�F$|��Af!B�K�rD�W�J�!�,0�������TRT��촲�<><��������ljl464�����Լ��LNL$&$���DFD�����tvt���$"$���\Z\��촶�DBD������������ܼ��|~|�@�pH,����C@>�!!"D����a-F&�pa��"C��:�%##`~Q���x/2'k�G�s
"{�F!��wD���S�{]C��E����b��D������b���C��kD���t´��a�Bʂ#��C�Љ�c���R�kD��ҋ!���E�kݩ~(���\����ې-��2E6�qe���bc2n��ȇ�� ܼ9 RH�!��
:"��O
�2#�Q���Cxz�|����E�>���H!�,0����������<:<��������$&$TVT���������DBD�������464dbd
��������촶������,.,���������DFDljl�pH,���Qs�\4ʡg0�D��G�p1z,�pӁ"
qAI2@���Hj��\���vFs�
iaF�bF��~�a]D��
E
�����R�bD����C�mC�����B���B��r���B��C�������E��j�E�D�����G�jG��
�������%��P}E�0�`�E�a��+ C*	!�,0�������TRT��촲�<><��������ljl464��Լ��LNL$&$���DFD�����tvt$"$������\Z\��촶�DBD���������ܼ��|~|���pH,����C@<�!�ӁD����A0B$�pAs�"; q�HBB����Hj1�\���vF�riaF�bF���~jj]D�� E�������D��D���a���Cy��mC���s��ʐD�b����B�φ�ñԴCj�c��C��ш��c���aԶ�:E䀽C�$p$p��k���GӜU�d8�N�Gd��p��,(���a@�I#�M!��Q��H*�d@�@^
� �s��S!�N!�,0�<:<������dfd��켾�LNL|~|�����������lnl\Z\DBD�������Č�������Լ��<><���ljl������TVT��������������trt\^\���pH,���Q1AL�a���D���"b-f��0�Ev
�p��H�8�f*�|�\���Grr�
hiF�yF!q��q
~�iE��E	r����D�yD���" �a�C�aD������B���Cõ����C��C��q"���C� E����i�Ȇ �E��� ��@8" `G&2e�B!"��a ��������@���(<�%"�,�Ȝ�$!�,0�\Z\������|~|�����Ĕ��ljl���������̼����䄆���trt\^\�����܄�����������������Ԝ��tvtҠ&�di�hz*Y�)�h%��ʆl�i]�``���a�HY8�`H�J!�Xd���e0-(E�,�l��T)�#o<�)��%v�K{A$�A=#�v�n#
�h#u�e���"��s"d�Sq�#��"��z{�"�_���J�%�l�$��=��'�Y'��J�(��Nv�"		�1�*��7��(!!�,0�tvt�����䜚������􌊌��������������������|~|������|z|���������������������������������&�di�hz2��0�XLS�LvevY\���Ҡ�P��p�*�`y(d�ep(��2K�2s*t�41�0��F|O�&Zzc�.
�h�h`szKW$J[sB%j���A{{s$�K{C$T����yv#���r
N#��h���B�"�yDZ�"j��hpZs{�#����#�S�`֫A�#J��L�̔Soy�#x�r�}$�́�6�9t��b
,(�_7�*���	6�p�ħˬXQa��"
�PN�(����!!�,0������̴����줦�����������Լ������������������Դ����쬪��������������ܼ����#�di�hz^C5\�4��W�T��8�@ ��P
�p���.�T�������3e��e�t�LϘ��dH�C�����%ÆIp�c_pwKj$JZpB%}��Axxp$�KxCV#�~��vs#���oN#|�g���B�"�vDY�"f�SmYpx�#����"��_ʣA�λY��$��lvķ#u�o�z%��6
n�\'_v	'�g/DFߑ4ȓ���}($q���"Thp-ł",8��dI�"B;images/system/loading.gif000060400000003325150751650340011446 0ustar00GIF89a����DFD���dfd���$"$���TVTtvt�����������
LNLlnl424�����̬��\^\|~|������LJL���ljl$&$���|z|�����������TRTtrt<:<������dbd!�NETSCAPE2.0!�,���pH,KH��X�!��"*-'��哅|��,���h���A�.B�	P �-�cB%BVB
!F$��C%DB
#E'& "b)EY�Y�E%!O(KD%���A!�,�������DBD���$&$dbd������TRT�����
������424|z|���\Z\LJL���ljl������������DFD���,.,������TVT������������<:<���\^\lnl���P��t�Ȥ�����I������J�:�v������6W�B9�mK8�f$HJ	+�J#lK.B!BH
)�#I'�*aH%*\*X�U�X("+XIIA!�,�������DBD,*,��줦�dbd�����TRT464���
��܌��LNL���|z|���<><������DFD424��쬪�dfd��������\^\<:<���������p8�T�H��!H�N�����`��@��p��%�I��2�HA�'��b;'I"MH�WB%)#$CD#'&$n�H["�&tD)g]
N�!$�I#�NB�A!�,�������DBD���,.,���dbd�����TVT<:<|z|
���LJL��켺�������464lnl������������DFD424���dfd������\^\<><|~|���LNL���������|��pH,�Ȍ �&��bE$�ج����͓uy`Q^� <!��\"&��32�].QB	.�$TC
Y'�D�%�).D&X)\
�
YYrD
$*�IB$��IA!�,����DFD������$&$dbd���������464tvt\^\
LNL���,.,ljl��������ܜ�����<><LJL���,*,dfd�����<:<|z|TRT���424lnl��������ܜ��������pH,���s:5(�I@�>ƋKcP�$�fB�p-�H���c��BF�bUB
(T.T
 B+
T
)#'�F)D+iD%$#
FUU"G	.,vIq��CA;images/system/font_decrease.gif000060400000000212150751650340012622 0ustar00GIF89a

�����������������������������������������!�,

7�I6cI��`����4h{-�X1h�B��t
0@�����i�H�Â�H";images/loaders/calendar.gif000060400000023452150751650340011712 0ustar00GIF89a0������������켾���������̼������������������������!�NETSCAPE2.0!�,0��#�di�hz���F�-��
�E�2��"U�(����@	�R�
�\�V8���3�lBb�@J�3��yg$
~$~Oui#�K#pu
�l�"�~�"�u�a�#��#��tln$�V
|~	�W&�a
�$�\��\r'�V'���	�
;(��L�h�$	�*��1��7���!!�,0������̴����줦�����������Լ������������������Դ����쬪��������������ܼ����#�di�hz^EV]�4��C5�"@��jhH����D$IA�& �X
��I2�����T��Z`jD���a���_��P��$GyPy%w�P~j
$�Ir$QqpH�j$���q�"v��q�A�oH��v��qi��#�����#�wr�a��מ�w�H�D#nȄt%�^�<�~�#]o�	+�p�� �CQAC�8
r�p�ԔdcA��T\hp�	o��!�,0�tvt�����䜚������􌊌��������������������|~|������|z|���������������������������������&�di�hzٕ1�XLS���T��D����CM��% H1(
��`M@��2ʃ4sbH�ʍ�`�n���i"M���)aNjfpZ�Zd$HQ%
}�Qm��$�Jx$RwvI��nr#��
�wM#|��woY�$�u��"|��w

��Z�#�ȱȟ#�}x���#H�¥�}�Il��0$tՋz%�a�<�A]N���lA�����������Ν
�L<Y����\HLQ@��*L0�˗1B!�,0�\Z\������|~|�����Ĕ��ljl���������̼����䄆���trt\^\�����܄�����������������Ԝ��tvtΠ&�di�hzZ�=�h%��Y��eb@��cC%�d�H)6e`Q�4��JH����M2l�Hv]1%�҄�O"��~QB֗%Izk$�I$��Z$
�$t���@��r#�����#��#��H�|$~u��X�&���%�e0�k�%^p'�R�	��&��bQJ<$�7��		��$!!�,0�<:<������dfd��켾�LNL|~|��������\Z\���lnlDBD��������TVT��������Լ��<><���ljl������TRT�����������\^\���trt�@�pH,���Q�% ʡ���D�ZD`�cbEz
�4��H**"5�Sa8�@P�rrG
�iVaaz#F�rF�i�{�	Eh�kE�i!���D�iD�y��D�D��"|��}�—Cƪ��{�C¶C���ˠz�Ǩ�ʡ
F��"�E҈"P��E� pB)A"��x����Fd0���i"p!B���W@x��<lɲ� !�,0�������TRT��촲�<><��������ljl464��Լ��LNL$&$���DFD�����tvt$"$������\Z\��촶�DBD���������ܼ��|~|���pH,�����!�ӁD�Z�(*��#dEv@�t�Hz.uAP�0a� ?rrG�i
Vzy�F�rF�i 	���Eh�kE�i`��D�q�D���k�{aD�qqimC�j����a�z�C���q�B��i�q�ЫCr��߶C����q ҝa�D���@�Jì�D+`@:a�ڵ�T�R3p�&\��h�nD\���H���7�K9
FBS������B"�I2 @�S	�\���J!�,0����������<:<��������$&$TVT���������DBD�������464dbd
��������촶������,.,���������DFDljl��pH,����R�<<ʡg0�F���`�$`�H�tAIj:uaa�t��r���GiOy�F�rF�i
��Eh�kEL���D�ieC�
�yD�mC�������B�����C��B��
�ɜD�������E�ْEƅ�x��Dq�G�r�_ac�G�a�gD�yip)�B�gJt��d@��W2j�!�,0�������TRT��촲�<><��������ljl464�����Լ��LNL$&$���DFD�����tvt���$"$���\Z\��촶�DBD������������ܼ��|~|�@�pH,��� ��!!"D��R\`�(���#��`6�xA@6`����'i�Gr�dzy�F!��lE��"	���E��E��!_��D��~B��q"�{`D��iD�r�p��`�z�CĂ#��C��q�p�ЭR�iD����p"Ҟ`�D�iإ�Rq�p��b �8�UK�A�L���DG��+bh��B�X��
���@���0h���<���D> ����D<(�Ri�+J�!�,0�<:<������dfd��켾�|~|LNL���trt�����\Z\������DBD���lnl�����TVT���|z|��Լ��<><���ljl�����Ą��TRT���tvt�����\^\���������pH,����))$�!�rAD�DZDX`���I^���!J..���!*5@F�T�!��Gs�ea�z	F��j	�mE��`{��
Eh���E��$��|D���i�VC��|�aD"��j��B��s%{���C"�	��i�#��r�ٷ�C��м!�B��
��|z������B
�nE��נ䦝+EÁda�8�!�CF$ V���e0a�U��,@�@D�9�!P�D�+#�A/
 t]��H!�,0�\Z\������|~|�����씒�ljl����������������䄆������trt\^\�����܄�������������������tvt� '�di�hzb
�A��\W�Z��eb@���I]$A���Zl�(EQ5��Z�d��ӂ 
HE���.� �t��s ��Ɓ
%kq%vxwP@$�@$Ry�Q�$�$u������#���#u��w���#�����x~�$X���Q�lo������0�I'qbP��"	Y�'��&N��T&<bȐ�ҍ	$Xp��Æ!!�,0�<:<������tvt�����쌊������������TVT������������|~|�����������<><���|z|�����씒������������\Z\���������pH,���Q��<<��@xD�E!a,80�0��E@�"$=�	gΡH�xo�Fki�Gttw{}a!Fk�jjnEsr���|�|VDh��iE���r���"Di��Dt��s����C��D�����{�D�ę�C��ܢ��|�C�װ�Cܶ���j5�95���b���H�R��Bn�5�%Sƌ����s$��s��x� �]
X�P�Б	,.Ȩ2N�	v�H�Ħ���E��A��W�J�!�,0������̬����䤢���ܼ���􌎌�����Դ�����<><�����������$"$�����̴����줦��������������Լ�������$�di�hzn�m�X��t!��@
ECY�$�aIm��q(a6��@X,�4ҁ�SE`��8�Y�(����
�jp�Y%acIc%~�Q�rY$w���R��4Zq[[{#x�I$}���
�Yq�"���#}��o���2�c�62����Ί$H��E"�Ȩ�Yt$��Ŷ���<W�UJlH@-Os#6���@�>�(8���qb<؀0!���@a��*<� �c�
 �x�eM!!�,0���������������Դ��|~|����������$&$����������ܴ��������������%�di�hz.ʠ,�XIR���Dr����4H@C�Z(�C�0"0�@�p$����cP2�a�|�f�a"�:PQ:“
%
z?i�6#	o	$�P�l#�_$t��z�"��H�#���z�"�����y�}��$���d&����z"��;&�'�j#�A�'~H
�&����)	�*��7���!!�,0������̬����䤢���ܼ���􌎌�����Դ�����<><�����������$"$�����̴����줦��������������Լ�������$�di�hzntm�X���A��	�����,�త6�4@�4F�&�hz��0&�'ă�
��d\F�dY��|T��u[w[q$ceJe%��nStyx�$~��$l���x�][{#�J$��R
���B�"���#��t��x�2�e�6#����v�\AW���F"�њs[�z|��ξ�o=
<�q䋉
	�J�˃p�@P��
K<HR��
E ���A:��!b��B���!�,e�!�,0�<:<������tvt�����쌊������������TVT������������|~|�����������<><���|z|�����씒������������\Z\���������pH,����SP<��@xD��G�!1J:��3@�`��3�c���0�9	Gmk�G
t�a~Fm�llpE!t����}�}yDj��kE�����d�Dk��Dv����}�C��D!�ލљ��b�B�ȟ�C
�����Ӯ��C�ٵ�C"�u�a���A?a4Q��
."���R`��L(��B;n�����@�h	aa]"/P�c�`H
�&\8sd�"�>z�O!	>8�"���L=\� @�Q�X�	!�,0�\Z\������|~|�����씒�ljl����������������䄆������trt\^\�����܄�������������������tvt� '�di�hz.Z�-��\W�˖m��=����P	`	�R�΄	0$F�p(� '
�8a���Yd���˸�.i�d�/%p[r[%J~M%�KotD�
$�K$�s�][v#�$}��s�rB�"���#h�A[�s�#�����q�\A=$���n���#x��$�y=��_'~'�l"
�EG'�L�>cW%	\�! CM7 \��o�Ç(B!�,0�<:<������dfd��켾�|~|LNL���trt�����������\Z\DBD���lnl��������|z|��Լ��<><���ljl�����Ą��TVT���tvt�����������\^\�@�pH,���qAAP���bAD�c�1n����EZ�t�JnH�`�
7��>\( ��Gss"{�F��j	�mE	r��r��Eh���
E
s����{�B���i�vB
���s%#�{�C!��j��"�ǡ��a�B!�	��i��Ŋ���Ի�Ҽ �"��r%������	q��ؙ*P)Z/A	�	� �"�ض���#�I3d�B"�"až!>"	�J?E��
�F$|��Af!B�K�rD�W�J�!�,0�������TRT��촲�<><��������ljl464�����Լ��LNL$&$���DFD�����tvt���$"$���\Z\��촶�DBD������������ܼ��|~|�@�pH,����C@>�!!"D����a-F&�pa��"C��:�%##`~Q���x/2'k�G�s
"{�F!��wD���S�{]C��E����b��D������b���C��kD���t´��a�Bʂ#��C�Љ�c���R�kD��ҋ!���E�kݩ~(���\����ې-��2E6�qe���bc2n��ȇ�� ܼ9 RH�!��
:"��O
�2#�Q���Cxz�|����E�>���H!�,0����������<:<��������$&$TVT���������DBD�������464dbd
��������촶������,.,���������DFDljl�pH,���Qs�\4ʡg0�D��G�p1z,�pӁ"
qAI2@���Hj��\���vFs�
iaF�bF��~�a]D��
E
�����R�bD����C�mC�����B���B��r���B��C�������E��j�E�D�����G�jG��
�������%��P}E�0�`�E�a��+ C*	!�,0�������TRT��촲�<><��������ljl464��Լ��LNL$&$���DFD�����tvt$"$������\Z\��촶�DBD���������ܼ��|~|���pH,����C@<�!�ӁD����A0B$�pAs�"; q�HBB����Hj1�\���vF�riaF�bF���~jj]D�� E�������D��D���a���Cy��mC���s��ʐD�b����B�φ�ñԴCj�c��C��ш��c���aԶ�:E䀽C�$p$p��k���GӜU�d8�N�Gd��p��,(���a@�I#�M!��Q��H*�d@�@^
� �s��S!�N!�,0�<:<������dfd��켾�LNL|~|�����������lnl\Z\DBD�������Č�������Լ��<><���ljl������TVT��������������trt\^\���pH,���Q1AL�a���D���"b-f��0�Ev
�p��H�8�f*�|�\���Grr�
hiF�yF!q��q
~�iE��E	r����D�yD���" �a�C�aD������B���Cõ����C��C��q"���C� E����i�Ȇ �E��� ��@8" `G&2e�B!"��a ��������@���(<�%"�,�Ȝ�$!�,0�\Z\������|~|�����Ĕ��ljl���������̼����䄆���trt\^\�����܄�����������������Ԝ��tvtҠ&�di�hz*Y�)�h%��ʆl�i]�``���a�HY8�`H�J!�Xd���e0-(E�,�l��T)�#o<�)��%v�K{A$�A=#�v�n#
�h#u�e���"��s"d�Sq�#��"��z{�"�_���J�%�l�$��=��'�Y'��J�(��Nv�"		�1�*��7��(!!�,0�tvt�����䜚������􌊌��������������������|~|������|z|���������������������������������&�di�hz2��0�XLS�LvevY\���Ҡ�P��p�*�`y(d�ep(��2K�2s*t�41�0��F|O�&Zzc�.
�h�h`szKW$J[sB%j���A{{s$�K{C$T����yv#���r
N#��h���B�"�yDZ�"j��hpZs{�#����#�S�`֫A�#J��L�̔Soy�#x�r�}$�́�6�9t��b
,(�_7�*���	6�p�ħˬXQa��"
�PN�(����!!�,0������̴����줦�����������Լ������������������Դ����쬪��������������ܼ����#�di�hz^C5\�4��W�T��8�@ ��P
�p���.�T�������3e��e�t�LϘ��dH�C�����%ÆIp�c_pwKj$JZpB%}��Axxp$�KxCV#�~��vs#���oN#|�g���B�"�vDY�"f�SmYpx�#����"��_ʣA�λY��$��lvķ#u�o�z%��6
n�\'_v	'�g/DFߑ4ȓ���}($q���"Thp-ł",8��dI�"B;images/loaders/generic.gif000060400000003325150751650340011552 0ustar00GIF89a����DFD���dfd���$"$���TVTtvt�����������
LNLlnl424�����̬��\^\|~|������LJL���ljl$&$���|z|�����������TRTtrt<:<������dbd!�NETSCAPE2.0!�,���pH,KH��X�!��"*-'��哅|��,���h���A�.B�	P �-�cB%BVB
!F$��C%DB
#E'& "b)EY�Y�E%!O(KD%���A!�,�������DBD���$&$dbd������TRT�����
������424|z|���\Z\LJL���ljl������������DFD���,.,������TVT������������<:<���\^\lnl���P��t�Ȥ�����I������J�:�v������6W�B9�mK8�f$HJ	+�J#lK.B!BH
)�#I'�*aH%*\*X�U�X("+XIIA!�,�������DBD,*,��줦�dbd�����TRT464���
��܌��LNL���|z|���<><������DFD424��쬪�dfd��������\^\<:<���������p8�T�H��!H�N�����`��@��p��%�I��2�HA�'��b;'I"MH�WB%)#$CD#'&$n�H["�&tD)g]
N�!$�I#�NB�A!�,�������DBD���,.,���dbd�����TVT<:<|z|
���LJL��켺�������464lnl������������DFD424���dfd������\^\<><|~|���LNL���������|��pH,�Ȍ �&��bE$�ج����͓uy`Q^� <!��\"&��32�].QB	.�$TC
Y'�D�%�).D&X)\
�
YYrD
$*�IB$��IA!�,����DFD������$&$dbd���������464tvt\^\
LNL���,.,ljl��������ܜ�����<><LJL���,*,dfd�����<:<|z|TRT���424lnl��������ܜ��������pH,���s:5(�I@�>ƋKcP�$�fB�p-�H���c��BF�bUB
(T.T
 B+
T
)#'�F)D+iD%$#
FUU"G	.,vIq��CA;images/loaders/search.gif000060400000001323150751650340011377 0ustar00GIF89a�������������...���```���"""JJJ���ddd���&&&NNN���������888�����򶶶���������!�NETSCAPE2.0!�Created with ajaxload.info!�	,-  �di���
���@�8�5p�{�۸�����@�.s��
E��B!�	,$`a`��i�����©�ҧ����X/(��;�!�	,6  ��a,�$	"c�b�(�ϴ��2�����[��K���ӸN��U*�N�!�	,5  ��ET��4b$I��<��uy�;�
�Ȅ>b�G��̑s9y�֋�*�R!!�	,2  �di�ֲX�DQ��H�bRUEɴ]�:^��f�_Q�#����c�J��!�	,7  �di�$q]���b�iمa�h㢶m�] ��a�.�M$��4_-66ˠ��R!�	,/  �di��DQ����r%R�
�5���p���Ěq��^-4CY��!�	,/  �di��DQ����r%R�
�5���p���Ěq��^-4CY��;images/ratingstars.gif000060400000002000150751650340011033 0ustar00GIF89aK�`����������������������������E����J��Q��J��C��9��\��;����A��C�������a��J��Y��Y��L��N����R��B��:��5����c�����O��6��j�ޘ�����i�����������y��S��q��X�̙���;��]����Q����������u��y��3��O��S�ئ�������r����N����e���݇�լ����������m����l��s��i������������!�`,K��`������������_��__����_���_	�`	���������������ž��̽����_��Ȉ��ۋ��Ǐ��	����ʧ�_���`
@lS"��+$�����"J�H�"�%@���L(z�#����J�p���Q��ܸ�.�	���B�@�@@�RF0Hp��
�PS����—K�|R2%��`�6#�O;����m[��
H`aF�$��+�Œ��Z��p��:.tL R��"Gn���#p.�m��󖗉 H��1\��p�XV�A��
'#xA��F�aV�'��
Pz-��L�������سk�.ZN��U��*wD&��P�qA-�}�$`��{�0��\ P�`tE��wĘ�P���
h��d�N
'P�� :���EFH���P�AH(��\LXA~"��~'(��!�@CDF�N�]q\�� r0D���_�؁2h�
&=2�^F`�Y|Q�"���B_�B,h�/O�`A*`A	��	�K�+Tr�'�H��E*)w�;images/social/twitter.png000060400000001222150751650340011472 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z���IDAT8���MkSQ��s�I�/ikԍ�SЅ�bA1[7n��H@�[��D�n�U��E�bAcH�$MC��ZIc��8���w�U�=�ڏUsbUU)�;�F�+R3�լ�U�I%P4�E�V�����9rT]	X,V"n�\�"&޳3�2pnR�"�
o�Ժ�"�L`�=�9>�-�
w�y��\�#g^�@�՚z�P��Z�D���D�ApA�*������pD�:|�&x��pֿ����5��R�w�x���SY��/J&�I�H'Ɋ�	X��¥=A�x��&���{��b�0cEp��:��
�������%��$&©����g;fP�6��t~�SR>�[6��s=x�u�r&�O�^��jJQDc0b��������'tc�ec8�#��z����ͼ�>\��M�b�;�<%�40v���o�V/b��&g|mo"�ݑ^��N�#�)#�.fB��:��tIEND�B`�images/social/reddit.png000060400000001512150751650340011245 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z���IDAT8���KH�Q���8i�4:j��BE�����v��T8��F��"k!Ѣ�2�(�����T�D�Ț|�����W:���L�
<�{����U/;=+�~q��bfe�P�Q�*��#;�hN2�gh2`v�_P�I&�:c^E��<�s���l���%�ϰs�P?����哺�D����9�v¯��sT_���	9]���V��u�r��c�!;�N��[X�eJDD��"G+���^"""ޙi��^(�/_�ۏ�H�[��7Iަm�:���/Sr�i��nW+K�r�---�;\���R\�4HK�"f��6G�s�߀���[�a?���,+�8h?MO�,3?��[MR�
��6��r �0;`��lGA�4��烮�^<�aF�n�k��,;Hi�� �s�ĥ	,�V��~p��]޼xB��I�đEJ\�\S�0>���;��^b㗒�*�O���_���RS�HY����Đ}Mi�v��-/TIww�l̷��j�����_��eJB�̬)..���B�u=|����B#X�يhmm������AS��FNՀu��%�c��u�g���ي���	?�o���O@S"�ʯ�@=m��g%
�L���}���k&sڧ�� ��P(M�_-�$ZXE�-�v#/ IEND�B`�images/social/digg_16.png000060400000001237150751650340011216 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�Ӡ�IDAT8���OHTQƿ{�͙�i�q�B� "Qr�h!E.$(��&�hHKwm*Z��
�ZE�1�-\��J��-(űPǙw�y�Z��_&�����W��{���V�q��R�L@*���M���[���C��
P����!��5���f`W&b���Q*Wb��̇�;�94gskJe�0X����=8ݝ}���b��.����"1p�X����xt_+�0�1X�p��=G+̔������;B�#:X,�G�ޕ�1ݾh^�}�ȗ�U�l��}�swFb���z
�q���o�b�Sș	��!���#���':q��P#{�YFDbyC�ɳ�)<;��m-x��r�a�l�aBm.�;q)��p�g�}!�H��hG��5�D}ٞ����|���8ھ�W"T�*0�$��=��}9�8���Qa,>�V��@��>+'�Ք�I��\]~�
ZX@�{S�G�'��=�.��tTJ���{�Q:�l�IEND�B`�images/social/myspace.png000060400000001003150751650340011426 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z��[IDAT8����KBa�ッ�CS]A%)ͩ�;;4������6��45}lA�8�5�8�fK���be�C\���5���r<��=�W���e-�=g2B�(	ًIe-~�\
yR�hXY}�*m����9s%hPk����Vj���Kn�k�ͮ�h.I����0�R�|zE��S�&
P��IG�%�T�q��8{���*N'���Cu7�6���Cu#
2�:�T�L��i�2М=�ep��A"�����NreNr��7HD�Cu���f�#N�L���H�ʶwq�Ǘ�4�R��~Ím�����e�a�
t�>H؟(�m����4:%)d/�h�B�ٝ�;�,�FfO!#IEND�B`�images/social/technorati_16.png000060400000001465150751650340012447 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�Ӡ�IDAT8����kUg���5�T�UB��61-�Wp�n�Fp!Bq'�h�-Xj���U�?��XRl�B1��T��hI�1F��ޜs�s��ݱr�g1�3�3̌||q�|�2t��!V��١Se��T����=�H1��C@� ��������N]Qq��՗�����M��s$DDJ�Ëe^�V������Mjy0��K��&:�r>�|��K7P����I3|�g����"��:�:ި�ͳ͜
o�e`��(A8,�;��("�)��GcI�l)����)Q�yO���cܘ�L�7�U�Y׹�=}Y8�c,ڤ����ݫ��V�22u�/��#����l����!��=&u�,��ZT�Vu�A~��t�I�^&Nܸ?L�XTf,&���$���g3���dL���'S�1OGau�:2cQ&��YQ���WXoyg����Į�<FnO�W�|�C�����ݘ�"����J9^�4�+�rd�hU!��G�A�+�d1*�&�%��p�	ƞ�!"x���
3Å[���D;t�Y$o��eo/��~�sUH�늒�e���,�j�����q�U�I��H��E�X<V�y��M�r�דe�_�����Y��D�j!6��g�+��/7Ѳ�_�b�q�wIEND�B`�images/social/technorati.png000060400000001344150751650340012135 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z��<IDAT8���OHTa���7�nj�4��6M&F�C!�D���A��(h�A�vA�ݴ�	"4*#B(-J�)St4��y�}-^Cc���.�p8�^9�CԪ �H����,ʪ �-K4l��<�PĠ��C����BM�
�f��1�����w�S�S�֏NƓ��?�-̡�É�W9�pC<�5�S�����"�<�A�WAvy�fw�!N�G?V��`�&#ӏ�YX�T$�Nҵ�:5f�(�8Z{�gS����?���������exh��c�k��>�3�	�s��'���0�y�+0��FDh��$싔m 싰/�V^��5,�@����k��_&�!F鬻DO�g���ncm���$��,EK�,W��/��Z;n+"��82�߁R#���YI#�c#�x�h��<I�qn��|��Uj��<�6�/���>h��ϗ�u����U�!�+A�VY,���;(%MD��6n�-Du�����\
C<TbX�+��U�&3���H��@|�┃�`���|�3�T��ҩ�K�
����s�
7���,J/IEND�B`�images/social/facebook.png000060400000000745150751650340011552 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z��=IDAT8����J�Pƿ��DJ�V�hK!b�
�E�;8���/� 8_�'p�!���I�v�EQi� ��͍CZ�%
�-�s��~�ꍖ™cr��!�"TjR��RY04M�!���s��i���'�rΌj����/�>����(g�����=2��>~�.�89�Eq.��?Ţ\Z��	��C�࠱�cE���|�I�X����(I�σWa�zj��óOɓ:�?������,񱾬�PK���c��Y��5��B�k����˵�jlmn@�S�׵qe]�ݳ�z��p�1��\�E��|d{{�IEND�B`�images/social/friendfeed.png000060400000001162150751650340012066 0ustar00�PNG


IHDR�asBIT|d�	pHYs
�
�B�4�tEXtCreation Time12/12/08�Z��tEXtSoftwareAdobe Fireworks CS4�Ӡ�IDAT8���mk�P�����o3��Z�@t/�a� 
��?��Яs���	�	:*�u��Y��tI�ꒅ�p8��s�\�9�Ϟ���嚭Z�&gX���G���k�����`���)q�P���>����Tk��X(�E�c�<�@�����9>��L
 {N���l��=?%*�rXF�vw�s���WЎ�� ���a$�h
FA`��{~l��f��,1ش;���z�<wn\J4����dm=���{�q��䳙1��<�]M�S��u�x'�&R�
��p��4v&wP��a�xn�H�ʉ�u���%~��n5�&l�Tf�V�Y�w�K��*ow�1
z�.%l܏޿Y�S����)Am����$$p\?ޒ$��0�q��P��>����ʅ��%(����y����i���;߳��K���%�N��}��oҺ��v�pIEND�B`�images/social/googlebuzz_16.png000060400000002027150751650340012471 0ustar00�PNG


IHDR(-StEXtSoftwareAdobe ImageReadyq�e<PLTE��������*I��Xp�z��;��lL�l��E�]~�?��?�D.t�9����2�F-?�x�r/}.�5;��B,�0$��}?_oh�kck��=xAu���F@��n��=�Cy�x��PD���V=u��>�Gi�F�e�bu��r�.d���q��o7�~�m3L�~�����6��_�$Qȃ���-��t*{�, b}��_`���>�kS�L2`����zo���(��1�6G�vy�x��5���?u�؟Ji�>�]{�7'
6���P]P���y}Rr6�=,k��O��f�N����\��_[�����
�x[��J�2��xD��4��1�����'Jv�"���C9�6}�Z��]@X����}_��^�>�3G���G��N+�t���m���'[�Gz눃y|�p��91�L��1)Z{�_�w��|��4����~�6$~�s��19V�/�����x�tRNS���������������������������������������������������������������������������������������������������������������������������������������������������������������������������*=l�IDATx�bX����a�J X��`⛭]P���EL�	$��<��#�vj��e]�*�Y�9�5E�0UsLbf`��f����Y�2��a�����N�`v~�� ��+V�ʔ��-5���
4$���4/��R�Q2i%K�l�����~��*�q,}s��[�u�\���S��j��O@x�B��0���@�1�H��X%U�j���t�CIy%�D�J�_
�$2\�ݺ�!�e���}���gJ�;�IEND�B`�images/social/email.png000060400000000770150751650340011066 0ustar00�PNG


IHDR�asBIT|d�	pHYs
�
�B�4�tEXtCreation Time12/12/08�Z��tEXtSoftwareAdobe Fireworks CS4�ӠPIDAT8���1��0E�`"�H�qREPpo�U�2�$qD�"�x�X%K0��/M��̛/�C������/f��R�8�?��VU%着*q�m53�I��r��v��D$���$��>׍Y������3�8��d�w��M�"BQ���{f��������jfnAπ�Ƙ6I�>�1��&�؀�s���@ʲ eYb�Xw�
k-�4��p������5�i�,˂ii��Zہ��'�	��~��֝ʲ��n�l6{��ݟM��[?�`8�z�??��E�"��ڝN�|4!�����:�PJ�Yg��YD�u���3r��IEND�B`�images/social/twitter_16.png000060400000001140150751650340011777 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�Ӡ�IDAT8���KkA��]:;n4�	�6!	z�%��O��������ɓ`$�� �@B.b|�2�>`�����2�6b
�n��~��j:xՊ/Y�u�,� ��*hPj�ƕ�l����X�H��V�mP�R�Za?IN#�����)�����o�c�y�G��x�z"�(7ȭ@XJo�ĨL��܉��(7�a��d���e�dX�NU*���k����7n9eV`�$�Tk7<���]<|R�fV�*p�\��ٝ/w������c �d�>�ia��!�/O�M�`��:!͇��テͯ���|˷���
�{����?����C��oc	����{�c<"��������ܫǃ��`�I��2����v��kLDm�17�ýZ:P�K���:��a7iӹP�t���J.����sUC՞���7*�a8�;^IEND�B`�images/social/stumble.png000060400000001137150751650340011450 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z���IDAT8����kQ�o2)�PH
ɪ�h�Y��n*�`]�(t�V�JЕ�A�
R���N��D�
��d�.L�ai��d�\������
~ah.Y ���U�/���n5_ͤ' 0Ax6�ڣ�]��x���@}Xy����S�c�\{����db�k��LbzSXi�l���ֽ�p��|9�1�L�n6�)EK��,qz�䮇d�����Lp�ϫ���p�C��*���4@D�{j<�y�kSG�]w�H6��ՠ����CT*yt�>SP����*y�m�\�3��]N�����x�]���DDzI"���$���M�ޔ;�~Ih�#��I�Ƭ���zS��ow�T�Zz�����Z(���vQ����!g)���i^[G�X�a��dr����<�n���Q���C/_������!IEND�B`�images/social/delicious.png000060400000000617150751650340011757 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z���IDAT8�͓���PE���Km%��_-ďx�������ΖK�]�bs`���;3�H��\�m[���ͧ��k�$)�4%D䩭�|f�0<�q�l�N�e�W�s��^��U�(|�	 ��W{P�q��ӯ���I�Z�%M�x�i��qc�}��/`��!�2�1?E� X�U��a�<���`��0y]W�y�c�-�}纮��b��a޿�4t}�=3)IEND�B`�images/social/feed.png000060400000001323150751650340010675 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z��+IDAT8���IhSQ����f0�1/Mj��*M("��" �nTP�q���A\�V\t����T�U�n�#lj�&m�tHm�4�]�1{v���{�h���FТ
¬!&��G'*�1:�N[�,��9	#3�g�7���ILe@��B�m5���v�?sa�Nٮ�:$�g�g+��l*H�r`�`�F�փ��H�������Ȗ�)�e% R3����
sFo�B
���3c�?��2�	����ء?�i�Aǐ��oI"�@k���Q&?��r'��i���&@׈������&��.&�GoOBw#���Vj��}���!7Bڼğ��3��
v�����n
�M/C$ۡ��r/�x3է���գ�`j��⨀�+�|� >CN���ȾTib,��8|��9G&'J\u����q�=��"�SM�wP�o"��_��N5t�(�&�^��y�E�Ma�:P�����gKM�=,�R^�����k#Ưѩ*��Vcت!�)H�Rz%њ-jr���+���c��]��IEND�B`�images/social/digg.png000060400000000645150751650340010712 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtSoftwareAdobe Fireworks CS4�ӠtEXtCreation Time12/12/08�Z���IDAT8���AN�0E�-�]T���¤��O��E��-rn�+���JM�� ��b�@��hڄ�����3}k�'�yKI�JE�ܞd2��f"U��몊l�l�M�(��f�|��m[�?i�p������J����Y3���.���pL�<&�����_�.��C;@��Ի���c�;z'�
h��^	�*����B��� F���D���� ��z��=���� /�TIE�o�d��3�TD�7]�I��IEND�B`�images/social/facebook_16.png000060400000000766150751650340012063 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�ӠOIDAT8����JA�Ϭ���
k��)��S��&E,�G�7�Al�Z��W�1����a�c�Av7���;�33�rSf��X6&���5��.�v���R*l����c����P�JO�љ$r����5	���<���/�� ah&�$—�m���g&�&��X���p�X��	$�	���h2��
n�#�;�`.�����u�_�W���p��3��W�I�urx�:��04%>�(�D�$���|*��=�-,趺��N'^0<�=�KLPk�����<
7��5��s^�<cm�v���Z:���ƜҶ�IEND�B`�images/social/myspace_16.png000060400000001222150751650340011737 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�Ӡ�IDAT8���=hTA���2�Ƽ��b'*Fl,��	a�@���b%�Z�J+I�R���DA	X�Xh���ٙ;�E�m��18��9s���?틉��8�x����+�#K�\&<>4��w*E��a�R_RZ�0�
�����\����������Ih]US��$�Ze�j�D67@o��K�g������+�~*���)���EK�p"��;L��h���Kʧ��ڼ�X|##Q™�83�q�D�V��5�𵸶���u����{�^�8�
�LL;�2�Y�Hw��A+�Fu� ;�J��ύ/(mڶF�r�cβ�3o?�8�m��y
��O^��S�W[�2ƶ�zk�*�ϝ���3�	zv]�[dv�y�Ƣ�ݽA'h��0@Гn��PF.8H3�PF,Z�_
��{5#%�U��ҽ�^Ա�ڝ��"����<_��3�Iɿ`u
]�$�욲Λ�D��ͯ#�J��׵�j�7��%����1IEND�B`�images/social/delicious_16.png000060400000000723150751650340012263 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�Ӡ,IDAT8����jA��Y�"���i�M��,�Ty"���J�Hm,�\ ���EΜK��dg�)����0a��L�}af%�xxOm!<#�{b��x<.'�	�,;��y��kmv��*�>b�r8�ݡz&"<�~'���9�$"Ȳf�n��1	�~�#(���|�u����_2�#HD���F�3]Όk��(|0tf��egm�Z5"�rw�u�BD@��,��T����u>33��@D@�
fn��K��~ߌ��k3��zIH
PUv��}M�:s���M�`>�'͈����~8T��:��
IEND�B`�images/social/stumbleupon_16.png000060400000001272150751650340012660 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�ӠIDAT8����KTQ��{�z/�69�)I D.B\4S-�/h�a� Ze!Ѧm� \��h�.�a�D0��`Tf�9�3��=�-�Fd&�^8�����=�qNN�%�L[kS47��[��qN{V�����ԁ�}8��O�>�c}���/O{:����O������m1�(�<-4�U��d��I���x&�iС��R�U��x��(-�`��xF*����.����3XsL-?c^-m�J�q��X��u�
�	��nu�p��,VꚆAT��eh�������re��.���^�;�����e�}�ږ�aE����-J$�8G:�PN�,�$A�w�YQ��Rc���C>���@��b�v��JK�`-o���7�Q���w�*�h���mQ%���%�N7y>�,���*[�XO�;��x�5�#��\�m������ *\|<�\��ߞ��8�������]�|
���]]�C����<�'�7)na7��U�s��>���Ǎd�x#�H�ͽ�%�IEND�B`�images/social/reddit_16.png000060400000001350150751650340011553 0ustar00�PNG


IHDR�asBIT|d�	pHYs��~�tEXtCreation Time6/24/09��k�tEXtSoftwareAdobe Fireworks CS4�ӠAIDAT8��SMha}�]����M-=4���B��X��z��Q�-=�
*b�H���<� B�$�
�b���ڃ�Ã�M�$�%���7C����0|of�|�x��B��sl
��"'x��iV���$��͍�c��[�oW�4��'t�6XCB��ܒ9�!��<l��L�x�+��p�L;޼J�f@���r�w3�l	����Q	�� i��|����r�:�g30�|"�Y)C�|�|���r�f��H�����G���������~R�[6�������:֋���pmp����g�wb=�~ҏ�]��~�̀��/w���j��}|��ֲ06�@M'"���q
4�����D�O����5|�A��'SDD��t�^ $RY*�J422B�p����)���ft���H$B�x�LӤD*KB�a���1��4|�f�
+��#Qw���t��b1�6ڔ���N</���n�e�(���1��J�W��	�8�ap���L��(
��{^,ܺ'/.��xw�k���*���'^\Z��/=O��wTv���Yn蜽��(����U��ǏWIEND�B`�images/placeholder/category.png000060400000001562150751650340012624 0ustar00�PNG


IHDR���>a�sBIT|d�	pHYs��IDATx��ݽjQ��G1�Ш`ec#Xy��;�B� 7��N�l%إV�ďJ�DE�� 1_��6��yϙ3{���ef����΀$I�$I�$I�$I�$I�$IC9MTW��,?���kX�����O�>���Zρ��R����[K�t��3y�Մ��5<��R�b�ڣ�EsN����w-b'�j�����10�r��f*a��|���N�k��p�&�����Z^7F�쇖j&N֯�p�]8շ�9<����SN��f�$�����$�6@$���*խY�`�g*w*E�T8��n�z�<�׫�%�[3�n�$IŹ
<��/��k蓾րW�]�[�;�@�J�����@��ߓ�R��
8ۦ@D���ht[���K�?��jh<��������@���-`��P9P9G@��_jh<E��G@���3�sT��ව�@�e�
|_fh�"2�����E�oZ|�����n�`�,��F�����3�+j����+*����\Q��g*��\Q`_��[Q�!h�4��F8rڤyKk����0�d*v���O�������r�r������O���S��`>Ev�m�G`=
Vd�1�K�#<�aP�U������ߧ�b�x\O���,�'����R�p�E��Ҥ������"��zJ�"�3�,��N��o����gI�$I�$I�$I�$I�$I�$�0k�u�{�IEND�B`�images/placeholder/user.png000060400000002715150751650340011766 0ustar00�PNG


IHDR���>a�sBIT|d�	pHYs��oIDATx����k]U��o^M*��U"Vi
T���)���T�:h(��/�BE|D[t�c�$�(��*�>'BSc��$J����H��z�c����}`��>k�r���}���������������Hn��H`��\l.��f���G�I��l�|%�A`7�0,V�Y�]�^` ���!�q�G��[�#4��Э�q��3�^R�%��}�9�/�r��eu��j�a���3��4>K9�A�}슿�
����9^mx���A���7:c��(0�}�;�w�&i���[ln��R����瀱�f߀~�Jz�v����N"Wk	�����0��D��0\h�D�;��(�S�YT�N����ۭ(a�uEyj���	��&WO
0l�@	k�(�S�X'P¬uEyj���(a�:��<5�)�Jp���:4�͢�(W5@3���~�N�7����3@~�N����	���N����(�S�N����(�Sx�:�6�����~q��:��<5��/�����Z'P�1����_Z'P��\=5���	��uE��7��X6X'���R�&���t8|`�D��޲N��7��Y?�nֻ����S�3�}���x��a_��8���t5a��y�1���6@/�LZ'P���+�%�۷-w�Z �{x�:������]�ۏ����N`�����s|f��
m�e�؂�G�����\�������g� �/n�l�
9�ZW�b��v)1t�؟`~��&®��ş6&��pio!�ܕdfRس�k�}��$%�v�6]�)�
��W���M,+95�w	���O�����-�1�ɭR<���H&�XLp���H&�H!E�%�[dU�rk�������5@�Gʴ}sj)�5��Ǹ&�1����<Nf/9�^$ݗAH�~Cz$ܓ��9��Q6Y�n^"�?8u�;�4�A�Ӟ�J��v/'�/z�8�Fxn��!����������w����S�	�+~��E[�̬>ǾXM�$�(�]P�j'�:�9{օIs�A��Uex��nm�o	g@7O�b#���H�okLO��~�Q�Ƿ9��K�/��h��n����	��^P�1<��7�Ng��KL{pp=a���5>��/7Ҏk����Z��v�cR�g����Pez��2D�-3a,)�p5�)�I�ݨ����k��7DC����1`s�1��+��.�0�TS{�c4�%Ɛj.�;@�pw�2#�7��h�uƐjj�}���~9]Pw5�ok���C�N�q)x1�R�"�m����~�Cy�f޲IEND�B`�images/search.png000060400000001251150751650340007765 0ustar00�PNG


IHDR�atEXtSoftwareAdobe ImageReadyq�e<KIDATx�b���c`ffaAFFF}) ��@��������@�&�m��Bw8����``a�E.~G3g?MC#S)Q>�_?�;y���=[�*}��n?P�}�B���OU`�h� '�s@b�������77##+������������L�>�]T��
0�������O�WPX^���
�.	d��H�ظ�ԁ����.��뗬������ �n������e��߿�spr
���,�)�LJ��ɻ� uX
��ۿ�?>30��c����_�A������sǟ�031���/��î�;����1؀�_��^:w�ݿ_޾�����L���?���tތ�tr�����������������Ǐon^��-36�܎��n����'3�ߟ�wl\s����PfFzЀ@`4ʣ��QNN��Ç߾}��X�Aa�	����m1˖��������&&�k@�p��a�|��caa��U����<���׿������Ɔ�"�
acuu������0���ʗT@����zэ/���`a 
�9s椄���s�m�@;�`p����IEND�B`�images/fugue/globe.png000060400000001521150751650340010723 0ustar00�PNG


IHDR�atEXtSoftwareAdobe ImageReadyq�e<�IDATxڤSKOQ��<�N��
}Q(�](b\(6�6&.]�7Mt�?�]L%*ȣEʣP��3���<�����39ə���c�K�G+ˁx��p�x����^���zC�]�YJ4��bZf�qz�d��L�K�{��^G4��6�4�U�x�����y�iv��Z`�����蜚�^lT����u�x���	�7�R����l�[$dI�RJ͏�%#~>���ϔ"�dՀ�ӣ��w�I;���3�J�V�o&�u#���Ḭ��6�h��9��)��\'
0�

�z��5G���&�|ŀQ5q���ó
r���r�=��y$�D�1�Evv��(�-g���PD<� iu�lMK̺��P��A�ְ����n �eE��@����78�oj1���!t
�u�ك�c����+��(
\�������r<�s0Lb��a,dM��hC�F�/�p�:�n�,�]<?O��p,uZݎm3Y��M>��ص��_����5	x�����ld�G����<K+�{0-\ҹM�D4l�.o��ڸ&�CX�d5�}.�G�����@t8)	m���:-{��Q����.���6�I x� Lj'��v������EP���8��>,�}�KLQ�U�I��=�u<��k���Ei��p<��E'�U���������$}��F/�ջ�.�~���έ~�E2L�6
{�ta�"=_�qY�#�e����TrْIEND�B`�images/fugue/feed.png000060400000001222150751650340010534 0ustar00�PNG


IHDR�atEXtSoftwareAdobe ImageReadyq�e<4IDATxڤR=hA�ffo�sgqGBTB.(A-����F䚈 h���-,-�T��&`
A����]0
g�B����������������ov�}��Zk�fY�X:#R"�$2�B�R���R���B`ax^�5LK^>��m[P�T
�c�.��R�`�G����Wfr�U�=�E���@�,��Ž��GI �%@��2����(���;��/ kr)!ȷql��Ժ�ٛFЙ�&Wn}����h��5y�Kϡ������=M��v�?0Q����-���ЅW�ߏd$�9���~hD�6P^N܀N�#.��m����@�����{����6�	:�& :=й9���˫a�����7hr!ҧ"���vY@�Pb6��	���nj�����@n$@
)�yT�e:�p�X<$�u�w_�'�Z
e����X8tn�լ�{Gŕ���fۃ���O�.�c������O�'�'�B��3*AE�F��5��f!�W*X������ji��R�R�e�~'�@ۇ�l`�9�v��	0�eM�<rIEND�B`�images/fugue/search.png000060400000001251150751650340011100 0ustar00�PNG


IHDR�atEXtSoftwareAdobe ImageReadyq�e<KIDATx�b���c`ffaAFFF}) ��@��������@�&�m��Bw8����``a�E.~G3g?MC#S)Q>�_?�;y���=[�*}��n?P�}�B���OU`�h� '�s@b�������77##+������������L�>�]T��
0�������O�WPX^���
�.	d��H�ظ�ԁ����.��뗬������ �n������e��߿�spr
���,�)�LJ��ɻ� uX
��ۿ�?>30��c����_�A������sǟ�031���/��î�;����1؀�_��^:w�ݿ_޾�����L���?���tތ�tr�����������������Ǐon^��-36�܎��n����'3�ߟ�wl\s����PfFzЀ@`4ʣ��QNN��Ç߾}��X�Aa�	����m1˖��������&&�k@�p��a�|��caa��U����<���׿������Ɔ�"�
acuu������0���ʗT@����zэ/���`a 
�9s椄���s�m�@;�`p����IEND�B`�images/fugue/mail.png000060400000000756150751650340010566 0ustar00�PNG


IHDR�atEXtSoftwareAdobe ImageReadyq�e<�IDATx�ē�JAƿ���ϖB	J7� m���mOAo�[�F��uA^IWa��	���k�L�?�E��=�}{fvƚN�X$���!ύ?�v��G��i�\F.���F�n�qv~~�B��}���������A
�d�*��r�i�no�����a�QC-�J�
�Od%�W��ys���C��k�PK��1�{ �M�U\�ZxL��s�X��9ӕ�v@q�hm6(�H�P(�)@}g�䮥�R�dj:˶��D��&A����y�ʗ�ĄQ�<�R)te�'�MF�y��1��k++��B:��W��ܸ�,��x29� �&p���z.���12�s��Κ+f�&h �=�}�s�R��q~<DK��f�!k��wE�֟.�R��o���Pq�N�IEND�B`�helpers/permissions.j16.php000060400000005113150751650340011673 0ustar00<?php
/**
 * @version    2.7.x
 * @package    K2
 * @author     JoomlaWorks http://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2016 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.html.parameter');

class K2HelperPermissions
{

    public static function checkPermissions()
    {
        // Set some variables
        $mainframe = JFactory::getApplication();
        $user = JFactory::getUser();
        $option = JRequest::getCmd('option');
        $view = JRequest::getCmd('view');
        $task = JRequest::getCmd('task');
        $id = ($task == 'apply' || $task == 'save') ? JRequest::getInt('id') : JRequest::getVar('cid');

        //Generic manage check
        if (!$user->authorise('core.manage', $option))
        {
            JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
            $mainframe->redirect('index.php');
        }

        // Determine action for rest checks
        $action = false;
        if ($mainframe->isAdmin() && $view != '' && $view != 'info')
        {
            switch($task)
            {
                case '' :
                case 'save' :
                case 'apply' :
                    if (!$id)
                    {
                        $action = 'core.create';
                    }
                    else
                    {
                        $action = 'core.edit';
                    }
                    break;
                case 'trash' :
                case 'remove' :
                    $action = 'core.delete';
                    break;
                case 'publish' :
                case 'unpublish' :
				case 'featured':
                    $action = 'core.edit.state';
            }

            // Edit or Edit own action
            if ($action == 'core.edit' && $view == 'item' && $id)
            {
                JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.DS.'tables');
                $item = JTable::getInstance('K2Item', 'Table');
                $item->load($id);
                if ($item->created_by == $user->id)
                {
                    $action = 'core.edit.own';
                }
            }

            // Check the determined action
            if ($action)
            {
                if (!$user->authorise($action, $option))
                {
                    JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
                    $mainframe->redirect('index.php?option=com_k2');
                }
            }

        }
    }

}
helpers/permissions.php000060400000030364150751650340011302 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.html.parameter');

class K2HelperPermissions
{

    public static function setPermissions()
    {
        $params = K2HelperUtilities::getParams('com_k2');
        $user = JFactory::getUser();
        if ($user->guest)
        {
            return;
        }
        $K2User = K2HelperPermissions::getK2User($user->id);
        if (!is_object($K2User))
        {
            return;
        }
        $K2UserGroup = K2HelperPermissions::getK2UserGroup($K2User->group);
        if (is_null($K2UserGroup))
        {
            return;
        }
        $K2Permissions = K2Permissions::getInstance();
        $permissions = K2_JVERSION == '15' ? new JParameter($K2UserGroup->permissions) : new JRegistry($K2UserGroup->permissions);
        $K2Permissions->permissions = $permissions;
        if ($permissions->get('categories') == 'none')
        {
            return;
        }
        else if ($permissions->get('categories') == 'all')
        {
            if ($permissions->get('add') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
            {
                $K2Permissions->actions[] = 'add.category.all';
                $K2Permissions->actions[] = 'tag';
                $K2Permissions->actions[] = 'extraFields';
            }
            if ($permissions->get('editOwn') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
            {
                $K2Permissions->actions[] = 'editOwn.item.'.$user->id;
                $K2Permissions->actions[] = 'tag';
                $K2Permissions->actions[] = 'extraFields';
            }
            if ($permissions->get('editAll') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
            {
                $K2Permissions->actions[] = 'editAll.category.all';
                $K2Permissions->actions[] = 'tag';
                $K2Permissions->actions[] = 'extraFields';
            }
            if ($permissions->get('publish') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
            {
                $K2Permissions->actions[] = 'publish.category.all';
            }
            if ($permissions->get('comment'))
            {
                $K2Permissions->actions[] = 'comment.category.all';
            }
            if ($permissions->get('editPublished'))
            {
                $K2Permissions->actions[] = 'editPublished.category.all';
            }
        }
        else
        {
            $selectedCategories = $permissions->get('categories', NULL);
            if (is_string($selectedCategories))
            {
                $searchIDs[] = $selectedCategories;
            }
            else
            {
                $searchIDs = $selectedCategories;
            }
            if ($permissions->get('inheritance'))
            {
                $model = K2Model::getInstance('Itemlist', 'K2Model');
                $categories = $model->getCategoryTree($searchIDs);
            }
            else
            {
                $categories = $searchIDs;
            }
            if (is_array($categories) && count($categories))
            {
                foreach ($categories as $category)
                {
                    if ($permissions->get('add') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
                    {
                        $K2Permissions->actions[] = 'add.category.'.$category;
                        $K2Permissions->actions[] = 'tag';
                        $K2Permissions->actions[] = 'extraFields';
                    }
                    if ($permissions->get('editOwn') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
                    {
                        $K2Permissions->actions[] = 'editOwn.item.'.$user->id.'.'.$category;
                        $K2Permissions->actions[] = 'tag';
                        $K2Permissions->actions[] = 'extraFields';
                    }
                    if ($permissions->get('editAll') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
                    {
                        $K2Permissions->actions[] = 'editAll.category.'.$category;
                        $K2Permissions->actions[] = 'tag';
                        $K2Permissions->actions[] = 'extraFields';
                    }
                    if ($permissions->get('publish') && $permissions->get('frontEdit') && $params->get('frontendEditing'))
                    {
                        $K2Permissions->actions[] = 'publish.category.'.$category;
                    }
                    if ($permissions->get('comment'))
                    {
                        $K2Permissions->actions[] = 'comment.category.'.$category;
                    }
		            if ($permissions->get('editPublished'))
		            {
		                $K2Permissions->actions[] = 'editPublished.category.'.$category;
		            }
                }
            }
        }
        return;
    }

    public static function checkPermissions()
    {
        $view = JRequest::getCmd('view');
        if ($view != 'item')
        {
            return;
        }
        $task = JRequest::getCmd('task');
        $user = JFactory::getUser();
        $application = JFactory::getApplication();
        if ($user->guest && ($task == 'add' || $task == 'edit'))
        {
            $uri = JURI::getInstance();
            $return = base64_encode($uri->toString());
			$application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
            if (K2_JVERSION == '15')
            {
                $application->redirect('index.php?option=com_user&view=login&return='.$return.'&tmpl=component');
            }
            else
            {
                $application->redirect('index.php?option=com_users&view=login&return='.$return.'&tmpl=component');
            }
        }

        switch ($task)
        {

            case 'add' :
                if (!K2HelperPermissions::canAddItem())
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                break;

            case 'edit' :
            case 'deleteAttachment' :
            case 'checkin' :
                $cid = JRequest::getInt('cid');
                if($cid)
                {
                  JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                  $item = JTable::getInstance('K2Item', 'Table');
                  $item->load($cid);

                  if (!K2HelperPermissions::canEditItem($item->created_by, $item->catid))
                  {
                    // Handle in a different way the case when user can add an item but not edit it.
                    if($task == 'edit' && !$user->guest && $item->created_by == $user->id && (int)$item->modified == 0 && K2HelperPermissions::canAddItem())
                    {
                      echo '<script>parent.location.href = "'.JUri::root().'";</script>';
                      exit;
                    }
                    else
                    {
                      JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    }

                  }

                }
                break;

            case 'save' :
                $cid = JRequest::getInt('id');
                if ($cid)
                {

                    JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                    $item = JTable::getInstance('K2Item', 'Table');
                    $item->load($cid);

                    if (!K2HelperPermissions::canEditItem($item->created_by, $item->catid))
                        JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                }
                else
                {
                    if (!K2HelperPermissions::canAddItem())
                        JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                }

                break;

            case 'tag' :
                if (!K2HelperPermissions::canAddTag())
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                break;

            case 'extraFields' :
                if (!K2HelperPermissions::canRenderExtraFields())
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                break;
        }
    }

    public static function getK2User($userID)
    {

        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_users WHERE userID = ".(int)$userID;
        $db->setQuery($query);
        $row = $db->loadObject();
        return $row;
    }

    public static function getK2UserGroup($id)
    {

        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_user_groups WHERE id = ".(int)$id;
        $db->setQuery($query);
        $row = $db->loadObject();
        return $row;
    }

    public static function canAddItem($category = false)
    {

        $user = JFactory::getUser();
        $K2Permissions = K2Permissions::getInstance();
        if (in_array('add.category.all', $K2Permissions->actions))
        {
            return true;
        }
        if ($category)
        {
            return in_array('add.category.'.$category, $K2Permissions->actions);
        }
        $db = JFactory::getDbo();
        $query = "SELECT id FROM #__k2_categories WHERE published=1 AND trash=0";
        if (K2_JVERSION != '15')
        {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).")";
        }
        else
        {
            $aid = (int)$user->get('aid');
            $query .= " AND access<={$aid}";
        }
        $db->setQuery($query);
        $categories = K2_JVERSION == '30' ? $db->loadColumn() : $db->loadResultArray();
        foreach ($categories as $category)
        {
            if (in_array('add.category.'.$category, $K2Permissions->actions))
            {
                return true;
            }
        }

        return false;
    }

    public static function canAddToAll()
    {
        $K2Permissions = K2Permissions::getInstance();
        return in_array('add.category.all', $K2Permissions->actions);
    }

    public static function canEditItem($itemOwner, $itemCategory)
    {
        $K2Permissions = K2Permissions::getInstance();
        if (in_array('editAll.category.all', $K2Permissions->actions) || in_array('editOwn.item.'.$itemOwner, $K2Permissions->actions) || in_array('editOwn.item.'.$itemOwner.'.'.$itemCategory, $K2Permissions->actions) || in_array('editAll.category.'.$itemCategory, $K2Permissions->actions))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public static function canPublishItem($itemCategory)
    {
        $K2Permissions = K2Permissions::getInstance();
        if (in_array('publish.category.all', $K2Permissions->actions) || in_array('publish.category.'.$itemCategory, $K2Permissions->actions))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public static function canAddTag()
    {
        $K2Permissions = K2Permissions::getInstance();
        return in_array('tag', $K2Permissions->actions);
    }

    public static function canRenderExtraFields()
    {
        $K2Permissions = K2Permissions::getInstance();
        return in_array('extraFields', $K2Permissions->actions);
    }

    public static function canAddComment($itemCategory)
    {
        $K2Permissions = K2Permissions::getInstance();
        return in_array('comment.category.all', $K2Permissions->actions) || in_array('comment.category.'.$itemCategory, $K2Permissions->actions);
    }

    public static function canEditPublished($itemCategory)
    {
        $K2Permissions = K2Permissions::getInstance();
        return in_array('editPublished.category.all', $K2Permissions->actions) || in_array('editPublished.category.'.$itemCategory, $K2Permissions->actions);
    }

}

class K2Permissions
{
    var $actions = array();
    var $permissions = null;
    public static function getInstance()
    {
        static $instance;
        if (!is_object($instance))
        {
            $instance = new K2Permissions();
        }
        return $instance;
    }

}
helpers/route.php000060400000020476150751650340010070 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.helper');

class K2HelperRoute
{
	private static $anyK2Link = null;
	private static $multipleCategoriesMapping = array();
	private static $tree = null;
	private static $model = null;
	private static $cache = array(
		'item' => array(),
		'category' => array(),
		'user' => array(),
		'tag' => array()
	);

	public static function getItemRoute($id, $catid = 0)
	{
		$key = (string)(int)$id.'|'.(int)$catid;
		if (isset(self::$cache['item'][$key]))
		{
			return self::$cache['item'][$key];
		}

		$needles = array(
			'item' => (int)$id,
			'category' => (int)$catid,
		);
		$link = 'index.php?option=com_k2&view=item&id='.$id;
		if ($item = K2HelperRoute::_findItem($needles))
		{
			$link .= '&Itemid='.$item->id;
		}
		self::$cache['item'][$key] = $link;
		return $link;
	}

	public static function getCategoryRoute($catid)
	{
		$key = (int)$catid;
		if (isset(self::$cache['category'][$key]))
		{
			return self::$cache['category'][$key];
		}
		$needles = array('category' => (int)$catid);
		$link = 'index.php?option=com_k2&view=itemlist&task=category&id='.$catid;
		if ($item = K2HelperRoute::_findItem($needles))
		{
			$link .= '&Itemid='.$item->id;
		}
		self::$cache['category'][$key] = $link;
		return $link;
	}

	public static function getUserRoute($userID)
	{
		$key = (int)$userID;
		if (isset(self::$cache['user'][$key]))
		{
			return self::$cache['user'][$key];
		}

		$needles = array('user' => (int)$userID);
		$user = JFactory::getUser($userID);
		if (K2_JVERSION != '15' && JFactory::getConfig()->get('unicodeslugs') == 1)
		{
			$alias = JApplication::stringURLSafe($user->name);
		}
		else if (JPluginHelper::isEnabled('system', 'unicodeslug') || JPluginHelper::isEnabled('system', 'jw_unicodeSlugsExtended'))
		{
			$alias = JFilterOutput::stringURLSafe($user->name);
		}
		else
		{
			mb_internal_encoding("UTF-8");
			mb_regex_encoding("UTF-8");
			$alias = trim(mb_strtolower($user->name));
			$alias = str_replace('-', ' ', $alias);
			$alias = mb_ereg_replace('[[:space:]]+', ' ', $alias);
			$alias = trim(str_replace(' ', '', $alias));
			$alias = str_replace('.', '', $alias);

			$stripthese = ',|~|!|@|%|^|(|)|<|>|:|;|{|}|[|]|&|`|„|‹|’|‘|“|â€�|•|›|«|´|»|°|«|»|…';
			$strips = explode('|', $stripthese);
			foreach ($strips as $strip)
			{
				$alias = str_replace($strip, '', $alias);
			}
			$params = K2HelperUtilities::getParams('com_k2');
			$SEFReplacements = array();
			$items = explode(',', $params->get('SEFReplacements', NULL));
			foreach ($items as $item)
			{
				if (!empty($item))
				{
					@list($src, $dst) = explode('|', trim($item));
					$SEFReplacements[trim($src)] = trim($dst);
				}
			}
			foreach ($SEFReplacements as $key => $value)
			{
				$alias = str_replace($key, $value, $alias);
			}
			$alias = trim($alias, '-.');
			if (trim(str_replace('-', '', $alias)) == '')
			{
				$datenow = JFactory::getDate();
				$alias = K2_JVERSION == '15' ? $datenow->toFormat("%Y-%m-%d-%H-%M-%S") : $datenow->format("Y-m-d-H-i-s");
			}
		}
		$link = 'index.php?option=com_k2&view=itemlist&task=user&id='.$userID.':'.$alias;
		if ($item = K2HelperRoute::_findItem($needles))
		{
			$link .= '&Itemid='.$item->id;
		}
		self::$cache['user'][$key] = $link;
		return $link;
	}

	public static function getTagRoute($tag)
	{
		$key = $tag;
		if (isset(self::$cache['tag'][$key]))
		{
			return self::$cache['tag'][$key];
		}

		$needles = array('tag' => $tag);
		$link = 'index.php?option=com_k2&view=itemlist&task=tag&tag='.urlencode($tag);
		if ($item = K2HelperRoute::_findItem($needles))
		{
			$link .= '&Itemid='.$item->id;
		}
		self::$cache['tag'][$key] = $link;
		return $link;
	}

	public static function getDateRoute($year, $month, $day = null, $catid = null)
	{
		$needles = array('year' => $year);
		$link = 'index.php?option=com_k2&view=itemlist&task=date&year='.$year.'&month='.$month;
		if ($day)
		{
			$link .= '&day='.$day;
		}
		if ($catid)
		{
			$link .= '&catid='.$catid;
		}
		if ($item = K2HelperRoute::_findItem($needles))
		{
			$link .= '&Itemid='.$item->id;
		}
		return $link;
	}

	public static function getSearchRoute()
	{
		$needles = array('search' => 'search');
		$link = 'index.php?option=com_k2&view=itemlist&task=search';
		if ($item = K2HelperRoute::_findItem($needles))
		{
			$link .= '&Itemid='.$item->id;
		}
		return $link;
	}

	public static function _findItem($needles)
	{
		$component = JComponentHelper::getComponent('com_k2');
		$application = JFactory::getApplication();
		$menus = $application->getMenu('site', array());
		if (K2_JVERSION != '15')
		{
			$items = $menus->getItems('component_id', $component->id);
		}
		else
		{
			$items = $menus->getItems('componentid', $component->id);
		}
		$match = null;
		foreach ($needles as $needle => $id)
		{
			if (count($items))
			{
				foreach ($items as $item)
				{

					// Detect multiple K2 categories link and set the generic K2 link ( if any )
					if (@$item->query['view'] == 'itemlist' && @$item->query['task'] == '')
					{

						if (!isset(self::$multipleCategoriesMapping[$item->id]))
						{
							if (K2_JVERSION == '15')
							{
								$menuparams = explode("\n", $item->params);
								foreach ($menuparams as $param)
								{
									if (strpos($param, 'categories=') === 0)
									{
										$array = explode('categories=', $param);
										$item->K2Categories = explode('|', $array[1]);
									}
								}
								if (!isset($item->K2Categories))
								{
									$item->K2Categories = array();
								}
							}
							else
							{
								$menuparams = json_decode($item->params);
								$item->K2Categories = isset($menuparams->categories) ? $menuparams->categories : array();
							}

							self::$multipleCategoriesMapping[$item->id] = $item->K2Categories;

							if (count($item->K2Categories) === 0)
							{

								self::$anyK2Link = $item;
							}

						}
					}

					if ($needle == 'user' || $needle == 'category')
					{
						if ((@$item->query['task'] == $needle) && (@$item->query['id'] == $id))
						{
							$match = $item;
							break;
						}

					}
					else if ($needle == 'tag')
					{
						if ((@$item->query['task'] == $needle) && (@$item->query['tag'] == $id))
						{
							$match = $item;
							break;
						}
					}
					else
					{
						if ((@$item->query['view'] == $needle) && (@$item->query['id'] == $id))
						{
							$match = $item;
							break;
						}
					}

					if (!is_null($match))
					{
						break;
					}
				}
				// Second pass [START]
				// Only for multiple categories links. Triggered only if we do not have find any match (link to direct category)
				if (is_null($match) && $needle == 'category')
				{
					foreach ($items as $item)
					{
						if (@$item->query['view'] == 'itemlist' && @$item->query['task'] == '')
						{
							if (isset(self::$multipleCategoriesMapping[$item->id]) && is_array(self::$multipleCategoriesMapping[$item->id]))
							{
								foreach (self::$multipleCategoriesMapping[$item->id] as $catid)
								{
									if ((int)$catid == $id)
									{
										$match = $item;
										break;
									}
								}
							}
							if (!is_null($match))
							{
								break;
							}
						}
					}
				}
				// Second pass [END]
			}
			if (!is_null($match))
			{
				break;
			}
		}

		if (is_null($match))
		{
			// Try to detect any parent category menu item....
			if ($needle == 'category')
			{
				if (is_null(self::$tree))
				{
					K2Model::addIncludePath(JPATH_SITE.'/components/com_k2/models');
					$model = K2Model::getInstance('Itemlist', 'K2Model');
					self::$model = $model;
					self::$tree = $model->getCategoriesTree();
				}
				$parents = self::$model->getTreePath(self::$tree, $id);
				if (is_array($parents))
				{
					foreach ($parents as $categoryID)
					{
						if ($categoryID != $id)
						{
							$match = K2HelperRoute::_findItem(array('category' => $categoryID));
							if (!is_null($match))
							{
								break;
							}
						}
					}
				}
			}
			if (is_null($match) && !is_null(self::$anyK2Link))
			{
				$match = self::$anyK2Link;
			}
		}

		return $match;
	}

}
helpers/utilities.php000060400000026636150751650340010751 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

class K2HelperUtilities
{
    // Get user avatar
    public static function getAvatar($userID, $email = null, $width = 50)
    {
        jimport('joomla.filesystem.folder');
        jimport('joomla.application.component.model');
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $template = JRequest::getCmd('template');

        // Check for placeholder overrides
        if (isset($template) && JFile::exists(JPATH_SITE.'/templates/'.$template.'/images/placeholder/user.png')) {
            $avatarPath = 'templates/'.$template.'/images/placeholder/user.png';
        } elseif (JFile::exists(JPATH_SITE.'/templates/'.$application->getTemplate().'/images/placeholder/user.png')) {
            $avatarPath = 'templates/'.$application->getTemplate().'/images/placeholder/user.png';
        } else {
            $avatarPath = 'components/com_k2/images/placeholder/user.png';
        }

        // Continue with default K2 avatar determination
        if ($userID == 'alias') {
            $avatar = JURI::root(true).'/'.$avatarPath;
        } elseif ($userID == 0) {
            if ($params->get('gravatar') && !is_null($email)) {
                $avatar = 'https://secure.gravatar.com/avatar/'.md5($email).'?s='.$width.'&amp;default='.urlencode(JURI::root().$avatarPath);
            } else {
                $avatar = JURI::root(true).'/'.$avatarPath;
            }
        } elseif (is_numeric($userID) && $userID > 0) {
            K2Model::addIncludePath(JPATH_SITE.'/components/com_k2/models');
            $model = K2Model::getInstance('Item', 'K2Model');
            $profile = $model->getUserProfile($userID);
            $avatar = (is_null($profile)) ? '' : $profile->image;
            if (empty($avatar)) {
                if ($params->get('gravatar') && !is_null($email)) {
                    $avatar = 'https://secure.gravatar.com/avatar/'.md5($email).'?s='.$width.'&amp;default='.urlencode(JURI::root().$avatarPath);
                } else {
                    $avatar = JURI::root(true).'/'.$avatarPath;
                }
            } else {
                $avatar = JURI::root(true).'/media/k2/users/'.$avatar;
            }
        }

        if (!$params->get('userImageDefault') && $avatar == JURI::root(true).'/'.$avatarPath) {
            $avatar = '';
        }

        return $avatar;
    }

    public static function getCategoryImage($image, $params)
    {
        jimport('joomla.filesystem.file');
        $application = JFactory::getApplication();
        $categoryImage = null;
        if (!empty($image)) {
            $categoryImage = JURI::root(true).'/media/k2/categories/'.$image;
        } else {
            if ($params->get('catImageDefault')) {
                if (JFile::exists(JPATH_SITE.'/templates/'.$application->getTemplate().'/images/placeholder/category.png')) {
                    $categoryImage = JURI::root(true).'/templates/'.$application->getTemplate().'/images/placeholder/category.png';
                } else {
                    $categoryImage = JURI::root(true).'/components/com_k2/images/placeholder/category.png';
                }
            }
        }
        return $categoryImage;
    }

    // Word limit
    public static function wordLimit($str, $limit = 100, $end_char = '&#8230;')
    {
        if (JString::trim($str) == '') {
            return $str;
        }

        // always strip tags for text
        $str = strip_tags($str);

        $find = array("/\r|\n/u", "/\t/u", "/\s\s+/u");
        $replace = array(" ", " ", " ");
        $str = preg_replace($find, $replace, $str);

        preg_match('/\s*(?:\S*\s*){'.(int)$limit.'}/u', $str, $matches);
        if (JString::strlen($matches[0]) == JString::strlen($str)) {
            $end_char = '';
        }
        return JString::rtrim($matches[0]).$end_char;
    }

    // Character limit
    public static function characterLimit($str, $limit = 150, $end_char = '...')
    {
        if (JString::trim($str) == '') {
            return $str;
        }

        // always strip tags for text
        $str = strip_tags(JString::trim($str));

        $find = array("/\r|\n/u", "/\t/u", "/\s\s+/u");
        $replace = array(" ", " ", " ");
        $str = preg_replace($find, $replace, $str);

        if (JString::strlen($str) > $limit) {
            $str = JString::substr($str, 0, $limit);
            return JString::rtrim($str).$end_char;
        } else {
            return $str;
        }
    }

    // Cleanup HTML entities
    public static function cleanHtml($text)
    {
        return htmlentities($text, ENT_QUOTES, 'UTF-8');
    }

    // Gender
    public static function writtenBy($gender)
    {
        if (is_null($gender)) {
            return JText::_('K2_WRITTEN_BY');
        }
        if ($gender == 'm') {
            return JText::_('K2_WRITTEN_BY_MALE');
        }
        if ($gender == 'f') {
            return JText::_('K2_WRITTEN_BY_FEMALE');
        }
    }

    public static function setDefaultImage(&$item, $view, $params = null)
    {
        if ($view == 'item') {
            $image = 'image'.$item->params->get('itemImgSize');
            $item->image = $item->$image;
            switch ($item->params->get('itemImgSize')) {
                case 'XSmall':
                    $item->imageWidth = $item->params->get('itemImageXS');
                    break;
                case 'Small':
                    $item->imageWidth = $item->params->get('itemImageS');
                    break;
                case 'Medium':
                    $item->imageWidth = $item->params->get('itemImageM');
                    break;
                case 'Large':
                    $item->imageWidth = $item->params->get('itemImageL');
                    break;
                case 'XLarge':
                    $item->imageWidth = $item->params->get('itemImageXL');
                    break;
            }
        }

        if ($view == 'itemlist') {
            $image = 'image'.$params->get($item->itemGroup.'ImgSize');
            $item->image = isset($item->$image) ? $item->$image : '';
            switch ($params->get($item->itemGroup.'ImgSize')) {
                case 'XSmall':
                    $item->imageWidth = $item->params->get('itemImageXS');
                    break;
                case 'Small':
                    $item->imageWidth = $item->params->get('itemImageS');
                    break;
                case 'Medium':
                    $item->imageWidth = $item->params->get('itemImageM');
                    break;
                case 'Large':
                    $item->imageWidth = $item->params->get('itemImageL');
                    break;
                case 'XLarge':
                    $item->imageWidth = $item->params->get('itemImageXL');
                    break;
            }
        }

        if ($view == 'latest') {
            $image = 'image'.$params->get('latestItemImageSize');
            $item->image = $item->$image;
            switch ($params->get('latestItemImageSize')) {
                case 'XSmall':
                    $item->imageWidth = $item->params->get('itemImageXS');
                    break;
                case 'Small':
                    $item->imageWidth = $item->params->get('itemImageS');
                    break;
                case 'Medium':
                    $item->imageWidth = $item->params->get('itemImageM');
                    break;
                case 'Large':
                    $item->imageWidth = $item->params->get('itemImageL');
                    break;
                case 'XLarge':
                    $item->imageWidth = $item->params->get('itemImageXL');
                    break;
            }
        }

        if ($view == 'relatedByTag' && $params->get('itemRelatedImageSize')) {
            $image = 'image'.$params->get('itemRelatedImageSize');
            $item->image = $item->$image;
            switch ($params->get('itemRelatedImageSize')) {
                case 'XSmall':
                    $item->imageWidth = $item->params->get('itemImageXS');
                    break;
                case 'Small':
                    $item->imageWidth = $item->params->get('itemImageS');
                    break;
                case 'Medium':
                    $item->imageWidth = $item->params->get('itemImageM');
                    break;
                case 'Large':
                    $item->imageWidth = $item->params->get('itemImageL');
                    break;
                case 'XLarge':
                    $item->imageWidth = $item->params->get('itemImageXL');
                    break;
            }
        }
    }

    public static function getParams($option)
    {
        if (K2_JVERSION != '15') {
            $application = JFactory::getApplication();
            if ($application->isSite()) {
                $params = $application->getParams($option);
            } else {
                $params = JComponentHelper::getParams($option);
            }
        } else {
            $params = JComponentHelper::getParams($option);
        }
        return $params;
    }

    public static function cleanTags($string, $allowed_tags)
    {
        $allowed_htmltags = array();
        foreach ($allowed_tags as $tag) {
            $allowed_htmltags[] .= "<".$tag.">";
        }
        $allowed_htmltags = implode("", $allowed_htmltags);
        $string = strip_tags($string, $allowed_htmltags);
        return $string;
    }

    // Clean HTML Tag Attributes
    // e.g. cleanupAttributes($string,"img,hr,h1,h2,h3,h4","style,width,height,hspace,vspace,border,class,id");
    public static function cleanAttributes($string, $tag_array, $attr_array)
    {
        $attr = implode("|", $attr_array);
        foreach ($tag_array as $tag) {
            preg_match_all("#<($tag) .+?>#", $string, $matches, PREG_PATTERN_ORDER);
            foreach ($matches[0] as $match) {
                preg_match_all('/('.$attr.')=([\\"\\\']).+?([\\"\\\'])/', $match, $matchesAttr, PREG_PATTERN_ORDER);
                foreach ($matchesAttr[0] as $attrToClean) {
                    $string = str_replace($attrToClean, '', $string);
                    $string = preg_replace('|  +|', ' ', $string);
                    $string = str_replace(' >', '>', $string);
                }
            }
        }
        return $string;
    }

    public static function verifyRecaptcha()
    {
        $params = JComponentHelper::getParams('com_k2');
        $vars = array();
        $vars['secret'] = $params->get('recaptcha_private_key');
        $vars['response'] = $_POST['g-recaptcha-response'];
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, 'https://www.google.com/recaptcha/api/siteverify');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($vars, '', '&'));
        $result = curl_exec($ch);
        $info = curl_getinfo($ch);
        curl_close($ch);
        $response = json_decode($result);
        if ($result && $info['http_code'] == 200 && is_object($response) && isset($response->success) && $response->success == true) {
            return true;
        } else {
            return false;
        }
    }
}
controllers/item.php000060400000025471150751650340010574 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

class K2ControllerItem extends K2Controller
{
    public function display($cachable = false, $urlparams = array())
    {
        $model = $this->getModel('itemlist');
        $document = JFactory::getDocument();
        $viewType = $document->getType();
        $view = $this->getView('item', $viewType);
        $view->setModel($model);
        JRequest::setVar('view', 'item');
        $user = JFactory::getUser();
        if ($user->guest) {
            $cache = true;
        } else {
            $cache = true;
            JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
            $row = JTable::getInstance('K2Item', 'Table');
            $row->load(JRequest::getInt('id'));
            if (K2HelperPermissions::canEditItem($row->created_by, $row->catid)) {
                $cache = false;
            }
            $params = K2HelperUtilities::getParams('com_k2');
            if ($row->created_by == $user->id && $params->get('inlineCommentsModeration')) {
                $cache = false;
            }
            if ($row->access > 0) {
                $cache = false;
            }
            $category = JTable::getInstance('K2Category', 'Table');
            $category->load($row->catid);
            if ($category->access > 0) {
                $cache = false;
            }
            if ($params->get('comments') && $document->getType() == 'html') {
                $itemListModel = K2Model::getInstance('Itemlist', 'K2Model');
                $profile = $itemListModel->getUserProfile($user->id);
                $script = "
					\$K2(document).ready(function() {
						\$K2('#userName').val(".json_encode($user->name).").attr('disabled', 'disabled');
						\$K2('#commentEmail').val('".$user->email."').attr('disabled', 'disabled');
				";
                if (is_object($profile) && $profile->url) {
                    $script .= "
						\$K2('#commentURL').val('".htmlspecialchars($profile->url, ENT_QUOTES, 'UTF-8')."').attr('disabled', 'disabled');
					";
                }
                $script .= "
					});
				";
                $document->addScriptDeclaration($script);
            }
        }

        if (K2_JVERSION != '15') {
            $urlparams['id'] = 'INT';
            $urlparams['print'] = 'INT';
            $urlparams['lang'] = 'CMD';
            $urlparams['Itemid'] = 'INT';
        }
        parent::display($cache, $urlparams);
    }

    public function edit()
    {
        JRequest::setVar('tmpl', 'component');
        $application = JFactory::getApplication();
        $document = JFactory::getDocument();
        $params = K2HelperUtilities::getParams('com_k2');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);

        K2HelperHTML::loadHeadIncludes(true, true, true);

        // CSS
        $document->addStyleSheet(JURI::root(true).'/templates/system/css/general.css');
        $document->addStyleSheet(JURI::root(true).'/templates/system/css/system.css');

        $this->addViewPath(JPATH_COMPONENT_ADMINISTRATOR.'/views');
        $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $view = $this->getView('item', 'html');
        $view->setLayout('itemform');

        if ($params->get('category')) {
            JRequest::setVar('catid', $params->get('category'));
        }

        $view->display();
    }

    public function add()
    {
        $this->edit();
    }

    public function cancel()
    {
        $this->setRedirect(JURI::root(true));
        return false;
    }

    public function save()
    {
        $application = JFactory::getApplication();
        JRequest::checkToken() or jexit('Invalid Token');
        JRequest::setVar('tmpl', 'component');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/item.php');
        $model = new K2ModelItem;
        $model->save(true);
        $application->close();
    }

    public function deleteAttachment()
    {
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/item.php');
        $model = new K2ModelItem;
        $model->deleteAttachment();
    }

    public function tag()
    {
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/tag.php');
        $model = new K2ModelTag;
        $model->addTag();
    }

    public function tags()
    {
        $user = JFactory::getUser();
        if ($user->guest) {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/tag.php');
        $model = new K2ModelTag;
        $model->tags();
    }

    public function download()
    {
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/item.php');
        $model = new K2ModelItem;
        $model->download();
    }

    public function extraFields()
    {
        $application = JFactory::getApplication();
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $itemID = JRequest::getInt('id', null);

        JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
        $catid = JRequest::getInt('cid');
        $category = JTable::getInstance('K2Category', 'Table');
        $category->load($catid);

        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/extrafield.php');
        $extraFieldModel = new K2ModelExtraField;

        $extraFields = $extraFieldModel->getExtraFieldsByGroup($category->extraFieldsGroup);

        $output = '<table class="admintable" id="extraFields">';
        $counter = 0;
        if (count($extraFields)) {
            foreach ($extraFields as $extraField) {
                if ($extraField->type == 'header') {
                    $output .= '<tr><td colspan="2" ><h4 class="k2ExtraFieldHeader">'.$extraField->name.'</h4></td></tr>';
                } else {
                    $output .= '<tr><td align="right" class="key"><label for="K2ExtraField_'.$extraField->id.'">'.$extraField->name.'</label></td>';
                    $output .= '<td>'.$extraFieldModel->renderExtraField($extraField, $itemID).'</td></tr>';
                }
                $counter++;
            }
        }
        $output .= '</table>';

        if ($counter == 0) {
            $output = JText::_('K2_THIS_CATEGORY_DOESNT_HAVE_ASSIGNED_EXTRA_FIELDS');
        }

        echo $output;
        $application->close();
    }

    public function checkin()
    {
        $model = $this->getModel('item');
        $model->checkin();
    }

    public function vote()
    {
        $model = $this->getModel('item');
        $model->vote();
    }

    public function getVotesNum()
    {
        $model = $this->getModel('item');
        $model->getVotesNum();
    }

    public function getVotesPercentage()
    {
        $model = $this->getModel('item');
        $model->getVotesPercentage();
    }

    public function comment()
    {
        $model = $this->getModel('item');
        $model->comment();
    }

    public function resetHits()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        JRequest::setVar('tmpl', 'component');
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/item.php');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $model = new K2ModelItem;
        $model->resetHits();
    }

    public function resetRating()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        JRequest::setVar('tmpl', 'component');
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/models/item.php');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $model = new K2ModelItem;
        $model->resetRating();
    }

    public function media()
    {
        JRequest::setVar('tmpl', 'component');
        $params = K2HelperUtilities::getParams('com_k2');
        $document = JFactory::getDocument();
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $user = JFactory::getUser();
        if ($user->guest) {
            $uri = JFactory::getURI();
            if (K2_JVERSION != '15') {
                $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
            } else {
                $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
            }
            $application = JFactory::getApplication();
            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
            $application->redirect(JRoute::_($url, false));
        }

        K2HelperHTML::loadHeadIncludes(false, true, true);

        $this->addViewPath(JPATH_COMPONENT_ADMINISTRATOR.'/views');
        $view = $this->getView('media', 'html');
        $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.'/views/media/tmpl');
        $view->setLayout('default');
        $view->display();
    }

    public function connector()
    {
        JRequest::setVar('tmpl', 'component');
        $user = JFactory::getUser();
        if ($user->guest) {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        require_once(JPATH_COMPONENT_ADMINISTRATOR.'/controllers/media.php');
        $controller = new K2ControllerMedia();
        $controller->connector();
    }

    public function users()
    {
        $itemID = JRequest::getInt('itemID');
        JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
        $item = JTable::getInstance('K2Item', 'Table');
        $item->load($itemID);
        if (!K2HelperPermissions::canAddItem() && !K2HelperPermissions::canEditItem($item->created_by, $item->catid)) {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        $K2Permissions = K2Permissions::getInstance();
        if (!$K2Permissions->permissions->get('editAll')) {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        JRequest::setVar('tmpl', 'component');
        $application = JFactory::getApplication();
        $params = JComponentHelper::getParams('com_k2');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);

        $document = JFactory::getDocument();

        K2HelperHTML::loadHeadIncludes(true, true, true);

        $this->addViewPath(JPATH_COMPONENT_ADMINISTRATOR.'/views');
        $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $view = $this->getView('users', 'html');
        $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.'/views/users/tmpl');
        $view->display();
    }
}
controllers/controller.php000060400000001775150751650340012022 0ustar00<?php
/**
 * @version     2.9.x
 * @package     K2
 * @author      JoomlaWorks https://www.joomlaworks.net
 * @copyright   Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license     GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

if (version_compare(JVERSION, '3.0', 'ge')) {
    class K2Controller extends JControllerLegacy
    {
        public function display($cachable = false, $urlparams = array())
        {
            parent::display($cachable, $urlparams);
        }
    }
} elseif (version_compare(JVERSION, '2.5', 'ge')) {
    class K2Controller extends JController
    {
        public function display($cachable = false, $urlparams = false)
        {
            parent::display($cachable, $urlparams);
        }
    }
} else {
    class K2Controller extends JController
    {
        public function display($cachable = false)
        {
            parent::display($cachable);
        }
    }
}
controllers/latest.php000060400000001557150751650340011131 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */
// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

class K2ControllerLatest extends K2Controller
{
	public function display($cachable = false, $urlparams = array())
	{
		$view = $this->getView('latest', 'html');
		$model = $this->getModel('itemlist');
		$view->setModel($model);
		$itemModel = $this->getModel('item');
		$view->setModel($itemModel);
		$user = JFactory::getUser();
		if ($user->guest)
		{
			$cache = true;
		}
		else
		{
			$cache = false;
		}
		if (K2_JVERSION != '15')
		{
			$urlparams['Itemid'] = 'INT';
		}
		parent::display($cache, $urlparams);
	}

}
controllers/comments.php000060400000015430150751650340011455 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */
// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

class K2ControllerComments extends K2Controller
{
    public function display($cachable = false, $urlparams = array())
    {
		$document = JFactory::getDocument();
        $user = JFactory::getUser();

        $params = JComponentHelper::getParams('com_k2');

        K2HelperHTML::loadHeadIncludes(true, true, true);

        // Message for guests
        if ($user->guest)
        {
            $uri = JFactory::getURI();
            if (K2_JVERSION != '15')
            {
                $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
            }
            else
            {
                $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
            }
            $application = JFactory::getApplication();
			$application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
            $application->redirect(JRoute::_($url, false));
        }

        JRequest::setVar('tmpl', 'component');

        // Language
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);

        $this->addViewPath(JPATH_COMPONENT_ADMINISTRATOR.'/views');
        $this->addModelPath(JPATH_COMPONENT_ADMINISTRATOR.'/models');

        $view = $this->getView('comments', 'html');
        $view->addTemplatePath(JPATH_COMPONENT_ADMINISTRATOR.'/views/comments/tmpl');
        $view->addHelperPath(JPATH_COMPONENT_ADMINISTRATOR.'/helpers');
        $view->display();
    }

    function publish()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $user = JFactory::getUser();
        if ($user->guest)
        {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $model = K2Model::getInstance('Comments', 'K2Model');
        $model->publish();
    }

    function unpublish()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $user = JFactory::getUser();
        if ($user->guest)
        {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $model = K2Model::getInstance('Comments', 'K2Model');
        $model->unpublish();
    }

    function remove()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $user = JFactory::getUser();
        if ($user->guest)
        {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $model = K2Model::getInstance('Comments', 'K2Model');
        $model->remove();
    }

    function deleteUnpublished()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $user = JFactory::getUser();
        if ($user->guest)
        {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $model = K2Model::getInstance('Comments', 'K2Model');
        $model->deleteUnpublished();
    }

    function saveComment()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        $language = JFactory::getLanguage();
        $language->load('com_k2', JPATH_ADMINISTRATOR);
        $user = JFactory::getUser();
        if ($user->guest)
        {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $model = K2Model::getInstance('Comments', 'K2Model');
        $model->save();
        $application->close();
    }

    function report()
    {
        JRequest::setVar('tmpl', 'component');
        $view = $this->getView('comments', 'html');
        $view->setLayout('report');
        $view->report();
    }

    function sendReport()
    {
        JRequest::checkToken() or jexit('Invalid Token');
        $params = K2HelperUtilities::getParams('com_k2');
        $user = JFactory::getUser();
        if (!$params->get('comments') || !$params->get('commentsReporting') || ($params->get('commentsReporting') == '2' && $user->guest))
        {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        K2Model::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/models');
        $model = K2Model::getInstance('Comments', 'K2Model');
        $model->setState('id', JRequest::getInt('id'));
        $model->setState('name', JRequest::getString('name'));
        $model->setState('reportReason', JRequest::getString('reportReason'));
        if (!$model->report())
        {
            echo $model->getError();
        }
        else
        {
            echo JText::_('K2_REPORT_SUBMITTED');
        }
        $application = JFactory::getApplication();
        $application->close();
    }

    function reportSpammer()
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $format = JRequest::getVar('format');
        $errors = array();
        if (K2_JVERSION != '15')
        {
            if (!$user->authorise('core.admin', 'com_k2'))
            {
                $format == 'raw' ? die(JText::_('K2_ALERTNOTAUTH')) : JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }
        else
        {
            if ($user->gid < 25)
            {
                $format == 'raw' ? die(JText::_('K2_ALERTNOTAUTH')) : JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }
        K2Model::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_k2/models');
        $model = K2Model::getInstance('User', 'K2Model');
        $model->setState('id', JRequest::getInt('id'));
        $model->reportSpammer();
        if ($format == 'raw')
        {
            $response = '';
            $messages = $application->getMessageQueue();
            foreach ($messages as $message)
            {
                $response .= $message['message']."\n";
            }
            die($response);

        }
        $this->setRedirect('index.php?option=com_k2&view=comments&tmpl=component');
    }
}
controllers/itemlist.php000060400000004025150751650340011460 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.controller');

class K2ControllerItemlist extends K2Controller
{
    public function display($cachable = false, $urlparams = array())
    {
        $model = $this->getModel('item');
        $format = JRequest::getWord('format', 'html');
        $document = JFactory::getDocument();
        $viewType = $document->getType();
        $view = $this->getView('itemlist', $viewType);
        $view->setModel($model);
        $user = JFactory::getUser();
        if ($user->guest) {
            $cache = true;
        } else {
            $cache = false;
        }
        if (K2_JVERSION != '15') {
            $urlparams['limit'] = 'UINT';
            $urlparams['limitstart'] = 'UINT';
            $urlparams['id'] = 'INT';
            $urlparams['tag'] = 'STRING';
            $urlparams['searchword'] = 'STRING';
            $urlparams['day'] = 'INT';
            $urlparams['year'] = 'INT';
            $urlparams['month'] = 'INT';
            $urlparams['print'] = 'INT';
            $urlparams['lang'] = 'CMD';
            $urlparams['Itemid'] = 'INT';
            $urlparams['ordering'] = 'CMD';
        }
        parent::display($cache, $urlparams);
    }

    // For mod_k2_content
    public function module()
    {
        $document = JFactory::getDocument();
        $view = $this->getView('itemlist', 'raw');
        $model = $this->getModel('itemlist');
        $view->setModel($model);
        $model = $this->getModel('item');
        $view->setModel($model);
        $view->module();
    }

    // For mod_k2_tools
    public function calendar()
    {
        require_once(JPATH_SITE.'/modules/mod_k2_tools/helper.php');
        $calendar = new modK2ToolsHelper();
        $calendar->calendarNavigation();
    }
}
views/latest/tmpl/latest_item.php000060400000000463150751650340013201 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/latest/tmpl/latest.php000060400000000463150751650340012163 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/latest/tmpl/latest.xml000060400000034562150751650340012203 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_LATEST_ITEMS_FROM_ONE_OR_MORE_USERS_OR_CATEGORIES">
		<message>
			<![CDATA[K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_CATEGORIES_OR_USERS_IN_K2]]>
		</message>
	</layout>
	<state>
		<name>K2_LATEST_ITEMS_FROM_ONE_OR_MORE_USERS_OR_CATEGORIES</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_CATEGORIES_OR_USERS_IN_K2</description>
		<params addPath="/administrator/components/com_k2/elements">
		    <param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="" type="header" default="K2_CONTENT_SOURCE" label="" description=""/>
			<param name="source" type="list" default="0" label="K2_CHOOSE_CONTENT_SOURCE" description="K2_PLEASE_SELECT_WHETHER_TO_RETRIEVE_CONTENT_FROM_K2_USERS_OR_CATEGORIES">
				<option value="0">K2_USERS</option>
				<option value="1">K2_CATEGORIES</option>
			</param>
			<param name="latestItemsCols" type="text" default="2" size="4" label="K2_NUMBER_OF_COLUMNS"/>
			<param name="latestItemsLimit" type="text" default="3" size="4" label="K2_MAXIMUM_NUMBER_OF_ITEMS_PER_USER_OR_CATEGORY"/>
			<param name="latestItemsDisplayEffect" type="list" default="all" label="K2_ITEM_VIEW_OPTIONS_SET_BELOW_EFFECT" description="">
				<option value="first">K2_EFFECT_THE_FIRST_ITEM_ONLY_SUBSEQUENT_ITEMS_DISPLAY_TITLE_ONLY</option>
				<option value="all">K2_ALL_FETCHED_ITEMS</option>
			</param>
			<param name="" type="header" default="K2_USER_SETTINGS" label="" description=""/>
			<param name="userIDs" type="k2modalselector" scope="users" default="" label="K2_SELECTED_USERS_SORT_WITH_DRAG_DROP" description="K2_DRAG_USERS_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_USER_FROM_THE_LIST"/>
			<param name="userName" type="radio" default="1" label="K2_NAME" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userImage" type="radio" default="1" label="K2_IMAGE_AVATAR" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userURL" type="radio" default="1" label="K2_URL" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userEmail" type="radio" default="0" label="K2_EMAIL" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="" type="header" default="K2_CATEGORY_SETTINGS" label="" description=""/>
			<param name="categoryIDs" type="k2modalselector" scope="categories" default="" label="K2_SELECTED_CATEGORIES_SORT_WITH_DRAG_DROP" description="K2_DRAG_CATEGORIES_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_CATEGORY_FROM_THE_LIST"/>
			<param name="categoryTitle" type="radio" default="1" label="K2_TITLE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="categoryDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="categoryImage" type="radio" default="1" label="K2_IMAGE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="categoryFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="" type="header" default="K2_ITEM_VIEW_OPTIONS_COMMON_FOR_USER_OR_CATEGORY_SOURCE" label="" description=""/>
			<param name="latestItemTitle" type="radio" default="1" label="K2_TITLE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemTitleLinked" type="radio" default="1" label="K2_LINK_ON_TITLE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemDateCreated" type="radio" default="1" label="K2_ITEM_CREATED_DATE_AND_TIME" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemImage" type="radio" default="1" label="K2_IMAGE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemImageSize" type="list" default="Medium" label="K2_IMAGE_SIZE" description="">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
			</param>
			<param name="latestItemVideo" type="radio" default="1" label="K2_VIDEO" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemVideoWidth" type="text" default="" size="4" label="K2_VIDEO_WIDTH" description=""/>
			<param name="latestItemVideoHeight" type="text" default="" size="4" label="K2_VIDEO_HEIGHT" description=""/>
			<param name="latestItemAudioWidth" type="text" default="" size="4" label="K2_AUDIO_WIDTH" description=""/>
			<param name="latestItemAudioHeight" type="text" default="" size="4" label="K2_AUDIO_HEIGHT" description=""/>
			<param name="latestItemVideoAutoPlay" type="radio" default="0" label="K2_MEDIA_AUTOPLAY" description="">
				<option value="0">K2_NO</option>
				<option value="1">K2_YES</option>
			</param>
			<param name="latestItemIntroText" type="radio" default="1" label="K2_INTROTEXT" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemCategory" type="radio" default="1" label="K2_CATEGORY" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemTags" type="radio" default="1" label="K2_TAGS" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemReadMore" type="radio" default="1" label="K2_READ_MORE_LINK" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemCommentsAnchor" type="radio" default="0" label="K2_ANCHOR_LINK_WITH_COMMENTS_COUNTER_TO_ITEMS_COMMENT_FORM" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="" type="header" default="K2_ADVANCED" label="" description=""/>
			<param name="feedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="latestItemK2Plugins" type="radio" default="0" label="K2_ENABLE_K2_PLUGINS" description="">
				<option value="0">K2_NO</option>
				<option value="1">K2_YES</option>
			</param>
		</params>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
			    <field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="" type="header" default="K2_CONTENT_SOURCE" label="" description=""/>
				<field name="source" type="list" default="0" label="K2_CHOOSE_CONTENT_SOURCE" description="K2_PLEASE_SELECT_WHETHER_TO_RETRIEVE_CONTENT_FROM_K2_USERS_OR_CATEGORIES">
					<option value="0">K2_USERS</option>
					<option value="1">K2_CATEGORIES</option>
				</field>
				<field name="latestItemsCols" type="text" default="2" size="4" label="K2_NUMBER_OF_COLUMNS"/>
				<field name="latestItemsLimit" type="text" default="3" size="4" label="K2_MAXIMUM_NUMBER_OF_ITEMS_PER_USER_OR_CATEGORY"/>
				<field name="latestItemsDisplayEffect" type="list" default="all" label="K2_ITEM_VIEW_OPTIONS_SET_BELOW_EFFECT" description="">
					<option value="first">K2_EFFECT_THE_FIRST_ITEM_ONLY_SUBSEQUENT_ITEMS_DISPLAY_TITLE_ONLY</option>
					<option value="all">K2_ALL_FETCHED_ITEMS</option>
				</field>
				<field name="" type="header" default="K2_USER_SETTINGS" label="" description=""/>
				<field name="userIDs" type="k2modalselector" scope="users" default="" label="K2_SELECTED_USERS_SORT_WITH_DRAG_DROP" description="K2_DRAG_USERS_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_USER_FROM_THE_LIST"/>
				<field name="userName" type="radio" default="1" label="K2_NAME" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userImage" type="radio" default="1" label="K2_IMAGE_AVATAR" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userURL" type="radio" default="1" label="K2_URL" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userEmail" type="radio" default="0" label="K2_EMAIL" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="" type="header" default="K2_CATEGORY_SETTINGS" label="" description=""/>
				<field name="categoryIDs" type="k2modalselector" scope="categories" default="" label="K2_SELECTED_CATEGORIES_SORT_WITH_DRAG_DROP" description="K2_DRAG_CATEGORIES_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_CATEGORY_FROM_THE_LIST"/>
				<field name="categoryTitle" type="radio" default="1" label="K2_TITLE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="categoryDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="categoryImage" type="radio" default="1" label="K2_IMAGE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="categoryFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="" type="header" default="K2_ITEM_VIEW_OPTIONS_COMMON_FOR_USER_OR_CATEGORY_SOURCE" label="" description=""/>
				<field name="latestItemTitle" type="radio" default="1" label="K2_TITLE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemTitleLinked" type="radio" default="1" label="K2_LINK_ON_TITLE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemDateCreated" type="radio" default="1" label="K2_ITEM_CREATED_DATE_AND_TIME" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemImage" type="radio" default="1" label="K2_IMAGE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemImageSize" type="list" default="Medium" label="K2_IMAGE_SIZE" description="">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
				</field>
				<field name="latestItemVideo" type="radio" default="1" label="K2_VIDEO" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemVideoWidth" type="text" default="" size="4" label="K2_VIDEO_WIDTH" description=""/>
				<field name="latestItemVideoHeight" type="text" default="" size="4" label="K2_VIDEO_HEIGHT" description=""/>
				<field name="latestItemAudioWidth" type="text" default="" size="4" label="K2_AUDIO_WIDTH" description=""/>
				<field name="latestItemAudioHeight" type="text" default="" size="4" label="K2_AUDIO_HEIGHT" description=""/>
				<field name="latestItemVideoAutoPlay" type="radio" default="0" label="K2_MEDIA_AUTOPLAY" description="">
					<option value="0">K2_NO</option>
					<option value="1">K2_YES</option>
				</field>
				<field name="latestItemIntroText" type="radio" default="1" label="K2_INTROTEXT" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemCategory" type="radio" default="1" label="K2_CATEGORY" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemTags" type="radio" default="1" label="K2_TAGS" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemReadMore" type="radio" default="1" label="K2_READ_MORE_LINK" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemCommentsAnchor" type="radio" default="0" label="K2_ANCHOR_LINK_WITH_COMMENTS_COUNTER_TO_ITEMS_COMMENT_FORM" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="" type="header" default="K2_ADVANCED" label="" description=""/>
				<field name="feedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="latestItemK2Plugins" type="radio" default="0" label="K2_ENABLE_K2_PLUGINS" description="">
					<option value="0">K2_NO</option>
					<option value="1">K2_YES</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
views/latest/view.html.php000060400000032707150751650340011636 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewLatest extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $document = JFactory::getDocument();
        $user = JFactory::getUser();
        $cache = JFactory::getCache('com_k2_extended');
        $limit = $params->get('latestItemsLimit');
        $limitstart = JRequest::getInt('limitstart');
        $model = $this->getModel('itemlist');
        $itemModel = $this->getModel('item');

        if ($params->get('source')) {
            $categoryIDs = $params->get('categoryIDs');
            if (is_string($categoryIDs) && !empty($categoryIDs)) {
                $categoryIDs = array();
                $categoryIDs[] = $params->get('categoryIDs');
            }
            $categories = array();
            JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_k2/tables');
            if (is_array($categoryIDs)) {
                foreach ($categoryIDs as $categoryID) {
                    $category = JTable::getInstance('K2Category', 'Table');
                    $category->load($categoryID);
                    $category->event = new stdClass;
                    $languageCheck = true;
                    if (K2_JVERSION != '15') {
                        $accessCheck = in_array($category->access, $user->getAuthorisedViewLevels());
                        if ($application->getLanguageFilter()) {
                            $languageTag = JFactory::getLanguage()->getTag();
                            $languageCheck = in_array($category->language, array($languageTag, '*'));
                        }
                    } else {
                        $accessCheck = $category->access <= $user->get('aid', 0);
                    }

                    if ($category->published && $accessCheck && $languageCheck) {

                        //Merge params
                        $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                        if ($cparams->get('inheritFrom')) {
                            $masterCategory = JTable::getInstance('K2Category', 'Table');
                            $masterCategory->load($cparams->get('inheritFrom'));
                            $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                        }
                        $params->merge($cparams);

                        //Category image
                        $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                        //Category plugins
                        $dispatcher = JDispatcher::getInstance();
                        JPluginHelper::importPlugin('content');
                        $category->text = $category->description;

                        if (K2_JVERSION != '15') {
                            $dispatcher->trigger('onContentPrepare', array('com_k2.category', &$category, &$params, $limitstart));
                        } else {
                            $dispatcher->trigger('onPrepareContent', array(&$category, &$params, $limitstart));
                        }
                        $category->description = $category->text;

                        //Category K2 plugins
                        $category->event->K2CategoryDisplay = '';
                        JPluginHelper::importPlugin('k2');
                        $results = $dispatcher->trigger('onK2CategoryDisplay', array(&$category, &$params, $limitstart));
                        $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                        $category->text = $category->description;
                        $dispatcher->trigger('onK2PrepareContent', array(&$category, &$params, $limitstart));
                        $category->description = $category->text;

                        //Category link
                        $link = urldecode(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias)));
                        $category->link = JRoute::_($link);
                        $category->feed = JRoute::_($link.'&format=feed');

                        JRequest::setVar('view', 'itemlist');
                        JRequest::setVar('task', 'category');
                        JRequest::setVar('id', $category->id);
                        JRequest::setVar('featured', 1);
                        JRequest::setVar('limit', $limit);
                        JRequest::setVar('clearFlag', true);

                        $category->name = htmlspecialchars($category->name, ENT_QUOTES);
                        if ($limit) {
                            $category->items = $model->getData('rdate');

                            JRequest::setVar('view', 'latest');
                            JRequest::setVar('task', '');

                            for ($i = 0; $i < sizeof($category->items); $i++) {
                                $hits = $category->items[$i]->hits;
                                $category->items[$i]->hits = 0;
                                $category->items[$i] = $cache->call(array($itemModel, 'prepareItem'), $category->items[$i], 'latest', '');
                                $category->items[$i]->hits = $hits;
                                $category->items[$i] = $itemModel->execPlugins($category->items[$i], 'latest', '');

                                //Trigger comments counter event
                                $dispatcher = JDispatcher::getInstance();
                                JPluginHelper::importPlugin('k2');
                                $results = $dispatcher->trigger('onK2CommentsCounter', array(&$category->items[$i], &$params, $limitstart));
                                $category->items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
                            }
                        } else {
                            $category->items = array();
                        }
                        $categories[] = $category;
                    }
                }
            }
            $source = 'categories';
            $this->assignRef('blocks', $categories);
        } else {
            $usersIDs = $params->get('userIDs');
            if (is_string($usersIDs) && !empty($usersIDs)) {
                $usersIDs = array();
                $usersIDs[] = $params->get('userIDs');
            }

            $users = array();
            if (is_array($usersIDs)) {
                foreach ($usersIDs as $userID) {
                    $userObject = JFactory::getUser($userID);
                    if (!$userObject->block) {
                        $userObject->event = new stdClass;

                        //User profile
                        $userObject->profile = $model->getUserProfile($userID);

                        //User image
                        $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                        //User K2 plugins
                        $userObject->event->K2UserDisplay = '';
                        if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                            $dispatcher = JDispatcher::getInstance();
                            JPluginHelper::importPlugin('k2');
                            $results = $dispatcher->trigger('onK2UserDisplay', array(&$userObject->profile, &$params, $limitstart));
                            $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                            $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                        }

                        $link = K2HelperRoute::getUserRoute($userObject->id);
                        $userObject->link = JRoute::_($link);
                        $userObject->feed = JRoute::_($link.'&format=feed');
                        $userObject->name = htmlspecialchars($userObject->name, ENT_QUOTES);
                        if ($limit) {
                            $userObject->items = $model->getAuthorLatest(0, $limit, $userID);

                            for ($i = 0; $i < sizeof($userObject->items); $i++) {
                                $hits = $userObject->items[$i]->hits;
                                $userObject->items[$i]->hits = 0;
                                $userObject->items[$i] = $cache->call(array($itemModel, 'prepareItem'), $userObject->items[$i], 'latest', '');
                                $userObject->items[$i]->hits = $hits;

                                //Plugins
                                $userObject->items[$i] = $itemModel->execPlugins($userObject->items[$i], 'latest', '');

                                //Trigger comments counter event
                                $dispatcher = JDispatcher::getInstance();
                                JPluginHelper::importPlugin('k2');
                                $results = $dispatcher->trigger('onK2CommentsCounter', array(&$userObject->items[$i], &$params, $limitstart));
                                $userObject->items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
                            }
                        } else {
                            $userObject->items = array();
                        }
                        $users[] = $userObject;
                    }
                }
            }
            $source = 'users';
            $this->assignRef('blocks', $users);
        }

        // Browser title
        $browserTitle = $params->get('page_title');
        if (K2_JVERSION != '15') {
            if ($application->getCfg('sitename_pagetitles', 0) == 1) {
                $browserTitle = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
            } elseif ($application->getCfg('sitename_pagetitles', 0) == 2) {
                $browserTitle = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
            }
        }
        $document->setTitle($browserTitle);


        // Set menu metadata for Joomla 2.5+
        if (K2_JVERSION != '15') {
            if ($params->get('menu-meta_description')) {
                $document->setDescription($params->get('menu-meta_description'));
            }

            if ($params->get('menu-meta_keywords')) {
                $document->setMetadata('keywords', $params->get('menu-meta_keywords'));
            }

            if ($params->get('robots')) {
                $document->setMetadata('robots', $params->get('robots'));
            }

            // Menu page display options
            if ($params->get('page_heading')) {
                $params->set('page_title', $params->get('page_heading'));
            }
            $params->set('show_page_title', $params->get('show_page_heading'));
        }

        // Set Facebook meta data
        if ($params->get('facebookMetatags', '1')) {
            $document = JFactory::getDocument();
            $uri = JURI::getInstance();
            $document->setMetaData('og:url', $uri->toString());
            $document->setMetaData('og:title', (K2_JVERSION == '15') ? htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8') : $document->getTitle());
            $document->setMetaData('og:type', 'website');
            $document->setMetaData('og:description', strip_tags($document->getDescription()));
        }

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        $theme = $params->get('theme');
        if ($theme) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$theme);
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($theme) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$theme);
            }
        }

        //Assign params
        $this->assignRef('params', $params);
        $this->assignRef('source', $source);

        //Set layout
        $this->setLayout('latest');

        //Display
        parent::display($tpl);
    }
}
views/latest/metadata.xml000060400000000420150751650350011476 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="K2_LATEST_ITEMS_FROM_ONE_OR_MORE_USERS_OR_CATEGORIES">
    <message>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_CATEGORIES_OR_USERS_IN_K2</message>
  </view>
</metadata>
views/item/tmpl/item.xml000060400000001504150751650350011276 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_ITEM">
		<message>K2_CREATE_A_MENU_ITEM_LINKING_DIRECTLY_TO_AN_ITEM_IN_K2</message>
	</layout>
	<state>
		<name>K2_ITEM</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_DIRECTLY_TO_AN_ITEM_IN_K2</description>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="id" type="k2modalselector" scope="item" default="" label="K2_SELECT_ITEM" description="K2_SELECT_AN_ITEM_TO_LINK_TO_DIRECTLY"/>
		</url>
		<params></params>
		<fields name="request">
			<fieldset name="request" addfieldpath="/administrator/components/com_k2/elements">
				<field name="id" type="k2modalselector" scope="item" default="" label="K2_SELECT_ITEM" description="K2_SELECT_AN_ITEM_TO_LINK_TO_DIRECTLY" required="true"/>
			</fieldset>
		</fields>
	</state>
</metadata>
views/item/tmpl/item.php000060400000000463150751650350011270 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/item/tmpl/itemform.xml000060400000002430150751650350012161 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_ITEM_EDIT_FORM">
		<message>K2_CREATE_A_MENU_ITEM_LINKING_TO_ITEM_EDIT_FORM</message>
	</layout>
	<state>
		<name>K2_ITEM_EDIT_FORM</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_ITEM_EDIT_FORM</description>
		<params addpath="/administrator/components/com_k2/elements">
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE" />
			<param name="category" type="categories" default="" label="K2_PRESELECTED_CATEGORY" />
			<param name="itemform" type="itemform" />
		</params>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="task" type="hidden" default="add" />
		</url>
		<params></params>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE" />
				<field name="category" type="categories" default="" label="K2_PRESELECTED_CATEGORY" />
				<field name="itemform" type="itemform" />
			</fieldset>
		</fields>
		<fields name="request">
			<fieldset name="request" addfieldpath="/administrator/components/com_k2/elements">
				<field name="task" type="hidden" default="add" />
			</fieldset>
		</fields>
	</state>
</metadata>
views/item/tmpl/itemform.php000060400000000463150751650350012154 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/item/tmpl/item_comments_form.php000060400000000463150751650350014220 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/item/metadata.xml000060400000000260150751650350011142 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="K2_ITEM">
    <message>K2_CREATE_A_MENU_ITEM_LINKING_DIRECTLY_TO_AN_ITEM_IN_K2</message>
  </view>
</metadata>
views/item/view.json.php000060400000010332150751650350011274 0ustar00<?php
/**
 * @version     2.9.x
 * @package     K2
 * @author      JoomlaWorks https://www.joomlaworks.net
 * @copyright   Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license     GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItem extends K2View
{

    function display($tpl = null)
    {

        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $document = JFactory::getDocument();
        if (K2_JVERSION == '15')
        {
            $document->setMimeEncoding('application/json');
            $document->setType('json');
        }
        $params = K2HelperUtilities::getParams('com_k2');
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $db = JFactory::getDbo();
        $jnow = JFactory::getDate();
        $now =  K2_JVERSION == '15'?$jnow->toMySQL():$jnow->toSql();
        $nullDate = $db->getNullDate();

        // Get item
        $model = $this->getModel();
        $item = $model->getData();

        // Does the item exists?
        if (!is_object($item) || !$item->id)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Override some params because we want to show all elements in JSON
        $itemParams = class_exists('JParameter') ? new JParameter($item->params) : new JRegistry($item->params);
        $itemParams->set('itemIntroText', true);
        $itemParams->set('itemFullText', true);
        $itemParams->set('itemTags', true);
        $itemParams->set('itemExtraFields', true);
        $itemParams->set('itemAttachments', true);
        $itemParams->set('itemRating', true);
        $itemParams->set('itemAuthor', true);
        $itemParams->set('itemImageGallery', true);
        $itemParams->set('itemVideo', true);
        $item->params = $itemParams->toString();

        // Prepare item
        $item = $model->prepareItem($item, $view, $task);

        // Plugins
        $item = $model->execPlugins($item, $view, $task);

        // Access check
        if (K2_JVERSION != '15')
        {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($item->category->access, $user->getAuthorisedViewLevels()))
            {
               JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }
        else
        {
            if ($item->access > $user->get('aid', 0) || $item->category->access > $user->get('aid', 0))
            {
                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }

        // Published check
        if (!$item->published || $item->trash)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_up != $nullDate && $item->publish_up > $now)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_down != $nullDate && $item->publish_down < $now)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if (!$item->category->published || $item->category->trash)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }
        
        // Increase hits counter
        $model->hit($item->id);

        // Set default image
        K2HelperUtilities::setDefaultImage($item, $view);

        // Build the output object
        $row = $model->prepareJSONItem($item);

        // Output
        $response = new stdClass();

        // Site
        $response->site = new stdClass();
        $uri = JURI::getInstance();
        $response->site->url = $uri->toString(array('scheme', 'host', 'port'));
        $config = JFactory::getConfig();
        $response->site->name = K2_JVERSION == '30' ? $config->get('sitename') : $config->getValue('config.sitename');

        $response->item = $row;

        $json = json_encode($response);
        $callback = JRequest::getCmd('callback');
        if ($callback)
        {
            $document->setMimeEncoding('application/javascript');
            echo $callback.'('.$json.')';
        }
        else
        {
            echo $json;
        }
    }

}
views/item/view.raw.php000060400000030200150751650350011110 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItem extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $document = JFactory::getDocument();
        $params = K2HelperUtilities::getParams('com_k2');
        $limitstart = JRequest::getInt('limitstart', 0);
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $db = JFactory::getDbo();
        $jnow = JFactory::getDate();
        $now =  K2_JVERSION == '15'?$jnow->toMySQL():$jnow->toSql();
        $nullDate = $db->getNullDate();

        $this->setLayout('item');

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get item
        $model = $this->getModel();
        $item = $model->getData();
        $item->event = new stdClass;

        // Does the item exists?
        if (!is_object($item) || !$item->id) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Prepare item
        $item = $model->prepareItem($item, $view, $task);

        // Plugins
        $item = $model->execPlugins($item, $view, $task);

        // User K2 plugins
        $item->event->K2UserDisplay = '';
        if (isset($item->author) && is_object($item->author->profile) && isset($item->author->profile->id)) {
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2UserDisplay', array(&$item->author->profile, &$params, $limitstart));
            $item->event->K2UserDisplay = trim(implode("\n", $results));
            $item->author->profile->url = htmlspecialchars($item->author->profile->url, ENT_QUOTES, 'UTF-8');
        }

        // Access check
        if ($this->getLayout() == 'form') {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        if (K2_JVERSION != '15') {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($item->category->access, $user->getAuthorisedViewLevels())) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        } else {
            if ($item->access > $user->get('aid', 0) || $item->category->access > $user->get('aid', 0)) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        }

        // Published check
        if (!$item->published || $item->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_up != $nullDate && $item->publish_up > $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_down != $nullDate && $item->publish_down < $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if (!$item->category->published || $item->category->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Increase hits counter
        $model->hit($item->id);

        // Set default image
        K2HelperUtilities::setDefaultImage($item, $view);

        // Comments
        $item->event->K2CommentsCounter = '';
        $item->event->K2CommentsBlock = '';
        if ($item->params->get('itemComments')) {

            // Trigger comments events
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(&$item, &$params, $limitstart));
            $item->event->K2CommentsCounter = trim(implode("\n", $results));
            $results = $dispatcher->trigger('onK2CommentsBlock', array(&$item, &$params, $limitstart));
            $item->event->K2CommentsBlock = trim(implode("\n", $results));

            // Load K2 native comments system only if there are no plugins overriding it
            if (empty($item->event->K2CommentsCounter) && empty($item->event->K2CommentsBlock)) {
                $limit = $params->get('commentsLimit');
                $comments = $model->getItemComments($item->id, $limitstart, $limit);
                $pattern = "@\b(https?://)?(([0-9a-zA-Z_!~*'().&=+$%-]+:)?[0-9a-zA-Z_!~*'().&=+$%-]+\@)?(([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+\.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z]\.[a-zA-Z]{2,6})(:[0-9]{1,4})?((/[0-9a-zA-Z_!~*'().;?:\@&=+$,%#-]+)*/?)@";

                for ($i = 0; $i < sizeof($comments); $i++) {
                    $comments[$i]->commentText = nl2br($comments[$i]->commentText);
                    $comments[$i]->commentText = preg_replace($pattern, '<a target="_blank" rel="nofollow" href="\0">\0</a>', $comments[$i]->commentText);
                    $comments[$i]->userImage = K2HelperUtilities::getAvatar($comments[$i]->userID, $comments[$i]->commentEmail, $params->get('commenterImgWidth'));
                    if ($comments[$i]->userID > 0) {
                        $comments[$i]->userLink = K2HelperRoute::getUserRoute($comments[$i]->userID);
                    } else {
                        $comments[$i]->userLink = $comments[$i]->commentURL;
                    }
                }

                $item->comments = $comments;

                jimport('joomla.html.pagination');
                $total = $item->numOfComments;
                $pagination = new JPagination($total, $limitstart, $limit);
            }
        }

        // Author's latest items
        if ($item->params->get('itemAuthorLatest') && $item->created_by_alias == '') {
            $model = $this->getModel('itemlist');
            $authorLatestItems = $model->getAuthorLatest($item->id, $item->params->get('itemAuthorLatestLimit'), $item->created_by);
            if (count($authorLatestItems)) {
                for ($i = 0; $i < sizeof($authorLatestItems); $i++) {
                    $authorLatestItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($authorLatestItems[$i]->id.':'.urlencode($authorLatestItems[$i]->alias), $authorLatestItems[$i]->catid.':'.urlencode($authorLatestItems[$i]->categoryalias))));
                }
                $this->assignRef('authorLatestItems', $authorLatestItems);
            }
        }

        // Related items
        if ($item->params->get('itemRelated') && isset($item->tags) && count($item->tags)) {
            $model = $this->getModel('itemlist');
            $relatedItems = $model->getRelatedItems($item->id, $item->tags, $item->params);
            if (count($relatedItems)) {
                for ($i = 0; $i < sizeof($relatedItems); $i++) {
                    $relatedItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($relatedItems[$i]->id.':'.urlencode($relatedItems[$i]->alias), $relatedItems[$i]->catid.':'.urlencode($relatedItems[$i]->categoryalias))));
                }
                $this->assignRef('relatedItems', $relatedItems);
            }
        }

        // Navigation (previous and next item)
        if ($item->params->get('itemNavigation')) {
            $model = $this->getModel('item');

            $nextItem = $model->getNextItem($item->id, $item->catid, $item->ordering);
            if (!is_null($nextItem)) {
                $item->nextLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($nextItem->id.':'.urlencode($nextItem->alias), $nextItem->catid.':'.urlencode($item->category->alias))));
                $item->nextTitle = $nextItem->title;
            }

            $previousItem = $model->getPreviousItem($item->id, $item->catid, $item->ordering);
            if (!is_null($previousItem)) {
                $item->previousLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($previousItem->id.':'.urlencode($previousItem->alias), $previousItem->catid.':'.urlencode($item->category->alias))));
                $item->previousTitle = $previousItem->title;
            }
        }

        // Absolute URL
        $uri = JURI::getInstance();
        $item->absoluteURL = $uri->toString();

        // Email link
        if (K2_JVERSION != '15') {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $template = $application->getTemplate();
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&template='.$template.'&link='.MailToHelper::addLink($item->absoluteURL));
        } else {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&link='.MailToHelper::addLink($item->absoluteURL));
        }

        // Twitter link (legacy code)
        if ($params->get('twitterUsername')) {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL).'&amp;via='.$params->get('twitterUsername');
        } else {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL);
        }

        // Social link
        $item->socialLink = urlencode($item->absoluteURL);

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        if ($item->params->get('theme')) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$item->params->get('theme'));
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($item->params->get('theme')) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$item->params->get('theme'));
            }
        }

        // Assign data
        $this->assignRef('item', $item);
        $this->assignRef('user', $user);
        $this->assignRef('params', $item->params);
        $this->assignRef('pagination', $pagination);

        parent::display($tpl);
    }
}
views/item/view.html.php000060400000062736150751650350011306 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItem extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $document = JFactory::getDocument();
        $params = K2HelperUtilities::getParams('com_k2');
        $limitstart = JRequest::getInt('limitstart', 0);
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $db = JFactory::getDbo();
        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        $this->setLayout('item');

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get item
        $model = $this->getModel();
        $item = $model->getData();

        // Does the item exists?
        if (!is_object($item) || !$item->id) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Prepare item
        $item = $model->prepareItem($item, $view, $task);

        // Plugins
        $item = $model->execPlugins($item, $view, $task);

        // User K2 plugins
        $item->event->K2UserDisplay = '';
        if (isset($item->author) && is_object($item->author->profile) && isset($item->author->profile->id)) {
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2UserDisplay', array(
                &$item->author->profile,
                &$params,
                $limitstart
            ));
            $item->event->K2UserDisplay = trim(implode("\n", $results));
            $item->author->profile->url = htmlspecialchars($item->author->profile->url, ENT_QUOTES, 'UTF-8');
        }

        // Access check
        if ($this->getLayout() == 'form') {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        if (K2_JVERSION != '15') {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($item->category->access, $user->getAuthorisedViewLevels())) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        } else {
            if ($item->access > $user->get('aid', 0) || $item->category->access > $user->get('aid', 0)) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        }

        // Published check
        if (!$item->published || $item->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_up != $nullDate && $item->publish_up > $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_down != $nullDate && $item->publish_down < $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if (!$item->category->published || $item->category->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Increase hits counter
        $model->hit($item->id);

        // Set default image
        K2HelperUtilities::setDefaultImage($item, $view);

        // Pass the old parameter to the view in order to avoid layout changes
        if ($params->get('antispam') == 'recaptcha' || $params->get('antispam') == 'both') {
            $params->set('recaptcha', true);
            $item->params->set('recaptcha', true);
        } else {
            $params->set('recaptcha', false);
            $item->params->set('recaptcha', false);
        }

        // Comments
        $item->event->K2CommentsCounter = '';
        $item->event->K2CommentsBlock = '';
        if ($item->params->get('itemComments')) {
            // Trigger comments events
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2CommentsCounter = trim(implode("\n", $results));
            $results = $dispatcher->trigger('onK2CommentsBlock', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2CommentsBlock = trim(implode("\n", $results));

            // Load K2 native comments system only if there are no plugins overriding it
            if (empty($item->event->K2CommentsCounter) && empty($item->event->K2CommentsBlock)) {

                // Load reCAPTCHA script
                if (!JRequest::getInt('print') && ($item->params->get('comments') == '1' || ($item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($item->catid)))) {
                    if ($params->get('recaptcha') && ($user->guest || $params->get('recaptchaForRegistered', 1))) {
                        if ($params->get('recaptchaV2')) {
                            $document->addScript('https://www.google.com/recaptcha/api.js?onload=onK2RecaptchaLoaded&render=explicit');
                            $js = 'function onK2RecaptchaLoaded(){grecaptcha.render("recaptcha", {"sitekey" : "'.$item->params->get('recaptcha_public_key').'"});}';
                            $document->addScriptDeclaration($js);
                            $this->recaptchaClass = 'k2-recaptcha-v2';
                        } else {
                            $document->addScript('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js');
                            $js = '
							function showRecaptcha(){
								Recaptcha.create("'.$item->params->get('recaptcha_public_key').'", "recaptcha", {
									theme: "'.$item->params->get('recaptcha_theme', 'clean').'"
								});
							}
							$K2(window).load(function() {
								showRecaptcha();
							});
							';
                            $document->addScriptDeclaration($js);
                            $this->recaptchaClass = 'k2-recaptcha-v1';
                        }
                    }
                }

                // Check for inline comment moderation
                if (!$user->guest && $user->id == $item->created_by && $params->get('inlineCommentsModeration')) {
                    $inlineCommentsModeration = true;
                    $commentsPublished = false;
                } else {
                    $inlineCommentsModeration = false;
                    $commentsPublished = true;
                }
                $this->assignRef('inlineCommentsModeration', $inlineCommentsModeration);

                // Flag spammer link
                $reportSpammerFlag = false;
                if (K2_JVERSION != '15') {
                    if ($user->authorise('core.admin', 'com_k2')) {
                        $reportSpammerFlag = true;
                        $document = JFactory::getDocument();
                        $document->addScriptDeclaration('var K2Language = ["'.JText::_('K2_REPORT_USER_WARNING', true).'"];');
                    }
                } else {
                    if ($user->gid > 24) {
                        $reportSpammerFlag = true;
                    }
                }

                $limit = $params->get('commentsLimit');
                $comments = $model->getItemComments($item->id, $limitstart, $limit, $commentsPublished);

                for ($i = 0; $i < sizeof($comments); $i++) {
                    $comments[$i]->commentText = nl2br($comments[$i]->commentText);

                    // Convert URLs to links properly
                    $comments[$i]->commentText = preg_replace("/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/i", "$1http://$2", $comments[$i]->commentText);
                    $comments[$i]->commentText = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i", "<a target=\"_blank\" rel=\"nofollow\" href=\"$1\">$1</A>", $comments[$i]->commentText);
                    $comments[$i]->commentText = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?))/i", "<a href=\"mailto:$1\">$1</A>", $comments[$i]->commentText);

                    $comments[$i]->userImage = K2HelperUtilities::getAvatar($comments[$i]->userID, $comments[$i]->commentEmail, $params->get('commenterImgWidth'));
                    if ($comments[$i]->userID > 0) {
                        $comments[$i]->userLink = K2HelperRoute::getUserRoute($comments[$i]->userID);
                    } else {
                        $comments[$i]->userLink = $comments[$i]->commentURL;
                    }
                    if ($reportSpammerFlag && $comments[$i]->userID > 0) {
                        $comments[$i]->reportUserLink = JRoute::_('index.php?option=com_k2&view=comments&task=reportSpammer&id='.$comments[$i]->userID.'&format=raw');
                    } else {
                        $comments[$i]->reportUserLink = false;
                    }
                }

                $item->comments = $comments;

                if (!isset($item->numOfComments)) {
                    $item->numOfComments = 0;
                }

                jimport('joomla.html.pagination');
                $total = $item->numOfComments;
                $pagination = new JPagination($total, $limitstart, $limit);
            }
        }

        // Author's latest items
        if ($item->params->get('itemAuthorLatest') && $item->created_by_alias == '') {
            $model = $this->getModel('itemlist');
            $authorLatestItems = $model->getAuthorLatest($item->id, $item->params->get('itemAuthorLatestLimit'), $item->created_by);
            if (count($authorLatestItems)) {
                for ($i = 0; $i < sizeof($authorLatestItems); $i++) {
                    $authorLatestItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($authorLatestItems[$i]->id.':'.urlencode($authorLatestItems[$i]->alias), $authorLatestItems[$i]->catid.':'.urlencode($authorLatestItems[$i]->categoryalias))));
                }
                $this->assignRef('authorLatestItems', $authorLatestItems);
            }
        }

        // Related items
        if ($item->params->get('itemRelated') && isset($item->tags) && count($item->tags)) {
            $model = $this->getModel('itemlist');
            $relatedItems = $model->getRelatedItems($item->id, $item->tags, $item->params);
            if (count($relatedItems)) {
                for ($i = 0; $i < sizeof($relatedItems); $i++) {
                    $relatedItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($relatedItems[$i]->id.':'.urlencode($relatedItems[$i]->alias), $relatedItems[$i]->catid.':'.urlencode($relatedItems[$i]->categoryalias))));
                }
                $this->assignRef('relatedItems', $relatedItems);
            }
        }

        // Navigation (previous and next item)
        if ($item->params->get('itemNavigation')) {
            $model = $this->getModel('item');

            $nextItem = $model->getNextItem($item->id, $item->catid, $item->ordering);
            if (!is_null($nextItem)) {
                $item->nextLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($nextItem->id.':'.urlencode($nextItem->alias), $nextItem->catid.':'.urlencode($item->category->alias))));
                $item->nextTitle = $nextItem->title;

                $date = JFactory::getDate($item->modified);
                $timestamp = '?t='.$date->toUnix();

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XS.jpg')) {
                    $item->nextImageXSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XS.jpg'.$timestamp;
                }
                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_S.jpg')) {
                    $item->nextImageSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_S.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_M.jpg')) {
                    $item->nextImageMedium = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_M.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_L.jpg')) {
                    $item->nextImageLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_L.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XL.jpg')) {
                    $item->nextImageXLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XL.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_Generic.jpg')) {
                    $item->nextImageGeneric = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_Generic.jpg'.$timestamp;
                }
            }

            $previousItem = $model->getPreviousItem($item->id, $item->catid, $item->ordering);
            if (!is_null($previousItem)) {
                $item->previousLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($previousItem->id.':'.urlencode($previousItem->alias), $previousItem->catid.':'.urlencode($item->category->alias))));
                $item->previousTitle = $previousItem->title;

                $date = JFactory::getDate($item->modified);
                $timestamp = '?t='.$date->toUnix();

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XS.jpg')) {
                    $item->previousImageXSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XS.jpg'.$timestamp;
                }
                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_S.jpg')) {
                    $item->previousImageSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_S.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_M.jpg')) {
                    $item->previousImageMedium = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_M.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_L.jpg')) {
                    $item->previousImageLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_L.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XL.jpg')) {
                    $item->previousImageXLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XL.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_Generic.jpg')) {
                    $item->previousImageGeneric = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_Generic.jpg'.$timestamp;
                }
            }
        }

        // Absolute URL
        $uri = JURI::getInstance();
        $item->absoluteURL = $uri->toString();

        // Email link
        if (K2_JVERSION != '15') {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $template = $application->getTemplate();
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&template='.$template.'&link='.MailToHelper::addLink($item->absoluteURL));
        } else {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&link='.MailToHelper::addLink($item->absoluteURL));
        }

        // Twitter link (legacy code)
        if ($params->get('twitterUsername')) {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL).'&amp;via='.$params->get('twitterUsername');
        } else {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL);
        }

        // Social link
        $item->socialLink = urlencode($item->absoluteURL);

        // Set page title
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        if (is_object($menu) && isset($menu->query['view']) && $menu->query['view'] == 'item' && isset($menu->query['id']) && $menu->query['id'] == $item->id) {
            if (is_string($menu->params)) {
                $menu_params = K2_JVERSION == '15' ? new JParameter($menu->params) : new JRegistry($menu->params);
            } else {
                $menu_params = $menu->params;
            }
            if (!$menu_params->get('page_title')) {
                $params->set('page_title', $item->cleanTitle);
            }
        } else {
            $params->set('page_title', $item->cleanTitle);
        }

        if (K2_JVERSION != '15') {
            if ($application->getCfg('sitename_pagetitles', 0) == 1) {
                $title = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
                $params->set('page_title', $title);
            } elseif ($application->getCfg('sitename_pagetitles', 0) == 2) {
                $title = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
                $params->set('page_title', $title);
            }
        }
        $document->setTitle($params->get('page_title'));

        // Set pathway
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        $pathway = $application->getPathWay();
        if ($menu) {
            if (isset($menu->query['view']) && ($menu->query['view'] != 'item' || $menu->query['id'] != $item->id)) {
                if (!isset($menu->query['task']) || $menu->query['task'] != 'category' || $menu->query['id'] != $item->catid) {
                    $pathway->addItem($item->category->name, $item->category->link);
                }
                $pathway->addItem($item->cleanTitle, '');
            }
        }

        // Set metadata
        if ($item->metadesc) {
            $document->setDescription((K2_JVERSION == '15') ? htmlspecialchars($item->metadesc, ENT_QUOTES, 'UTF-8') : $item->metadesc);
        } else {
            $metaDescItem = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->introtext.' '.$item->fulltext);
            $metaDescItem = preg_replace("/<script\b[^>]*>(.*?)<\/script>/is", '', $item->introtext.' '.$item->fulltext);
            $metaDescItem = strip_tags($metaDescItem);
            $metaDescItem = K2HelperUtilities::characterLimit($metaDescItem, $params->get('metaDescLimit', 150));
            $document->setDescription(K2_JVERSION == '15' ? $metaDescItem : html_entity_decode($metaDescItem));
        }
        if ($item->metakey) {
            $document->setMetadata('keywords', $item->metakey);
        } else {
            if (isset($item->tags) && count($item->tags)) {
                $tmp = array();
                foreach ($item->tags as $tag) {
                    $tmp[] = $tag->name;
                }
                $document->setMetadata('keywords', implode(',', $tmp));
            }
        }

        // Menu metadata for Joomla 2.5+ (overrides the current metadata if set)
        if (K2_JVERSION != '15') {
            if ($params->get('menu-meta_description')) {
                $document->setDescription($params->get('menu-meta_description'));
            }

            if ($params->get('menu-meta_keywords')) {
                $document->setMetadata('keywords', $params->get('menu-meta_keywords'));
            }

            if ($params->get('robots')) {
                $document->setMetadata('robots', $params->get('robots'));
            }

            // Menu page display options
            if ($params->get('page_heading')) {
                $params->set('page_title', $params->get('page_heading'));
            }
            $params->set('show_page_title', $params->get('show_page_heading'));
        }

        if ($application->getCfg('MetaTitle') == '1') {
            $document->setMetadata('title', $item->cleanTitle);
        }
        if ($application->getCfg('MetaAuthor') == '1' && isset($item->author->name)) {
            $document->setMetadata('author', $item->author->name);
        }
        $mdata = class_exists('JParameter') ? new JParameter($item->metadata) : new JRegistry($item->metadata);
        $mdata = $mdata->toArray();
        foreach ($mdata as $k => $v) {
            if ($k == 'robots' || $k == 'author') {
                if ($v) {
                    $document->setMetadata($k, $v);
                }
            }
        }

        // Set Facebook meta data
        if ($params->get('facebookMetatags', '1')) {
            $document = JFactory::getDocument();
            $uri = JURI::getInstance();
            $document->setMetaData('og:url', $uri->toString());
            $document->setMetaData('og:title', (K2_JVERSION == '15') ? htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8') : $document->getTitle());
            $document->setMetaData('og:type', 'article');
            $facebookImage = 'image'.$params->get('facebookImage', 'Small');
            if ($item->$facebookImage) {
                $basename = basename($item->$facebookImage);
                if (strpos($basename, '?t=')!==false) {
                    $tmpBasename = explode('?t=', $basename);
                    $basenameWithNoTimestamp = $tmpBasename[0];
                } else {
                    $basenameWithNoTimestamp = $basename;
                }
                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.$basenameWithNoTimestamp)) {
                    $image = JURI::root().'media/k2/items/cache/'.$basename;
                    $document->setMetaData('og:image', $image);
                    $document->setMetaData('image', $image);
                }
            }
            $document->setMetaData('og:description', strip_tags($document->getDescription()));
        }

        // Get the frontend's language for use in social media buttons - use explicit variable references for future update flexibility
        $getSiteLanguage = JFactory::getLanguage();
        $languageTag = $getSiteLanguage->getTag();
        $item->langTagForFB = str_replace('-', '_', $languageTag);
        $item->langTagForTW = strtolower($languageTag);
        $item->langTagForGP = $languageTag;

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        if ($item->params->get('theme')) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$item->params->get('theme'));
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($item->params->get('theme')) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$item->params->get('theme'));
            }
        }

        // Assign data
        $this->assignRef('item', $item);
        $this->assignRef('user', $user);
        $this->assignRef('params', $item->params);
        $this->assignRef('pagination', $pagination);

        parent::display($tpl);
    }
}
views/comments/tmpl/report.php000060400000003506150751650350012535 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div class="k2ReportCommentFormContainer">
	<h2 class="componentheading">
		<?php echo JText::_('K2_REPORT_COMMENT'); ?>
	</h2>
	<blockquote class="commentPreview">
		<span class="quoteIconLeft">&ldquo;</span>
		<span class="theComment"><?php echo nl2br($this->row->commentText); ?></span>
		<span class="quoteIconRight">&rdquo;</span>
	</blockquote>
	<form action="<?php echo JURI::root(true); ?>/index.php" name="k2ReportCommentForm" id="k2ReportCommentForm" method="post">
		<label for="name"><?php echo JText::_('K2_YOUR_NAME'); ?></label>
		<input type="text" id="name" name="name" value="" />

		<label for="reportReason"><?php echo JText::_('K2_REPORT_REASON'); ?></label>
		<textarea name="reportReason" id="reportReason" cols="60" rows="10"></textarea>

		<?php if($this->params->get('recaptcha') && $this->user->guest): ?>
		<?php if(!$this->params->get('recaptchaV2')): ?>
		<label class="formRecaptcha"><?php echo JText::_('K2_ENTER_THE_TWO_WORDS_YOU_SEE_BELOW'); ?></label>
		<?php endif; ?>
		<div id="recaptcha" class="<?php echo $this->recaptchaClass; ?>"></div>
		<?php endif; ?>

		<button class="button"><?php echo JText::_('K2_SEND_REPORT'); ?></button>

		<span id="formLog"></span>

		<input type="hidden" name="option" value="com_k2" />
		<input type="hidden" name="view" value="comments" />
		<input type="hidden" name="task" value="sendReport" />
		<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
		<input type="hidden" name="format" value="raw" />
		<?php echo JHTML::_('form.token'); ?>
	</form>
</div>
views/comments/metadata.xml000060400000000147150751650350012035 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="Comments" hidden="true"/>
</metadata>
views/comments/view.html.php000060400000004357150751650350012170 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewComments extends K2View
{

	function report($tpl = null)
	{
		JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
		$row = JTable::getInstance('K2Comment', 'Table');
		$row->load(JRequest::getInt('commentID'));
		if (!$row->published)
		{
			JError::raiseError(404, JText::_('K2_NOT_FOUND'));
		}
		$this->assignRef('row', $row);
		$user = JFactory::getUser();
		$this->assignRef('user', $user);
		$params = K2HelperUtilities::getParams('com_k2');
		if (!$params->get('comments') || !$params->get('commentsReporting') || ($params->get('commentsReporting') == '2' && $user->guest))
		{
			JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
		}
		// Pass the old parameter to the view in order to avoid layout changes
		if ($params->get('antispam') == 'recaptcha' || $params->get('antispam') == 'both')
		{
			$params->set('recaptcha', true);
		}
		else
		{
			$params->set('recaptcha', false);
		}

		$this->assignRef('params', $params);
		if ($params->get('recaptcha') && $user->guest)
		{
			$document = JFactory::getDocument();
			if($params->get('recaptchaV2')) {
				$document->addScript('https://www.google.com/recaptcha/api.js?onload=onK2RecaptchaLoaded&render=explicit');
				$js = 'function onK2RecaptchaLoaded(){grecaptcha.render("recaptcha", {"sitekey" : "'.$params->get('recaptcha_public_key').'"});}';
				$document->addScriptDeclaration($js);
				$this->recaptchaClass = 'k2-recaptcha-v2';
			}
			else
			{
				$document->addScript('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js');
				$js = '
				function showRecaptcha(){
					Recaptcha.create("'.$params->get('recaptcha_public_key').'", "recaptcha", {
						theme: "'.$params->get('recaptcha_theme', 'clean').'"
					});
				}
				$K2(window).load(function() {
					showRecaptcha();
				});
				';
				$document->addScriptDeclaration($js);
				$this->recaptchaClass = 'k2-recaptcha-v1';
			}

		}

		parent::display($tpl);
	}

}
views/itemlist/view.raw.php000060400000046550150751650350012023 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $model = $this->getModel('itemlist');
        $limitstart = JRequest::getInt('limitstart');
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get data depending on task
        switch ($task) {

            case 'category':
                // Get category
                $id = JRequest::getInt('id');
                JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                $category = JTable::getInstance('K2Category', 'Table');
                $category->load($id);

                // State Check
                if (!$category->published || $category->trash) {
                    JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                }

                // Access check
                $user = JFactory::getUser();
                if (K2_JVERSION != '15') {
                    if (!in_array($category->access, $user->getAuthorisedViewLevels())) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                    $languageFilter = $application->getLanguageFilter();
                    $languageTag = JFactory::getLanguage()->getTag();
                    if ($languageFilter && $category->language != $languageTag && $category->language != '*') {
                        return;
                    }
                } else {
                    if ($category->access > $user->get('aid', 0)) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                }

                // Hide the add new item link if user cannot post in the specific category
                if (!K2HelperPermissions::canAddItem($id)) {
                    unset($this->addLink);
                }

                // Merge params
                $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                if ($cparams->get('inheritFrom')) {
                    $masterCategory = JTable::getInstance('K2Category', 'Table');
                    $masterCategory->load($cparams->get('inheritFrom'));
                    $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                }
                $params->merge($cparams);

                // Category link
                $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                // Category image
                $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                // Category plugins
                $dispatcher = JDispatcher::getInstance();
                JPluginHelper::importPlugin('content');
                $category->text = $category->description;

                if (K2_JVERSION != '15') {
                    $dispatcher->trigger('onContentPrepare', array('com_k2.category', &$category, &$params, $limitstart));
                } else {
                    $dispatcher->trigger('onPrepareContent', array(&$category, &$params, $limitstart));
                }

                $category->description = $category->text;

                // Category K2 plugins
                $category->event->K2CategoryDisplay = '';
                JPluginHelper::importPlugin('k2');
                $results = $dispatcher->trigger('onK2CategoryDisplay', array(&$category, &$params, $limitstart));
                $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                $category->text = $category->description;
                $dispatcher->trigger('onK2PrepareContent', array(&$category, &$params, $limitstart));
                $category->description = $category->text;

                $this->assignRef('category', $category);
                $this->assignRef('user', $user);

                // Category children
                $ordering = $params->get('subCatOrdering');
                $children = $model->getCategoryFirstChildren($id, $ordering);
                if (count($children)) {
                    foreach ($children as $child) {
                        if ($params->get('subCatTitleItemCounter')) {
                            $child->numOfItems = $model->countCategoryItems($child->id);
                        }
                        $child->image = K2HelperUtilities::getCategoryImage($child->image, $params);
                        $child->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($child->id.':'.urlencode($child->alias))));
                        $subCategories[] = $child;
                    }
                    $this->assignRef('subCategories', $subCategories);
                }

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');

                // Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set layout
                $this->setLayout('category');

                // Set title
                $title = $category->name;

                // Set ordering
                if ($params->get('singleCatOrdering')) {
                    $ordering = $params->get('singleCatOrdering');
                } else {
                    $ordering = $params->get('catOrdering');
                }

                break;

            case 'user':
                // Get user
                $id = JRequest::getInt('id');
                $userObject = JFactory::getUser($id);

                // Check user status
                if ($userObject->block) {
                    JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                }

                // Get K2 user profile
                $userObject->profile = $model->getUserProfile();

                // User image
                $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                // User K2 plugins
                $userObject->event->K2UserDisplay = '';
                if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                    $dispatcher = JDispatcher::getInstance();
                    JPluginHelper::importPlugin('k2');
                    $results = $dispatcher->trigger('onK2UserDisplay', array(&$userObject->profile, &$params, $limitstart));
                    $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                    $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                }

                $this->assignRef('user', $userObject);

                // Set layout
                $this->setLayout('user');

                // Set limit
                $limit = $params->get('userItemCount');

                // Set title
                $title = $userObject->name;

                // Set ordering
                $ordering = $params->get('userOrdering');

                break;

            case 'tag':
                // Set layout
                $this->setLayout('tag');

                // Set limit
                $limit = $params->get('tagItemCount');

                // Prevent spammers from using the tag view
                $tag = JRequest::getString('tag');
                $db = JFactory::getDbo();
                $db->setQuery('SELECT id, name FROM #__k2_tags WHERE name = '.$db->quote($tag));
                $tag = $db->loadObject();
                if (!$tag->id) {
                    JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                    return false;
                }

                // set title
                $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.$tag->name;

                // Set ordering
                $ordering = $params->get('tagOrdering');
                break;

            case 'search':
                // Set layout
                $this->setLayout('generic');
                $tpl = JRequest::getCmd('tpl', null);

                // Set limit
                $limit = $params->get('genericItemCount');

                // Set title
                $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');
                break;

            case 'date':
                // Set layout
                $this->setLayout('generic');

                // Set limit
                $limit = $params->get('genericItemCount');

                // Set title
                if (JRequest::getInt('day')) {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                    $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                } else {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                    $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                }
                // Set ordering
                $ordering = 'rdate';
                break;

            default:
                // Set layout
                $this->setLayout('category');
                $user = JFactory::getUser();
                $this->assignRef('user', $user);

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');
                //Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set title
                $title = $params->get('page_title');

                // Set ordering
                $ordering = $params->get('catOrdering');

                break;
        }

        // Set limit for model
        JRequest::setVar('limit', $limit);

        if (!isset($ordering)) {
            $items = $model->getData();
        } else {
            $items = $model->getData($ordering);
        }

        // Pagination
        jimport('joomla.html.pagination');
        $total = count($items) ? $model->getTotal() : 0;
        $pagination = new JPagination($total, $limitstart, $limit);

        // Prepare items
        $user = JFactory::getUser();
        $cache = JFactory::getCache('com_k2_extended');
        $model = $this->getModel('item');
        for ($i = 0; $i < sizeof($items); $i++) {

            // Item group
            if ($task == "category" || $task == "") {
                if ($i < ($params->get('num_links') + $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'))) {
                    $items[$i]->itemGroup = 'links';
                }
                if ($i < ($params->get('num_secondary_items') + $params->get('num_leading_items') + $params->get('num_primary_items'))) {
                    $items[$i]->itemGroup = 'secondary';
                }
                if ($i < ($params->get('num_primary_items') + $params->get('num_leading_items'))) {
                    $items[$i]->itemGroup = 'primary';
                }
                if ($i < $params->get('num_leading_items')) {
                    $items[$i]->itemGroup = 'leading';
                }
            }

            // Check if model should use cache for preparing item even if user is logged in
            if ($user->guest || $task == 'tag' || $task == 'search' || $task == 'date') {
                $cacheFlag = true;
            } else {
                $cacheFlag = true;
                if (K2HelperPermissions::canEditItem($items[$i]->created_by, $items[$i]->catid)) {
                    $cacheFlag = false;
                }
            }

            // Prepare item
            if ($cacheFlag) {
                $hits = $items[$i]->hits;
                $items[$i]->hits = 0;
                JTable::getInstance('K2Category', 'Table');
                $items[$i] = $cache->call(array($model, 'prepareItem'), $items[$i], $view, $task);
                $items[$i]->hits = $hits;
            } else {
                $items[$i] = $model->prepareItem($items[$i], $view, $task);
            }

            // Plugins
            $items[$i] = $model->execPlugins($items[$i], $view, $task);

            // Trigger comments counter event
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(&$items[$i], &$params, $limitstart));
            $items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
        }

        // Pathway
        $pathway = $application->getPathWay();
        $pathway->addItem($title);

        // Feed link
        $config = JFactory::getConfig();
        $menu = $application->getMenu();
        $default = $menu->getDefault();
        $active = $menu->getActive();
        if ($task == 'tag') {
            $link = K2HelperRoute::getTagRoute(JRequest::getVar('tag'));
        } else {
            $link = '';
        }
        $sef = K2_JVERSION == '30' ? $config->get('sef') : $config->getValue('config.sef');
        if (!is_null($active) && $active->id == $default->id && $sef) {
            $link .= '&Itemid='.$active->id.'&format=feed&limitstart=';
        } else {
            $link .= '&format=feed&limitstart=';
        }

        $feed = JRoute::_($link);
        $this->assignRef('feed', $feed);

        // Assign data
        if ($task == "category" || $task == "") {
            $leading = @array_slice($items, 0, $params->get('num_leading_items'));
            $primary = @array_slice($items, $params->get('num_leading_items'), $params->get('num_primary_items'));
            $secondary = @array_slice($items, $params->get('num_leading_items') + $params->get('num_primary_items'), $params->get('num_secondary_items'));
            $links = @array_slice($items, $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'), $params->get('num_links'));
            $this->assignRef('leading', $leading);
            $this->assignRef('primary', $primary);
            $this->assignRef('secondary', $secondary);
            $this->assignRef('links', $links);
        } else {
            $this->assignRef('items', $items);
        }

        // Set default values to avoid division by zero
        if ($params->get('num_leading_columns') == 0) {
            $params->set('num_leading_columns', 1);
        }
        if ($params->get('num_primary_columns') == 0) {
            $params->set('num_primary_columns', 1);
        }
        if ($params->get('num_secondary_columns') == 0) {
            $params->set('num_secondary_columns', 1);
        }
        if ($params->get('num_links_columns') == 0) {
            $params->set('num_links_columns', 1);
        }

        $this->assignRef('params', $params);
        $this->assignRef('pagination', $pagination);

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        $theme = $params->get('theme');
        if ($theme) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$theme);
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($theme) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$theme);
            }
        }

        $db = JFactory::getDbo();
        $nullDate = $db->getNullDate();
        $this->assignRef('nullDate', $nullDate);

        parent::display($tpl);
    }

    public function module()
    {
        jimport('joomla.application.module.helper');
        $application = JFactory::getApplication();
        $moduleID = JRequest::getInt('moduleID');
        $model = K2Model::getInstance('Itemlist', 'K2Model');
        if ($moduleID) {
            $result = $model->getModuleItems($moduleID);
            $items = $result->items;
            $componentParams = JComponentHelper::getParams('com_k2');
            if (is_string($result->params)) {
                $params = class_exists('JParameter') ? new JParameter($result->params) : new JRegistry($result->params);
            } else {
                $params = $result->params;
            }

            if ($params->get('getTemplate')) {
                require(JModuleHelper::getLayoutPath('mod_k2_content', $params->get('getTemplate').'/default'));
            } else {
                require(JModuleHelper::getLayoutPath($result->module, 'default'));
            }
        }
        $application->close();
    }
}
views/itemlist/view.feed.php000060400000025035150751650350012130 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{

    function display($tpl = null)
    {

        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $document = JFactory::getDocument();
        $model = $this->getModel('itemlist');
        $limitstart = JRequest::getInt('limitstart');
        $moduleID = JRequest::getInt('moduleID');

        if ($moduleID)
        {

            $result = $model->getModuleItems($moduleID);
            $items = $result->items;
            $title = $result->title;

        }
        else
        {

            //Get data depending on task
            $task = JRequest::getCmd('task');
            switch ($task)
            {

                case 'category' :
                    //Get category
                    $id = JRequest::getInt('id');
                    JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                    $category = JTable::getInstance('K2Category', 'Table');
                    $category->load($id);

                    // State check
                    if (!$category->published || $category->trash)
                    {
                        JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                    }

                    //Access check
                    $user = JFactory::getUser();
                    if (K2_JVERSION != '15')
                    {
                        if (!in_array($category->access, $user->getAuthorisedViewLevels()))
                        {
                            if ($user->guest)
                            {
                                $uri = JFactory::getURI();
                                $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
								$application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                                $application->redirect(JRoute::_($url, false));
                            }
                            else
                            {
                                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                                return;
                            }
                        }
                        $languageFilter = $application->getLanguageFilter();
                        $languageTag = JFactory::getLanguage()->getTag();
                        if ($languageFilter && $category->language != $languageTag && $category->language != '*')
                        {
                            return;
                        }
                    }
                    else
                    {
                        if ($category->access > $user->get('aid', 0))
                        {
                            if ($user->guest)
                            {
                                $uri = JFactory::getURI();
                                $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
								$application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                                $application->redirect(JRoute::_($url, false));
                            }
                            else
                            {
                                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                                return;
                            }
                        }
                    }

                    //Merge params
                    $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                    if ($cparams->get('inheritFrom'))
                    {
                        $masterCategory = JTable::getInstance('K2Category', 'Table');
                        $masterCategory->load($cparams->get('inheritFrom'));
                        $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                    }
                    $params->merge($cparams);

                    //Category link
                    $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                    //Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    //Set title
                    $title = $category->name;

                    // Set ordering
                    if ($params->get('singleCatOrdering'))
                    {
                        $ordering = $params->get('singleCatOrdering');
                    }
                    else
                    {
                        $ordering = $params->get('catOrdering');
                    }

                    break;

                case 'user' :
                    //Get user
                    $id = JRequest::getInt('id');
                    $userObject = JFactory::getUser($id);

                    //Check user status
                    if ($userObject->block)
                    {
                        JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                    }

                    //Set title
                    $title = $userObject->name;

                    // Set ordering
                    $ordering = $params->get('userOrdering');

                    break;

                case 'tag' :

                    // Prevent spammers from using the tag view
                    $tag = JRequest::getString('tag');
                    $db = JFactory::getDbo();
                    $db->setQuery('SELECT id, name FROM #__k2_tags WHERE name = '.$db->quote($tag));
                    $tag = $db->loadObject();
                    if (!$tag->id)
                    {
                      JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                      return false;
                    }

                    //set title
                    $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.$tag->name;

                    // Set ordering
                    $ordering = $params->get('tagOrdering');
                    break;

                case 'search' :
                    //Set title
                    $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');
                    break;

                case 'date' :
                    // Set title
                    if (JRequest::getInt('day'))
                    {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                        $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    }
                    else
                    {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                        $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    }
                    // Set ordering
                    $ordering = 'rdate';
                    break;

                default :

                    //Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    //Set title
                    $title = $params->get('page_title');

                    // Set ordering
                    $ordering = $params->get('catOrdering');

                    break;
            }

            // Various Feed Validations
            $title = JFilterOutput::ampReplace($title);

            // Get items
            if (!isset($ordering))
            {
                $items = $model->getData();
            }
            else
            {
                $items = $model->getData($ordering);
            }

        }

        // Prepare feed items
        $model = $this->getModel('item');
        foreach ($items as $item)
        {

            $item = $model->prepareFeedItem($item);
            $item->title = $this->escape($item->title);
            $item->title = html_entity_decode($item->title);
            $feedItem = new JFeedItem();
            $feedItem->title = $item->title;
            $feedItem->link = $item->link;
            $feedItem->description = $item->description;
            $feedItem->date = $item->created;
            $feedItem->category = $item->category->name;
            $feedItem->author = $item->author->name;
            if ($params->get('feedBogusEmail'))
            {
                $feedItem->authorEmail = $params->get('feedBogusEmail');
            }
            else
            {
                if ($application->getCfg('feed_email') == 'author')
                {
                    $feedItem->authorEmail = $item->author->email;
                }
                else
                {
                    $feedItem->authorEmail = $application->getCfg('mailfrom');
                }
            }

            // Add item
            $document->addItem($feedItem);
        }

        // Set title
        $document = JFactory::getDocument();
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        if (is_object($menu))
        {
            $menu_params = class_exists('JParameter') ? new JParameter($menu->params) : new JRegistry($menu->params);
            if (!$menu_params->get('page_title'))
                $params->set('page_title', $title);
        }
        else
        {
            $params->set('page_title', $title);
        }
        if (K2_JVERSION != '15')
        {
            if ($application->getCfg('sitename_pagetitles', 0) == 1)
            {
                $title = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
                $params->set('page_title', $title);
            }
            elseif ($application->getCfg('sitename_pagetitles', 0) == 2)
            {
                $title = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
                $params->set('page_title', $title);
            }
        }
        $document->setTitle($params->get('page_title'));

    }

}
views/itemlist/view.html.php000060400000071061150751650350012171 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $model = $this->getModel('itemlist');
        $limitstart = JRequest::getInt('limitstart');
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');
        $db = JFactory::getDbo();

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get data depending on task
        switch ($task) {

            case 'category':
                // Get category
                $id = JRequest::getInt('id');
                JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                $category = JTable::getInstance('K2Category', 'Table');
                $category->load($id);
                $category->event = new stdClass;

                // State check
                if (!$category->published || $category->trash) {
                    JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                }

                // Access check
                $user = JFactory::getUser();
                if (K2_JVERSION != '15') {
                    if (!in_array($category->access, $user->getAuthorisedViewLevels())) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                    $languageFilter = $application->getLanguageFilter();
                    $languageTag = JFactory::getLanguage()->getTag();
                    if ($languageFilter && $category->language != $languageTag && $category->language != '*') {
                        return;
                    }
                } else {
                    if ($category->access > $user->get('aid', 0)) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                }

                // Hide the add new item link if user cannot post in the specific category
                if (!K2HelperPermissions::canAddItem($id)) {
                    unset($this->addLink);
                }

                // Merge params
                $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);

                // Get the meta information before merging params since we do not want them to be inherited
                $category->metaDescription = $cparams->get('catMetaDesc');
                $category->metaKeywords = $cparams->get('catMetaKey');
                $category->metaRobots = $cparams->get('catMetaRobots');
                $category->metaAuthor = $cparams->get('catMetaAuthor');

                if ($cparams->get('inheritFrom')) {
                    $masterCategory = JTable::getInstance('K2Category', 'Table');
                    $masterCategory->load($cparams->get('inheritFrom'));
                    $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                }
                $params->merge($cparams);

                // Category link
                $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                // Category image
                $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                // Category plugins
                $dispatcher = JDispatcher::getInstance();
                JPluginHelper::importPlugin('content');
                $category->text = $category->description;
                if (K2_JVERSION != '15') {
                    $dispatcher->trigger('onContentPrepare', array(
                        'com_k2.category',
                        &$category,
                        &$params,
                        $limitstart
                    ));
                } else {
                    $dispatcher->trigger('onPrepareContent', array(
                        &$category,
                        &$params,
                        $limitstart
                    ));
                }

                $category->description = $category->text;

                // Category K2 plugins
                $category->event->K2CategoryDisplay = '';
                JPluginHelper::importPlugin('k2');
                $results = $dispatcher->trigger('onK2CategoryDisplay', array(
                    &$category,
                    &$params,
                    $limitstart
                ));
                $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                $category->text = $category->description;
                $dispatcher->trigger('onK2PrepareContent', array(
                    &$category,
                    &$params,
                    $limitstart
                ));
                $category->description = $category->text;

                $this->assignRef('category', $category);
                $this->assignRef('user', $user);

                // Category children
                $ordering = $params->get('subCatOrdering');
                $children = $model->getCategoryFirstChildren($id, $ordering);
                if (count($children)) {
                    foreach ($children as $child) {
                        if ($params->get('subCatTitleItemCounter')) {
                            $child->numOfItems = $model->countCategoryItems($child->id);
                        }
                        $child->image = K2HelperUtilities::getCategoryImage($child->image, $params);
                        $child->name = htmlspecialchars($child->name, ENT_QUOTES);
                        $child->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($child->id.':'.urlencode($child->alias))));
                        $subCategories[] = $child;
                    }
                    $this->assignRef('subCategories', $subCategories);
                }

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');

                // Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set layout
                $this->setLayout('category');

                // Set title
                $title = $category->name;
                $category->name = htmlspecialchars($category->name, ENT_QUOTES);

                // Set ordering
                if ($params->get('singleCatOrdering')) {
                    $ordering = $params->get('singleCatOrdering');
                } else {
                    $ordering = $params->get('catOrdering');
                }

                $addHeadFeedLink = $params->get('catFeedLink');

                break;

            case 'user':
                // Get user
                $id = JRequest::getInt('id');
                $userObject = JFactory::getUser($id);
                $userObject->event = new stdClass;

                // Check user status
                if ($userObject->block) {
                    JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                }

                // Get K2 user profile
                $userObject->profile = $model->getUserProfile();

                // User image
                $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                // User K2 plugins
                $userObject->event->K2UserDisplay = '';
                if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                    $dispatcher = JDispatcher::getInstance();
                    JPluginHelper::importPlugin('k2');
                    $results = $dispatcher->trigger('onK2UserDisplay', array(
                        &$userObject->profile,
                        &$params,
                        $limitstart
                    ));
                    $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                    $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                }
                $this->assignRef('user', $userObject);

                $date = JFactory::getDate();
                $now = K2_JVERSION == '15' ? $date->toMySQL() : $date->toSql();
                $this->assignRef('now', $now);

                // Set layout
                $this->setLayout('user');

                // Set limit
                $limit = $params->get('userItemCount');

                // Set title
                $title = $userObject->name;

                // Set ordering
                $ordering = $params->get('userOrdering');

                $addHeadFeedLink = $params->get('userFeedLink', 1);

                break;

            case 'tag':
                // Set layout
                $this->setLayout('tag');

                // Set limit
                $limit = $params->get('tagItemCount');

                // Prevent spammers from using the tag view
                $tag = JRequest::getString('tag');
                $db = JFactory::getDbo();
                $db->setQuery('SELECT id, name FROM #__k2_tags WHERE name = '.$db->quote($tag));
                $tag = $db->loadObject();
                if (!$tag || !$tag->id) {
                    JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                    return false;
                }

                // Set title
                $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.$tag->name;

                // Set ordering
                $ordering = $params->get('tagOrdering');

                $addHeadFeedLink = $params->get('tagFeedLink', 1);

                break;

            case 'search':
                // Set layout
                $this->setLayout('generic');

                // Set limit
                $limit = $params->get('genericItemCount');

                // Set title
                $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');

                $addHeadFeedLink = $params->get('genericFeedLink', 1);

                break;

            case 'date':
                // Set layout
                $this->setLayout('generic');

                // Set limit
                $limit = $params->get('genericItemCount');

                // Fix wrong timezone
                if (function_exists('date_default_timezone_get')) {
                    $originalTimezone = date_default_timezone_get();
                }
                if (function_exists('date_default_timezone_set')) {
                    date_default_timezone_set('UTC');
                }

                // Set title
                if (JRequest::getInt('day')) {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                    $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                } else {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                    $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                }

                // Restore the original timezone
                if (function_exists('date_default_timezone_set') && isset($originalTimezone)) {
                    date_default_timezone_set($originalTimezone);
                }

                // Set ordering
                $ordering = 'rdate';

                $addHeadFeedLink = $params->get('genericFeedLink', 1);

                break;

            default:
                // Set layout
                $this->setLayout('category');
                $user = JFactory::getUser();
                $this->assignRef('user', $user);

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');
                // Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set title
                $title = $params->get('page_title');

                // Set ordering
                $ordering = $params->get('catOrdering');

                $addHeadFeedLink = $params->get('catFeedLink', 1);

                break;
        }

        // Set limit for model
        if (!$limit) {
            $limit = 10;
        }
        JRequest::setVar('limit', $limit);

        // Get items
        if (!isset($ordering)) {
            $items = $model->getData();
        } else {
            $items = $model->getData($ordering);
        }

        // If a user has no published items, do not display their K2 user page (in the frontend) and redirect to the homepage of the site.
        $user = JFactory::getUser();
        $userPageDisplay = 0;
        switch ($params->get('profilePageDisplay', 0)) {
            case 1:
                $userPageDisplay = 1;
                break;
            case 2:
                if ($user->id > 0) {
                    $userPageDisplay = 1;
                }
                break;
        }
        if ((count($items) == 0 && $task == 'user') && $userPageDisplay == 0) {
            $application->redirect(JUri::root());
        }

        // Pagination
        jimport('joomla.html.pagination');
        $total = count($items) ? $model->getTotal() : 0;
        $pagination = new JPagination($total, $limitstart, $limit);

        //Prepare items
        $cache = JFactory::getCache('com_k2_extended');
        $model = $this->getModel('item');

        for ($i = 0; $i < sizeof($items); $i++) {

            // Ensure that all items have a group. If an item with no group is found then assign to it the leading group
            $items[$i]->itemGroup = 'leading';

            //Item group
            if ($task == "category" || $task == "") {
                if ($i < ($params->get('num_links') + $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'))) {
                    $items[$i]->itemGroup = 'links';
                }
                if ($i < ($params->get('num_secondary_items') + $params->get('num_leading_items') + $params->get('num_primary_items'))) {
                    $items[$i]->itemGroup = 'secondary';
                }
                if ($i < ($params->get('num_primary_items') + $params->get('num_leading_items'))) {
                    $items[$i]->itemGroup = 'primary';
                }
                if ($i < $params->get('num_leading_items')) {
                    $items[$i]->itemGroup = 'leading';
                }
            }

            // Check if the model should use the cache for preparing the item even if the user is logged in
            if ($user->guest || $task == 'tag' || $task == 'search' || $task == 'date') {
                $cacheFlag = true;
            } else {
                $cacheFlag = true;
                if (K2HelperPermissions::canEditItem($items[$i]->created_by, $items[$i]->catid)) {
                    $cacheFlag = false;
                }
            }

            // Prepare item
            if ($cacheFlag) {
                $hits = $items[$i]->hits;
                $items[$i]->hits = 0;
                JTable::getInstance('K2Category', 'Table');
                $items[$i] = $cache->call(array(
                    $model,
                    'prepareItem'
                ), $items[$i], $view, $task);
                $items[$i]->hits = $hits;
            } else {
                $items[$i] = $model->prepareItem($items[$i], $view, $task);
            }

            // Plugins
            $items[$i] = $model->execPlugins($items[$i], $view, $task);

            // Trigger comments counter event if needed
            if ($params->get('catItemK2Plugins') &&
                ($params->get('catItemCommentsAnchor') ||
                 $params->get('itemCommentsAnchor') ||
                 $params->get('itemComments'))) {
                // Trigger comments counter event
                $dispatcher = JDispatcher::getInstance();
                JPluginHelper::importPlugin('k2');
                $results = $dispatcher->trigger('onK2CommentsCounter', array(
                    &$items[$i],
                    &$params,
                    $limitstart
                ));
                $items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
            }
        }

        // Set title
        $document = JFactory::getDocument();
        $application = JFactory::getApplication();
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        if (is_object($menu)) {
            if (is_string($menu->params)) {
                $menu_params = K2_JVERSION == '15' ? new JParameter($menu->params) : new JRegistry($menu->params);
            } else {
                $menu_params = $menu->params;
            }
            if (!$menu_params->get('page_title')) {
                $params->set('page_title', $title);
            }
        } else {
            $params->set('page_title', $title);
        }

        // We're adding a new variable here which won't get the appended/prepended site title,
        // when enabled via Joomla's SEO/SEF settings
        $params->set('page_title_clean', $title);

        if (K2_JVERSION != '15') {
            if ($application->getCfg('sitename_pagetitles', 0) == 1) {
                $tmpTitle = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
                $params->set('page_title', $tmpTitle);
            } elseif ($application->getCfg('sitename_pagetitles', 0) == 2) {
                $tmpTitle = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
                $params->set('page_title', $tmpTitle);
            }
        }
        $document->setTitle($params->get('page_title'));

        // Keep for b/c in v2.x: Search - Update the Google Search results container
        if ($task == 'search') {
            $params->set('googleSearch', 0);
            $googleSearchContainerID = trim($params->get('googleSearchContainer', 'k2GoogleSearchContainer'));
            if ($googleSearchContainerID == 'k2Container') {
                $googleSearchContainerID = 'k2GoogleSearchContainer';
            }
            $params->set('googleSearchContainer', $googleSearchContainerID);
        }

        // Set metadata for category
        if ($task == 'category') {
            if ($category->metaDescription) {
                $document->setDescription($category->metaDescription);
            } else {
                $metaDescItem = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $this->category->description);
                $metaDescItem = strip_tags($metaDescItem);
                $metaDescItem = K2HelperUtilities::characterLimit($metaDescItem, $params->get('metaDescLimit', 150));
                if (K2_JVERSION != '15') {
                    $metaDescItem = html_entity_decode($metaDescItem);
                }
                $document->setDescription($metaDescItem);
            }
            if ($category->metaKeywords) {
                $document->setMetadata('keywords', $category->metaKeywords);
            }
            if ($category->metaRobots) {
                $document->setMetadata('robots', $category->metaRobots);
            }
            if ($category->metaAuthor) {
                $document->setMetadata('author', $category->metaAuthor);
            }
        }

        if (K2_JVERSION != '15') {

            // Menu metadata options
            if ($params->get('menu-meta_description')) {
                $document->setDescription($params->get('menu-meta_description'));
            }

            if ($params->get('menu-meta_keywords')) {
                $document->setMetadata('keywords', $params->get('menu-meta_keywords'));
            }

            if ($params->get('robots')) {
                $document->setMetadata('robots', $params->get('robots'));
            }

            // Menu page display options
            if ($params->get('page_heading')) {
                $params->set('page_title', $params->get('page_heading'));
            }
            $params->set('show_page_title', $params->get('show_page_heading'));
        }

        // Pathway
        $pathway = $application->getPathWay();
        if (!isset($menu->query['task'])) {
            $menu->query['task'] = '';
        }
        if ($menu) {
            switch ($task) {
                case 'category':
                    if ($menu->query['task'] != 'category' || $menu->query['id'] != JRequest::getInt('id')) {
                        $pathway->addItem($title, '');
                    }
                    break;
                case 'user':
                    if ($menu->query['task'] != 'user' || $menu->query['id'] != JRequest::getInt('id')) {
                        $pathway->addItem($title, '');
                    }
                    break;

                case 'tag':
                    if ($menu->query['task'] != 'tag' || $menu->query['tag'] != JRequest::getVar('tag')) {
                        $pathway->addItem($title, '');
                    }
                    break;

                case 'search':
                case 'date':
                    $pathway->addItem($title, '');
                    break;
            }
        }

        // Feed link
        $config = JFactory::getConfig();
        $menu = $application->getMenu();
        $default = $menu->getDefault();
        $active = $menu->getActive();
        if ($task == 'tag') {
            $link = K2HelperRoute::getTagRoute(JRequest::getVar('tag'));
        } else {
            $link = '';
        }
        $sef = K2_JVERSION == '30' ? $config->get('sef') : $config->getValue('config.sef');
        if (!is_null($active) && $active->id == $default->id && $sef) {
            $link .= '&Itemid='.$active->id.'&format=feed&limitstart=';
        } else {
            $link .= '&format=feed&limitstart=';
        }

        $feed = JRoute::_($link);
        $this->assignRef('feed', $feed);

        // Add head feed link
        if ($addHeadFeedLink) {
            $attribs = array(
                'type' => 'application/rss+xml',
                'title' => 'RSS 2.0'
            );
            $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
            $attribs = array(
                'type' => 'application/atom+xml',
                'title' => 'Atom 1.0'
            );
            $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
        }

        // Assign data
        if ($task == "category" || $task == "") {

            // Leading items
            $offset = 0;
            $length = $params->get('num_leading_items');
            $leading = array_slice($items, $offset, $length);

            // Primary
            $offset = (int)$params->get('num_leading_items');
            $length = (int)$params->get('num_primary_items');
            $primary = array_slice($items, $offset, $length);

            // Secondary
            $offset = (int)($params->get('num_leading_items') + $params->get('num_primary_items'));
            $length = (int)$params->get('num_secondary_items');
            $secondary = array_slice($items, $offset, $length);

            // Links
            $offset = (int)($params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'));
            $length = (int)$params->get('num_links');
            $links = array_slice($items, $offset, $length);

            // Assign data
            $this->assignRef('leading', $leading);
            $this->assignRef('primary', $primary);
            $this->assignRef('secondary', $secondary);
            $this->assignRef('links', $links);
        } else {
            $this->assignRef('items', $items);
        }

        // Set default values to avoid division by zero
        if ($params->get('num_leading_columns') == 0) {
            $params->set('num_leading_columns', 1);
        }
        if ($params->get('num_primary_columns') == 0) {
            $params->set('num_primary_columns', 1);
        }
        if ($params->get('num_secondary_columns') == 0) {
            $params->set('num_secondary_columns', 1);
        }
        if ($params->get('num_links_columns') == 0) {
            $params->set('num_links_columns', 1);
        }

        $this->assignRef('params', $params);
        $this->assignRef('pagination', $pagination);

        // Set Facebook meta data
        if ($params->get('facebookMetatags', '1')) {
            $document = JFactory::getDocument();
            $uri = JURI::getInstance();
            $document->setMetaData('og:url', $uri->toString());
            $document->setMetaData('og:title', (K2_JVERSION == '15') ? htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8') : $document->getTitle());
            $document->setMetaData('og:type', 'website');
            if ($task == 'category' && $this->category->image && strpos($this->category->image, 'placeholder/category.png') === false) {
                $image = substr(JURI::root(), 0, -1).str_replace(JURI::root(true), '', $this->category->image);
                $document->setMetaData('og:image', $image);
                $document->setMetaData('image', $image);
            }
            $document->setMetaData('og:description', strip_tags($document->getDescription()));
        }

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        $theme = $params->get('theme');
        if ($theme) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$theme);
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($theme) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$theme);
            }
        }

        $nullDate = $db->getNullDate();
        $this->assignRef('nullDate', $nullDate);
        $dispatcher = JDispatcher::getInstance();
        JPluginHelper::importPlugin('k2');
        $dispatcher->trigger('onK2BeforeViewDisplay');

        parent::display($tpl);
    }
}
views/itemlist/tmpl/generic_item.php000060400000000463150751650350013660 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/itemlist/tmpl/category.php000060400000000463150751650350013043 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/itemlist/tmpl/category.xml000060400000036445150751650350013065 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_CATEGORIES">
		<message>
			<![CDATA[K2_DISPLAYS_A_LIST_OF_ITEMS_FROM_ONE_OR_MORE_CATEGORIES]]>
		</message>
	</layout>
	<state>
		<name>K2_CATEGORIES</name>
		<description>K2_DISPLAYS_A_LIST_OF_ITEMS_FROM_ONE_OR_MORE_CATEGORIES</description>
		<params addpath="/administrator/components/com_k2/elements">
			<param name="" type="header" default="K2_SELECT_ONE_OR_MORE_CATEGORIES" label="" description=""/>
			<param name="categories" type="category" default="" label="K2_SELECT_CATEGORIES" description="K2_IF_YOU_SELECT_MULTIPLE_CATEGORIES_YOU_CAN_ADJUST_ADDITIONAL_PARAMETERS_BELOW_IF_YOU_SELECT_ONLY_ONE_CATEGORY_THEN_K2_WILL_FETCH_THE_OPTIONS_AS_DEFINED_IN_THAT_SPECIFIC_CATEGORYS_OPTIONS_IN_K2_CATEGORIES"/>
			<param name="catCatalogMode" type="radio" default="0" label="K2_FETCH_ITEMS_FROM_CHILDREN_CATEGORIES" description="K2_IF_YOU_SELECT_NO_THEN_ONLY_THE_ITEMS_DIRECTLY_BELONGING_TO_THIS_CATEGORY_WILL_BE_RETRIEVED_IF_YOU_SELECT_YES_THEN_ITEMS_FROM_ALL_SUBCATEGORIES_WILL_BE_RETRIEVED_SETTING_THIS_OPTION_TO_YES_IS_IDEAL_FOR_NEWSPORTALMAGAZINEBLOG_LAYOUTS">
				<option value="1">K2_NO</option>
				<option value="0">K2_YES</option>
			</param>
			<param name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_SINGLE_CATEGORY_SELECTION" label="" description=""/>
			<param name="singleCatOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_INHERIT_FROM_CATEGORY</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="modified">K2_LATEST_MODIFIED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_MULTIPLE_CATEGORY_SELECTION" label="" description=""/>
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_leading_items" type="text" size="4" default="2" label="K2_LEADING_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LEADING"/>
			<param name="num_leading_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LEADING" description=""/>
			<param name="leadingImgSize" type="list" default="Large" label="K2_IMAGE_SIZE_FOR_LEADING_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_primary_items" type="text" size="4" default="4" label="K2_PRIMARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_PRIMARY"/>
			<param name="num_primary_columns" type="text" size="4" default="2" label="K2_COLUMNS_FOR_PRIMARY" description=""/>
			<param name="primaryImgSize" type="list" default="Medium" label="K2_IMAGE_SIZE_FOR_PRIMARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_secondary_items" type="text" size="4" default="4" label="K2_SECONDARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_SECONDARY"/>
			<param name="num_secondary_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_SECONDARY" description=""/>
			<param name="secondaryImgSize" type="list" default="Small" label="K2_IMAGE_SIZE_FOR_SECONDARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_links" type="text" size="4" default="4" label="K2_LINKS_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LINKS"/>
			<param name="num_links_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LINKS" description=""/>
			<param name="linksImgSize" type="list" default="XSmall" label="K2_IMAGE_SIZE_FOR_LINK_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="catFeaturedItems" type="list" default="1" label="K2_FEATURED_ITEMS" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
				<option value="2">K2_SHOW_ONLY_FEATURED_ITEMS</option>
			</param>
			<param name="catOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_DEFAULT</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="modified">K2_LATEST_MODIFIED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="catPagination" type="list" default="2" label="K2_PAGINATION" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
				<option value="2">K2_AUTO</option>
			</param>
			<param name="catPaginationResults" type="radio" default="1" label="K2_PAGINATION_RESULTS" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="catFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="catFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
		</params>
		<url>
			<param name="task" type="hidden" default=""/>
			<param name="id" type="hidden" default=""/>
		</url>
		<fields name="request">
			<fieldset name="request">
				<field name="task" type="hidden" default=""/>
				<field name="id" type="hidden" default=""/>
			</fieldset>
		</fields>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
				<field name="" type="header" default="K2_SELECT_ONE_OR_MORE_CATEGORIES" label="" description=""/>
				<field name="categories" type="k2category" default="" label="K2_SELECT_CATEGORIES" description="K2_IF_YOU_SELECT_MULTIPLE_CATEGORIES_YOU_CAN_ADJUST_ADDITIONAL_PARAMETERS_BELOW_IF_YOU_SELECT_ONLY_ONE_CATEGORY_THEN_K2_WILL_FETCH_THE_OPTIONS_AS_DEFINED_IN_THAT_SPECIFIC_CATEGORYS_OPTIONS_IN_K2_CATEGORIES"/>
				<field name="catCatalogMode" type="radio" default="0" label="K2_FETCH_ITEMS_FROM_CHILDREN_CATEGORIES" description="K2_IF_YOU_SELECT_NO_THEN_ONLY_THE_ITEMS_DIRECTLY_BELONGING_TO_THIS_CATEGORY_WILL_BE_RETRIEVED_IF_YOU_SELECT_YES_THEN_ITEMS_FROM_ALL_SUBCATEGORIES_WILL_BE_RETRIEVED_SETTING_THIS_OPTION_TO_YES_IS_IDEAL_FOR_NEWSPORTALMAGAZINEBLOG_LAYOUTS" class="btn-group btn-group-yesno-reverse">
					<option value="1">K2_NO</option>
					<option value="0">K2_YES</option>
				</field>
				<field name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_SINGLE_CATEGORY_SELECTION" label="" description=""/>
				<field name="singleCatOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_INHERIT_FROM_CATEGORY</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="modified">K2_LATEST_MODIFIED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_MULTIPLE_CATEGORY_SELECTION" label="" description=""/>
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_leading_items" type="text" size="4" default="2" label="K2_LEADING_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LEADING"/>
				<field name="num_leading_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LEADING" description=""/>
				<field name="leadingImgSize" type="list" default="Large" label="K2_IMAGE_SIZE_FOR_LEADING_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_primary_items" type="text" size="4" default="4" label="K2_PRIMARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_PRIMARY"/>
				<field name="num_primary_columns" type="text" size="4" default="2" label="K2_COLUMNS_FOR_PRIMARY" description=""/>
				<field name="primaryImgSize" type="list" default="Medium" label="K2_IMAGE_SIZE_FOR_PRIMARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_secondary_items" type="text" size="4" default="4" label="K2_SECONDARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_SECONDARY"/>
				<field name="num_secondary_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_SECONDARY" description=""/>
				<field name="secondaryImgSize" type="list" default="Small" label="K2_IMAGE_SIZE_FOR_SECONDARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_links" type="text" size="4" default="4" label="K2_LINKS_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LINKS"/>
				<field name="num_links_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LINKS" description=""/>
				<field name="linksImgSize" type="list" default="XSmall" label="K2_IMAGE_SIZE_FOR_LINK_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="catFeaturedItems" type="list" default="1" label="K2_FEATURED_ITEMS" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
					<option value="2">K2_SHOW_ONLY_FEATURED_ITEMS</option>
				</field>
				<field name="catOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_DEFAULT</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="modified">K2_LATEST_MODIFIED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="catPagination" type="list" default="2" label="K2_PAGINATION" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
					<option value="2">K2_AUTO</option>
				</field>
				<field name="catPaginationResults" type="radio" default="1" label="K2_PAGINATION_RESULTS" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="catFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="catFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
views/itemlist/tmpl/generic.xml000060400000000556150751650350012656 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="Generic" hidden="true">
		<message>
			<![CDATA[This XML file is intentionally left blank to override the pre-v2.5 generic.xml file, which K2 used to create the 'tag' menu item. The 'tag' menu item now has its own tag.xml menu definition file.]]>
		</message>
	</layout>
	<state></state>
</metadata>
views/itemlist/tmpl/tag.xml000060400000007500150751650350012011 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_TAG">
		<message>
			<![CDATA[K2_CREATE_A_MENU_ITEM_LINKING_TO_A_TAG_IN_K2]]>
		</message>
	</layout>
	<state>
		<name>K2_TAG</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_TAG_IN_K2</description>
		<params addpath="/administrator/components/com_k2/elements">
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="categoriesFilter" type="category" default="" label="K2_FILTER_CATEGORIES" description=""/>
			<param name="tagOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_INHERIT_FROM_PARAMS</option>
				<option value="id">K2_DEFAULT</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="tagFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="tagFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
		</params>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="tag" type="k2modalselector" scope="tag" default="" label="K2_SELECT_TAG_IN_MENUS" description=""/>
			<param name="task" type="hidden" default="tag"/>
		</url>
		<fields name="request">
			<fieldset name="request" addfieldpath="/administrator/components/com_k2/elements">
				<field name="tag" type="k2modalselector" scope="tag" default="" label="K2_SELECT_TAG_IN_MENUS" description=""/>
				<field name="task" type="hidden" default="tag"/>
			</fieldset>
		</fields>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="categoriesFilter" type="k2category" default="" label="K2_FILTER_CATEGORIES" description=""/>
				<field name="tagOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_INHERIT_FROM_PARAMS</option>
					<option value="id">K2_DEFAULT</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="tagFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="tagFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
views/itemlist/tmpl/tag.php000060400000000463150751650350012001 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/itemlist/tmpl/user.php000060400000000463150751650350012204 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/itemlist/tmpl/user.xml000060400000007433150751650350012221 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_USER_PAGE_BLOG">
		<message>
			<![CDATA[K2_CREATE_A_MENU_ITEM_LINKING_TO_A_USER_PAGE_BLOG]]>
		</message>
	</layout>
	<state>
		<name>K2_USER_PAGE_BLOG</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_USER_PAGE_BLOG</description>
		<params addPath="/administrator/components/com_k2/elements">
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="userCategoriesFilter" type="categories" multiple="multiple" default="" label="K2_FILTER_CATEGORIES" description=""/>
			<param name="userOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_DEFAULT</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="userFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="userFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
		</params>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="id" type="k2modalselector" scope="user" default="" label="K2_SELECT_USER" description=""/>
			<param name="task" type="hidden" default="user"/>
		</url>
		<fields name="request" addfieldpath="/administrator/components/com_k2/elements">
			<fieldset name="request">
				<field name="id" type="k2modalselector" scope="user" default="" label="K2_SELECT_USER" description=""/>
				<field name="task" type="hidden" default="user"/>
			</fieldset>
		</fields>
		<fields name="params" addfieldpath="/administrator/components/com_k2/elements">
			<fieldset name="basic">
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="userCategoriesFilter" type="categories" multiple="multiple" default="" label="K2_FILTER_CATEGORIES" description=""/>
				<field name="userOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_DEFAULT</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="userFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="userFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
views/itemlist/tmpl/user_item.php000060400000000463150751650350013222 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/itemlist/tmpl/category_item.php000060400000000463150751650350014061 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
views/itemlist/view.json.php000060400000043130150751650350012172 0ustar00<?php
/**
 * @version     2.9.x
 * @package     K2
 * @author      JoomlaWorks https://www.joomlaworks.net
 * @copyright   Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license     GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $document = JFactory::getDocument();
        if (K2_JVERSION == '15') {
            $document->setMimeEncoding('application/json');
            $document->setType('json');
        }
        $model = $this->getModel('itemlist');

        // Set limit for model
        $limit = JRequest::getInt('limit');
        if ($limit > 100 || $limit == 0) {
            $limit = 100;
            JRequest::setVar('limit', $limit);
        }
        $page = JRequest::getInt('page');
        if ($page <= 0) {
            $limitstart = 0;
        } else {
            $page--;
            $limitstart = $page * $limit;
        }
        JRequest::setVar('limitstart', $limitstart);

        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $response = new JObject();
        unset($response->_errors);

        // Site
        $response->site = new stdClass();
        $uri = JURI::getInstance();
        $response->site->url = $uri->toString(array('scheme', 'host', 'port'));
        $config = JFactory::getConfig();
        $response->site->name = K2_JVERSION == '30' ? $config->get('sitename') : $config->getValue('config.sitename');

        $moduleID = JRequest::getInt('moduleID');
        if ($moduleID) {
            $result = $model->getModuleItems($moduleID);
            $items = $result->items;
            $title = $result->title;
            $prefix = 'cat';
        } else {

            // Get data depending on task
            switch ($task) {

                case 'category':
                    // Get category
                    $id = JRequest::getInt('id');
                    JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                    $category = JTable::getInstance('K2Category', 'Table');
                    $category->load($id);

                    // State Check
                    if (!$category->published || $category->trash) {
                        JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                    }

                    // Access check
                    $user = JFactory::getUser();
                    if (K2_JVERSION != '15') {
                        if (!in_array($category->access, $user->getAuthorisedViewLevels())) {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                        }
                        $languageFilter = $application->getLanguageFilter();
                        $languageTag = JFactory::getLanguage()->getTag();
                        if ($languageFilter && $category->language != $languageTag && $category->language != '*') {
                            return;
                        }
                    } else {
                        if ($category->access > $user->get('aid', 0)) {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                        }
                    }

                    // Merge params
                    $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                    if ($cparams->get('inheritFrom')) {
                        $masterCategory = JTable::getInstance('K2Category', 'Table');
                        $masterCategory->load($cparams->get('inheritFrom'));
                        $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                    }
                    $params->merge($cparams);

                    // Category link
                    $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                    // Category image
                    $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                    // Category plugins
                    $dispatcher = JDispatcher::getInstance();
                    JPluginHelper::importPlugin('content');
                    $category->text = $category->description;

                    if (K2_JVERSION != '15') {
                        $dispatcher->trigger('onContentPrepare', array('com_k2.category', &$category, &$params, $limitstart));
                    } else {
                        $dispatcher->trigger('onPrepareContent', array(&$category, &$params, $limitstart));
                    }

                    $category->description = $category->text;

                    // Category K2 plugins
                    $category->event = new stdClass;
                    $category->event->K2CategoryDisplay = '';
                    JPluginHelper::importPlugin('k2');
                    $results = $dispatcher->trigger('onK2CategoryDisplay', array(&$category, &$params, $limitstart));
                    $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                    $category->text = $category->description;
                    $dispatcher->trigger('onK2PrepareContent', array(&$category, &$params, $limitstart));
                    $category->description = $category->text;

                    //Category children
                    $ordering = $params->get('subCatOrdering');
                    $children = $model->getCategoryFirstChildren($id, $ordering);
                    $subCategories = array();
                    if (count($children)) {
                        foreach ($children as $child) {
                            if ($params->get('subCatTitleItemCounter')) {
                                $child->numOfItems = $model->countCategoryItems($child->id);
                            }
                            $child->image = K2HelperUtilities::getCategoryImage($child->image, $params);
                            $child->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($child->id.':'.urlencode($child->alias))));
                            unset($child->params);
                            unset($child->access);
                            unset($child->published);
                            unset($child->trash);
                            unset($child->language);
                            $subCategories[] = $child;
                        }
                    }

                    // Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    // Set title
                    $title = $category->name;

                    // Set ordering
                    if ($params->get('singleCatOrdering')) {
                        $ordering = $params->get('singleCatOrdering');
                    } else {
                        $ordering = $params->get('catOrdering');
                    }

                    // Set parameters prefix
                    $prefix = 'cat';

                    // Prepare the JSON category object;
                    $row = new JObject();
                    unset($row->_errors);
                    $row->id = $category->id;
                    $row->alias = $category->alias;
                    $row->link = $category->link;
                    $row->name = $category->name;
                    $row->description = $category->description;
                    $row->image = $category->image;
                    $row->extraFieldsGroup = $category->extraFieldsGroup;
                    $row->ordering = $category->ordering;
                    $row->parent = $category->parent;
                    $row->children = $subCategories;
                    $row->events = $category->event;
                    //$row->plugins = $category->plugins;

                    $response->category = $row;
                    break;

                case 'user':
                    // Get user
                    $id = JRequest::getInt('id');
                    $userObject = JFactory::getUser($id);

                    // Check user status
                    if ($userObject->block) {
                        JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                    }

                    // Get K2 user profile
                    $userObject->profile = $model->getUserProfile();

                    // User image
                    $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                    // User K2 plugins
                    $userObject->event->K2UserDisplay = '';
                    if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                        $dispatcher = JDispatcher::getInstance();
                        JPluginHelper::importPlugin('k2');
                        $results = $dispatcher->trigger('onK2UserDisplay', array(&$userObject->profile, &$params, $limitstart));
                        $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                        $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                    }

                    // Set title
                    $title = $userObject->name;

                    // Set ordering
                    $ordering = $params->get('userOrdering');

                    // Set parameters prefix
                    $prefix = 'user';

                    // Prepare the JSON user object;
                    $row = new JObject();
                    unset($row->_errors);
                    //$row->id = $userObject->id;
                    $row->name = $userObject->name;
                    //$row->username = $userObject->username;
                    $row->profile = $userObject->profile;
                    if (isset($userObject->profile->plugins)) {
                        unset($userObject->profile->plugins);
                    }
                    $row->avatar = $userObject->avatar;
                    $row->events = $userObject->event;

                    $response->user = $row;
                    break;

                case 'tag':
                    // Set limit
                    $limit = $params->get('tagItemCount');

                    // Set title
                    $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.JRequest::getVar('tag');

                    // Set ordering
                    $ordering = $params->get('tagOrdering');

                    // Set parameters prefix
                    $prefix = 'tag';

                    $response->tag = JRequest::getVar('tag');
                    break;

                case 'search':

                    // Set title
                    $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');

                    // Set parameters prefix
                    $prefix = 'generic';

                    $response->search = JRequest::getVar('searchword');
                    break;

                case 'date':

                    // Set title
                    if (JRequest::getInt('day')) {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                        $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    } else {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                        $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    }
                    // Set ordering
                    $ordering = 'rdate';

                    // Set parameters prefix
                    $prefix = 'generic';

                    $response->date = JHTML::_('date', $date, $dateFormat);
                    break;

                default:
                    $user = JFactory::getUser();

                    // Set limit
                    $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');
                    // Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    // Set title
                    $title = $params->get('page_title');

                    // Set ordering
                    $ordering = $params->get('catOrdering');

                    // Set parameters prefix
                    $prefix = 'cat';

                    break;
            }

            if (!isset($ordering)) {
                $items = $model->getData();
            } else {
                $items = $model->getData($ordering);
            }
        }

        // Prepare items
        $user = JFactory::getUser();
        $cache = JFactory::getCache('com_k2_extended');
        $model = $this->getModel('item');
        $rows = array();
        for ($i = 0; $i < sizeof($items); $i++) {

            // Item group
            if ($task == "category" || $task == "") {
                $items[$i]->itemGroup = 'links';

                if ($i < ($params->get('num_links') + $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'))) {
                    $items[$i]->itemGroup = 'links';
                }
                if ($i < ($params->get('num_secondary_items') + $params->get('num_leading_items') + $params->get('num_primary_items'))) {
                    $items[$i]->itemGroup = 'secondary';
                }
                if ($i < ($params->get('num_primary_items') + $params->get('num_leading_items'))) {
                    $items[$i]->itemGroup = 'primary';
                }
                if ($i < $params->get('num_leading_items')) {
                    $items[$i]->itemGroup = 'leading';
                }
            } else {
                $items[$i]->itemGroup = '';
            }

            $itemParams = class_exists('JParameter') ? new JParameter($items[$i]->params) : new JRegistry($items[$i]->params);
            $itemParams->set($prefix.'ItemIntroText', true);
            $itemParams->set($prefix.'ItemFullText', true);
            $itemParams->set($prefix.'ItemTags', true);
            $itemParams->set($prefix.'ItemExtraFields', true);
            $itemParams->set($prefix.'ItemAttachments', true);
            $itemParams->set($prefix.'ItemRating', true);
            $itemParams->set($prefix.'ItemAuthor', true);
            $itemParams->set($prefix.'ItemImageGallery', true);
            $itemParams->set($prefix.'ItemVideo', true);
            $itemParams->set($prefix.'ItemImage', true);
            $items[$i]->params = $itemParams->toString();

            // Check if the model should use caching for preparing the item content, even if a user is logged in (improves performance)
            if ($user->guest || $task == 'tag' || $task == 'search' || $task == 'date') {
                $cacheFlag = true;
            } else {
                $cacheFlag = true;
                if (K2HelperPermissions::canEditItem($items[$i]->created_by, $items[$i]->catid)) {
                    $cacheFlag = false;
                }
            }

            // Prepare item
            if ($cacheFlag) {
                $hits = $items[$i]->hits;
                $items[$i]->hits = 0;
                JTable::getInstance('K2Category', 'Table');
                $items[$i] = $cache->call(array($model, 'prepareItem'), $items[$i], $view, $task);
                $items[$i]->hits = $hits;
            } else {
                $items[$i] = $model->prepareItem($items[$i], $view, $task);
            }

            // Plugins
            $items[$i] = $model->execPlugins($items[$i], $view, $task);

            // Trigger comments counter event
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(&$items[$i], &$params, $limitstart));
            $items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));

            // Set default image
            if ($task == 'user' || $task == 'tag' || $task == 'search' || $task == 'date') {
                $items[$i]->image = (isset($items[$i]->imageGeneric)) ? $items[$i]->imageGeneric : '';
            } else {
                if (!$moduleID) {
                    K2HelperUtilities::setDefaultImage($items[$i], $view, $params);
                }
            }

            $rows[] = $model->prepareJSONItem($items[$i]);
        }

        $response->items = $rows;

        // Prevent spammers from using the tag view
        if ($task == 'tag' && !count($response->items)) {
            $tag = JRequest::getString('tag');
            $db = JFactory::getDbo();
            $db->setQuery('SELECT id FROM #__k2_tags WHERE name = '.$db->quote($tag));
            $tagID = $db->loadResult();
            if (!$tagID) {
                JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                return false;
            }
        }

        // Output
        $json = json_encode($response);
        $callback = JRequest::getCmd('callback');
        if ($callback) {
            $document->setMimeEncoding('application/javascript');
            echo $callback.'('.$json.')';
        } else {
            echo $json;
        }
    }
}
views/itemlist/metadata.xml000060400000000354150751650350012042 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="K2_ITEM_LISTINGS">
    <message>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_USERS_OR_CATEGORIES_IN_K2</message>
  </view>
</metadata>
css/k2.print.css000060400000001035150751650350007517 0ustar00/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

/* Print-specific CSS for K2 */
a.itemPrintThisPage,
div.itemHeader h2.itemTitle span sup,
div.itemToolbar,
div.itemRatingBlock,
div.itemLinks,
div.itemSocialLinksBlock,
div.itemAttachmentsBlock,
div.itemRelated,
div.itemAuthorLatest,
div.itemVideoBlock,
div.itemNavigation {display:none;}
css/k2.css000060400000143526150751650350006400 0ustar00/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license:http://www.gnu.org/copyleft/gpl.html
 */

/*
	### Legend ###
	Colors used:
		#fafafa (light grey) used as background on all toolbars, category and user/author boxes
*/



/*------------------------------------------------------------------------------
	Common Elements
--------------------------------------------------------------------------------*/

/* --- Basic typography --- */
a:active,
a:focus {outline:0;}
img {border:none;}

/* --- Global K2 container --- */
#k2Container {padding:0 0 24px 0;}
body.contentpane #k2Container {padding:16px;} /* used in popups */

/* --- General padding --- */
.k2Padding {padding:4px;}

/* --- Clearing --- */
.clr {clear:both;height:0;line-height:0;display:block;float:none;padding:0;margin:0;border:none;}

/* --- Striped rows (add a different background color enable stripped rows in various listings with K2 content) --- */
.even {padding:2px;}
.odd {padding:2px;}

/* --- RSS feed icon --- */
div.k2FeedIcon {padding:4px 8px;}
div.k2FeedIcon a,
div.k2FeedIcon a:hover {display:block;float:right;margin:0;padding:0;width:16px;height:16px;}
div.k2FeedIcon a span,
div.k2FeedIcon a:hover span {display:none;}

/* --- Rating --- */
.itemRatingForm {display:block;vertical-align:middle;line-height:25px;float:left;}
.itemRatingLog {font-size:11px;margin:0;padding:0 0 0 4px;float:left;}
div.itemRatingForm .formLogLoading {background:url(../images/loaders/generic.gif) no-repeat left center;height:25px;padding:0 0 0 20px;}
.itemRatingList,
.itemRatingList a:hover,
.itemRatingList .itemCurrentRating {background:transparent url(../images/ratingstars.gif) left -1000px repeat-x;}
.itemRatingList {position:relative;float:left;width:125px;height:25px;overflow:hidden;list-style:none;margin:0;padding:0;background-position:left top;}
.itemRatingList li {display:inline;background:none;padding:0;}
.itemRatingList a,
.itemRatingList .itemCurrentRating {position:absolute;top:0;left:0;text-indent:-1000px;height:25px;line-height:25px;outline:none;overflow:hidden;border:none;cursor:pointer;}
.itemRatingList a:hover {background-position:left bottom;}
.itemRatingList a.one-star {width:20%;z-index:6;}
.itemRatingList a.two-stars {width:40%;z-index:5;}
.itemRatingList a.three-stars {width:60%;z-index:4;}
.itemRatingList a.four-stars {width:80%;z-index:3;}
.itemRatingList a.five-stars {width:100%;z-index:2;}
.itemRatingList .itemCurrentRating {z-index:1;background-position:0 center;margin:0;padding:0;}
span.siteRoot {display:none;}

/* --- CSS added with JavaScript --- */
.smallerFontSize {font-size:100%;line-height:inherit;}
.largerFontSize {font-size:150%;line-height:140%;}

/* --- ReCaptcha --- */
.recaptchatable .recaptcha_image_cell,
#recaptcha_table {background-color:#fff !important;}
#recaptcha_table {border-color:#ccc !important;}
#recaptcha_response_field {border-color:#ccc !important;background-color:#fff !important;}
.k2-recaptcha-v2 {margin-top:12px;}

/* --- Icon Font Support --- */
/* Reset for users with older overrides */
div.itemToolbar ul li a#fontDecrease,
div.itemToolbar ul li a#fontIncrease {font-size:14px;}
div.itemToolbar ul li a#fontDecrease img,
div.itemToolbar ul li a#fontIncrease img {background:none;}
a.ubUserFeedIcon,
a.ubUserFeedIcon:hover,
a.ubUserURL,
a.ubUserURL:hover,
span.ubUserEmail,
div.itemIsFeatured:before,
div.catItemIsFeatured:before,
div.userItemIsFeatured:before,
div.k2FeedIcon a,
div.k2FeedIcon a:hover,
div.itemToolbar ul li a#fontDecrease,
div.itemToolbar ul li a#fontIncrease {background:none;text-decoration:none;vertical-align:middle;font-family:'simple-line-icons';speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;}

/* Font assignments */
div.catItemIsFeatured:before,
div.userItemIsFeatured:before,
div.itemIsFeatured:before {content:"\e09b";}
a#fontIncrease:before {content:"\e091";}
a#fontDecrease:before {content:"\e092";}
div.k2FeedIcon a:before,
a.ubUserFeedIcon:before {content:"\e03b";}
a.ubUserURL:before {content:"\e037";}
span.ubUserEmail:before {content:"\e086";}

/* --- Primary lists in modules --- */
div.k2LatestCommentsBlock ul,
div.k2TopCommentersBlock ul,
div.k2ItemsBlock ul,
div.k2LoginBlock ul,
div.k2UserBlock ul.k2UserBlockActions,
div.k2UserBlock ul.k2UserBlockRenderedMenu,
div.k2ArchivesBlock ul,
div.k2AuthorsListBlock ul,
div.k2CategoriesListBlock ul,
div.k2UsersBlock ul {margin:0;padding:0 4px;list-style:none;} /* Example CSS: padding:0;margin:0;list-style:none; */

div.k2LatestCommentsBlock ul li,
div.k2TopCommentersBlock ul li,
div.k2ItemsBlock ul li,
div.k2LoginBlock ul li,
div.k2ArchivesBlock ul li,
div.k2AuthorsListBlock ul li,
div.k2CategoriesListBlock ul li,
div.k2UsersBlock ul li {display:block;padding:0;margin:0 0 24px 0;} /* Example CSS: display:block;clear:both;padding:2px 0;border-bottom:1px dotted #ccc; */

.clearList {display:none;float:none;clear:both;} /* this class is used to clear all previous floating list elements */
.lastItem {border:none;} /* class appended on last list item */

/* --- Avatars --- */
.k2Avatar img {display:block;float:left;background:#fff;border:1px solid #ddd;border-radius:50%;padding:2px;margin:2px 4px 4px 0;}

/* --- Read more --- */
a.k2ReadMore {}
a.k2ReadMore:hover {}

/* --- Pagination --- */
div.k2Pagination {padding:8px;margin:24px 0 4px 0;text-align:center;}
div.k2Pagination ul {text-align:center;}
div.k2Pagination ul li {display:inline-block;margin:0;padding:0;}
div.k2Pagination ul li a {display:inline-block;padding:4px 8px;margin:0 8px;border:1px solid #ddd;border-radius:4px;vertical-align:middle;background:#fff;text-decoration:none;}
div.k2Pagination ul li a:hover {background:#fafafa;cursor:pointer;}
div.k2Pagination ul li.active a {background:#fafafa;}
div.k2Pagination ul li a span {vertical-align:middle;}

/* --- Extra fields: CSV data styling --- */
table.csvData {}
table.csvData tr th {}
table.csvData tr td {}

/* --- Featured flags: the classes are repeated further below to indicate placement in the CSS structure --- */
div.itemIsFeatured,
div.catItemIsFeatured,
div.userItemIsFeatured {position:relative;}
div.itemIsFeatured:before,
div.catItemIsFeatured:before,
div.userItemIsFeatured:before {position:absolute;top:10px;right:10px;color:#CF1919;font-size:20px;}

/* --- Separators --- */
.k2HorizontalSep {border:0;padding:0;margin:0 8px;}

/* --- Edit Buttons --- */
span.itemEditLink,
span.catItemEditLink,
span.userItemEditLink,
span.userItemAddLink {float:right;display:block;padding:0;margin:0;width:120px;text-align:right;}
	span.itemEditLink a,
	span.catItemEditLink a,
	span.userItemEditLink a,
	span.userItemAddLink a {display:inline-block;padding:4px 8px;margin:0;background:#2d96dd;color:#fff;border:0;border-radius:4px;font-size:11px;line-height:100%;font-weight:bold;text-align:center;text-decoration:none;}
	span.itemEditLink a:hover,
	span.catItemEditLink a:hover,
	span.userItemEditLink a:hover,
	span.userItemAddLink a:hover {background:#217dbb;}



/*------------------------------------------------------------------------------
	Component - Item view
--------------------------------------------------------------------------------*/
a.itemPrintThisPage {display:block;width:160px;margin:4px auto 16px;padding:8px;border:1px solid #ddd;border-radius:4px;text-align:center;font-size:14px;}
a.itemPrintThisPage:hover {background:#fafafa;text-decoration:none;}

div.itemView {padding:8px 0 24px 0;margin:0 0 24px 0;} /* this is the item container for this view */
div.itemIsFeatured {} /* Attach a class for each featured item */

span.itemEditLink {}
	span.itemEditLink a {}
	span.itemEditLink a:hover {}

div.itemHeader {}
	div.itemHeader span.itemDateCreated {color:#999;font-size:11px;}
	div.itemHeader h2.itemTitle {padding:10px 0 4px 0;margin:0;}
	div.itemHeader h2.itemTitle span {}
	div.itemHeader h2.itemTitle span sup {font-size:12px;color:#CF1919;text-decoration:none;} /* "Featured" presented in superscript */
	div.itemHeader span.itemAuthor {display:block;padding:0;margin:0;}
	div.itemHeader span.itemAuthor a:before {content:" ";}
	div.itemHeader span.itemAuthor a {}
	div.itemHeader span.itemAuthor a:hover {}

div.itemToolbar {padding:8px;margin:16px 0 0 0;background:#fafafa;border-radius:4px;}
	div.itemToolbar ul {text-align:right;list-style:none;padding:0;margin:0;}
	div.itemToolbar ul li {display:inline;list-style:none;padding:0 4px 0 8px;margin:0;border-left:1px solid #ccc;text-align:center;background:none;font-size:12px;}
	div.itemToolbar ul > li:first-child {border:none;} /* remove the first CSS border from the left of the toolbar */
	div.itemToolbar ul li a {font-size:12px;font-weight:normal;}
	div.itemToolbar ul li a:hover {}
	div.itemToolbar ul li a span {}
	div.itemToolbar ul li a.itemPrintLink {}
	div.itemToolbar ul li a.itemPrintLink span {}
	div.itemToolbar ul li a.itemEmailLink {}
	div.itemToolbar ul li a.itemEmailLink span {}
	div.itemToolbar ul li a.itemVideoLink {}
	div.itemToolbar ul li a.itemVideoLink span {}
	div.itemToolbar ul li a.itemImageGalleryLink {}
	div.itemToolbar ul li a.itemImageGalleryLink span {}
	div.itemToolbar ul li a.itemCommentsLink {}
	div.itemToolbar ul li a.itemCommentsLink span {}
	div.itemToolbar ul li a img {vertical-align:middle;}
	div.itemToolbar ul li span.itemTextResizerTitle {}
	div.itemToolbar ul li a#fontDecrease {margin:0 0 0 2px;}
	div.itemToolbar ul li a#fontDecrease img {width:13px;height:13px;font-size:13px;}
	div.itemToolbar ul li a#fontIncrease {margin:0 0 0 2px;}
	div.itemToolbar ul li a#fontIncrease img {width:13px;height:13px;font-size:13px;}
	div.itemToolbar ul li a#fontDecrease span,
	div.itemToolbar ul li a#fontIncrease span {display:none;}

div.itemRatingBlock {padding:8px 0;}
	div.itemRatingBlock span {display:block;float:left;font-style:normal;padding:0 4px 0 0;margin:0;color:#999;}

div.itemBody {padding:8px 0;margin:0;}

div.itemImageBlock {padding:8px 0;margin:0 0 16px 0;}
	span.itemImage {display:block;text-align:center;margin:0 0 8px 0;}
	span.itemImage img {max-width:100%;height:auto;}
	span.itemImageCaption {color:#666;float:left;display:block;font-size:11px;}
	span.itemImageCredits {color:#999;float:right;display:block;font-style:italic;font-size:11px;}
	@media screen and ( max-width:600px ){
		span.itemImageCaption,
		span.itemImageCredits {float:none;text-align:center;}
	}

div.itemIntroText {color:#444;font-size:18px;font-weight:bold;line-height:24px;padding:4px 0 12px 0;}
	div.itemIntroText img {}

div.itemFullText {}
	div.itemFullText h3 {margin:0;padding:16px 0 4px 0;}
	div.itemFullText p {}
	div.itemFullText img {}

div.itemExtraFields {margin:16px 0 0 0;padding:8px 0 0 0;border-top:1px dotted #ddd;}
	div.itemExtraFields h3 {margin:0;padding:0 0 8px 0;}
	div.itemExtraFields ul {margin:0;padding:0;list-style:none;}
	div.itemExtraFields ul li {display:block;}
	div.itemExtraFields ul li span.itemExtraFieldsLabel {display:block;float:left;font-weight:bold;margin:0 4px 0 0;width:30%;}
	div.itemExtraFields ul li span.itemExtraFieldsValue {}

div.itemContentFooter {display:block;text-align:right;padding:4px 0;margin:16px 0 4px 0;color:#999;}
	span.itemHits {float:left;}
	span.itemDateModified {}

div.itemSocialSharing {padding:8px 0;}
	div.itemTwitterButton {float:left;margin:2px 24px 0 0;}
	div.itemFacebookButton {float:left;margin-right:24px;width:200px;}
	div.itemGooglePlusOneButton {}

div.itemLinks {margin:16px 0;padding:0;}

div.itemCategory {}
	div.itemCategory span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.itemCategory a {}
div.itemTagsBlock {}
	div.itemTagsBlock span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.itemTagsBlock ul.itemTags {list-style:none;padding:0;margin:0;display:inline;}
	div.itemTagsBlock ul.itemTags li {display:inline;list-style:none;padding:0 4px 0 0;margin:0;text-align:center;}
	div.itemTagsBlock ul.itemTags li a:before {content:"#";}
	div.itemTagsBlock ul.itemTags li a {}
	div.itemTagsBlock ul.itemTags li a:hover {}

div.itemAttachmentsBlock {padding:4px;border-bottom:1px dotted #ccc;}
	div.itemAttachmentsBlock span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.itemAttachmentsBlock ul.itemAttachments {list-style:none;padding:0;margin:0;display:inline;}
	div.itemAttachmentsBlock ul.itemAttachments li {display:inline;list-style:none;padding:0 4px;margin:0;text-align:center;}
	div.itemAttachmentsBlock ul.itemAttachments li a {}
	div.itemAttachmentsBlock ul.itemAttachments li a:hover {}
	div.itemAttachmentsBlock ul.itemAttachments li span {font-size:10px;color:#999;font-weight:normal;}

/* Author block */
div.itemAuthorBlock {background:#fafafa;border:1px solid #ddd;border-radius:4px;margin:0 0 16px 0;padding:8px;}
	div.itemAuthorBlock img.itemAuthorAvatar {float:left;display:block;background:#fff;padding:4px;border:1px solid #ddd;margin:0 8px 0 0;border-radius:50%;}
	div.itemAuthorBlock div.itemAuthorDetails {margin:0;padding:4px 0 0 0;}
	div.itemAuthorBlock div.itemAuthorDetails h3.authorName {margin:0 0 4px 0;padding:0;}
	div.itemAuthorBlock div.itemAuthorDetails h3.authorName a {font-size:16px;}
	div.itemAuthorBlock div.itemAuthorDetails h3.authorName a:hover {}
	div.itemAuthorBlock div.itemAuthorDetails p {}
	div.itemAuthorBlock div.itemAuthorDetails span.itemAuthorUrl {font-weight:bold;color:#555;}
	div.itemAuthorBlock div.itemAuthorDetails span.itemAuthorEmail {font-weight:bold;color:#555;}
	div.itemAuthorBlock div.itemAuthorDetails span.itemAuthorUrl a,
	div.itemAuthorBlock div.itemAuthorDetails span.itemAuthorEmail a {font-weight:normal;}

/* Author latest */
div.itemAuthorLatest {margin-bottom:16px;padding:0;}
	div.itemAuthorLatest h3 {}
	div.itemAuthorLatest ul {}
		div.itemAuthorLatest ul li {}
			div.itemAuthorLatest ul li a {}
			div.itemAuthorLatest ul li a:hover {}

/* Related by tag */
div.itemRelated {margin-bottom:16px;padding:0;} /* Add overflow-x:scroll; if you want to enable the scrolling features, as explained in item.php */
	div.itemRelated h3 {}
	div.itemRelated ul {}
		div.itemRelated ul li {}
		div.itemRelated ul li.k2ScrollerElement {float:left;overflow:hidden;border:1px solid #ddd;padding:4px;margin:0 4px 4px 0;background:#fff;} /* you need to insert this class in the related li element in item.php for this styling to take effect */
		div.itemRelated ul li.clr {clear:both;height:0;line-height:0;display:block;float:none;padding:0;margin:0;border:none;}
			a.itemRelTitle {}
			div.itemRelCat {}
				div.itemRelCat a {}
			div.itemRelAuthor {}
				div.itemRelAuthor a {}
			img.itemRelImg {}
			div.itemRelIntrotext {}
			div.itemRelFulltext {}
			div.itemRelMedia {}
			div.itemRelImageGallery {}

/* Video */
div.itemVideoBlock {margin:0 0 16px 0;padding:16px;background:#010101 url(../images/videobg.gif) repeat-x bottom;color:#eee;}
	div.itemVideoBlock div.itemVideoEmbedded {text-align:center;} /* for embedded videos (not using AllVideos) */
	div.itemVideoBlock span.itemVideo {display:block;overflow:hidden;}
	div.itemVideoBlock span.itemVideoCaption {color:#eee;float:left;display:block;font-size:11px;font-weight:bold;width:60%;}
	div.itemVideoBlock span.itemVideoCredits {color:#eee;float:right;display:block;font-style:italic;font-size:11px;width:35%;text-align:right;}
	@media screen and ( max-width:600px ){
		div.itemVideoBlock span.itemVideoCaption,
		div.itemVideoBlock span.itemVideoCredits {float:none;text-align:center;width:auto;}
	}

/* Image Gallery */
div.itemImageGallery {margin:0 0 16px 0;padding:0;}

/* Article navigation */
div.itemNavigation {padding:8px;margin:0 0 24px 0;background:#fafafa;border-radius:4px;}
	div.itemNavigation span.itemNavigationTitle {color:#999;}
	div.itemNavigation a.itemPrevious {padding:0 12px;}
	div.itemNavigation a.itemNext {padding:0 12px;}

/* Comments */
div.itemComments {background:#fafafa;border:1px solid #ddd;border-radius:4px;padding:16px;}

	div.itemComments ul.itemCommentsList {margin:0 0 16px;padding:0;list-style:none;}
	div.itemComments ul.itemCommentsList li {display:block;padding:4px;margin:0 0 8px 0;border-bottom:1px solid #ddd;background:#fff;}
	div.itemComments ul.itemCommentsList li.authorResponse {background:#f5fdff;}
	div.itemComments ul.itemCommentsList li.unpublishedComment {background:#ffeaea;}
	div.itemComments ul.itemCommentsList li img {float:left;margin:4px 4px 4px 0;padding:4px;}
	div.itemComments ul.itemCommentsList li span.commentDate {padding:0 4px 0 0;margin:0 8px 0 0;border-right:1px solid #ccc;font-weight:bold;font-size:14px;}
	div.itemComments ul.itemCommentsList li span.commentAuthorName {font-weight:bold;font-size:14px;}
	div.itemComments ul.itemCommentsList li p {padding:4px 0;}
	div.itemComments ul.itemCommentsList li span.commentAuthorEmail {display:none;}
	div.itemComments ul.itemCommentsList li span.commentLink {float:right;margin-left:8px;}
	div.itemComments ul.itemCommentsList li span.commentLink a {font-size:11px;color:#999;text-decoration:underline;}
	div.itemComments ul.itemCommentsList li span.commentLink a:hover {font-size:11px;color:#555;text-decoration:underline;}

	div.itemComments ul.itemCommentsList li span.commentToolbar {display:block;clear:both;}
	div.itemComments ul.itemCommentsList li span.commentToolbar a {font-size:11px;color:#999;text-decoration:underline;margin-right:4px;}
	div.itemComments ul.itemCommentsList li span.commentToolbar a:hover {font-size:11px;color:#555;text-decoration:underline;}
	div.itemComments ul.itemCommentsList li span.commentToolbarLoading {background:url(../images/loaders/search.gif) no-repeat 100% 50%;}

div.itemCommentsPagination {padding:4px;margin:0 0 24px 0;}
	/* Joomla 1.5 - 2.5 */
	div.itemCommentsPagination span.pagination {display:block;float:right;clear:both;}
	/* Joomla 3.x */
	div.itemCommentsPagination ul {text-align:center;}
	div.itemCommentsPagination ul li {display:inline-block;margin:0;padding:0;}
	div.itemCommentsPagination ul li a {display:inline-block;padding:4px 8px;margin:0 8px;border:1px solid #ddd;border-radius:4px;vertical-align:middle;background:#fff;text-decoration:none;}
	div.itemCommentsPagination ul li a:hover {background:#fafafa;cursor:pointer;}
	div.itemCommentsPagination ul li.active a {background:#fafafa;}
	div.itemCommentsPagination ul li a span {vertical-align:middle;}

div.itemCommentsForm h3 {margin:0;padding:0 0 4px 0;}
	div.itemCommentsForm p.itemCommentsFormNotes {border-top:2px solid #ccc;padding:8px 0;}
	div.itemCommentsForm form {margin:0;padding:0;width:100%;}
	div.itemCommentsForm form label.formComment,
	div.itemCommentsForm form label.formName,
	div.itemCommentsForm form label.formEmail,
	div.itemCommentsForm form label.formUrl,
	div.itemCommentsForm form label.formRecaptcha {display:block;margin:12px 0 0 2px;}
	div.itemCommentsForm form textarea.inputbox {display:block;width:100%;height:200px;margin:0;padding:8px;box-sizing:border-box;}
	div.itemCommentsForm form input.inputbox {display:block;width:100%;margin:0;padding:8px;line-height:150%;height:auto;box-sizing:border-box;}
	div.itemCommentsForm form input#submitCommentButton {display:block;margin:16px 0 0 0;padding:8px 16px;background:#2d96dd;color:#fff;border:0;border-radius:4px;font-size:16px;font-weight:bold;}
	div.itemCommentsForm form input#submitCommentButton:hover {background:#217dbb;}
	div.itemCommentsForm form span#formLog {margin:24px;padding:8px 12px;border-radius:4px;text-align:center;display:none;}
		div.itemCommentsForm form span#formLog.k2FormLogError {display:block;background:#f00;color:#fff;}
		div.itemCommentsForm form span#formLog.k2FormLogSuccess {display:block;background:#18ac00;color:#fff;}
	div.itemCommentsForm form .formLogLoading {background:url(../images/loaders/generic.gif) no-repeat left center;}

div.itemCommentsLoginFirst {display:block;margin:24px;padding:8px 12px;background:#f00;color:#fff;border-radius:4px;}

/* "Report comment" form */
div.k2ReportCommentFormContainer {padding:8px;width:480px;margin:0 auto;}
	div.k2ReportCommentFormContainer blockquote {width:462px;background:#fafafa;border:1px solid #ddd;padding:8px;margin:0 0 8px 0;}
	div.k2ReportCommentFormContainer blockquote span.quoteIconLeft {font-style:italic;font-weight:bold;font-size:40px;color:#135CAE;line-height:30px;vertical-align:top;display:block;float:left;}
	div.k2ReportCommentFormContainer blockquote span.quoteIconRight {font-style:italic;font-weight:bold;font-size:40px;color:#135CAE;line-height:30px;vertical-align:top;display:block;float:right;}
	div.k2ReportCommentFormContainer blockquote span.theComment {font-style:italic;font-size:12px;font-weight:normal;color:#000;padding:0 4px;}
	div.k2ReportCommentFormContainer form label {display:block;font-weight:bold;}
	div.k2ReportCommentFormContainer form input,
	div.k2ReportCommentFormContainer form textarea {display:block;border:1px solid #ddd;font-size:12px;padding:2px;margin:0 0 8px 0;width:474px;}
	div.k2ReportCommentFormContainer form #recaptcha {margin-bottom:24px;}
	div.k2ReportCommentFormContainer form span#formLog {margin:24px;padding:8px 12px;background:#fafafa;border-radius:4px;text-align:center;display:none;}
	div.k2ReportCommentFormContainer form .formLogLoading {background:url(../images/loaders/generic.gif) no-repeat left center;}

/* Back to top link */
div.itemBackToTop {text-align:right;}
	div.itemBackToTop a {text-decoration:underline;}
	div.itemBackToTop a:hover {text-decoration:underline;}



/*------------------------------------------------------------------------------
	Component - Itemlist view (category)
--------------------------------------------------------------------------------*/

div.itemListCategoriesBlock {}

/* --- Category block --- */
div.itemListCategory {background:#fafafa;border:1px solid #ddd;border-radius:4px;margin:0 0 24px 0;padding:8px;}
	span.catItemAddLink {display:block;padding:8px 0;margin:0 0 4px 0;border-bottom:1px dotted #ccc;text-align:right;}
	span.catItemAddLink a {padding:4px 16px;border:1px solid #ddd;background:#fafafa;text-decoration:none;}
	span.catItemAddLink a:hover {background:#ffffcc;}
	div.itemListCategory img {float:left;display:block;margin:0 8px 0 0;}
	div.itemListCategory h2 {}
	div.itemListCategory p {}

/* --- Sub-category block --- */
div.itemListSubCategories {}
	div.itemListSubCategories h3 {}
		div.subCategoryContainer {float:left;}
		div.subCategoryContainerLast {} /* this class is appended to the last container on each row of items (useful when you want to set 0 padding/margin to the last container) */
			div.subCategory {background:#fafafa;border:1px solid #ddd;margin:4px;padding:8px;}
				div.subCategory a.subCategoryImage,
				div.subCategory a.subCategoryImage:hover {text-align:center;display:block;}
				div.subCategory a.subCategoryImage img,
				div.subCategory a.subCategoryImage:hover img {margin:0 8px 0 0;}
				div.subCategory h2 {}
				div.subCategory h2 a {}
				div.subCategory h2 a:hover {}
				div.subCategory p {}

/* --- Item groups --- */
div.itemList {}
	div#itemListLeading {}
	div#itemListPrimary {}
	div#itemListSecondary {}
	div#itemListLinks {background:#fafafa;border:1px solid #ddd;margin:8px 0;padding:8px;}

		div.itemContainer {float:left;}
		div.itemContainerLast {} /* this class is appended to the last container on each row of items (useful when you want to set 0 padding/margin to the last container) */
		@media screen and ( max-width:600px ){
			div.itemContainer, div.subCategoryContainer {float:none;display:block;width:100%!important;}
		}

/* --- Item block for each item group --- */
div.catItemView {margin-bottom:48px;padding:4px;} /* this is the container for each K2 item on this view */

	/* Additional class appended to the element above for further styling per group item */
	div.groupLeading {}
	div.groupPrimary {}
	div.groupSecondary {}
	div.groupLinks {padding:0;margin:0;}

	div.catItemIsFeatured {} /* Attach a class for each featured item */

span.catItemEditLink {}
	span.catItemEditLink a {}
	span.catItemEditLink a:hover {}

div.catItemHeader {}
	div.catItemHeader span.catItemDateCreated {color:#999;font-size:11px;}
	div.catItemHeader h3.catItemTitle {padding:10px 0 4px 0;margin:0;}
	div.catItemHeader h3.catItemTitle span {}
	div.catItemHeader h3.catItemTitle span sup {font-size:12px;color:#CF1919;text-decoration:none;} /* superscript */
	div.catItemHeader span.catItemAuthor {display:block;padding:0;margin:0;}
	div.catItemHeader span.catItemAuthor a {}
	div.catItemHeader span.catItemAuthor a:hover {}

div.catItemRatingBlock {padding:8px 0;}
	div.catItemRatingBlock span {display:block;float:left;font-style:normal;padding:0 4px 0 0;margin:0;color:#999;}

div.catItemBody {padding:8px 0;margin:0;}

div.catItemImageBlock {padding:8px 0;margin:0 0 16px 0;}
	span.catItemImage {display:block;text-align:center;margin:0 0 8px 0;}
	span.catItemImage img {max-width:100%;height:auto;}

div.catItemIntroText {font-size:inherit;font-weight:normal;line-height:inherit;padding:4px 0 12px 0;}
	div.catItemIntroText img {}

div.catItemExtraFields,
div.genericItemExtraFields {margin:16px 0 0 0;padding:8px 0 0 0;border-top:1px dotted #ddd;}
	div.catItemExtraFields h4,
	div.genericItemExtraFields h4 {margin:0;padding:0 0 8px 0;}
	div.catItemExtraFields ul,
	div.genericItemExtraFields ul {margin:0;padding:0;list-style:none;}
	div.catItemExtraFields ul li,
	div.genericItemExtraFields ul li {display:block;}
	div.catItemExtraFields ul li span.catItemExtraFieldsLabel,
	div.genericItemExtraFields ul li span.genericItemExtraFieldsLabel {display:block;float:left;font-weight:bold;margin:0 4px 0 0;width:30%;}
	div.catItemExtraFields ul li span.catItemExtraFieldsValue {}

div.catItemLinks {margin:0 0 16px 0;padding:0;}

div.catItemHitsBlock {padding:4px 0;}
	span.catItemHits {}

div.catItemCategory {padding:4px 0;}
	div.catItemCategory span {font-weight:bold;padding:0 4px 0 0;}
	div.catItemCategory a {}

div.catItemTagsBlock {padding:4px 0;}
	div.catItemTagsBlock span {font-weight:bold;padding:0 4px 0 0;}
	div.catItemTagsBlock ul.catItemTags {list-style:none;padding:0;margin:0;display:inline;}
	div.catItemTagsBlock ul.catItemTags li {display:inline;list-style:none;padding:0 4px 0 0;margin:0;text-align:center;}
	div.catItemTagsBlock ul.catItemTags li a:before {content:"#";}
	div.catItemTagsBlock ul.catItemTags li a {}
	div.catItemTagsBlock ul.catItemTags li a:hover {}

div.catItemAttachmentsBlock {padding:4px;border-bottom:1px dotted #ccc;}
	div.catItemAttachmentsBlock span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.catItemAttachmentsBlock ul.catItemAttachments {list-style:none;padding:0;margin:0;display:inline;}
	div.catItemAttachmentsBlock ul.catItemAttachments li {display:inline;list-style:none;padding:0 4px;margin:0;text-align:center;}
	div.catItemAttachmentsBlock ul.catItemAttachments li a {}
	div.catItemAttachmentsBlock ul.catItemAttachments li a:hover {}
	div.catItemAttachmentsBlock ul.catItemAttachments li span {font-size:10px;color:#999;font-weight:normal;}

/* Video */
div.catItemVideoBlock {margin:0 0 16px 0;padding:16px;background:#010101 url(../images/videobg.gif) repeat-x bottom;}
	div.catItemVideoBlock div.catItemVideoEmbedded {text-align:center;} /* for embedded videos (not using AllVideos) */
	div.catItemVideoBlock span.catItemVideo {display:block;}

/* Image Gallery */
div.catItemImageGallery {margin:0 0 16px 0;padding:0;}

/* Anchor link to comments */
div.catItemCommentsLink {display:inline;margin:0 8px 0 0;padding:0 8px 0 0;border-right:1px solid #ccc;}
	div.catItemCommentsLink a {}
	div.catItemCommentsLink a:hover {}

/* Read more link */
div.catItemReadMore {display:inline;}
	div.catItemReadMore a {}
	div.catItemReadMore a:hover {}

/* Modified date */
span.catItemDateModified {display:block;text-align:right;padding:4px;margin:4px 0;color:#999;border-top:1px solid #ddd;}



/*------------------------------------------------------------------------------
	Component - Itemlist view (user)
--------------------------------------------------------------------------------*/

/* User info block */
div.userView {}
	div.userBlock {background:#fafafa;border:1px solid #ddd;border-radius:4px;margin:0 0 24px 0;padding:8px;}

		div.userBlock img {display:block;float:left;background:#fff;padding:4px;border:1px solid #ddd;margin:0 8px 0 0;border-radius:50%;}
		div.userBlock h2 {}
		div.userBlock div.userDescription {padding:4px 0;}
		div.userBlock div.userAdditionalInfo {padding:4px 0;margin:8px 0 0 0;}
			span.userURL {font-weight:bold;color:#555;display:block;}
			span.userEmail {font-weight:bold;color:#555;display:block;}

		div.userItemList {}

/* User items */
div.userItemView {margin-bottom:48px;} /* this is the item container for this view */
div.userItemIsFeatured {} /* Attach a class for each featured item */

div.userItemViewUnpublished {opacity:0.9;border:4px dashed #ccc;background:#fffff2;padding:8px;margin:8px 0;}

span.userItemEditLink {}
	span.userItemEditLink a {}
	span.userItemEditLink a:hover {}

div.userItemHeader {}
	div.userItemHeader span.userItemDateCreated {color:#999;font-size:11px;}
	div.userItemHeader h3.userItemTitle {padding:10px 0 4px 0;margin:0;}
	div.userItemHeader h3.userItemTitle span sup {font-size:12px;color:#CF1919;text-decoration:none;} /* "Unpublished" presented in superscript */

div.userItemBody {padding:8px 0;margin:0;}

div.userItemImageBlock {padding:0;margin:0;float:left;}
	span.userItemImage {display:block;text-align:center;margin:0 8px 8px 0;}
	span.userItemImage img {max-width:100%;height:auto;}

div.userItemIntroText {font-size:inherit;font-weight:normal;line-height:inherit;padding:4px 0 12px 0;}
	div.userItemIntroText img {}

div.userItemLinks {margin:0 0 16px 0;padding:0;}

div.userItemCategory {padding:4px 0;}
	div.userItemCategory span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.userItemCategory a {}

div.userItemTagsBlock {padding:4px 0;}
	div.userItemTagsBlock span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.userItemTagsBlock ul.userItemTags {list-style:none;padding:0;margin:0;display:inline;}
	div.userItemTagsBlock ul.userItemTags li {display:inline;list-style:none;padding:0 4px 0 0;margin:0;text-align:center;}
	div.userItemTagsBlock ul.userItemTags li a:before {content:"#";}
	div.userItemTagsBlock ul.userItemTags li a {}
	div.userItemTagsBlock ul.userItemTags li a:hover {}

/* Anchor link to comments */
div.userItemCommentsLink {display:inline;margin:0 8px 0 0;padding:0 8px 0 0;border-right:1px solid #ccc;}
	div.userItemCommentsLink a {}
	div.userItemCommentsLink a:hover {}

/* Read more link */
div.userItemReadMore {display:inline;}
	div.userItemReadMore a {}
	div.userItemReadMore a:hover {}



/*------------------------------------------------------------------------------
	Component - Itemlist view (tag)
--------------------------------------------------------------------------------*/
div.tagView {}

div.tagItemList {}

div.tagItemView {margin-bottom:48px;} /* this is the item container for this view */

div.tagItemHeader {}
	div.tagItemHeader span.tagItemDateCreated {color:#999;font-size:11px;}
	div.tagItemHeader h2.tagItemTitle {padding:10px 0 4px 0;margin:0;}

div.tagItemBody {padding:8px 0;margin:0;}

div.tagItemImageBlock {padding:0;margin:0;float:left;}
	span.tagItemImage {display:block;text-align:center;margin:0 8px 8px 0;}
	span.tagItemImage img {max-width:100%;height:auto;}

div.tagItemIntroText {font-size:inherit;font-weight:normal;line-height:inherit;padding:4px 0 12px 0;}
	div.tagItemIntroText img {}

	div.tagItemExtraFields {}
		div.tagItemExtraFields h4 {}
		div.tagItemExtraFields ul {}
			div.tagItemExtraFields ul li {}
				div.tagItemExtraFields ul li span.tagItemExtraFieldsLabel {}
				div.tagItemExtraFields ul li span.tagItemExtraFieldsValue {}

	div.tagItemCategory {display:inline;margin:0 8px 0 0;padding:0 8px 0 0;border-right:1px solid #ccc;}
		div.tagItemCategory span {font-weight:bold;color:#555;padding:0 4px 0 0;}
		div.tagItemCategory a {}

/* Read more link */
div.tagItemReadMore {display:inline;}
	div.tagItemReadMore a {}
	div.tagItemReadMore a:hover {}



/*------------------------------------------------------------------------------
	Component - Itemlist view (generic)
--------------------------------------------------------------------------------*/
div.genericView {}

div.genericItemList {}

div.genericItemView {margin-bottom:48px;} /* this is the item container for this view */

div.genericItemHeader {}
	div.genericItemHeader span.genericItemDateCreated {color:#999;font-size:11px;}
	div.genericItemHeader h2.genericItemTitle {padding:10px 0 4px 0;margin:0;}

div.genericItemBody {padding:8px 0;margin:0;}

div.genericItemImageBlock {padding:0;margin:0;float:left;}
	span.genericItemImage {display:block;text-align:center;margin:0 8px 8px 0;}
	span.genericItemImage img {max-width:100%;height:auto;}

div.genericItemIntroText {font-size:inherit;font-weight:normal;line-height:inherit;padding:4px 0 12px 0;}
	div.genericItemIntroText img {}

	div.genericItemExtraFields {}
		div.genericItemExtraFields h4 {}
		div.genericItemExtraFields ul {}
			div.genericItemExtraFields ul li {}
				div.genericItemExtraFields ul li span.genericItemExtraFieldsLabel {}
				div.genericItemExtraFields ul li span.genericItemExtraFieldsValue {}

	div.genericItemCategory {display:inline;margin:0 8px 0 0;padding:0 8px 0 0;border-right:1px solid #ccc;}
		div.genericItemCategory span {font-weight:bold;color:#555;padding:0 4px 0 0;}
		div.genericItemCategory a {}

/* Read more link */
div.genericItemReadMore {display:inline;}
	div.genericItemReadMore a {}
	div.genericItemReadMore a:hover {}

/* No results found message */
div#genericItemListNothingFound {padding:40px;text-align:center;}
	div#genericItemListNothingFound p {font-size:20px;color:#999;}

/* --- Google Search (use Firebug or similar tools to inspect the generated HTML, then style accordingly --- */
#k2GoogleSearchContainer .gsc-control {width:auto !important;}
#k2GoogleSearchContainer .gsc-control .gsc-above-wrapper-area,
#k2GoogleSearchContainer .gsc-control .gsc-resultsHeader,
#k2GoogleSearchContainer .gsc-control .gsc-url-bottom {display:none !important;} /* Hide unneeded elements of the results page */



/*------------------------------------------------------------------------------
	Component - Latest view
--------------------------------------------------------------------------------*/

div.latestItemsContainer {float:left;}
@media screen and ( max-width:600px ){
	div.latestItemsContainer {float:none;display:block;width:100%!important;}
}

/* Category info block */
div.latestItemsCategory {background:#fafafa;border:1px solid #ddd;border-radius:4px;margin:0 8px 24px 0;padding:8px;}
	div.latestItemsCategoryImage {text-align:center;}
	div.latestItemsCategoryImage img {margin:0 8px 0 0;}
div.latestItemsCategory h2 {}
div.latestItemsCategory p {}

/* User info block */
div.latestItemsUser {background:#fafafa;border:1px solid #ddd;border-radius:4px;margin:0 8px 24px 0;padding:8px;}
	div.latestItemsUser img {display:block;float:left;background:#fff;padding:4px;border:1px solid #ddd;margin:0 8px 0 0;border-radius:50%;}
	div.latestItemsUser h2 {}
	div.latestItemsUser p.latestItemsUserDescription {padding:4px 0;}
	div.latestItemsUser p.latestItemsUserAdditionalInfo {padding:4px 0;margin:8px 0 0 0;}
		span.latestItemsUserURL {font-weight:bold;color:#555;display:block;}
		span.latestItemsUserEmail {font-weight:bold;color:#555;display:block;}

/* Latest items list */
div.latestItemList {padding:0 8px 8px 0;}

div.latestItemView {} /* this is the item container for this view */

div.latestItemHeader {}
	div.latestItemHeader h3.latestItemTitle {padding:10px 0 4px 0;margin:0;}

span.latestItemDateCreated {color:#999;font-size:11px;}

div.latestItemBody {padding:8px 0;margin:0;}

div.latestItemImageBlock {padding:0;margin:0;float:left;}
	span.latestItemImage {display:block;text-align:center;margin:0 8px 8px 0;}
	span.latestItemImage img {max-width:100%;height:auto;}
	@media screen and ( max-width:600px ){
		div.latestItemImageBlock {float:none;display:block;}
	}

div.latestItemIntroText {font-size:inherit;font-weight:normal;line-height:inherit;padding:4px 0 12px 0;}
	div.latestItemIntroText img {}

div.latestItemLinks {margin:0 0 16px 0;padding:0;}

div.latestItemCategory {padding:4px 0;}
	div.latestItemCategory span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.latestItemCategory a {}

div.latestItemTagsBlock {padding:4px 0;}
	div.latestItemTagsBlock span {font-weight:bold;color:#555;padding:0 4px 0 0;}
	div.latestItemTagsBlock ul.latestItemTags {list-style:none;padding:0;margin:0;display:inline;}
	div.latestItemTagsBlock ul.latestItemTags li {display:inline;list-style:none;padding:0 4px 0 0;margin:0;text-align:center;}
	div.latestItemTagsBlock ul.latestItemTags li a:before {content:"#";}
	div.latestItemTagsBlock ul.latestItemTags li a {}
	div.latestItemTagsBlock ul.latestItemTags li a:hover {}

/* Video */
div.latestItemVideoBlock {margin:0 0 16px 0;padding:16px;background:#010101 url(../images/videobg.gif) repeat-x bottom;}
	div.latestItemVideoBlock span.latestItemVideo {display:block;}

/* Anchor link to comments */
div.latestItemCommentsLink {display:inline;margin:0 8px 0 0;padding:0 8px 0 0;border-right:1px solid #ccc;}
	div.latestItemCommentsLink a {}
	div.latestItemCommentsLink a:hover {}

/* Read more link */
div.latestItemReadMore {display:inline;}
	div.latestItemReadMore a {}
	div.latestItemReadMore a:hover {}

/* Items presented in a list */
h2.latestItemTitleList {padding:2px 0;margin:8px 0 2px 0;border-bottom:1px dotted #ccc;}



/*------------------------------------------------------------------------------
	Component - Register & profile page views (register.php & profile.php)
--------------------------------------------------------------------------------*/
.k2AccountPage {}
.k2AccountPage table {}
.k2AccountPage table tr th {}
.k2AccountPage table tr td {}
.k2AccountPage table tr td label {white-space:nowrap;}
img.k2AccountPageImage {border:4px solid #ddd;margin:10px 0;padding:0;display:block;}
.k2AccountPage div.k2AccountPageNotice {padding:8px;}
.k2AccountPage div.k2AccountPageUpdate {border-top:1px dotted #ddd;margin:8px 0;padding:8px;text-align:right;}

.k2AccountPage th.k2ProfileHeading {text-align:left;font-size:18px;padding:8px;background:#f6f6f6;}
.k2AccountPage td#userAdminParams {padding:0;margin:0;}
.k2AccountPage table.admintable td.key,
.k2AccountPage table.admintable td.paramlist_key {background:#f6f6f6;border-bottom:1px solid #e9e9e9;border-right:1px solid #e9e9e9;color:#666;font-weight:bold;text-align:right;font-size:11px;width:140px;}

/* Profile edit */
.k2AccountPage table.admintable {}
.k2AccountPage table.admintable tr td {}
.k2AccountPage table.admintable tr td span {}
.k2AccountPage table.admintable tr td span label {}



/*------------------------------------------------------------------------------
	Modules - mod_k2_comments
--------------------------------------------------------------------------------*/

/* Latest Comments */
div.k2LatestCommentsBlock {}
div.k2LatestCommentsBlock ul {}
div.k2LatestCommentsBlock ul li {}
div.k2LatestCommentsBlock ul li.lastItem {}
div.k2LatestCommentsBlock ul li a.lcAvatar img {}
div.k2LatestCommentsBlock ul li a {}
div.k2LatestCommentsBlock ul li a:hover {}
div.k2LatestCommentsBlock ul li span.lcComment {}
div.k2LatestCommentsBlock ul li span.lcUsername {}
div.k2LatestCommentsBlock ul li span.lcCommentDate {color:#999;}
div.k2LatestCommentsBlock ul li span.lcItemTitle {}
div.k2LatestCommentsBlock ul li span.lcItemCategory {}

/* Top Commenters */
div.k2TopCommentersBlock {}
div.k2TopCommentersBlock ul {}
div.k2TopCommentersBlock ul li {}
div.k2TopCommentersBlock ul li.lastItem {}
div.k2TopCommentersBlock ul li a.tcAvatar img {}
div.k2TopCommentersBlock ul li a.tcLink {}
div.k2TopCommentersBlock ul li a.tcLink:hover {}
div.k2TopCommentersBlock ul li span.tcUsername {}
div.k2TopCommentersBlock ul li span.tcCommentsCounter {}
div.k2TopCommentersBlock ul li a.tcLatestComment {}
div.k2TopCommentersBlock ul li a.tcLatestComment:hover {}
div.k2TopCommentersBlock ul li span.tcLatestCommentDate {color:#999;}



/*------------------------------------------------------------------------------
	Modules - mod_k2_content
--------------------------------------------------------------------------------*/

div.k2ItemsBlock {}

div.k2ItemsBlock p.modulePretext {}

div.k2ItemsBlock ul {}
div.k2ItemsBlock ul li {}
div.k2ItemsBlock ul li a {}
div.k2ItemsBlock ul li a:hover {}
div.k2ItemsBlock ul li.lastItem {}

div.k2ItemsBlock ul li a.moduleItemTitle {}
div.k2ItemsBlock ul li a.moduleItemTitle:hover {}

div.k2ItemsBlock ul li div.moduleItemAuthor {}
div.k2ItemsBlock ul li div.moduleItemAuthor a {}
div.k2ItemsBlock ul li div.moduleItemAuthor a:hover {}

div.k2ItemsBlock ul li a.moduleItemAuthorAvatar img {}

div.k2ItemsBlock ul li div.moduleItemIntrotext {display:block;padding:4px 0;}
div.k2ItemsBlock ul li div.moduleItemIntrotext a.moduleItemImage img {float:right;margin:2px 0 4px 4px;padding:0;}

div.k2ItemsBlock ul li div.moduleItemExtraFields {}
	div.moduleItemExtraFields ul {}
	div.moduleItemExtraFields ul li {}
	div.moduleItemExtraFields ul li span.moduleItemExtraFieldsLabel {display:block;float:left;font-weight:bold;margin:0 4px 0 0;width:30%;}
	div.moduleItemExtraFields ul li span.moduleItemExtraFieldsValue {}

div.k2ItemsBlock ul li div.moduleItemVideo {}
div.k2ItemsBlock ul li div.moduleItemVideo span.moduleItemVideoCaption {}
div.k2ItemsBlock ul li div.moduleItemVideo span.moduleItemVideoCredits {}

div.k2ItemsBlock ul li span.moduleItemDateCreated {}

div.k2ItemsBlock ul li a.moduleItemCategory {}

div.k2ItemsBlock ul li div.moduleItemTags {}
div.k2ItemsBlock ul li div.moduleItemTags b {}
div.k2ItemsBlock ul li div.moduleItemTags a {padding:0 2px;}
div.k2ItemsBlock ul li div.moduleItemTags a:hover {}

div.k2ItemsBlock ul li div.moduleAttachments {}

div.k2ItemsBlock ul li a.moduleItemComments {border-right:1px solid #ccc;padding:0 4px 0 0;margin:0 8px 0 0;}
div.k2ItemsBlock ul li a.moduleItemComments:hover {}
div.k2ItemsBlock ul li span.moduleItemHits {border-right:1px solid #ccc;padding:0 4px 0 0;margin:0 8px 0 0;}
div.k2ItemsBlock ul li a.moduleItemReadMore {}
div.k2ItemsBlock ul li a.moduleItemReadMore:hover {}

div.k2ItemsBlock a.moduleCustomLink {}
div.k2ItemsBlock a.moduleCustomLink:hover {}



/*------------------------------------------------------------------------------
	Modules - mod_k2_tools
--------------------------------------------------------------------------------*/

/* --- Archives --- */
div.k2ArchivesBlock {}
div.k2ArchivesBlock ul {}
div.k2ArchivesBlock ul li {}
div.k2ArchivesBlock ul li a {}
div.k2ArchivesBlock ul li a:hover {}

/* --- Authors --- */
div.k2AuthorsListBlock {}
div.k2AuthorsListBlock ul {}
div.k2AuthorsListBlock ul li {}
div.k2AuthorsListBlock ul li a.abAuthorAvatar img {}
div.k2AuthorsListBlock ul li a.abAuthorName {}
div.k2AuthorsListBlock ul li a.abAuthorName:hover {}
div.k2AuthorsListBlock ul li a.abAuthorLatestItem {display:block;clear:both;}
div.k2AuthorsListBlock ul li a.abAuthorLatestItem:hover {}
div.k2AuthorsListBlock ul li span.abAuthorCommentsCount {}

/* --- Breadcrumbs --- */
div.k2BreadcrumbsBlock {}
div.k2BreadcrumbsBlock span.bcTitle {padding:0 4px 0 0;color:#999;}
div.k2BreadcrumbsBlock a {}
div.k2BreadcrumbsBlock a:hover {}
div.k2BreadcrumbsBlock span.bcSeparator {padding:0 4px;font-size:14px;}

/* --- Calendar --- */
div.k2CalendarBlock {height:190px;margin-bottom:8px;} /* use this height value so that the calendar height won't change on Month change via ajax */
div.k2CalendarLoader {background:#fff url(../images/loaders/calendar.gif) no-repeat 50% 50%;}
table.calendar {margin:0 auto;background:#fff;border-collapse:collapse;}
table.calendar tr td {text-align:center;vertical-align:middle;padding:2px;border:1px solid #f4f4f4;background:#fff;}
table.calendar tr td.calendarNavMonthPrev {background:#fafafa;text-align:left;}
table.calendar tr td.calendarNavMonthPrev a {font-size:20px;text-decoration:none;}
table.calendar tr td.calendarNavMonthPrev a:hover {font-size:20px;text-decoration:none;}
table.calendar tr td.calendarCurrentMonth {background:#fafafa;}
table.calendar tr td.calendarNavMonthNext {background:#fafafa;text-align:right;}
table.calendar tr td.calendarNavMonthNext a {font-size:20px;text-decoration:none;}
table.calendar tr td.calendarNavMonthNext a:hover {font-size:20px;text-decoration:none;}
table.calendar tr td.calendarDayName {background:#e9e9e9;font-size:11px;width:14.2%;}
table.calendar tr td.calendarDateEmpty {background:#fbfbfb;}
table.calendar tr td.calendarDate {}
table.calendar tr td.calendarDateLinked {padding:0;}
table.calendar tr td.calendarDateLinked a {display:block;padding:2px;text-decoration:none;background:#fafafa;}
table.calendar tr td.calendarDateLinked a:hover {display:block;background:#135cae;color:#fff;padding:2px;text-decoration:none;}
table.calendar tr td.calendarToday {background:#135cae;color:#fff;}
table.calendar tr td.calendarTodayLinked {background:#135cae;color:#fff;padding:0;}
table.calendar tr td.calendarTodayLinked a {display:block;padding:2px;color:#fff;text-decoration:none;}
table.calendar tr td.calendarTodayLinked a:hover {display:block;background:#BFD9FF;padding:2px;text-decoration:none;}

/* --- Category Tree Select Box --- */
div.k2CategorySelectBlock {}
div.k2CategorySelectBlock form select {width:auto;}
div.k2CategorySelectBlock form select option {}

/* --- Category List/Menu --- */
div.k2CategoriesListBlock {}
div.k2CategoriesListBlock ul {}
div.k2CategoriesListBlock ul li {}
div.k2CategoriesListBlock ul li a {}
div.k2CategoriesListBlock ul li a:hover {}
div.k2CategoriesListBlock ul li a span.catTitle {padding-right:4px;}
div.k2CategoriesListBlock ul li a span.catCounter {}
div.k2CategoriesListBlock ul li a:hover span.catTitle {}
div.k2CategoriesListBlock ul li a:hover span.catCounter {}
div.k2CategoriesListBlock ul li.activeCategory {}
div.k2CategoriesListBlock ul li.activeCategory a {font-weight:bold;}

	/* Root level (0) */
	ul.level0 {}
	ul.level0 li {}
	ul.level0 li a {}
	ul.level0 li a:hover {}
	ul.level0 li a span {}
	ul.level0 li a:hover span {}

		/* First level (1) */
		ul.level1 {}
		ul.level1 li {}
		ul.level1 li a {}
		ul.level1 li a:hover {}
		ul.level1 li a span {}
		ul.level1 li a:hover span {}

			/* n level (n) - like the above... */

/* --- Search Box --- */
div.k2SearchBlock {position:relative;}
div.k2SearchBlock form {}
div.k2SearchBlock form input.inputbox {}
div.k2SearchBlock form input.button {}
div.k2SearchBlock form input.k2SearchLoading {background:url(../images/loaders/search.gif) no-repeat 100% 50%;}
div.k2SearchBlock div.k2LiveSearchResults {display:none;background:#fff;position:absolute;z-index:99;border:1px solid #ddd;margin-top:-1px;}
	/* Live search results (fetched via ajax) */
	div.k2SearchBlock div.k2LiveSearchResults ul.liveSearchResults {list-style:none;margin:0;padding:0;}
	div.k2SearchBlock div.k2LiveSearchResults ul.liveSearchResults li {border:none;margin:0;padding:0;}
	div.k2SearchBlock div.k2LiveSearchResults ul.liveSearchResults li a {display:block;padding:1px 2px;border-top:1px dotted #ddd;}
	div.k2SearchBlock div.k2LiveSearchResults ul.liveSearchResults li a:hover {background:#fffff0;}

/* --- Tag Cloud --- */
div.k2TagCloudBlock {padding:8px 0;}
div.k2TagCloudBlock a {padding:4px;float:left;display:block;}
div.k2TagCloudBlock a:hover {padding:4px;float:left;display:block;background:#135cae;color:#fff;text-decoration:none;}

/* --- Custom Code --- */
div.k2CustomCodeBlock {}



/*------------------------------------------------------------------------------
	Modules - mod_k2_user (mod_k2_login is removed since v2.6.x)
--------------------------------------------------------------------------------*/

div.k2LoginBlock {}
	div.k2LoginBlock p.preText {}

	div.k2LoginBlock fieldset.input {margin:0;padding:0 0 8px 0;}
	div.k2LoginBlock fieldset.input p {margin:0;padding:0 0 4px 0;}
	div.k2LoginBlock fieldset.input p label {display:block;}
	div.k2LoginBlock fieldset.input p input {display:block;}
	div.k2LoginBlock fieldset.input p#form-login-remember label,
	div.k2LoginBlock fieldset.input p#form-login-remember input {display:inline;}
	div.k2LoginBlock fieldset.input input.button {}

	div.k2LoginBlock ul {}
	div.k2LoginBlock ul li {}

	div.k2LoginBlock p.postText {}

div.k2UserBlock {}
	div.k2UserBlock p.ubGreeting {border-bottom:1px dotted #ccc;}
	div.k2UserBlock div.k2UserBlockDetails a.ubAvatar img {}
	div.k2UserBlock div.k2UserBlockDetails span.ubName {display:block;font-weight:bold;font-size:14px;}
	div.k2UserBlock div.k2UserBlockDetails span.ubCommentsCount {}

	div.k2UserBlock ul.k2UserBlockActions {}
		div.k2UserBlock ul.k2UserBlockActions li {}
		div.k2UserBlock ul.k2UserBlockActions li a {}
		div.k2UserBlock ul.k2UserBlockActions li a:hover {}

	div.k2UserBlock ul.k2UserBlockRenderedMenu {}
		div.k2UserBlock ul.k2UserBlockRenderedMenu li {}
		div.k2UserBlock ul.k2UserBlockRenderedMenu li a {}
		div.k2UserBlock ul.k2UserBlockRenderedMenu li a:hover {}
		div.k2UserBlock ul.k2UserBlockRenderedMenu li ul {} /* 2nd level ul */
		div.k2UserBlock ul.k2UserBlockRenderedMenu li ul li {}
		div.k2UserBlock ul.k2UserBlockRenderedMenu li ul li a {}
		div.k2UserBlock ul.k2UserBlockRenderedMenu li ul ul {} /* 3rd level ul (and so on...) */
		div.k2UserBlock ul.k2UserBlockRenderedMenu li ul ul li {}
		div.k2UserBlock ul.k2UserBlockRenderedMenu li ul ul li a {}

	div.k2UserBlock form {}
	div.k2UserBlock form input.ubLogout {}



/*------------------------------------------------------------------------------
	Modules - mod_k2_users
--------------------------------------------------------------------------------*/

div.k2UsersBlock {}
div.k2UsersBlock ul {}
div.k2UsersBlock ul li {}
div.k2UsersBlock ul li.lastItem {}
div.k2UsersBlock ul li a.ubUserAvatar img {}
div.k2UsersBlock ul li a.ubUserName {}
div.k2UsersBlock ul li a.ubUserName:hover {}
div.k2UsersBlock ul li div.ubUserDescription {}
div.k2UsersBlock ul li div.ubUserAdditionalInfo {}
	a.ubUserFeedIcon,
	a.ubUserFeedIcon:hover {display:inline-block;margin:0 2px 0 0;padding:0;font-size:15px;}
	a.ubUserFeedIcon span,
	a.ubUserFeedIcon:hover span {display:none;}
	a.ubUserURL,
	a.ubUserURL:hover {display:inline-block;margin:0 2px 0 0;padding:0;font-size:15px;}
	a.ubUserURL span,
	a.ubUserURL:hover span {display:none;}
	span.ubUserEmail {display:inline-block;margin:0 2px 0 0;padding:0;overflow:hidden;font-size:15px;}
	span.ubUserEmail a {display:inline-block;margin:0;padding:0;width:16px;height:16px;text-indent:-9999px;}

div.k2UsersBlock ul li h3 {clear:both;margin:8px 0 0 0;padding:0;}
div.k2UsersBlock ul li ul.ubUserItems {}
div.k2UsersBlock ul li ul.ubUserItems li {}



/* --- END --- */
router.php000060400000035175150751650350006613 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

$params = JComponentHelper::getParams('com_k2');

// Quick implementation of "Improved K2 router.php" https://gist.github.com/phproberto/4687829
// @TODO Merge the two routers
if ($params->get('k2Sef'))
{

	/**
	 * Build the SEF route from the query
	 *
	 * @param   array  &$query  The array of query string values for which to build a route
	 *
	 * @return  array           The URL arguments to use to assemble the subsequent URL.
	 *
	 * @since	1.5
	 */
	function k2BuildRoute(&$query)
	{
		// Initialize
		$segments = array();

		// Get params
		$params = JComponentHelper::getParams('com_k2');

		// Get the menu
		$menu = JFactory::getApplication()->getMenu();

		// Detect the active menu item
		if (empty($query['Itemid']))
		{
			$menuItem = $menu->getActive();
		}
		else
		{
			$menuItem = $menu->getItem($query['Itemid']);
		}

		// Load data from the current menu item
		$mView = ( empty($menuItem->query['view'])) ? null : $menuItem->query['view'];
		$mTask = ( empty($menuItem->query['task'])) ? null : $menuItem->query['task'];
		$mId = ( empty($menuItem->query['id'])) ? null : $menuItem->query['id'];
		$mTag = ( empty($menuItem->query['tag'])) ? null : $menuItem->query['tag'];

		if (isset($query['layout']))
		{
			unset($query['layout']);
		}

		if ($mView == @$query['view'] && $mTask == @$query['task'] && $mId == @intval($query['id']) && @intval($query['id']) > 0)
		{
			unset($query['view']);
			unset($query['task']);
			unset($query['id']);
		}

		if ($mView == @$query['view'] && $mTask == @$query['task'] && $mTag == @$query['tag'] && isset($query['tag']))
		{
			unset($query['view']);
			unset($query['task']);
			unset($query['tag']);
		}

		if (isset($query['view']))
		{
			$segments[] = $query['view'];
			unset($query['view']);
		}

		if (isset($query['task']))
		{
			$segments[] = $query['task'];
			unset($query['task']);
		}

		if (isset($query['id']))
		{
			$segments[] = $query['id'];
			unset($query['id']);
		}

		if (isset($query['cid']))
		{
			$segments[] = $query['cid'];
			unset($query['cid']);
		}

		if (isset($query['tag']))
		{
			$segments[] = $query['tag'];
			unset($query['tag']);
		}

		if (isset($query['year']))
		{
			$segments[] = $query['year'];
			unset($query['year']);
		}

		if (isset($query['month']))
		{
			$segments[] = $query['month'];
			unset($query['month']);
		}

		if (isset($query['day']))
		{
			$segments[] = $query['day'];
			unset($query['day']);
		}

		if (isset($query['task']))
		{
			$segments[] = $query['task'];
			unset($query['task']);
		}

		// Item view
		if (isset($segments[0]) && $segments[0] == 'item' && @$segments[1] != 'add')
		{
			// Enabled category prefix  for items
			if ($params->get('k2SefLabelItem'))
			{
				// Tasks available for an item
				$itemTasks = array('edit', 'download');

				// If it's a task pick the next key
				if (in_array($segments[1], $itemTasks))
				{
					$ItemId = $segments[2];
				}
				else
				{
					$ItemId = $segments[1];
				}

				// Replace the item with the category slug
				if ($params->get('k2SefLabelItem') == '1')
				{

					// Remove the id from the slug
					if ($params->get('k2SefInsertCatId') == '0')
					{

						// Try to split the slug
						$segments[0] = getCategorySlug((int)$ItemId);
						$temp 	 	 = @explode('-', $segments[0]);

						// If the slug contained an item id do not use it
						if (count($temp) > 1)
						{
							@$segments[0] = $temp[1];
						}

					}
					else
					{
						// Apply the link including the id
						$segments[0] = getCategorySlug((int)$ItemId);
					}

				}
				else
				{
					$segments[0] = $params->get('k2SefLabelItemCustomPrefix');
				}

			}
			// Remove "item" from the URL
			else
			{
				unset($segments[0]);
			}

			// Handle item id and alias
			if ($params->get('k2SefInsertItemId'))
			{
				if ($params->get('k2SefUseItemTitleAlias'))
				{
					if ($params->get('k2SefItemIdTitleAliasSep') == 'slash')
					{
						$segments[1] = JString::str_ireplace(':', '/', $segments[1]);
					}
				}
				else
				{
					$temp = @explode(':', $segments[1]);
					$segments[1] = $temp[0];
				}

			}
			else
			{
				if (isset($segments[1]) && $segments[1] != 'download')
				{
					// Try to split the slud
					$temp = @explode(':', $segments[1]);

					// If the slug contained an item id do not use it
					if (count($temp) > 1)
					{
						$segments[1] = $temp[1];
					}

				}
			}
		}
		// Itemlist view. Check for prefix segments
		elseif (isset($segments[0]) && $segments[0] == 'itemlist')
		{
			if (isset($segments[1]))
			{
				switch ($segments[1])
				{
					case 'category' :
						$segments[0] = $params->get('k2SefLabelCat', 'content');
						unset($segments[1]);
						// Handle category id and alias
						if ($params->get('k2SefInsertCatId'))
						{
							if ($params->get('k2SefUseCatTitleAlias'))
							{
								if ($params->get('k2SefCatIdTitleAliasSep') == 'slash')
								{
									$segments[2] = JString::str_ireplace(':', '/', $segments[2]);
								}
							}
							else
							{
								$temp = @explode(':', $segments[2]);
								$segments[2] = (int)$temp[0];
							}

						}
						else
						{
							// Try to split the slud
							$temp = @explode(':', $segments[2]);
							unset($segments[2]);

							// If the slug contained an item id do not use it
							if (count($temp) > 1)
							{
								@$segments[1] = $temp[1];
							}
						}

						break;
					case 'tag' :
						$segments[0] = $params->get('k2SefLabelTag', 'tag');
						unset($segments[1]);
						break;
					case 'user' :
						$segments[0] = $params->get('k2SefLabelUser', 'author');
						unset($segments[1]);
						break;
					case 'date' :
						$segments[0] = $params->get('k2SefLabelDate', 'date');
						unset($segments[1]);
						break;
					case 'search' :
						$segments[0] = $params->get('k2SefLabelSearch', 'search');
						unset($segments[1]);
						break;
					default :
						$segments[0] = 'itemlist';
						break;
				}
			}

		}
		// Return reordered segments array
		return array_values($segments);
	}

	/**
	 * Get back the url from the segments
	 *
	 * @param   array  $segments  Segments in the SEF URL
	 *
	 * @return  array             Generated vars for the query
	 */
	function k2ParseRoute($segments)
	{

		// Initialize
		$vars = array();

		$params = JComponentHelper::getParams('com_k2');

		$reservedViews = array('item', 'itemlist', 'media', 'users', 'comments', 'latest');

		if (!in_array($segments[0], $reservedViews))
		{
			// Category view
			if ($segments[0] == $params->get('k2SefLabelCat', 'content'))
			{
				$segments[0] = 'itemlist';
				array_splice($segments, 1, 0, 'category');
			}
			// Tag view
			elseif ($segments[0] == $params->get('k2SefLabelTag', 'tag'))
			{
				$segments[0] = 'itemlist';
				array_splice($segments, 1, 0, 'tag');
			}
			// User view
			elseif ($segments[0] == $params->get('k2SefLabelUser', 'author'))
			{
				$segments[0] = 'itemlist';
				array_splice($segments, 1, 0, 'user');
			}
			// Date view
			elseif ($segments[0] == $params->get('k2SefLabelDate', 'date'))
			{
				$segments[0] = 'itemlist';
				array_splice($segments, 1, 0, 'date');
			}
			// Search view
			elseif ($segments[0] == $params->get('k2SefLabelSearch', 'search'))
			{
				$segments[0] = 'itemlist';
				array_splice($segments, 1, 0, 'search');
			}
			// Item view
			else
			{
				// Replace the category prefix with item
				if ($params->get('k2SefLabelItem'))
				{
					$segments[0] = 'item';
				}
				// Reinsert the removed item segment
				else
				{
					array_splice($segments, 0, 0, 'item');
				}
				// Reinsert item id to the item alias
				if (!$params->get('k2SefInsertItemId') && @$segments[1] != 'download' && @$segments[1] != 'edit')
				{
					$segments[1] = str_replace(':', '-', $segments[1]);
					$ItemId = getItemId($segments[1]);
					$segments[1] = $ItemId.':'.$segments[1];
				}
			}

		}

		$vars['view'] = $segments[0];

		if (!isset($segments[1]))
		{
			$segments[1] = '';
		}
		$vars['task'] = $segments[1];
		if ($segments[0] == 'itemlist')
		{
			switch ($segments[1])
			{

				case 'category' :
					if (isset($segments[2]))
					{
						// Reinsert item id to the item alias
						if (!$params->get('k2SefInsertCatId'))
						{
							$segments[2] = str_replace(':', '-', $segments[2]);
							$catId = getCatId($segments[2]);
							$segments[2] = $catId.':'.$segments[2];
						}
						$vars['id'] = $segments[2];
					}
					break;

				case 'tag' :
					if (isset($segments[2]))
					{
						$vars['tag'] = $segments[2];
					}
					break;

				case 'user' :
					if (isset($segments[2]))
					{
						$vars['id'] = $segments[2];
					}
					break;

				case 'date' :
					if (isset($segments[2]))
					{
						$vars['year'] = $segments[2];
					}
					if (isset($segments[3]))
					{
						$vars['month'] = $segments[3];
					}
					if (isset($segments[4]))
					{
						$vars['day'] = $segments[4];
					}
					break;
			}

		}
		elseif ($segments[0] == 'item')
		{
			switch ($segments[1])
			{
				case 'add' :
				case 'edit' :
					if (isset($segments[2]))
					{
						$vars['cid'] = $segments[2];
					}
					break;

				case 'download' :
					if (isset($segments[2]))
					{
						$vars['id'] = $segments[2];
					}
					break;

				default :
					$vars['id'] = $segments[1];
					if (isset($segments[2]))
					{
						$vars['id'] .= ':'.str_replace(':', '-', $segments[2]);
					}
					unset($vars['task']);
					break;
			}

		}

		if ($segments[0] == 'comments' && isset($segments[1]) && $segments[1] == 'reportSpammer')
		{
			$vars['id'] = $segments[2];
		}

		return $vars;
	}

	/**
	 * Get a category alias
	 *
	 * @param   integer  $ItemId  The category id
	 *
	 * @return  string            The category alias
	 */
	function getCategorySlug($ItemId = null)
	{
		$slug = null;

		$db = JFactory::getDbo();
		$query = "SELECT items.id, categories.id AS catid, CASE WHEN CHAR_LENGTH(categories.alias) THEN CONCAT_WS('-', categories.id, categories.alias) ELSE categories.id END AS catslug FROM #__k2_items AS items INNER JOIN #__k2_categories AS categories ON items.catid = categories.id WHERE items.id = ".(int)$ItemId;
		$db->setQuery($query);

		try
		{
			if ($result = $db->loadObject())
			{
				$slug = $result->catslug;
			}
		}
		catch (Exception $e)
		{
			$this->setError($e->getMessage());

			return false;
		}

		return $slug;
	}

	/**
	 * Get id K2.
	 *
	 * @param   string  $alias  The K2 item alias
	 *
	 * @return  integer
	 */
	function getItemId($alias)
	{
		$id = null;
		$db = JFactory::getDbo();
		$query = "SELECT id FROM #__k2_items WHERE alias = ".$db->quote($alias);
		$db->setQuery($query);
		try
		{
			$id = $db->loadResult();
		}
		catch (Exception $e)
		{
			$this->setError($e->getMessage());
			return false;
		}
		return $id;
	}

	/**
	 * Get id K2.
	 *
	 * @param   string  $alias  The K2 category alias
	 *
	 * @return  integer
	 */
	function getCatId($alias)
	{
		$id = null;
		$db = JFactory::getDbo();
		$query = "SELECT id FROM #__k2_categories WHERE alias = ".$db->quote($alias);
		$db->setQuery($query);
		try
		{
			$id = $db->loadResult();
		}
		catch (Exception $e)
		{
			$this->setError($e->getMessage());
			return false;
		}
		return $id;
	}

}
else
{
	function K2BuildRoute(&$query)
	{
		$segments = array();
		$application = JFactory::getApplication();
		$menu = $application->getMenu();
		if (empty($query['Itemid']))
		{
			$menuItem = $menu->getActive();
		}
		else
		{
			$menuItem = $menu->getItem($query['Itemid']);
		}
		$mView = ( empty($menuItem->query['view'])) ? null : $menuItem->query['view'];
		$mTask = ( empty($menuItem->query['task'])) ? null : $menuItem->query['task'];
		$mId = ( empty($menuItem->query['id'])) ? null : $menuItem->query['id'];
		$mTag = ( empty($menuItem->query['tag'])) ? null : $menuItem->query['tag'];

		if (isset($query['layout']))
		{
			unset($query['layout']);
		}

		if ($mView == @$query['view'] && $mTask == @$query['task'] && $mId == @intval($query['id']) && @intval($query['id']) > 0)
		{
			unset($query['view']);
			unset($query['task']);
			unset($query['id']);
		}

		if ($mView == @$query['view'] && $mTask == @$query['task'] && $mTag == @$query['tag'] && isset($query['tag']))
		{
			unset($query['view']);
			unset($query['task']);
			unset($query['tag']);
		}

		if (isset($query['view']))
		{
			$view = $query['view'];
			$segments[] = $view;
			unset($query['view']);
		}

		if (@ isset($query['task']))
		{
			$task = $query['task'];
			$segments[] = $task;
			unset($query['task']);
		}

		if (isset($query['id']))
		{
			$id = $query['id'];
			$segments[] = $id;
			unset($query['id']);
		}

		if (isset($query['cid']))
		{
			$cid = $query['cid'];
			$segments[] = $cid;
			unset($query['cid']);
		}

		if (isset($query['tag']))
		{
			$tag = $query['tag'];
			$segments[] = $tag;
			unset($query['tag']);
		}

		if (isset($query['year']))
		{
			$year = $query['year'];
			$segments[] = $year;
			unset($query['year']);
		}

		if (isset($query['month']))
		{
			$month = $query['month'];
			$segments[] = $month;
			unset($query['month']);
		}

		if (isset($query['day']))
		{
			$day = $query['day'];
			$segments[] = $day;
			unset($query['day']);
		}

		if (isset($query['task']))
		{
			$task = $query['task'];
			$segments[] = $task;
			unset($query['task']);
		}

		return $segments;
	}

	function K2ParseRoute($segments)
	{
		$vars = array();
		$vars['view'] = $segments[0];
		if (!isset($segments[1]))
			$segments[1] = '';
		$vars['task'] = $segments[1];

		if ($segments[0] == 'itemlist')
		{

			switch($segments[1])
			{

				case 'category' :
					if (isset($segments[2]))
						$vars['id'] = $segments[2];
					break;

				case 'tag' :
					if (isset($segments[2]))
						$vars['tag'] = $segments[2];
					break;

				case 'user' :
					if (isset($segments[2]))
						$vars['id'] = $segments[2];
					break;

				case 'date' :
					if (isset($segments[2]))
						$vars['year'] = $segments[2];
					if (isset($segments[3]))
						$vars['month'] = $segments[3];
					if (isset($segments[4]))
					{
						$vars['day'] = $segments[4];
					}
					break;
			}

		}
		else if ($segments[0] == 'item')
		{

			switch($segments[1])
			{

				case 'add' :
				case 'edit' :
					if (isset($segments[2]))
						$vars['cid'] = $segments[2];
					break;

				case 'download' :
					if (isset($segments[2]))
						$vars['id'] = $segments[2];
					break;

				default :
					$vars['id'] = $segments[1];
					unset($vars['task']);
					break;
			}

		}

		if ($segments[0] == 'comments' && isset($segments[1]) && $segments[1] == 'reportSpammer')
		{
			$vars['id'] = $segments[2];
		}

		return $vars;
	}

}
k2.php000060400000003677150751650350005611 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

if (K2_JVERSION != '15')
{
    $user = JFactory::getUser();
    if ($user->authorise('core.admin', 'com_k2'))
    {
        $user->gid = 1000;
    }
    else
    {
        $user->gid = 1;
    }
}

JLoader::register('K2Controller', JPATH_COMPONENT.'/controllers/controller.php');
JLoader::register('K2View', JPATH_COMPONENT_ADMINISTRATOR.'/views/view.php');
JLoader::register('K2Model', JPATH_COMPONENT_ADMINISTRATOR.'/models/model.php');

JLoader::register('K2HelperRoute', JPATH_COMPONENT.'/helpers/route.php');
JLoader::register('K2HelperPermissions', JPATH_COMPONENT.'/helpers/permissions.php');
JLoader::register('K2HelperUtilities', JPATH_COMPONENT.'/helpers/utilities.php');

K2HelperPermissions::setPermissions();
K2HelperPermissions::checkPermissions();

$controller = JRequest::getWord('view', 'itemlist');
$task = JRequest::getWord('task');

if ($controller == 'media')
{
    $controller = 'item';
    if ($task != 'connector')
    {
        $task = 'media';
    }
}

if ($controller == 'users')
{
    $controller = 'item';
    $task = 'users';
}

jimport('joomla.filesystem.file');
jimport('joomla.html.parameter');

if (JFile::exists(JPATH_COMPONENT.'/controllers/'.$controller.'.php'))
{
    $classname = 'K2Controller'.$controller;
    if(!class_exists($classname))
        require_once(JPATH_COMPONENT.'/controllers/'.$controller.'.php');
    $controller = new $classname();
    $controller->execute($task);
    $controller->redirect();
}
else
{
    JError::raiseError(404, JText::_('K2_NOT_FOUND'));
}

if (JRequest::getCmd('format') != 'json')
{
    echo "\n<!-- JoomlaWorks \"K2\" (v".K2_CURRENT_VERSION.") | Learn more about K2 at http://getk2.org -->\n\n";
}
templates/default/category_item.php000060400000026254150751650350013546 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

// Define default image size (do not change)
K2HelperUtilities::setDefaultImage($this->item, 'itemlist', $this->params);

?>

<!-- Start K2 Item Layout -->
<div class="catItemView group<?php echo ucfirst($this->item->itemGroup); ?><?php echo ($this->item->featured) ? ' catItemIsFeatured' : ''; ?><?php if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item->params->get('pageclass_sfx'); ?>">

	<!-- Plugins: BeforeDisplay -->
	<?php echo $this->item->event->BeforeDisplay; ?>

	<!-- K2 Plugins: K2BeforeDisplay -->
	<?php echo $this->item->event->K2BeforeDisplay; ?>

	<div class="catItemHeader">
		<?php if($this->item->params->get('catItemDateCreated')): ?>
		<!-- Date created -->
		<span class="catItemDateCreated">
			<?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
		</span>
		<?php endif; ?>

	  <?php if($this->item->params->get('catItemTitle')): ?>
	  <!-- Item title -->
	  <h3 class="catItemTitle">
			<?php if(isset($this->item->editLink)): ?>
			<!-- Item edit link -->
			<span class="catItemEditLink">
				<a data-k2-modal="edit" href="<?php echo $this->item->editLink; ?>">
					<?php echo JText::_('K2_EDIT_ITEM'); ?>
				</a>
			</span>
			<?php endif; ?>

	  	<?php if ($this->item->params->get('catItemTitleLinked')): ?>
			<a href="<?php echo $this->item->link; ?>">
	  		<?php echo $this->item->title; ?>
	  	</a>
	  	<?php else: ?>
	  	<?php echo $this->item->title; ?>
	  	<?php endif; ?>

	  	<?php if($this->item->params->get('catItemFeaturedNotice') && $this->item->featured): ?>
	  	<!-- Featured flag -->
	  	<span>
		  	<sup>
		  		<?php echo JText::_('K2_FEATURED'); ?>
		  	</sup>
	  	</span>
	  	<?php endif; ?>
	  </h3>
	  <?php endif; ?>

		<?php if($this->item->params->get('catItemAuthor')): ?>
		<!-- Item Author -->
		<span class="catItemAuthor">
			<?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>
			<?php if(isset($this->item->author->link) && $this->item->author->link): ?>
			<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
			<?php else: ?>
			<?php echo $this->item->author->name; ?>
			<?php endif; ?>
		</span>
		<?php endif; ?>
  </div>

  <!-- Plugins: AfterDisplayTitle -->
  <?php echo $this->item->event->AfterDisplayTitle; ?>

  <!-- K2 Plugins: K2AfterDisplayTitle -->
  <?php echo $this->item->event->K2AfterDisplayTitle; ?>

	<?php if($this->item->params->get('catItemRating')): ?>
	<!-- Item Rating -->
	<div class="catItemRatingBlock">
		<span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
		<div class="itemRatingForm">
			<ul class="itemRatingList">
				<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
			</ul>
			<div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

  <div class="catItemBody">

	  <!-- Plugins: BeforeDisplayContent -->
	  <?php echo $this->item->event->BeforeDisplayContent; ?>

	  <!-- K2 Plugins: K2BeforeDisplayContent -->
	  <?php echo $this->item->event->K2BeforeDisplayContent; ?>

	  <?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?>
	  <!-- Item Image -->
	  <div class="catItemImageBlock">
		  <span class="catItemImage">
		    <a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
		    	<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
		    </a>
		  </span>
		  <div class="clr"></div>
	  </div>
	  <?php endif; ?>

	  <?php if($this->item->params->get('catItemIntroText')): ?>
	  <!-- Item introtext -->
	  <div class="catItemIntroText">
	  	<?php echo $this->item->introtext; ?>
	  </div>
	  <?php endif; ?>

		<div class="clr"></div>

	  <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?>
	  <!-- Item extra fields -->
	  <div class="catItemExtraFields">
	  	<h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>
	  	<ul>
			<?php foreach ($this->item->extra_fields as $key => $extraField): ?>
			<?php if($extraField->value != ''): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?> alias<?php echo ucfirst($extraField->alias); ?>">
				<?php if($extraField->type == 'header'): ?>
				<h4 class="catItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
				<?php else: ?>
				<span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
				<span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
				<?php endif; ?>
			</li>
			<?php endif; ?>
			<?php endforeach; ?>
			</ul>
	    <div class="clr"></div>
	  </div>
	  <?php endif; ?>

	  <!-- Plugins: AfterDisplayContent -->
	  <?php echo $this->item->event->AfterDisplayContent; ?>

	  <!-- K2 Plugins: K2AfterDisplayContent -->
	  <?php echo $this->item->event->K2AfterDisplayContent; ?>

	  <div class="clr"></div>
  </div>

  <?php if(
  $this->item->params->get('catItemHits') ||
  $this->item->params->get('catItemCategory') ||
  $this->item->params->get('catItemTags') ||
  $this->item->params->get('catItemAttachments')
  ): ?>
  <div class="catItemLinks">

		<?php if($this->item->params->get('catItemHits')): ?>
		<!-- Item Hits -->
		<div class="catItemHitsBlock">
			<span class="catItemHits">
				<?php echo JText::_('K2_READ'); ?> <b><?php echo $this->item->hits; ?></b> <?php echo JText::_('K2_TIMES'); ?>
			</span>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('catItemCategory')): ?>
		<!-- Item category name -->
		<div class="catItemCategory">
			<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
			<a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a>
		</div>
		<?php endif; ?>

	  <?php if($this->item->params->get('catItemTags') && count($this->item->tags)): ?>
	  <!-- Item tags -->
	  <div class="catItemTagsBlock">
		  <span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>
		  <ul class="catItemTags">
		    <?php foreach ($this->item->tags as $tag): ?>
		    <li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
		    <?php endforeach; ?>
		  </ul>
		  <div class="clr"></div>
	  </div>
	  <?php endif; ?>

	  <?php if($this->item->params->get('catItemAttachments') && count($this->item->attachments)): ?>
	  <!-- Item attachments -->
	  <div class="catItemAttachmentsBlock">
		  <span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span>
		  <ul class="catItemAttachments">
		    <?php foreach ($this->item->attachments as $attachment): ?>
		    <li>
			    <a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>">
			    	<?php echo $attachment->title ; ?>
			    </a>
			    <?php if($this->item->params->get('catItemAttachmentsCounter')): ?>
			    <span>(<?php echo $attachment->hits; ?> <?php echo ($attachment->hits==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span>
			    <?php endif; ?>
		    </li>
		    <?php endforeach; ?>
		  </ul>
	  </div>
	  <?php endif; ?>

		<div class="clr"></div>
  </div>
  <?php endif; ?>

	<div class="clr"></div>

  <?php if($this->item->params->get('catItemVideo') && !empty($this->item->video)): ?>
  <!-- Item video -->
  <div class="catItemVideoBlock">
  	<h3><?php echo JText::_('K2_RELATED_VIDEO'); ?></h3>
		<?php if($this->item->videoType=='embedded'): ?>
		<div class="catItemVideoEmbedded">
			<?php echo $this->item->video; ?>
		</div>
		<?php else: ?>
		<span class="catItemVideo"><?php echo $this->item->video; ?></span>
		<?php endif; ?>
  </div>
  <?php endif; ?>

  <?php if($this->item->params->get('catItemImageGallery') && !empty($this->item->gallery)): ?>
  <!-- Item image gallery -->
  <div class="catItemImageGallery">
	  <h4><?php echo JText::_('K2_IMAGE_GALLERY'); ?></h4>
	  <?php echo $this->item->gallery; ?>
  </div>
  <?php endif; ?>

  <div class="clr"></div>

	<?php if($this->item->params->get('catItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
	<!-- Anchor link to comments below -->
	<div class="catItemCommentsLink">
		<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
			<!-- K2 Plugins: K2CommentsCounter -->
			<?php echo $this->item->event->K2CommentsCounter; ?>
		<?php else: ?>
			<?php if($this->item->numOfComments > 0): ?>
			<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
				<?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
			</a>
			<?php else: ?>
			<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
				<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
			</a>
			<?php endif; ?>
		<?php endif; ?>
	</div>
	<?php endif; ?>

	<?php if ($this->item->params->get('catItemReadMore')): ?>
	<!-- Item "read more..." link -->
	<div class="catItemReadMore">
		<a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
			<?php echo JText::_('K2_READ_MORE'); ?>
		</a>
	</div>
	<?php endif; ?>

	<div class="clr"></div>

	<?php if($this->item->params->get('catItemDateModified')): ?>
	<!-- Item date modified -->
	<?php if($this->item->modified != $this->nullDate && $this->item->modified != $this->item->created ): ?>
	<span class="catItemDateModified">
		<?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('K2_DATE_FORMAT_LC2')); ?>
	</span>
	<?php endif; ?>
	<?php endif; ?>

  <!-- Plugins: AfterDisplay -->
  <?php echo $this->item->event->AfterDisplay; ?>

  <!-- K2 Plugins: K2AfterDisplay -->
  <?php echo $this->item->event->K2AfterDisplay; ?>

	<div class="clr"></div>
</div>
<!-- End K2 Item Layout -->
templates/default/item_comments_form.php000060400000006341150751650350014574 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- Comments Form -->
<h3><?php echo JText::_('K2_LEAVE_A_COMMENT') ?></h3>

<?php if($this->params->get('commentsFormNotes')): ?>
<p class="itemCommentsFormNotes">
	<?php if($this->params->get('commentsFormNotesText')): ?>
	<?php echo nl2br($this->params->get('commentsFormNotesText')); ?>
	<?php else: ?>
	<?php echo JText::_('K2_COMMENT_FORM_NOTES') ?>
	<?php endif; ?>
</p>
<?php endif; ?>

<form action="<?php echo JURI::root(true); ?>/index.php" method="post" id="comment-form" class="form-validate">
	<label class="formComment" for="commentText"><?php echo JText::_('K2_MESSAGE'); ?> *</label>
	<textarea rows="20" cols="10" class="inputbox" onblur="if(this.value=='') this.value='<?php echo JText::_('K2_ENTER_YOUR_MESSAGE_HERE'); ?>';" onfocus="if(this.value=='<?php echo JText::_('K2_ENTER_YOUR_MESSAGE_HERE'); ?>') this.value='';" name="commentText" id="commentText"><?php echo JText::_('K2_ENTER_YOUR_MESSAGE_HERE'); ?></textarea>

	<label class="formName" for="userName"><?php echo JText::_('K2_NAME'); ?> *</label>
	<input class="inputbox" type="text" name="userName" id="userName" value="<?php echo JText::_('K2_ENTER_YOUR_NAME'); ?>" onblur="if(this.value=='') this.value='<?php echo JText::_('K2_ENTER_YOUR_NAME'); ?>';" onfocus="if(this.value=='<?php echo JText::_('K2_ENTER_YOUR_NAME'); ?>') this.value='';" />

	<label class="formEmail" for="commentEmail"><?php echo JText::_('K2_EMAIL'); ?> *</label>
	<input class="inputbox" type="text" name="commentEmail" id="commentEmail" value="<?php echo JText::_('K2_ENTER_YOUR_EMAIL_ADDRESS'); ?>" onblur="if(this.value=='') this.value='<?php echo JText::_('K2_ENTER_YOUR_EMAIL_ADDRESS'); ?>';" onfocus="if(this.value=='<?php echo JText::_('K2_ENTER_YOUR_EMAIL_ADDRESS'); ?>') this.value='';" />

	<label class="formUrl" for="commentURL"><?php echo JText::_('K2_WEBSITE_URL'); ?></label>
	<input class="inputbox" type="text" name="commentURL" id="commentURL" value="<?php echo JText::_('K2_ENTER_YOUR_SITE_URL'); ?>"  onblur="if(this.value=='') this.value='<?php echo JText::_('K2_ENTER_YOUR_SITE_URL'); ?>';" onfocus="if(this.value=='<?php echo JText::_('K2_ENTER_YOUR_SITE_URL'); ?>') this.value='';" />

	<?php if($this->params->get('recaptcha') && ($this->user->guest || $this->params->get('recaptchaForRegistered', 1))): ?>
	<?php if(!$this->params->get('recaptchaV2')): ?>
	<label class="formRecaptcha"><?php echo JText::_('K2_ENTER_THE_TWO_WORDS_YOU_SEE_BELOW'); ?></label>
	<?php endif; ?>
	<div id="recaptcha" class="<?php echo $this->recaptchaClass; ?>"></div>
	<?php endif; ?>

	<input type="submit" class="button" id="submitCommentButton" value="<?php echo JText::_('K2_SUBMIT_COMMENT'); ?>" />

	<span id="formLog"></span>

	<input type="hidden" name="option" value="com_k2" />
	<input type="hidden" name="view" value="item" />
	<input type="hidden" name="task" value="comment" />
	<input type="hidden" name="itemID" value="<?php echo JRequest::getInt('id'); ?>" />
	<?php echo JHTML::_('form.token'); ?>
</form>
templates/default/latest_item.php000060400000013201150751650350013211 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- Start K2 Item Layout -->
<div class="latestItemView">

	<!-- Plugins: BeforeDisplay -->
	<?php echo $this->item->event->BeforeDisplay; ?>

	<!-- K2 Plugins: K2BeforeDisplay -->
	<?php echo $this->item->event->K2BeforeDisplay; ?>

	<div class="latestItemHeader">
	  <?php if($this->item->params->get('latestItemTitle')): ?>
	  <!-- Item title -->
	  <h2 class="latestItemTitle">
	  	<?php if ($this->item->params->get('latestItemTitleLinked')): ?>
			<a href="<?php echo $this->item->link; ?>">
	  		<?php echo $this->item->title; ?>
	  	</a>
	  	<?php else: ?>
	  	<?php echo $this->item->title; ?>
	  	<?php endif; ?>
	  </h2>
	  <?php endif; ?>
  </div>
  
	<?php if($this->item->params->get('latestItemDateCreated')): ?>
	<!-- Date created -->
	<span class="latestItemDateCreated">
		<?php echo JHTML::_('date', $this->item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
	</span>
	<?php endif; ?>

  <!-- Plugins: AfterDisplayTitle -->
  <?php echo $this->item->event->AfterDisplayTitle; ?>

  <!-- K2 Plugins: K2AfterDisplayTitle -->
  <?php echo $this->item->event->K2AfterDisplayTitle; ?>

  <div class="latestItemBody">

	  <!-- Plugins: BeforeDisplayContent -->
	  <?php echo $this->item->event->BeforeDisplayContent; ?>

	  <!-- K2 Plugins: K2BeforeDisplayContent -->
	  <?php echo $this->item->event->K2BeforeDisplayContent; ?>

	  <?php if($this->item->params->get('latestItemImage') && !empty($this->item->image)): ?>
	  <!-- Item Image -->
	  <div class="latestItemImageBlock">
		  <span class="latestItemImage">
		    <a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>">
		    	<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px;height:auto;" />
		    </a>
		  </span>
		  <div class="clr"></div>
	  </div>
	  <?php endif; ?>

	  <?php if($this->item->params->get('latestItemIntroText')): ?>
	  <!-- Item introtext -->
	  <div class="latestItemIntroText">
	  	<?php echo $this->item->introtext; ?>
	  </div>
	  <?php endif; ?>

		<div class="clr"></div>

	  <!-- Plugins: AfterDisplayContent -->
	  <?php echo $this->item->event->AfterDisplayContent; ?>

	  <!-- K2 Plugins: K2AfterDisplayContent -->
	  <?php echo $this->item->event->K2AfterDisplayContent; ?>

	  <div class="clr"></div>
  </div>

  <?php if($this->item->params->get('latestItemCategory') || $this->item->params->get('latestItemTags')): ?>
  <div class="latestItemLinks">

		<?php if($this->item->params->get('latestItemCategory')): ?>
		<!-- Item category name -->
		<div class="latestItemCategory">
			<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
			<a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a>
		</div>
		<?php endif; ?>

	  <?php if($this->item->params->get('latestItemTags') && count($this->item->tags)): ?>
	  <!-- Item tags -->
	  <div class="latestItemTagsBlock">
		  <span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>
		  <ul class="latestItemTags">
		    <?php foreach ($this->item->tags as $tag): ?>
		    <li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
		    <?php endforeach; ?>
		  </ul>
		  <div class="clr"></div>
	  </div>
	  <?php endif; ?>

		<div class="clr"></div>
  </div>
  <?php endif; ?>

	<div class="clr"></div>

  <?php if($this->params->get('latestItemVideo') && !empty($this->item->video)): ?>
  <!-- Item video -->
  <div class="latestItemVideoBlock">
  	<h3><?php echo JText::_('K2_RELATED_VIDEO'); ?></h3>
	  <span class="latestItemVideo<?php if($this->item->videoType=='embedded'): ?> embedded<?php endif; ?>"><?php echo $this->item->video; ?></span>
  </div>
  <?php endif; ?>

	<?php if($this->item->params->get('latestItemCommentsAnchor') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
	<!-- Anchor link to comments below -->
	<div class="latestItemCommentsLink">
		<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
			<!-- K2 Plugins: K2CommentsCounter -->
			<?php echo $this->item->event->K2CommentsCounter; ?>
		<?php else: ?>
			<?php if($this->item->numOfComments > 0): ?>
			<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
				<?php echo $this->item->numOfComments; ?> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
			</a>
			<?php else: ?>
			<a href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
				<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
			</a>
			<?php endif; ?>
		<?php endif; ?>
	</div>
	<?php endif; ?>

	<?php if ($this->item->params->get('latestItemReadMore')): ?>
	<!-- Item "read more..." link -->
	<div class="latestItemReadMore">
		<a class="k2ReadMore" href="<?php echo $this->item->link; ?>">
			<?php echo JText::_('K2_READ_MORE'); ?>
		</a>
	</div>
	<?php endif; ?>

	<div class="clr"></div>

  <!-- Plugins: AfterDisplay -->
  <?php echo $this->item->event->AfterDisplay; ?>

  <!-- K2 Plugins: K2AfterDisplay -->
  <?php echo $this->item->event->K2AfterDisplay; ?>

	<div class="clr"></div>
</div>
<!-- End K2 Item Layout -->
templates/default/category.php000060400000022250150751650350012520 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- Start K2 Category Layout -->
<div id="k2Container" class="itemListView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">

	<?php if($this->params->get('show_page_title')): ?>
	<!-- Page title -->
	<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
	<?php endif; ?>

	<?php if($this->params->get('catFeedIcon')): ?>
	<!-- RSS feed icon -->
	<div class="k2FeedIcon">
		<a href="<?php echo $this->feed; ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?>">
			<span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></span>
		</a>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if(isset($this->category) || ( $this->params->get('subCategories') && isset($this->subCategories) && count($this->subCategories) )): ?>
	<!-- Blocks for current category and subcategories -->
	<div class="itemListCategoriesBlock">

		<?php if(isset($this->category) && ( $this->params->get('catImage') || $this->params->get('catTitle') || $this->params->get('catDescription') || $this->category->event->K2CategoryDisplay )): ?>
		<!-- Category block -->
		<div class="itemListCategory">

			<?php if(isset($this->addLink)): ?>
			<!-- Item add link -->
			<span class="catItemAddLink">
				<a data-k2-modal="edit" href="<?php echo $this->addLink; ?>">
					<?php echo JText::_('K2_ADD_A_NEW_ITEM_IN_THIS_CATEGORY'); ?>
				</a>
			</span>
			<?php endif; ?>

			<?php if($this->params->get('catImage') && $this->category->image): ?>
			<!-- Category image -->
			<img alt="<?php echo K2HelperUtilities::cleanHtml($this->category->name); ?>" src="<?php echo $this->category->image; ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px; height:auto;" />
			<?php endif; ?>

			<?php if($this->params->get('catTitle')): ?>
			<!-- Category title -->
			<h2><?php echo $this->category->name; ?><?php if($this->params->get('catTitleItemCounter')) echo ' ('.$this->pagination->total.')'; ?></h2>
			<?php endif; ?>

			<?php if($this->params->get('catDescription')): ?>
			<!-- Category description -->
			<div><?php echo $this->category->description; ?></div>
			<?php endif; ?>

			<!-- K2 Plugins: K2CategoryDisplay -->
			<?php echo $this->category->event->K2CategoryDisplay; ?>

			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if($this->params->get('subCategories') && isset($this->subCategories) && count($this->subCategories)): ?>
		<!-- Subcategories -->
		<div class="itemListSubCategories">
			<h3><?php echo JText::_('K2_CHILDREN_CATEGORIES'); ?></h3>

			<?php foreach($this->subCategories as $key=>$subCategory): ?>

			<?php
			// Define a CSS class for the last container on each row
			if((($key+1)%($this->params->get('subCatColumns'))==0))
				$lastContainer= ' subCategoryContainerLast';
			else
				$lastContainer='';
			?>

			<div class="subCategoryContainer<?php echo $lastContainer; ?>"<?php echo (count($this->subCategories)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('subCatColumns'), 1).'%;"'; ?>>
				<div class="subCategory">
					<?php if($this->params->get('subCatImage') && $subCategory->image): ?>
					<!-- Subcategory image -->
					<a class="subCategoryImage" href="<?php echo $subCategory->link; ?>">
						<img alt="<?php echo K2HelperUtilities::cleanHtml($subCategory->name); ?>" src="<?php echo $subCategory->image; ?>" />
					</a>
					<?php endif; ?>

					<?php if($this->params->get('subCatTitle')): ?>
					<!-- Subcategory title -->
					<h2>
						<a href="<?php echo $subCategory->link; ?>">
							<?php echo $subCategory->name; ?><?php if($this->params->get('subCatTitleItemCounter')) echo ' ('.$subCategory->numOfItems.')'; ?>
						</a>
					</h2>
					<?php endif; ?>

					<?php if($this->params->get('subCatDescription')): ?>
					<!-- Subcategory description -->
					<div><?php echo $subCategory->description; ?></div>
					<?php endif; ?>

					<!-- Subcategory more... -->
					<a class="subCategoryMore" href="<?php echo $subCategory->link; ?>">
						<?php echo JText::_('K2_VIEW_ITEMS'); ?>
					</a>

					<div class="clr"></div>
				</div>
			</div>
			<?php if(($key+1)%($this->params->get('subCatColumns'))==0): ?>
			<div class="clr"></div>
			<?php endif; ?>
			<?php endforeach; ?>

			<div class="clr"></div>
		</div>
		<?php endif; ?>

	</div>
	<?php endif; ?>

	<?php if((isset($this->leading) || isset($this->primary) || isset($this->secondary) || isset($this->links)) && (count($this->leading) || count($this->primary) || count($this->secondary) || count($this->links))): ?>
	<!-- Item list -->
	<div class="itemList">

		<?php if(isset($this->leading) && count($this->leading)): ?>
		<!-- Leading items -->
		<div id="itemListLeading">
			<?php foreach($this->leading as $key=>$item): ?>

			<?php
			// Define a CSS class for the last container on each row
			if((($key+1)%($this->params->get('num_leading_columns'))==0) || count($this->leading)<$this->params->get('num_leading_columns'))
				$lastContainer= ' itemContainerLast';
			else
				$lastContainer='';
			?>

			<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->leading)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('num_leading_columns'), 1).'%;"'; ?>>
				<?php
					// Load category_item.php by default
					$this->item = $item;
					echo $this->loadTemplate('item');
				?>
			</div>
			<?php if(($key+1)%($this->params->get('num_leading_columns'))==0): ?>
			<div class="clr"></div>
			<?php endif; ?>
			<?php endforeach; ?>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if(isset($this->primary) && count($this->primary)): ?>
		<!-- Primary items -->
		<div id="itemListPrimary">
			<?php foreach($this->primary as $key=>$item): ?>

			<?php
			// Define a CSS class for the last container on each row
			if( (($key+1)%($this->params->get('num_primary_columns'))==0) || count($this->primary)<$this->params->get('num_primary_columns') )
				$lastContainer= ' itemContainerLast';
			else
				$lastContainer='';
			?>

			<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->primary)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('num_primary_columns'), 1).'%;"'; ?>>
				<?php
					// Load category_item.php by default
					$this->item = $item;
					echo $this->loadTemplate('item');
				?>
			</div>
			<?php if(($key+1)%($this->params->get('num_primary_columns'))==0): ?>
			<div class="clr"></div>
			<?php endif; ?>
			<?php endforeach; ?>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if(isset($this->secondary) && count($this->secondary)): ?>
		<!-- Secondary items -->
		<div id="itemListSecondary">
			<?php foreach($this->secondary as $key=>$item): ?>

			<?php
			// Define a CSS class for the last container on each row
			if( (($key+1)%($this->params->get('num_secondary_columns'))==0) || count($this->secondary)<$this->params->get('num_secondary_columns') )
				$lastContainer= ' itemContainerLast';
			else
				$lastContainer='';
			?>

			<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->secondary)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('num_secondary_columns'), 1).'%;"'; ?>>
				<?php
					// Load category_item.php by default
					$this->item = $item;
					echo $this->loadTemplate('item');
				?>
			</div>
			<?php if(($key+1)%($this->params->get('num_secondary_columns'))==0): ?>
			<div class="clr"></div>
			<?php endif; ?>
			<?php endforeach; ?>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if(isset($this->links) && count($this->links)): ?>
		<!-- Link items -->
		<div id="itemListLinks">
			<h4><?php echo JText::_('K2_MORE'); ?></h4>
			<?php foreach($this->links as $key=>$item): ?>

			<?php
			// Define a CSS class for the last container on each row
			if((($key+1)%($this->params->get('num_links_columns'))==0) || count($this->links)<$this->params->get('num_links_columns'))
				$lastContainer= ' itemContainerLast';
			else
				$lastContainer='';
			?>

			<div class="itemContainer<?php echo $lastContainer; ?>"<?php echo (count($this->links)==1) ? '' : ' style="width:'.number_format(100/$this->params->get('num_links_columns'), 1).'%;"'; ?>>
				<?php
					// Load category_item.php by default
					$this->item = $item;
					echo $this->loadTemplate('item');
				?>
			</div>
			<?php if(($key+1)%($this->params->get('num_links_columns'))==0): ?>
			<div class="clr"></div>
			<?php endif; ?>
			<?php endforeach; ?>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

	</div>

	<!-- Pagination -->
	<?php if($this->pagination->getPagesLinks()): ?>
	<div class="k2Pagination">
		<?php if($this->params->get('catPagination')) echo $this->pagination->getPagesLinks(); ?>
		<div class="clr"></div>
		<?php if($this->params->get('catPaginationResults')) echo $this->pagination->getPagesCounter(); ?>
	</div>
	<?php endif; ?>

	<?php endif; ?>
</div>

<!-- End K2 Category Layout -->
templates/default/tag.php000060400000011507150751650350011461 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- Start K2 Tag Layout -->
<div id="k2Container" class="tagView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">

	<?php if($this->params->get('show_page_title')): ?>
	<!-- Page title -->
	<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
	<?php endif; ?>

	<?php if($this->params->get('tagFeedIcon',1)): ?>
	<!-- RSS feed icon -->
	<div class="k2FeedIcon">
		<a href="<?php echo $this->feed; ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?>">
			<span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></span>
		</a>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if(count($this->items)): ?>
	<div class="tagItemList">
		<?php foreach($this->items as $item): ?>

		<!-- Start K2 Item Layout -->
		<div class="tagItemView">

			<div class="tagItemHeader">
				<?php if($item->params->get('tagItemDateCreated',1)): ?>
				<!-- Date created -->
				<span class="tagItemDateCreated">
					<?php echo JHTML::_('date', $item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
				</span>
				<?php endif; ?>

			  <?php if($item->params->get('tagItemTitle',1)): ?>
			  <!-- Item title -->
			  <h2 class="tagItemTitle">
			  	<?php if ($item->params->get('tagItemTitleLinked',1)): ?>
					<a href="<?php echo $item->link; ?>">
			  		<?php echo $item->title; ?>
			  	</a>
			  	<?php else: ?>
			  	<?php echo $item->title; ?>
			  	<?php endif; ?>
			  </h2>
			  <?php endif; ?>
		  </div>

		  <div class="tagItemBody">
			  <?php if($item->params->get('tagItemImage',1) && !empty($item->imageGeneric)): ?>
			  <!-- Item Image -->
			  <div class="tagItemImageBlock">
				  <span class="tagItemImage">
				    <a href="<?php echo $item->link; ?>" title="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>">
				    	<img src="<?php echo $item->imageGeneric; ?>" alt="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>" style="width:<?php echo $item->params->get('itemImageGeneric'); ?>px; height:auto;" />
				    </a>
				  </span>
				  <div class="clr"></div>
			  </div>
			  <?php endif; ?>

			  <?php if($item->params->get('tagItemIntroText',1)): ?>
			  <!-- Item introtext -->
			  <div class="tagItemIntroText">
			  	<?php echo $item->introtext; ?>
			  </div>
			  <?php endif; ?>

			  <div class="clr"></div>
		  </div>

		  <div class="clr"></div>

		  <?php if($item->params->get('tagItemExtraFields',0) && count($item->extra_fields)): ?>
		  <!-- Item extra fields -->
		  <div class="tagItemExtraFields">
		  	<h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>
		  	<ul>
				<?php foreach ($item->extra_fields as $key => $extraField): ?>
				<?php if($extraField->value != ''): ?>
				<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?> alias<?php echo ucfirst($extraField->alias); ?>">
					<?php if($extraField->type == 'header'): ?>
					<h4 class="tagItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
					<?php else: ?>
					<span class="tagItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
					<span class="tagItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
					<?php endif; ?>
				</li>
				<?php endif; ?>
				<?php endforeach; ?>
				</ul>
		    <div class="clr"></div>
		  </div>
		  <?php endif; ?>

			<?php if($item->params->get('tagItemCategory')): ?>
			<!-- Item category name -->
			<div class="tagItemCategory">
				<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
				<a href="<?php echo $item->category->link; ?>"><?php echo $item->category->name; ?></a>
			</div>
			<?php endif; ?>

			<?php if ($item->params->get('tagItemReadMore')): ?>
			<!-- Item "read more..." link -->
			<div class="tagItemReadMore">
				<a class="k2ReadMore" href="<?php echo $item->link; ?>">
					<?php echo JText::_('K2_READ_MORE'); ?>
				</a>
			</div>
			<?php endif; ?>

			<div class="clr"></div>
		</div>
		<!-- End K2 Item Layout -->

		<?php endforeach; ?>
	</div>

	<!-- Pagination -->
	<?php if($this->pagination->getPagesLinks()): ?>
	<div class="k2Pagination">
		<?php echo $this->pagination->getPagesLinks(); ?>
		<div class="clr"></div>
		<?php echo $this->pagination->getPagesCounter(); ?>
	</div>
	<?php endif; ?>

	<?php endif; ?>

</div>
<!-- End K2 Tag Layout -->
templates/default/itemform.php000060400000001270150751650350012524 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

/*
	HOW TO CHANGE THIS FORM'S LAYOUT:
	Bring in the backend item form - if you wish to override the form layout, simply copy the contents of
	/administrator/components/com_k2/views/item/tmpl/default.php and paste them in an itemform.php override
	inside your template's html/com_k2/default/ folder.
*/

require_once(JPATH_SITE.'/administrator/components/com_k2/views/item/tmpl/default.php');
templates/default/user.php000060400000022623150751650350011665 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

// Get user stuff (do not change)
$user = JFactory::getUser();

?>

<!-- Start K2 User Layout -->

<div id="k2Container" class="userView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">

	<?php if($this->params->get('show_page_title') && $this->params->get('page_title')!=$this->user->name): ?>
	<!-- Page title -->
	<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
	<?php endif; ?>

	<?php if($this->params->get('userFeedIcon',1)): ?>
	<!-- RSS feed icon -->
	<div class="k2FeedIcon">
		<a href="<?php echo $this->feed; ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?>">
			<span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></span>
		</a>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if ($this->params->get('userImage') || $this->params->get('userName') || $this->params->get('userDescription') || $this->params->get('userURL') || $this->params->get('userEmail')): ?>
	<div class="userBlock">

		<?php if(isset($this->addLink) && JRequest::getInt('id')==$user->id): ?>
		<!-- Item add link -->
		<span class="userItemAddLink">
			<a data-k2-modal="edit" href="<?php echo $this->addLink; ?>">
				<?php echo JText::_('K2_POST_A_NEW_ITEM'); ?>
			</a>
		</span>
		<?php endif; ?>

		<?php if ($this->params->get('userImage') && !empty($this->user->avatar)): ?>
		<img src="<?php echo $this->user->avatar; ?>" alt="<?php echo htmlspecialchars($this->user->name, ENT_QUOTES, 'UTF-8'); ?>" style="width:<?php echo $this->params->get('userImageWidth'); ?>px; height:auto;" />
		<?php endif; ?>

		<?php if ($this->params->get('userName')): ?>
		<h2><?php echo $this->user->name; ?></h2>
		<?php endif; ?>

		<?php if ($this->params->get('userDescription') && isset($this->user->profile->description) && trim($this->user->profile->description)!=''): ?>
		<div class="userDescription"><?php echo $this->user->profile->description; ?></div>
		<?php endif; ?>

		<?php if (($this->params->get('userURL') && isset($this->user->profile->url) && $this->user->profile->url) || $this->params->get('userEmail')): ?>
		<div class="userAdditionalInfo">
			<?php if ($this->params->get('userURL') && isset($this->user->profile->url) && $this->user->profile->url): ?>
			<span class="userURL">
				<?php echo JText::_('K2_WEBSITE_URL'); ?>: <a href="<?php echo $this->user->profile->url; ?>" target="_blank" rel="me"><?php echo $this->user->profile->url; ?></a>
			</span>
			<?php endif; ?>

			<?php if ($this->params->get('userEmail')): ?>
			<span class="userEmail">
				<?php echo JText::_('K2_EMAIL'); ?>: <?php echo JHTML::_('Email.cloak', $this->user->email); ?>
			</span>
			<?php endif; ?>
		</div>
		<?php endif; ?>

		<div class="clr"></div>

		<?php echo $this->user->event->K2UserDisplay; ?>

		<div class="clr"></div>
	</div>
	<?php endif; ?>



	<?php if(count($this->items)): ?>
	<!-- Item list -->
	<div class="userItemList">
		<?php foreach ($this->items as $item): ?>

		<!-- Start K2 Item Layout -->
		<div class="userItemView<?php if(!$item->published || ($item->publish_up != $this->nullDate && $item->publish_up > $this->now) || ($item->publish_down != $this->nullDate && $item->publish_down < $this->now)) echo ' userItemViewUnpublished'; ?><?php echo ($item->featured) ? ' userItemIsFeatured' : ''; ?>">

			<!-- Plugins: BeforeDisplay -->
			<?php echo $item->event->BeforeDisplay; ?>

			<!-- K2 Plugins: K2BeforeDisplay -->
			<?php echo $item->event->K2BeforeDisplay; ?>

			<div class="userItemHeader">
				<?php if($this->params->get('userItemDateCreated')): ?>
				<!-- Date created -->
				<span class="userItemDateCreated">
					<?php echo JHTML::_('date', $item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
				</span>
				<?php endif; ?>

			  <?php if($this->params->get('userItemTitle')): ?>
			  <!-- Item title -->
			  <h3 class="userItemTitle">
					<?php if(isset($item->editLink)): ?>
					<!-- Item edit link -->
					<span class="userItemEditLink">
						<a data-k2-modal="edit" href="<?php echo $item->editLink; ?>">
							<?php echo JText::_('K2_EDIT_ITEM'); ?>
						</a>
					</span>
					<?php endif; ?>

			  	<?php if ($this->params->get('userItemTitleLinked') && $item->published): ?>
					<a href="<?php echo $item->link; ?>">
			  		<?php echo $item->title; ?>
			  	</a>
			  	<?php else: ?>
			  	<?php echo $item->title; ?>
			  	<?php endif; ?>
			  	<?php if(!$item->published || ($item->publish_up != $this->nullDate && $item->publish_up > $this->now) || ($item->publish_down != $this->nullDate && $item->publish_down < $this->now)): ?>
			  	<span>
		  			<sup>
		  				<?php echo JText::_('K2_UNPUBLISHED'); ?>
		  			</sup>
	  			</span>
	  			<?php endif; ?>
			  </h3>
			  <?php endif; ?>
		  </div>

		  <!-- Plugins: AfterDisplayTitle -->
		  <?php echo $item->event->AfterDisplayTitle; ?>

		  <!-- K2 Plugins: K2AfterDisplayTitle -->
		  <?php echo $item->event->K2AfterDisplayTitle; ?>

		  <div class="userItemBody">

			  <!-- Plugins: BeforeDisplayContent -->
			  <?php echo $item->event->BeforeDisplayContent; ?>

			  <!-- K2 Plugins: K2BeforeDisplayContent -->
			  <?php echo $item->event->K2BeforeDisplayContent; ?>

			  <?php if($this->params->get('userItemImage') && !empty($item->imageGeneric)): ?>
			  <!-- Item Image -->
			  <div class="userItemImageBlock">
				  <span class="userItemImage">
				    <a href="<?php echo $item->link; ?>" title="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>">
				    	<img src="<?php echo $item->imageGeneric; ?>" alt="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>" style="width:<?php echo $this->params->get('itemImageGeneric'); ?>px; height:auto;" />
				    </a>
				  </span>
				  <div class="clr"></div>
			  </div>
			  <?php endif; ?>

			  <?php if($this->params->get('userItemIntroText')): ?>
			  <!-- Item introtext -->
			  <div class="userItemIntroText">
			  	<?php echo $item->introtext; ?>
			  </div>
			  <?php endif; ?>

				<div class="clr"></div>

			  <!-- Plugins: AfterDisplayContent -->
			  <?php echo $item->event->AfterDisplayContent; ?>

			  <!-- K2 Plugins: K2AfterDisplayContent -->
			  <?php echo $item->event->K2AfterDisplayContent; ?>

			  <div class="clr"></div>
		  </div>

		  <?php if($this->params->get('userItemCategory') || $this->params->get('userItemTags')): ?>
		  <div class="userItemLinks">

				<?php if($this->params->get('userItemCategory')): ?>
				<!-- Item category name -->
				<div class="userItemCategory">
					<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
					<a href="<?php echo $item->category->link; ?>"><?php echo $item->category->name; ?></a>
				</div>
				<?php endif; ?>

			  <?php if($this->params->get('userItemTags') && isset($item->tags)): ?>
			  <!-- Item tags -->
			  <div class="userItemTagsBlock">
				  <span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>
				  <ul class="userItemTags">
				    <?php foreach ($item->tags as $tag): ?>
				    <li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
				    <?php endforeach; ?>
				  </ul>
				  <div class="clr"></div>
			  </div>
			  <?php endif; ?>

				<div class="clr"></div>
		  </div>
		  <?php endif; ?>

			<div class="clr"></div>

			<?php if($this->params->get('userItemCommentsAnchor') && ( ($this->params->get('comments') == '2' && !$this->user->guest) || ($this->params->get('comments') == '1')) ): ?>
			<!-- Anchor link to comments below -->
			<div class="userItemCommentsLink">
				<?php if(!empty($item->event->K2CommentsCounter)): ?>
					<!-- K2 Plugins: K2CommentsCounter -->
					<?php echo $item->event->K2CommentsCounter; ?>
				<?php else: ?>
					<?php if($item->numOfComments > 0): ?>
					<a href="<?php echo $item->link; ?>#itemCommentsAnchor">
						<?php echo $item->numOfComments; ?> <?php echo ($item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
					</a>
					<?php else: ?>
					<a href="<?php echo $item->link; ?>#itemCommentsAnchor">
						<?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?>
					</a>
					<?php endif; ?>
				<?php endif; ?>
			</div>
			<?php endif; ?>

			<?php if ($this->params->get('userItemReadMore')): ?>
			<!-- Item "read more..." link -->
			<div class="userItemReadMore">
				<a class="k2ReadMore" href="<?php echo $item->link; ?>">
					<?php echo JText::_('K2_READ_MORE'); ?>
				</a>
			</div>
			<?php endif; ?>

			<div class="clr"></div>

		  <!-- Plugins: AfterDisplay -->
		  <?php echo $item->event->AfterDisplay; ?>

		  <!-- K2 Plugins: K2AfterDisplay -->
		  <?php echo $item->event->K2AfterDisplay; ?>

			<div class="clr"></div>
		</div>
		<!-- End K2 Item Layout -->

		<?php endforeach; ?>
	</div>

	<!-- Pagination -->
	<?php if(count($this->pagination->getPagesLinks())): ?>
	<div class="k2Pagination">
		<?php echo $this->pagination->getPagesLinks(); ?>
		<div class="clr"></div>
		<?php echo $this->pagination->getPagesCounter(); ?>
	</div>
	<?php endif; ?>

	<?php endif; ?>

</div>

<!-- End K2 User Layout -->
templates/default/item.php000060400000070322150751650350011644 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<?php if(JRequest::getInt('print')==1): ?>
<!-- Print button at the top of the print page only -->
<a class="itemPrintThisPage" rel="nofollow" href="#" onclick="window.print();return false;">
	<span><?php echo JText::_('K2_PRINT_THIS_PAGE'); ?></span>
</a>
<?php endif; ?>

<!-- Start K2 Item Layout -->
<span id="startOfPageId<?php echo JRequest::getInt('id'); ?>"></span>

<div id="k2Container" class="itemView<?php echo ($this->item->featured) ? ' itemIsFeatured' : ''; ?><?php if($this->item->params->get('pageclass_sfx')) echo ' '.$this->item->params->get('pageclass_sfx'); ?>">

	<!-- Plugins: BeforeDisplay -->
	<?php echo $this->item->event->BeforeDisplay; ?>

	<!-- K2 Plugins: K2BeforeDisplay -->
	<?php echo $this->item->event->K2BeforeDisplay; ?>

	<div class="itemHeader">

	<?php if($this->item->params->get('itemDateCreated')): ?>
	<!-- Date created -->
	<span class="itemDateCreated">
		<?php echo JHTML::_('date', $this->item->created, JText::_('K2_DATE_FORMAT_LC2')); ?>
	</span>
	<?php endif; ?>

	<?php if($this->item->params->get('itemTitle')): ?>
	<!-- Item title -->
	<h2 class="itemTitle">
		<?php if(isset($this->item->editLink)): ?>
		<!-- Item edit link -->
		<span class="itemEditLink">
			<a data-k2-modal="edit" href="<?php echo $this->item->editLink; ?>"><?php echo JText::_('K2_EDIT_ITEM'); ?></a>
		</span>
		<?php endif; ?>

		<?php echo $this->item->title; ?>

		<?php if($this->item->params->get('itemFeaturedNotice') && $this->item->featured): ?>
		<!-- Featured flag -->
		<span>
			<sup>
				<?php echo JText::_('K2_FEATURED'); ?>
			</sup>
		</span>
		<?php endif; ?>
	</h2>
	<?php endif; ?>

	<?php if($this->item->params->get('itemAuthor')): ?>
	<!-- Item Author -->
	<span class="itemAuthor">
		<?php echo K2HelperUtilities::writtenBy($this->item->author->profile->gender); ?>
		<?php if(empty($this->item->created_by_alias)): ?>
		<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
		<?php else: ?>
		<?php echo $this->item->author->name; ?>
		<?php endif; ?>
	</span>
	<?php endif; ?>

	</div>

	<!-- Plugins: AfterDisplayTitle -->
	<?php echo $this->item->event->AfterDisplayTitle; ?>

	<!-- K2 Plugins: K2AfterDisplayTitle -->
	<?php echo $this->item->event->K2AfterDisplayTitle; ?>

	<?php if(
		$this->item->params->get('itemFontResizer') ||
		$this->item->params->get('itemPrintButton') ||
		$this->item->params->get('itemEmailButton') ||
		$this->item->params->get('itemSocialButton') ||
		($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)) ||
		($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)) ||
		($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && $this->item->params->get('comments'))
	): ?>
	<div class="itemToolbar">
		<ul>
			<?php if($this->item->params->get('itemFontResizer')): ?>
			<!-- Font Resizer -->
			<li>
				<span class="itemTextResizerTitle"><?php echo JText::_('K2_FONT_SIZE'); ?></span>
				<a href="#" id="fontDecrease">
					<span><?php echo JText::_('K2_DECREASE_FONT_SIZE'); ?></span>
				</a>
				<a href="#" id="fontIncrease">
					<span><?php echo JText::_('K2_INCREASE_FONT_SIZE'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemPrintButton') && !JRequest::getInt('print')): ?>
			<!-- Print Button -->
			<li>
				<a class="itemPrintLink" rel="nofollow" href="<?php echo $this->item->printLink; ?>" onclick="window.open(this.href,'printWindow','width=900,height=600,location=no,menubar=no,resizable=yes,scrollbars=yes'); return false;">
					<span><?php echo JText::_('K2_PRINT'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemEmailButton') && !JRequest::getInt('print')): ?>
			<!-- Email Button -->
			<li>
				<a class="itemEmailLink" rel="nofollow" href="<?php echo $this->item->emailLink; ?>" onclick="window.open(this.href,'emailWindow','width=400,height=350,location=no,menubar=no,resizable=no,scrollbars=no'); return false;">
					<span><?php echo JText::_('K2_EMAIL'); ?></span>
				</a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemSocialButton') && !is_null($this->item->params->get('socialButtonCode', NULL))): ?>
			<!-- Item Social Button -->
			<li>
				<?php echo $this->item->params->get('socialButtonCode'); ?>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemVideoAnchor') && !empty($this->item->video)): ?>
			<!-- Anchor link to item video below - if it exists -->
			<li>
				<a class="itemVideoLink k2Anchor" href="<?php echo $this->item->link; ?>#itemVideoAnchor"><?php echo JText::_('K2_MEDIA'); ?></a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemImageGalleryAnchor') && !empty($this->item->gallery)): ?>
			<!-- Anchor link to item image gallery below - if it exists -->
			<li>
				<a class="itemImageGalleryLink k2Anchor" href="<?php echo $this->item->link; ?>#itemImageGalleryAnchor"><?php echo JText::_('K2_IMAGE_GALLERY'); ?></a>
			</li>
			<?php endif; ?>

			<?php if($this->item->params->get('itemCommentsAnchor') && $this->item->params->get('itemComments') && ( ($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1')) ): ?>
			<!-- Anchor link to comments below - if enabled -->
			<li>
				<?php if(!empty($this->item->event->K2CommentsCounter)): ?>
				<!-- K2 Plugins: K2CommentsCounter -->
				<?php echo $this->item->event->K2CommentsCounter; ?>
				<?php else: ?>
				<?php if($this->item->numOfComments > 0): ?>
				<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor">
					<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
				</a>
				<?php else: ?>
				<a class="itemCommentsLink k2Anchor" href="<?php echo $this->item->link; ?>#itemCommentsAnchor"><?php echo JText::_('K2_BE_THE_FIRST_TO_COMMENT'); ?></a>
				<?php endif; ?>
				<?php endif; ?>
			</li>
			<?php endif; ?>
		</ul>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemRating')): ?>
	<!-- Item Rating -->
	<div class="itemRatingBlock">
		<span><?php echo JText::_('K2_RATE_THIS_ITEM'); ?></span>
		<div class="itemRatingForm">
			<ul class="itemRatingList">
				<li class="itemCurrentRating" id="itemCurrentRating<?php echo $this->item->id; ?>" style="width:<?php echo $this->item->votingPercentage; ?>%;"></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_1_STAR_OUT_OF_5'); ?>" class="one-star">1</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_2_STARS_OUT_OF_5'); ?>" class="two-stars">2</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_3_STARS_OUT_OF_5'); ?>" class="three-stars">3</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_4_STARS_OUT_OF_5'); ?>" class="four-stars">4</a></li>
				<li><a href="#" data-id="<?php echo $this->item->id; ?>" title="<?php echo JText::_('K2_5_STARS_OUT_OF_5'); ?>" class="five-stars">5</a></li>
			</ul>
			<div id="itemRatingLog<?php echo $this->item->id; ?>" class="itemRatingLog"><?php echo $this->item->numOfvotes; ?></div>
			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<div class="itemBody">

		<!-- Plugins: BeforeDisplayContent -->
		<?php echo $this->item->event->BeforeDisplayContent; ?>

		<!-- K2 Plugins: K2BeforeDisplayContent -->
		<?php echo $this->item->event->K2BeforeDisplayContent; ?>

		<?php if($this->item->params->get('itemImage') && !empty($this->item->image)): ?>
		<!-- Item Image -->
		<div class="itemImageBlock">
			<span class="itemImage">
				<a data-k2-modal="image" href="<?php echo $this->item->imageXLarge; ?>" title="<?php echo JText::_('K2_CLICK_TO_PREVIEW_IMAGE'); ?>">
					<img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
				</a>
			</span>

			<?php if($this->item->params->get('itemImageMainCaption') && !empty($this->item->image_caption)): ?>
			<!-- Image caption -->
			<span class="itemImageCaption"><?php echo $this->item->image_caption; ?></span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemImageMainCredits') && !empty($this->item->image_credits)): ?>
			<!-- Image credits -->
			<span class="itemImageCredits"><?php echo $this->item->image_credits; ?></span>
			<?php endif; ?>

			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if(!empty($this->item->fulltext)): ?>

		<?php if($this->item->params->get('itemIntroText')): ?>
		<!-- Item introtext -->
		<div class="itemIntroText">
			<?php echo $this->item->introtext; ?>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemFullText')): ?>
		<!-- Item fulltext -->
		<div class="itemFullText">
			<?php echo $this->item->fulltext; ?>
		</div>
		<?php endif; ?>

		<?php else: ?>

		<!-- Item text -->
		<div class="itemFullText">
			<?php echo $this->item->introtext; ?>
		</div>

		<?php endif; ?>

		<div class="clr"></div>

		<?php if($this->item->params->get('itemExtraFields') && count($this->item->extra_fields)): ?>
		<!-- Item extra fields -->
		<div class="itemExtraFields">
			<h3><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h3>
			<ul>
				<?php foreach ($this->item->extra_fields as $key => $extraField): ?>
				<?php if($extraField->value != ''): ?>
				<li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?> alias<?php echo ucfirst($extraField->alias); ?>">
					<?php if($extraField->type == 'header'): ?>
					<h4 class="itemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
					<?php else: ?>
					<span class="itemExtraFieldsLabel"><?php echo $extraField->name; ?>:</span>
					<span class="itemExtraFieldsValue"><?php echo $extraField->value; ?></span>
					<?php endif; ?>
				</li>
				<?php endif; ?>
				<?php endforeach; ?>
			</ul>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemHits') || ($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0)): ?>
		<div class="itemContentFooter">

			<?php if($this->item->params->get('itemHits')): ?>
			<!-- Item Hits -->
			<span class="itemHits">
				<?php echo JText::_('K2_READ'); ?> <b><?php echo $this->item->hits; ?></b> <?php echo JText::_('K2_TIMES'); ?>
			</span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemDateModified') && intval($this->item->modified)!=0): ?>
			<!-- Item date modified -->
			<span class="itemDateModified">
				<?php echo JText::_('K2_LAST_MODIFIED_ON'); ?> <?php echo JHTML::_('date', $this->item->modified, JText::_('K2_DATE_FORMAT_LC2')); ?>
			</span>
			<?php endif; ?>

			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<!-- Plugins: AfterDisplayContent -->
		<?php echo $this->item->event->AfterDisplayContent; ?>

		<!-- K2 Plugins: K2AfterDisplayContent -->
		<?php echo $this->item->event->K2AfterDisplayContent; ?>

		<div class="clr"></div>

	</div>

	<?php if(
		$this->item->params->get('itemTwitterButton',1) ||
		$this->item->params->get('itemFacebookButton',1) ||
		$this->item->params->get('itemGooglePlusOneButton',1)
	): ?>
	<!-- Social sharing -->
	<div class="itemSocialSharing">

		<?php if($this->item->params->get('itemTwitterButton',1)): ?>
		<!-- Twitter Button -->
		<div class="itemTwitterButton">
			<a href="https://twitter.com/share" class="twitter-share-button" data-lang="<?php echo $this->item->langTagForTW; ?>" data-via="<?php if($this->item->params->get('twitterUsername')) echo $this->item->params->get('twitterUsername'); ?>"><?php echo JText::_('K2_TWEET'); ?></a>
			<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemFacebookButton',1)): ?>
		<!-- Facebook Button -->
		<div class="itemFacebookButton">
			<div id="fb-root"></div>
			<script>(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(d.getElementById(id)) return;js=d.createElement(s);js.id=id;js.src="//connect.facebook.net/<?php echo $this->item->langTagForFB; ?>/sdk.js#xfbml=1&version=v2.5";fjs.parentNode.insertBefore(js,fjs);}(document,'script','facebook-jssdk'));</script>
			<div class="fb-like" data-width="200" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemGooglePlusOneButton',1)): ?>
		<!-- Google +1 Button -->
		<div class="itemGooglePlusOneButton">
			<div class="g-plusone" data-size="medium"></div>
			<script>window.___gcfg={lang:'<?php echo $this->item->langTagForGP; ?>'};(function(){var po=document.createElement('script');po.type='text/javascript';po.async=true;po.src='https://apis.google.com/js/platform.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(po,s);})();</script>
		</div>
		<?php endif; ?>

		<div class="clr"></div>

	</div>
	<?php endif; ?>

	<?php if(
		$this->item->params->get('itemCategory') ||
		$this->item->params->get('itemTags') ||
		$this->item->params->get('itemAttachments')
	): ?>
	<div class="itemLinks">

		<?php if($this->item->params->get('itemCategory')): ?>
		<!-- Item category -->
		<div class="itemCategory">
			<span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
			<a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemTags') && count($this->item->tags)): ?>
		<!-- Item tags -->
		<div class="itemTagsBlock">
			<span><?php echo JText::_('K2_TAGGED_UNDER'); ?></span>
			<ul class="itemTags">
				<?php foreach ($this->item->tags as $tag): ?>
				<li><a href="<?php echo $tag->link; ?>"><?php echo $tag->name; ?></a></li>
				<?php endforeach; ?>
			</ul>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if($this->item->params->get('itemAttachments') && count($this->item->attachments)): ?>
		<!-- Item attachments -->
		<div class="itemAttachmentsBlock">
			<span><?php echo JText::_('K2_DOWNLOAD_ATTACHMENTS'); ?></span>
			<ul class="itemAttachments">
				<?php foreach ($this->item->attachments as $attachment): ?>
				<li>
					<a title="<?php echo K2HelperUtilities::cleanHtml($attachment->titleAttribute); ?>" href="<?php echo $attachment->link; ?>"><?php echo $attachment->title; ?></a>
					<?php if($this->item->params->get('itemAttachmentsCounter')): ?>
					<span>(<?php echo $attachment->hits; ?> <?php echo ($attachment->hits==1) ? JText::_('K2_DOWNLOAD') : JText::_('K2_DOWNLOADS'); ?>)</span>
					<?php endif; ?>
				</li>
				<?php endforeach; ?>
			</ul>
		</div>
		<?php endif; ?>

		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemAuthorBlock') && empty($this->item->created_by_alias)): ?>
	<!-- Author Block -->
	<div class="itemAuthorBlock">
		<?php if($this->item->params->get('itemAuthorImage') && !empty($this->item->author->avatar)): ?>
		<img class="itemAuthorAvatar" src="<?php echo $this->item->author->avatar; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($this->item->author->name); ?>" />
		<?php endif; ?>

		<div class="itemAuthorDetails">
			<h3 class="itemAuthorName">
				<a rel="author" href="<?php echo $this->item->author->link; ?>"><?php echo $this->item->author->name; ?></a>
			</h3>

			<?php if($this->item->params->get('itemAuthorDescription') && !empty($this->item->author->profile->description)): ?>
			<p><?php echo $this->item->author->profile->description; ?></p>
			<?php endif; ?>

			<?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url)): ?>
			<span class="itemAuthorUrl"><i class="icon-globe"></i> <a rel="me" href="<?php echo $this->item->author->profile->url; ?>" target="_blank"><?php echo str_replace('http://','',$this->item->author->profile->url); ?></a></span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemAuthorURL') && !empty($this->item->author->profile->url) && $this->item->params->get('itemAuthorEmail')): ?>
			<span class="k2HorizontalSep">|</span>
			<?php endif; ?>

			<?php if($this->item->params->get('itemAuthorEmail')): ?>
			<span class="itemAuthorEmail"><i class="icon-envelope"></i> <?php echo JHTML::_('Email.cloak', $this->item->author->email); ?></span>
			<?php endif; ?>

			<div class="clr"></div>

			<!-- K2 Plugins: K2UserDisplay -->
			<?php echo $this->item->event->K2UserDisplay; ?>

			<div class="clr"></div>
		</div>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemAuthorLatest') && empty($this->item->created_by_alias) && isset($this->authorLatestItems)): ?>
	<!-- Latest items from author -->
	<div class="itemAuthorLatest">
		<h3><?php echo JText::_('K2_LATEST_FROM'); ?> <?php echo $this->item->author->name; ?></h3>
		<ul>
			<?php foreach($this->authorLatestItems as $key=>$item): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; ?>">
				<a href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>
			</li>
			<?php endforeach; ?>
		</ul>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php
	/*
	A note regarding 'Related Items'...
	If you add:
	- the CSS rule 'overflow-x:scroll;' in the element div.itemRelated {…} in the k2.css
	- the class 'k2Scroller' to the ul element below
	- the classes 'k2ScrollerElement' and 'k2EqualHeights' to the li element inside the foreach loop below
	- the style attribute 'style="width:<?php echo $item->imageWidth; ?>px;"' to the li element inside the foreach loop below
	...then your Related Items will be transformed into a vertical-scrolling block, inside which, all items have the same height (equal column heights). This can be very useful if you want to show your related articles or products with title/author/category/image etc., which would take a significant amount of space in the classic list-style display.
	*/
	?>

	<?php if($this->item->params->get('itemRelated') && isset($this->relatedItems)): ?>
	<!-- Related items by tag -->
	<div class="itemRelated">
		<h3><?php echo JText::_("K2_RELATED_ITEMS_BY_TAG"); ?></h3>
		<ul>
			<?php foreach($this->relatedItems as $key=>$item): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; ?>">

				<?php if($this->item->params->get('itemRelatedTitle', 1)): ?>
				<a class="itemRelTitle" href="<?php echo $item->link ?>"><?php echo $item->title; ?></a>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedCategory')): ?>
				<div class="itemRelCat"><?php echo JText::_("K2_IN"); ?> <a href="<?php echo $item->category->link ?>"><?php echo $item->category->name; ?></a></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedAuthor')): ?>
				<div class="itemRelAuthor"><?php echo JText::_("K2_BY"); ?> <a rel="author" href="<?php echo $item->author->link; ?>"><?php echo $item->author->name; ?></a></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedImageSize')): ?>
				<img style="width:<?php echo $item->imageWidth; ?>px;height:auto;" class="itemRelImg" src="<?php echo $item->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($item->title); ?>" />
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedIntrotext')): ?>
				<div class="itemRelIntrotext"><?php echo $item->introtext; ?></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedFulltext')): ?>
				<div class="itemRelFulltext"><?php echo $item->fulltext; ?></div>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedMedia')): ?>
				<?php if($item->videoType=='embedded'): ?>
				<div class="itemRelMediaEmbedded"><?php echo $item->video; ?></div>
				<?php else: ?>
				<div class="itemRelMedia"><?php echo $item->video; ?></div>
				<?php endif; ?>
				<?php endif; ?>

				<?php if($this->item->params->get('itemRelatedImageGallery')): ?>
				<div class="itemRelImageGallery"><?php echo $item->gallery; ?></div>
				<?php endif; ?>
			</li>
			<?php endforeach; ?>
			<li class="clr"></li>
		</ul>
		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<div class="clr"></div>

	<?php if($this->item->params->get('itemVideo') && !empty($this->item->video)): ?>
	<!-- Item video -->
	<a name="itemVideoAnchor" id="itemVideoAnchor"></a>
	<div class="itemVideoBlock">
		<h3><?php echo JText::_('K2_MEDIA'); ?></h3>

		<?php if($this->item->videoType=='embedded'): ?>
		<div class="itemVideoEmbedded">
			<?php echo $this->item->video; ?>
		</div>
		<?php else: ?>
		<span class="itemVideo"><?php echo $this->item->video; ?></span>
		<?php endif; ?>

		<?php if($this->item->params->get('itemVideoCaption') && !empty($this->item->video_caption)): ?>
		<span class="itemVideoCaption"><?php echo $this->item->video_caption; ?></span>
		<?php endif; ?>

		<?php if($this->item->params->get('itemVideoCredits') && !empty($this->item->video_credits)): ?>
		<span class="itemVideoCredits"><?php echo $this->item->video_credits; ?></span>
		<?php endif; ?>

		<div class="clr"></div>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemImageGallery') && !empty($this->item->gallery)): ?>
	<!-- Item image gallery -->
	<a name="itemImageGalleryAnchor" id="itemImageGalleryAnchor"></a>
	<div class="itemImageGallery">
		<h3><?php echo JText::_('K2_IMAGE_GALLERY'); ?></h3>
		<?php echo $this->item->gallery; ?>
	</div>
	<?php endif; ?>

	<?php if($this->item->params->get('itemNavigation') && !JRequest::getCmd('print') && (isset($this->item->nextLink) || isset($this->item->previousLink))): ?>
	<!-- Item navigation -->
	<div class="itemNavigation">
		<span class="itemNavigationTitle"><?php echo JText::_('K2_MORE_IN_THIS_CATEGORY'); ?></span>

		<?php if(isset($this->item->previousLink)): ?>
		<a class="itemPrevious" href="<?php echo $this->item->previousLink; ?>">&laquo; <?php echo $this->item->previousTitle; ?></a>
		<?php endif; ?>

		<?php if(isset($this->item->nextLink)): ?>
		<a class="itemNext" href="<?php echo $this->item->nextLink; ?>"><?php echo $this->item->nextTitle; ?> &raquo;</a>
		<?php endif; ?>
	</div>
	<?php endif; ?>

	<!-- Plugins: AfterDisplay -->
	<?php echo $this->item->event->AfterDisplay; ?>

	<!-- K2 Plugins: K2AfterDisplay -->
	<?php echo $this->item->event->K2AfterDisplay; ?>

	<?php if(
		$this->item->params->get('itemComments') &&
		(($this->item->params->get('comments') == '2' && !$this->user->guest) || ($this->item->params->get('comments') == '1'))
	): ?>
	<!-- K2 Plugins: K2CommentsBlock -->
	<?php echo $this->item->event->K2CommentsBlock; ?>
	<?php endif; ?>

	<?php if(
		$this->item->params->get('itemComments') &&
		($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2')) && empty($this->item->event->K2CommentsBlock)
	): ?>
	<!-- Item comments -->
	<a name="itemCommentsAnchor" id="itemCommentsAnchor"></a>
	<div class="itemComments">
		<?php if($this->item->params->get('commentsFormPosition')=='above' && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
		<!-- Item comments form -->
		<div class="itemCommentsForm">
			<?php echo $this->loadTemplate('comments_form'); ?>
		</div>
		<?php endif; ?>

		<?php if($this->item->numOfComments>0 && $this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2'))): ?>
		<!-- Item user comments -->
		<h3 class="itemCommentsCounter">
			<span><?php echo $this->item->numOfComments; ?></span> <?php echo ($this->item->numOfComments>1) ? JText::_('K2_COMMENTS') : JText::_('K2_COMMENT'); ?>
		</h3>

		<ul class="itemCommentsList">
			<?php foreach ($this->item->comments as $key=>$comment): ?>
			<li class="<?php echo ($key%2) ? "odd" : "even"; echo (!$this->item->created_by_alias && $comment->userID==$this->item->created_by) ? " authorResponse" : ""; echo($comment->published) ? '':' unpublishedComment'; ?>">
				<span class="commentLink">
					<a href="<?php echo $this->item->link; ?>#comment<?php echo $comment->id; ?>" name="comment<?php echo $comment->id; ?>" id="comment<?php echo $comment->id; ?>">
						<?php echo JText::_('K2_COMMENT_LINK'); ?>
					</a>
				</span>

				<?php if($comment->userImage): ?>
				<img src="<?php echo $comment->userImage; ?>" alt="<?php echo JFilterOutput::cleanText($comment->userName); ?>" width="<?php echo $this->item->params->get('commenterImgWidth'); ?>" />
				<?php endif; ?>

				<span class="commentDate"><?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_LC2')); ?></span>

				<span class="commentAuthorName">
					<?php echo JText::_('K2_POSTED_BY'); ?>
					<?php if(!empty($comment->userLink)): ?>
					<a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" title="<?php echo JFilterOutput::cleanText($comment->userName); ?>" target="_blank" rel="nofollow"><?php echo $comment->userName; ?></a>
					<?php else: ?>
					<?php echo $comment->userName; ?>
					<?php endif; ?>
				</span>

				<p><?php echo $comment->commentText; ?></p>

				<?php if(
					$this->inlineCommentsModeration ||
					($comment->published && ($this->params->get('commentsReporting')=='1' || ($this->params->get('commentsReporting')=='2' && !$this->user->guest)))
				): ?>
				<span class="commentToolbar">
					<?php if($this->inlineCommentsModeration): ?>
					<?php if(!$comment->published): ?>
					<a class="commentApproveLink" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=publish&commentID='.$comment->id.'&format=raw')?>"><?php echo JText::_('K2_APPROVE')?></a>
					<?php endif; ?>

					<a class="commentRemoveLink" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=remove&commentID='.$comment->id.'&format=raw')?>"><?php echo JText::_('K2_REMOVE')?></a>
					<?php endif; ?>

					<?php if($comment->published && ($this->params->get('commentsReporting')=='1' || ($this->params->get('commentsReporting')=='2' && !$this->user->guest))): ?>
					<a data-k2-modal="iframe" href="<?php echo JRoute::_('index.php?option=com_k2&view=comments&task=report&commentID='.$comment->id)?>"><?php echo JText::_('K2_REPORT')?></a>
					<?php endif; ?>

					<?php if($comment->reportUserLink): ?>
					<a class="k2ReportUserButton" href="<?php echo $comment->reportUserLink; ?>"><?php echo JText::_('K2_FLAG_AS_SPAMMER'); ?></a>
					<?php endif; ?>
				</span>
				<?php endif; ?>

				<div class="clr"></div>
			</li>
			<?php endforeach; ?>
		</ul>

		<!-- Comments Pagination -->
		<div class="itemCommentsPagination">
			<?php echo $this->pagination->getPagesLinks(); ?>
			<div class="clr"></div>
		</div>
		<?php endif; ?>

		<?php if(
			$this->item->params->get('commentsFormPosition')=='below' &&
			$this->item->params->get('itemComments') &&
			!JRequest::getInt('print') &&
			($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))
		): ?>
		<!-- Item comments form -->
		<div class="itemCommentsForm">
			<?php echo $this->loadTemplate('comments_form'); ?>
		</div>
		<?php endif; ?>

		<?php $user = JFactory::getUser(); if($this->item->params->get('comments') == '2' && $user->guest): ?>
		<div class="itemCommentsLoginFirst"><?php echo JText::_('K2_LOGIN_TO_POST_COMMENTS'); ?></div>
		<?php endif; ?>

	</div>
	<?php endif; ?>

	<?php if(!JRequest::getCmd('print')): ?>
	<div class="itemBackToTop">
		<a class="k2Anchor" href="<?php echo $this->item->link; ?>#startOfPageId<?php echo JRequest::getInt('id'); ?>">
			<?php echo JText::_('K2_BACK_TO_TOP'); ?>
		</a>
	</div>
	<?php endif; ?>

	<div class="clr"></div>

</div>
<!-- End K2 Item Layout -->
templates/default/latest.php000060400000013176150751650350012206 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- Start K2 Latest Layout -->
<div id="k2Container" class="latestView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">

	<?php if($this->params->get('show_page_title')): ?>
	<!-- Page title -->
	<div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
	<?php endif; ?>

	<?php foreach($this->blocks as $key=>$block): ?>
	<div class="latestItemsContainer" style="width:<?php echo number_format(100/$this->params->get('latestItemsCols'), 1); ?>%;">

		<?php if($this->source=='categories'): $category=$block; ?>

		<?php if($this->params->get('categoryFeed') || $this->params->get('categoryImage') || $this->params->get('categoryTitle') || $this->params->get('categoryDescription')): ?>
		<!-- Start K2 Category block -->
		<div class="latestItemsCategory">
			<?php if($this->params->get('categoryFeed')): ?>
			<!-- RSS feed icon -->
			<div class="k2FeedIcon">
				<a href="<?php echo $category->feed; ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?>">
					<span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></span>
				</a>
				<div class="clr"></div>
			</div>
			<?php endif; ?>

			<?php if ($this->params->get('categoryImage') && !empty($category->image)): ?>
			<div class="latestItemsCategoryImage">
				<img src="<?php echo $category->image; ?>" alt="<?php echo K2HelperUtilities::cleanHtml($category->name); ?>" style="width:<?php echo $this->params->get('catImageWidth'); ?>px;height:auto;" />
			</div>
			<?php endif; ?>

			<?php if ($this->params->get('categoryTitle')): ?>
			<h2><a href="<?php echo $category->link; ?>"><?php echo $category->name; ?></a></h2>
			<?php endif; ?>

			<?php if ($this->params->get('categoryDescription') && isset($category->description)): ?>
			<p><?php echo $category->description; ?></p>
			<?php endif; ?>

			<div class="clr"></div>

			<!-- K2 Plugins: K2CategoryDisplay -->
			<?php echo $category->event->K2CategoryDisplay; ?>
			<div class="clr"></div>
		</div>
		<!-- End K2 Category block -->
		<?php endif; ?>

		<?php else: $user=$block; ?>

		<?php if ($this->params->get('userFeed') || $this->params->get('userImage') || $this->params->get('userName') || $this->params->get('userDescription') || $this->params->get('userURL') || $this->params->get('userEmail')): ?>
		<!-- Start K2 User block -->
		<div class="latestItemsUser">

			<?php if($this->params->get('userFeed')): ?>
			<!-- RSS feed icon -->
			<div class="k2FeedIcon">
				<a href="<?php echo $user->feed; ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?>">
					<span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></span>
				</a>
				<div class="clr"></div>
			</div>
			<?php endif; ?>

			<?php if ($this->params->get('userImage') && !empty($user->avatar)): ?>
			<img src="<?php echo $user->avatar; ?>" alt="<?php echo $user->name; ?>" style="width:<?php echo $this->params->get('userImageWidth'); ?>px;height:auto;" />
			<?php endif; ?>

			<?php if ($this->params->get('userName')): ?>
			<h2><a rel="author" href="<?php echo $user->link; ?>"><?php echo $user->name; ?></a></h2>
			<?php endif; ?>

			<?php if ($this->params->get('userDescription') && isset($user->profile->description)): ?>
			<p class="latestItemsUserDescription"><?php echo $user->profile->description; ?></p>
			<?php endif; ?>

			<?php if ($this->params->get('userURL') || $this->params->get('userEmail')): ?>
			<p class="latestItemsUserAdditionalInfo">
				<?php if ($this->params->get('userURL') && isset($user->profile->url)): ?>
				<span class="latestItemsUserURL">
					<?php echo JText::_('K2_WEBSITE_URL'); ?>: <a rel="me" href="<?php echo $user->profile->url; ?>" target="_blank"><?php echo $user->profile->url; ?></a>
				</span>
				<?php endif; ?>

				<?php if ($this->params->get('userEmail')): ?>
				<span class="latestItemsUserEmail">
					<?php echo JText::_('K2_EMAIL'); ?>: <?php echo JHTML::_('Email.cloak', $user->email); ?>
				</span>
				<?php endif; ?>
			</p>
			<?php endif; ?>

			<div class="clr"></div>

			<?php echo $user->event->K2UserDisplay; ?>

			<div class="clr"></div>
		</div>
		<!-- End K2 User block -->
		<?php endif; ?>

		<?php endif; ?>

		<!-- Start Items list -->
		<div class="latestItemList">
			<?php if($this->params->get('latestItemsDisplayEffect')=="first"): ?>

			<?php foreach ($block->items as $itemCounter=>$item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
			<?php if($itemCounter==0): ?>
			<?php $this->item=$item; echo $this->loadTemplate('item'); ?>
			<?php else: ?>
			<h2 class="latestItemTitleList">
				<?php if ($item->params->get('latestItemTitleLinked')): ?>
				<a href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a>
				<?php else: ?>
				<?php echo $item->title; ?>
				<?php endif; ?>
			</h2>
			<?php endif; ?>
			<?php endforeach; ?>

			<?php else: ?>

			<?php foreach ($block->items as $item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
			<?php $this->item=$item; echo $this->loadTemplate('item'); ?>
			<?php endforeach; ?>

			<?php endif; ?>
		</div>
		<!-- End Item list -->

	</div>

	<?php if(($key+1)%($this->params->get('latestItemsCols'))==0): ?>
	<div class="clr"></div>
	<?php endif; ?>

	<?php endforeach; ?>
	<div class="clr"></div>
</div>

<!-- End K2 Latest Layout -->
templates/generic_search.php000060400000001032150751650350012213 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<?php if(count($this->items)): ?>
<ul class="liveSearchResults">
	<?php foreach($this->items as $item): ?>
	<li><a href="<?php echo $item->link; ?>"><?php echo $item->title; ?></a></li>
	<?php endforeach; ?>
</ul>
<?php endif; ?>
templates/generic.php000060400000014175150751650350010702 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- Start K2 Generic (search/date) Layout -->
<div id="k2Container" class="genericView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">

    <?php if($this->params->get('show_page_title') || JRequest::getCmd('task')=='search' || JRequest::getCmd('task')=='date'): ?>
    <!-- Page title -->
    <div class="componentheading<?php echo $this->params->get('pageclass_sfx')?>">
        <?php echo $this->escape($this->params->get('page_title')); ?>
    </div>
    <?php endif; ?>

    <?php if(count($this->items) && $this->params->get('genericFeedIcon',1)): ?>
    <!-- RSS feed icon -->
    <div class="k2FeedIcon">
        <a href="<?php echo $this->feed; ?>" title="<?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?>">
            <span><?php echo JText::_('K2_SUBSCRIBE_TO_THIS_RSS_FEED'); ?></span>
        </a>
        <div class="clr"></div>
    </div>
    <?php endif; ?>

    <?php if(count($this->items)): ?>

    <div class="genericItemList">
        <?php foreach($this->items as $item): ?>

        <!-- Start K2 Item Layout -->
        <div class="genericItemView">

            <div class="genericItemHeader">
                <?php if($this->params->get('genericItemDateCreated')): ?>
                <!-- Date created -->
                <span class="genericItemDateCreated">
                    <?php echo JHTML::_('date', $item->created , JText::_('K2_DATE_FORMAT_LC2')); ?>
                </span>
                <?php endif; ?>

              <?php if($this->params->get('genericItemTitle')): ?>
              <!-- Item title -->
              <h2 class="genericItemTitle">
                <?php if ($this->params->get('genericItemTitleLinked')): ?>
                    <a href="<?php echo $item->link; ?>">
                    <?php echo $item->title; ?>
                </a>
                <?php else: ?>
                <?php echo $item->title; ?>
                <?php endif; ?>
              </h2>
              <?php endif; ?>
          </div>

          <div class="genericItemBody">
              <?php if($this->params->get('genericItemImage') && !empty($item->imageGeneric)): ?>
              <!-- Item Image -->
              <div class="genericItemImageBlock">
                  <span class="genericItemImage">
                    <a href="<?php echo $item->link; ?>" title="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>">
                        <img src="<?php echo $item->imageGeneric; ?>" alt="<?php if(!empty($item->image_caption)) echo K2HelperUtilities::cleanHtml($item->image_caption); else echo K2HelperUtilities::cleanHtml($item->title); ?>" style="width:<?php echo $this->params->get('itemImageGeneric'); ?>px; height:auto;" />
                    </a>
                  </span>
                  <div class="clr"></div>
              </div>
              <?php endif; ?>

              <?php if($this->params->get('genericItemIntroText')): ?>
              <!-- Item introtext -->
              <div class="genericItemIntroText">
                <?php echo $item->introtext; ?>
              </div>
              <?php endif; ?>

              <div class="clr"></div>
          </div>

          <div class="clr"></div>

          <?php if($this->params->get('genericItemExtraFields') && count($item->extra_fields)): ?>
          <!-- Item extra fields -->
          <div class="genericItemExtraFields">
            <h4><?php echo JText::_('K2_ADDITIONAL_INFO'); ?></h4>
            <ul>
                <?php foreach ($item->extra_fields as $key => $extraField): ?>
                <?php if($extraField->value != ''): ?>
                <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?> alias<?php echo ucfirst($extraField->alias); ?>">
                    <?php if($extraField->type == 'header'): ?>
                    <h4 class="genericItemExtraFieldsHeader"><?php echo $extraField->name; ?></h4>
                    <?php else: ?>
                    <span class="genericItemExtraFieldsLabel"><?php echo $extraField->name; ?></span>
                    <span class="genericItemExtraFieldsValue"><?php echo $extraField->value; ?></span>
                    <?php endif; ?>
                </li>
                <?php endif; ?>
                <?php endforeach; ?>
                </ul>
            <div class="clr"></div>
          </div>
          <?php endif; ?>

            <?php if($this->params->get('genericItemCategory')): ?>
            <!-- Item category name -->
            <div class="genericItemCategory">
                <span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span>
                <a href="<?php echo $item->category->link; ?>"><?php echo $item->category->name; ?></a>
            </div>
            <?php endif; ?>

            <?php if ($this->params->get('genericItemReadMore')): ?>
            <!-- Item "read more..." link -->
            <div class="genericItemReadMore">
                <a class="k2ReadMore" href="<?php echo $item->link; ?>">
                    <?php echo JText::_('K2_READ_MORE'); ?>
                </a>
            </div>
            <?php endif; ?>

            <div class="clr"></div>
        </div>
        <!-- End K2 Item Layout -->

        <?php endforeach; ?>
    </div>

    <!-- Pagination -->
    <?php if($this->pagination->getPagesLinks()): ?>
    <div class="k2Pagination">
        <?php echo $this->pagination->getPagesLinks(); ?>
        <div class="clr"></div>
        <?php echo $this->pagination->getPagesCounter(); ?>
    </div>
    <?php endif; ?>

    <?php else: ?>

    <!-- No results found -->
    <div id="genericItemListNothingFound">
        <p><?php echo JText::_('K2_NO_RESULTS_FOUND'); ?></p>
    </div>

    <?php endif; ?>

</div>
<!-- End K2 Generic (search/date) Layout -->
templates/profile.php000060400000016216150751650350010724 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- K2 user profile form -->
<form action="<?php echo JURI::root(true); ?>/index.php" enctype="multipart/form-data" method="post" name="userform" autocomplete="off" class="form-validate">
	<?php if($this->params->def('show_page_title',1)): ?>
	<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
	<?php endif; ?>
	<div id="k2Container" class="k2AccountPage">
		<table class="admintable" cellpadding="0" cellspacing="0">
			<tr>
				<th colspan="2" class="k2ProfileHeading">
					<?php echo JText::_('K2_ACCOUNT_DETAILS'); ?>
				</th>
			</tr>
			<tr>
				<td class="key">
					<label for="username"><?php echo JText::_('K2_USER_NAME'); ?></label>
				</td>
				<td>
					<span><b><?php echo $this->user->get('username'); ?></b></span>
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="namemsg" for="name"><?php echo JText::_('K2_NAME'); ?></label>
				</td>
				<td>
					<input type="text" name="<?php echo $this->nameFieldName; ?>" id="name" size="40" value="<?php echo $this->escape($this->user->get( 'name' )); ?>" class="inputbox required" maxlength="50" />
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="emailmsg" for="email"><?php echo JText::_('K2_EMAIL'); ?></label>
				</td>
				<td>
					<input type="text" id="email" name="<?php echo $this->emailFieldName; ?>" size="40" value="<?php echo $this->escape($this->user->get( 'email' )); ?>" class="inputbox required validate-email" maxlength="100" />
				</td>
			</tr>
			<?php if(version_compare(JVERSION, '2.5', 'ge')): ?>
			<tr>
				<td class="key">
					<label id="email2msg" for="email2"><?php echo JText::_('K2_CONFIRM_EMAIL'); ?></label>
				</td>
				<td>
					<input type="text" id="email2" name="jform[email2]" size="40" value="<?php echo $this->escape($this->user->get( 'email' )); ?>" class="inputbox required validate-email" maxlength="100" />
					*
				</td>
			</tr>
			<?php endif; ?>
			<tr>
				<td class="key">
					<label id="pwmsg" for="password"><?php echo JText::_('K2_PASSWORD'); ?></label>
				</td>
				<td>
					<input class="inputbox validate-password" type="password" id="password" name="<?php echo $this->passwordFieldName; ?>" size="40" value="" />
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="pw2msg" for="password2"><?php echo JText::_('K2_VERIFY_PASSWORD'); ?></label>
				</td>
				<td>
					<input class="inputbox validate-passverify" type="password" id="password2" name="<?php echo $this->passwordVerifyFieldName; ?>" size="40" value="" />
				</td>
			</tr>
			<tr>
				<th colspan="2" class="k2ProfileHeading">
					<?php echo JText::_('K2_PERSONAL_DETAILS'); ?>
				</th>
			</tr>
			<!-- K2 attached fields -->
			<tr>
				<td class="key">
					<label id="gendermsg" for="gender"><?php echo JText::_('K2_GENDER'); ?></label>
				</td>
				<td>
					<?php echo $this->lists['gender']; ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="descriptionmsg" for="description"><?php echo JText::_('K2_DESCRIPTION'); ?></label>
				</td>
				<td>
					<?php echo $this->editor; ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="imagemsg" for="image"><?php echo JText::_( 'K2_USER_IMAGE_AVATAR' ); ?></label>
				</td>
				<td>
					<input type="file" id="image" name="image" />
					<?php if ($this->K2User->image): ?>
					<img class="k2AccountPageImage" src="<?php echo JURI::root(true).'/media/k2/users/'.$this->K2User->image; ?>" alt="<?php echo $this->user->name; ?>" />
					<input type="checkbox" name="del_image" id="del_image" />
					<label for="del_image"><?php echo JText::_('K2_CHECK_THIS_BOX_TO_DELETE_CURRENT_IMAGE_OR_JUST_UPLOAD_A_NEW_IMAGE_TO_REPLACE_THE_EXISTING_ONE'); ?></label>
					<?php endif; ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="urlmsg" for="url"><?php echo JText::_('K2_URL'); ?></label>
				</td>
				<td>
					<input type="text" size="50" value="<?php echo $this->K2User->url; ?>" name="url" id="url" />
				</td>
			</tr>
			<?php if(count(array_filter($this->K2Plugins))): ?>
			<!-- K2 Plugin attached fields -->
			<tr>
				<th colspan="2" class="k2ProfileHeading">
					<?php echo JText::_('K2_ADDITIONAL_DETAILS'); ?>
				</th>
			</tr>
			<?php foreach($this->K2Plugins as $K2Plugin): ?>
			<?php if(!is_null($K2Plugin)): ?>
			<tr>
				<td colspan="2">
					<?php echo $K2Plugin->fields; ?>
				</td>
			</tr>
			<?php endif; ?>
			<?php endforeach; ?>
			<?php endif; ?>
			<?php if(isset($this->params) && version_compare(JVERSION, '1.6', 'lt')): ?>
			<tr>
				<th colspan="2" class="k2ProfileHeading">
					<?php echo JText::_('K2_ADMINISTRATIVE_DETAILS'); ?>
				</th>
			</tr>
			<tr>
				<td colspan="2" id="userAdminParams">
					<?php echo $this->params->render('params'); ?>
				</td>
			</tr>
			<?php endif; ?>
			<!-- Joomla 1.6+ JForm implementation -->
			<?php if(isset($this->form)): ?>
			<?php foreach ($this->form->getFieldsets() as $fieldset): // Iterate through the form fieldsets and display each one.?>
				<?php if($fieldset->name != 'core'): ?>
				<?php $fields = $this->form->getFieldset($fieldset->name);?>
				<?php if (count($fields)):?>
					<?php if (isset($fieldset->label)):// If the fieldset has a label set, display it as the legend.?>
					<tr>
						<th colspan="2" class="k2ProfileHeading">
							<?php echo JText::_($fieldset->label);?>
						</th>
					</tr>
					<?php endif;?>
					<?php foreach($fields as $field):// Iterate through the fields in the set and display them.?>
						<?php if ($field->hidden):// If the field is hidden, just display the input.?>
							<tr><td colspan="2"><?php echo $field->input;?></td></tr>
						<?php else:?>
							<tr>
								<td class="key">
									<?php echo $field->label; ?>
									<?php if (!$field->required && $field->type != 'Spacer'): ?>
										<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL');?></span>
									<?php endif; ?>
								</td>
								<td><?php echo $field->input;?></td>
							</tr>
						<?php endif;?>
					<?php endforeach;?>
				<?php endif;?>
				<?php endif; ?>
			<?php endforeach;?>
			<?php endif; ?>
		</table>
		<div class="k2AccountPageUpdate">
			<button class="button validate" type="submit" onclick="submitbutton( this.form );return false;">
				<?php echo JText::_('K2_SAVE'); ?>
			</button>
		</div>
	</div>
	<input type="hidden" name="<?php echo $this->usernameFieldName; ?>" value="<?php echo $this->user->get('username'); ?>" />
	<input type="hidden" name="<?php echo $this->idFieldName; ?>" value="<?php echo $this->user->get('id'); ?>" />
	<input type="hidden" name="gid" value="<?php echo $this->user->get('gid'); ?>" />
	<input type="hidden" name="option" value="<?php echo $this->optionValue; ?>" />
	<input type="hidden" name="task" value="<?php echo $this->taskValue; ?>" />
	<input type="hidden" name="K2UserForm" value="1" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
templates/register.php000060400000016501150751650350011105 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<!-- K2 user register form -->
<?php if(isset($this->message)) $this->display('message'); ?>

<form action="<?php echo version_compare(JVERSION, '3.0', 'ge') ? JRoute::_('index.php?option=com_users&task=registration.register') : JURI::root(true).'/index.php'; ?>" enctype="multipart/form-data" method="post" id="josForm" name="josForm" class="form-validate">
	<?php if($this->params->def('show_page_title',1)): ?>
	<div class="componentheading<?php echo $this->escape($this->params->get('pageclass_sfx')); ?>">
		<?php echo $this->escape($this->params->get('page_title')); ?>
	</div>
	<?php endif; ?>
	<div id="k2Container" class="k2AccountPage">
		<table class="admintable" cellpadding="0" cellspacing="0">
			<tr>
				<th colspan="2" class="k2ProfileHeading">
					<?php echo JText::_('K2_ACCOUNT_DETAILS'); ?>
				</th>
			</tr>
			<tr>
				<td class="key">
					<label id="namemsg" for="name"><?php echo JText::_('K2_NAME'); ?></label>
				</td>
				<td>
					<input type="text" name="<?php echo $this->nameFieldName; ?>" id="name" size="40" value="<?php echo $this->escape($this->user->get( 'name' )); ?>" class="inputbox required" maxlength="50" />
					*
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="usernamemsg" for="username"><?php echo JText::_('K2_USER_NAME'); ?></label>
				</td>
				<td>
					<input type="text" id="username" name="<?php echo $this->usernameFieldName; ?>" size="40" value="<?php echo $this->escape($this->user->get( 'username' )); ?>" class="inputbox required validate-username" maxlength="25" />
					*
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="emailmsg" for="email"><?php echo JText::_('K2_EMAIL'); ?></label>
				</td>
				<td>
					<input type="text" id="email" name="<?php echo $this->emailFieldName; ?>" size="40" value="<?php echo $this->escape($this->user->get( 'email' )); ?>" class="inputbox required validate-email" maxlength="100" />
					*
				</td>
			</tr>
			<?php if(version_compare(JVERSION, '1.6', 'ge')): ?>
			<tr>
				<td class="key">
					<label id="email2msg" for="email2"><?php echo JText::_('K2_CONFIRM_EMAIL'); ?></label>
				</td>
				<td>
					<input type="text" id="email2" name="jform[email2]" size="40" value="" class="inputbox required validate-email" maxlength="100" />
					*
				</td>
			</tr>
			<?php endif; ?>
			<tr>
				<td class="key">
					<label id="pwmsg" for="password"><?php echo JText::_('K2_PASSWORD'); ?></label>
				</td>
				<td>
					<input class="inputbox required validate-password" type="password" id="password" name="<?php echo $this->passwordFieldName; ?>" size="40" value="" />
					*
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="pw2msg" for="password2"><?php echo JText::_('K2_VERIFY_PASSWORD'); ?></label>
				</td>
				<td>
					<input class="inputbox required validate-passverify" type="password" id="password2" name="<?php echo $this->passwordVerifyFieldName; ?>" size="40" value="" />
					*
				</td>
			</tr>
			<tr>
				<th colspan="2" class="k2ProfileHeading">
					<?php echo JText::_('K2_PERSONAL_DETAILS'); ?>
				</th>
			</tr>
			<!-- K2 attached fields -->
			<tr>
				<td class="key">
					<label id="gendermsg" for="gender"><?php echo JText::_('K2_GENDER'); ?></label>
				</td>
				<td>
					<?php echo $this->lists['gender']; ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="descriptionmsg" for="description"><?php echo JText::_('K2_DESCRIPTION'); ?></label>
				</td>
				<td>
					<?php echo $this->editor; ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="imagemsg" for="image"><?php echo JText::_( 'K2_USER_IMAGE_AVATAR' ); ?></label>
				</td>
				<td>
					<input type="file" id="image" name="image" />
					<?php if ($this->K2User->image): ?>
					<img class="k2AdminImage" src="<?php echo JURI::root().'media/k2/users/'.$this->K2User->image; ?>" alt="<?php echo $this->user->name; ?>" />
					<input type="checkbox" name="del_image" id="del_image" />
					<label for="del_image"><?php echo JText::_('K2_CHECK_THIS_BOX_TO_DELETE_CURRENT_IMAGE_OR_JUST_UPLOAD_A_NEW_IMAGE_TO_REPLACE_THE_EXISTING_ONE'); ?></label>
					<?php endif; ?>
				</td>
			</tr>
			<tr>
				<td class="key">
					<label id="urlmsg" for="url"><?php echo JText::_('K2_URL'); ?></label>
				</td>
				<td>
					<input type="text" size="50" value="<?php echo $this->K2User->url; ?>" name="url" id="url" />
				</td>
			</tr>
			<?php if(count(array_filter($this->K2Plugins))): ?>
			<!-- K2 Plugin attached fields -->
			<tr>
				<th colspan="2" class="k2ProfileHeading">
					<?php echo JText::_('K2_ADDITIONAL_DETAILS'); ?>
				</th>
			</tr>
			<?php foreach ($this->K2Plugins as $K2Plugin): ?>
			<?php if(!is_null($K2Plugin)): ?>
			<tr>
				<td colspan="2">
					<?php echo $K2Plugin->fields; ?>
				</td>
			</tr>
			<?php endif; ?>
			<?php endforeach; ?>
			<?php endif; ?>

			<!-- Joomla 1.6+ JForm implementation -->
			<?php if(isset($this->form)): ?>
			<?php foreach ($this->form->getFieldsets() as $fieldset): // Iterate through the form fieldsets and display each one.?>
				<?php if($fieldset->name != 'default'): ?>
				<?php $fields = $this->form->getFieldset($fieldset->name);?>
				<?php if (count($fields)):?>
					<?php if (isset($fieldset->label)):// If the fieldset has a label set, display it as the legend.?>
					<tr>
						<th colspan="2" class="k2ProfileHeading">
							<?php echo JText::_($fieldset->label);?>
						</th>
					</tr>
					<?php endif;?>
					<?php foreach($fields as $field):// Iterate through the fields in the set and display them.?>
						<?php if ($field->hidden):// If the field is hidden, just display the input.?>
							<tr><td colspan="2"><?php echo $field->input;?></td></tr>
						<?php else:?>
							<tr>
								<td class="key">
									<?php echo $field->label; ?>
									<?php if (!$field->required && $field->type != 'Spacer'): ?>
										<span class="optional"><?php echo JText::_('COM_USERS_OPTIONAL');?></span>
									<?php endif; ?>
								</td>
								<td><?php echo $field->input;?></td>
							</tr>
						<?php endif;?>
					<?php endforeach;?>
				<?php endif;?>
				<?php endif; ?>
			<?php endforeach;?>
			<?php endif; ?>

		</table>

		<?php if($this->K2Params->get('recaptchaOnRegistration') && $this->K2Params->get('recaptcha_public_key')): ?>
		<?php if(!$this->K2Params->get('recaptchaV2')): ?>
		<label class="formRecaptcha"><?php echo JText::_('K2_ENTER_THE_TWO_WORDS_YOU_SEE_BELOW'); ?></label>
		<?php endif; ?>
		<div id="recaptcha" class="<?php echo $this->recaptchaClass; ?>"></div>
		<?php endif; ?>

		<div class="k2AccountPageNotice"><?php echo JText::_('K2_REGISTER_REQUIRED'); ?></div>
		<div class="k2AccountPageUpdate">
			<button class="button validate" type="submit">
				<?php echo JText::_('K2_REGISTER'); ?>
			</button>
		</div>
	</div>
	<input type="hidden" name="option" value="<?php echo $this->optionValue; ?>" />
	<input type="hidden" name="task" value="<?php echo $this->taskValue; ?>" />
	<input type="hidden" name="id" value="0" />
	<input type="hidden" name="gid" value="0" />
	<input type="hidden" name="K2UserForm" value="1" />
	<?php echo JHTML::_( 'form.token' ); ?>
</form>
models/item.php000060400000205150150751650350007504 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.model');

JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_k2/tables');

class K2ModelItem extends K2Model
{
    public function getData()
    {
        $application = JFactory::getApplication();
        $id = JRequest::getInt('id');
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_items WHERE id={$id}";
        if (K2_JVERSION != '15') {
            $languageFilter = $application->getLanguageFilter();
            if ($languageFilter) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND language IN (".$db->Quote($languageTag).", ".$db->Quote('*').")";
            }
        }
        $db->setQuery($query, 0, 1);
        $row = $db->loadObject();
        return $row;
    }

    public function prepareItem($item, $view, $task)
    {
        jimport('joomla.filesystem.file');
        JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
        $limitstart = JRequest::getInt('limitstart');
        $application = JFactory::getApplication();

        // Initialize params
        if ($view != 'item') {
            if (K2_JVERSION == '30') {
                $params = $application->getParams('com_k2');
            } else {
                $component = JComponentHelper::getComponent('com_k2');
                $params = class_exists('JParameter') ? new JParameter($component->params) : new JRegistry($component->params);
                $itemid = JRequest::getInt('Itemid');
                if ($itemid) {
                    $menu = $application->getMenu();
                    $menuparams = $menu->getParams($itemid);
                    $params->merge($menuparams);
                }
            }
        } else {
            $params = K2HelperUtilities::getParams('com_k2');
        }

        // Category
        $db = JFactory::getDbo();
        $category = JTable::getInstance('K2Category', 'Table');
        $category->load($item->catid);

        $item->category = $category;
        $item->category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

        // Read more link
        $link = K2HelperRoute::getItemRoute($item->id.':'.urlencode($item->alias), $item->catid.':'.urlencode($item->category->alias));
        $item->link = urldecode(JRoute::_($link));

        // Print link
        $item->printLink = urldecode(JRoute::_($link.'&tmpl=component&print=1'));

        //Params
        $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
        $iparams = class_exists('JParameter') ? new JParameter($item->params) : new JRegistry($item->params);
        $item->params = version_compare(PHP_VERSION, '5.0.0', '>=') ? clone $params : $params;

        if ($cparams->get('inheritFrom')) {
            $masterCategoryID = $cparams->get('inheritFrom');
            $masterCategory = JTable::getInstance('K2Category', 'Table');
            $masterCategory->load((int)$masterCategoryID);
            $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
        }
        $item->params->merge($cparams);
        $item->params->merge($iparams);

        // Edit link
        if (K2HelperPermissions::canEditItem($item->created_by, $item->catid)) {
            $item->editLink = JRoute::_('index.php?option=com_k2&view=item&task=edit&cid='.$item->id.'&tmpl=component');
        }

        // Tags
        if (($view == 'item' && ($item->params->get('itemTags') || $item->params->get('itemRelated'))) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemTags')) || ($view == 'itemlist' && $task == 'user' && $item->params->get('userItemTags')) || ($view == 'latest' && $params->get('latestItemTags'))) {
            $tags = $this->getItemTags($item->id);
            for ($i = 0; $i < sizeof($tags); $i++) {
                $tags[$i]->link = JRoute::_(K2HelperRoute::getTagRoute($tags[$i]->name));
            }
            $item->tags = $tags;
        }

        // Image
        $item->imageXSmall = '';
        $item->imageSmall = '';
        $item->imageMedium = '';
        $item->imageLarge = '';
        $item->imageXLarge = '';

        $date = JFactory::getDate($item->modified);
        $timestamp = '?t='.$date->toUnix();

        if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_XS.jpg')) {
            $item->imageXSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_XS.jpg';
            if ($params->get('imageTimestamp')) {
                $item->imageXSmall .= $timestamp;
            }
        }

        if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_S.jpg')) {
            $item->imageSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_S.jpg';
            if ($params->get('imageTimestamp')) {
                $item->imageSmall .= $timestamp;
            }
        }

        if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg')) {
            $item->imageMedium = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg';
            if ($params->get('imageTimestamp')) {
                $item->imageMedium .= $timestamp;
            }
        }

        if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg')) {
            $item->imageLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg';
            if ($params->get('imageTimestamp')) {
                $item->imageLarge .= $timestamp;
            }
        }

        if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_XL.jpg')) {
            $item->imageXLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_XL.jpg';
            if ($params->get('imageTimestamp')) {
                $item->imageXLarge .= $timestamp;
            }
        }

        if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_Generic.jpg')) {
            $item->imageGeneric = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_Generic.jpg';
            if ($params->get('imageTimestamp')) {
                $item->imageGeneric .= $timestamp;
            }
        }

        // Extra fields
        if ((($view == 'item' || $view == 'relatedByTag') && $item->params->get('itemExtraFields')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemExtraFields')) || ($view == 'itemlist' && $task == 'tag' && $item->params->get('tagItemExtraFields')) || ($view == 'itemlist' && ($task == 'search' || $task == 'date') && $item->params->get('genericItemExtraFields'))) {
            $item->extra_fields = $this->getItemExtraFields($item->extra_fields, $item);
        }

        // Attachments
        if (($view == 'item' && $item->params->get('itemAttachments')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemAttachments'))) {
            $item->attachments = $this->getItemAttachments($item->id);
        }

        // Rating
        if (($view == 'item' && $item->params->get('itemRating')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemRating'))) {
            $item->votingPercentage = $this->getVotesPercentage($item->id);
            $item->numOfvotes = $this->getVotesNum($item->id);
        }

        // Filtering
        if ($params->get('introTextCleanup')) {
            $filterTags = preg_split('#[,\s]+#', trim($params->get('introTextCleanupExcludeTags')));
            $filterAttrs = preg_split('#[,\s]+#', trim($params->get('introTextCleanupTagAttr')));
            $filterAttrs = array_filter($filterAttrs);
            $item->introtext = K2HelperUtilities::cleanTags($item->introtext, $filterTags);
            if (count($filterAttrs)) {
                $item->introtext = K2HelperUtilities::cleanAttributes($item->introtext, $filterTags, $filterAttrs);
            }
        }

        if ($params->get('fullTextCleanup')) {
            $filterTags = preg_split('#[,\s]+#', trim($params->get('fullTextCleanupExcludeTags')));
            $filterAttrs = preg_split('#[,\s]+#', trim($params->get('fullTextCleanupTagAttr')));
            $filterAttrs = array_filter($filterAttrs);
            $item->fulltext = K2HelperUtilities::cleanTags($item->fulltext, $filterTags);
            if (count($filterAttrs)) {
                $item->fulltext = K2HelperUtilities::cleanAttributes($item->fulltext, $filterTags, $filterAttrs);
            }
        }

        if ($item->params->get('catItemIntroTextWordLimit') && $task == 'category') {
            $item->introtext = K2HelperUtilities::wordLimit($item->introtext, $item->params->get('catItemIntroTextWordLimit'));
        }

        $item->cleanTitle = $item->title;
        $item->title = htmlspecialchars($item->title, ENT_QUOTES);
        $item->image_caption = htmlspecialchars($item->image_caption, ENT_QUOTES);

        // Author
        $metaAuthor = K2_JVERSION != '15' && $application->getCfg('MetaAuthor');
        if ($metaAuthor || ($view == 'item' && ($item->params->get('itemAuthorBlock') || $item->params->get('itemAuthor'))) ||  ($view == 'itemlist' && ($task == '' || $task == 'category') && ($item->params->get('catItemAuthorBlock') || $item->params->get('catItemAuthor'))) || ($view == 'itemlist' && $task == 'user') || ($view == 'relatedByTag')) {
            if (!empty($item->created_by_alias)) {
                $item->author = new stdClass;
                $item->author->name = $item->created_by_alias;
                $item->author->avatar = K2HelperUtilities::getAvatar('alias');
                $item->author->link = JURI::root();
            } else {
                $author = JFactory::getUser($item->created_by);
                $item->author = $author;
                $item->author->link = JRoute::_(K2HelperRoute::getUserRoute($item->created_by));
                $item->author->profile = $this->getUserProfile($item->created_by);
                $item->author->avatar = K2HelperUtilities::getAvatar($author->id, $author->email, $params->get('userImageWidth'));
            }

            if (!isset($item->author->profile) || is_null($item->author->profile)) {
                $item->author->profile = new JObject;
                $item->author->profile->gender = null;
            }
        }

        // Num of comments
        if ($params->get('comments', 0) > 0) {
            $user = JFactory::getUser();
            if (!$user->guest && $user->id == $item->created_by && $params->get('inlineCommentsModeration')) {
                $item->numOfComments = $this->countItemComments($item->id, false);
            } else {
                $item->numOfComments = $this->countItemComments($item->id);
            }
        }

        return $item;
    }

    public function prepareFeedItem(&$item)
    {
        JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
        $params = K2HelperUtilities::getParams('com_k2');
        $limitstart = 0;
        $view = JRequest::getCmd('view');
        // Category
        $category = JTable::getInstance('K2Category', 'Table');
        $category->load($item->catid);
        $item->category = $category;

        // Read more link
        $item->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($item->id.':'.$item->alias, $item->catid.':'.urlencode($item->category->alias))));

        // Filtering
        if ($params->get('introTextCleanup')) {
            $filterTags = preg_split('#[,\s]+#', trim($params->get('introTextCleanupExcludeTags')));
            $filterAttrs = preg_split('#[,\s]+#', trim($params->get('introTextCleanupTagAttr')));
            $filter = new JFilterInput($filterTags, $filterAttrs, 0, 1);
            $item->introtext = $filter->clean($item->introtext);
        }

        if ($params->get('fullTextCleanup')) {
            $filterTags = preg_split('#[,\s]+#', trim($params->get('fullTextCleanupExcludeTags')));
            $filterAttrs = preg_split('#[,\s]+#', trim($params->get('fullTextCleanupTagAttr')));
            $filter = new JFilterInput($filterTags, $filterAttrs, 0, 1);
            $item->fulltext = $filter->clean($item->fulltext);
        }

        // Description
        $item->description = '';

        // Item image
        if ($params->get('feedItemImage') && JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_'.$params->get('feedImgSize').'.jpg')) {
            $altText = $item->image_caption ? $item->image_caption : $item->title;
            $item->description .= '<div class="K2FeedImage"><img src="'.JURI::root().'media/k2/items/cache/'.md5('Image'.$item->id).'_'.$params->get('feedImgSize').'.jpg" alt="'.$altText.'" /></div>';
        }

        // Item Introtext
        if ($params->get('feedItemIntroText')) {
            // Introtext word limit
            if ($params->get('feedTextWordLimit') && $item->introtext) {
                $item->introtext = K2HelperUtilities::wordLimit($item->introtext, $params->get('feedTextWordLimit'));
            }
            $item->description .= '<div class="K2FeedIntroText">'.$item->introtext.'</div>';
        }

        // Item Fulltext
        if ($params->get('feedItemFullText') && $item->fulltext) {
            $item->description .= '<div class="K2FeedFullText">'.$item->fulltext.'</div>';
        }

        // Item Tags
        if ($params->get('feedItemTags')) {
            $tags = $this->getItemTags($item->id);
            if (count($tags)) {
                $item->description .= '<div class="K2FeedTags"><ul>';
                foreach ($tags as $tag) {
                    $item->description .= '<li>'.$tag->name.'</li>';
                }
                $item->description .= '<ul></div>';
            }
        }

        // Item Video
        if ($params->get('feedItemVideo') && $item->video) {
            if (!empty($item->video) && JString::substr($item->video, 0, 1) !== '{') {
                $item->description .= '<div class="K2FeedVideo">'.$item->video.'</div>';
            } else {
                $params->set('vfolder', 'media/k2/videos');
                $params->set('afolder', 'media/k2/audio');
                if (stripos($item->video, 'remote}') !== false) {
                    preg_match("#}(.*?){/#s", $item->video, $matches);
                    if (stripos($matches[1], 'http') === false) {
                        $item->video = str_replace($matches[1], JURI::root().$matches[1], $item->video);
                    }
                }
                $dispatcher = JDispatcher::getInstance();
                JPluginHelper::importPlugin('content');
                $item->text = $item->video;
                if (K2_JVERSION == '15') {
                    $dispatcher->trigger('onPrepareContent', array(
                        &$item,
                        &$params,
                        $limitstart
                    ));
                } else {
                    $dispatcher->trigger('onContentPrepare', array(
                        'com_k2.'.$view,
                        &$item,
                        &$params,
                        $limitstart
                    ));
                }
                $item->description .= '<div class="K2FeedVideo">'.$item->text.'</div>';
            }
        }

        // Item gallery
        if ($params->get('feedItemGallery') && $item->gallery) {
            $params->set('galleries_rootfolder', 'media/k2/galleries');
            $params->set('enabledownload', '0');
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('content');
            $item->text = $item->gallery;
            if (K2_JVERSION == '15') {
                $dispatcher->trigger('onPrepareContent', array(
                    &$item,
                    &$params,
                    $limitstart
                ));
            } else {
                $dispatcher->trigger('onContentPrepare', array(
                    'com_k2.'.$view,
                    &$item,
                    &$params,
                    $limitstart
                ));
            }
            $item->description .= '<div class="K2FeedGallery">'.$item->text.'</div>';
        }

        // Item attachments
        if ($params->get('feedItemAttachments')) {
            $attachments = $this->getItemAttachments($item->id);
            if (count($attachments)) {
                $item->description .= '<div class="K2FeedAttachments"><ul>';
                foreach ($attachments as $attachment) {
                    $item->description .= '<li><a title="'.htmlentities($attachment->titleAttribute, ENT_QUOTES, 'UTF-8').'" href="'.$attachment->link.'">'.$attachment->title.'</a></li>';
                }
                $item->description .= '<ul></div>';
            }
        }

        // Author
        if (!empty($item->created_by_alias)) {
            if (!isset($item->author)) {
                $item->author = new stdClass;
            }
            $item->author->name = $item->created_by_alias;
            $item->author->email = '';
        } else {
            $author = JFactory::getUser($item->created_by);
            $item->author = $author;
            $item->author->link = JRoute::_(K2HelperRoute::getUserRoute($item->created_by));
            $item->author->profile = $this->getUserProfile($item->created_by);
        }

        return $item;
    }

    public function prepareJSONItem($item)
    {
        $row = new JObject();
        unset($row->_errors);
        $row->id = $item->id;
        $row->title = $item->title;
        $row->alias = $item->alias;
        $row->link = $item->link;
        $row->catid = $item->catid;
        $row->introtext = $item->introtext;
        $row->fulltext = $item->fulltext;
        $row->extra_fields = $item->extra_fields;
        $row->created = $item->created;
        //$row->created_by = $item->created_by;
        $row->created_by_alias = $item->created_by_alias;
        $row->modified = $item->modified;
        //$row->modified_by = $item->modified_by;
        $row->featured = $item->featured;
        //$row->ordering = $item->ordering;
        //$row->featured_ordering = $item->featured_ordering;
        $row->image = isset($item->image) ? $item->image : '';
        $row->imageWidth = isset($item->imageWidth) ? $item->imageWidth : '';
        $row->image_caption = $item->image_caption;
        $row->image_credits = $item->image_credits;
        $row->imageXSmall = $item->imageXSmall;
        $row->imageSmall = $item->imageSmall;
        $row->imageMedium = $item->imageMedium;
        $row->imageLarge = $item->imageLarge;
        $row->imageXLarge = $item->imageXLarge;
        $row->video = $item->video;
        $row->video_caption = $item->video_caption;
        $row->video_credits = $item->video_credits;
        $row->gallery = $item->gallery;
        $row->hits = $item->hits;
        //$row->plugins = $item->plugins;
        $row->category = new stdClass;
        $row->category->id = $item->category->id;
        $row->category->name = $item->category->name;
        $row->category->alias = $item->category->alias;
        $row->category->link = $item->category->link;
        $row->category->description = $item->category->description;
        $row->category->image = $item->category->image;
        $row->category->ordering = $item->category->ordering;
        //$row->category->plugins = $item->category->plugins;
        $row->tags = isset($item->tags) ? $item->tags : array();
        $row->attachments = isset($item->attachments) ? $item->attachments : array();
        $row->votingPercentage = isset($item->votingPercentage) ? $item->votingPercentage : '';
        $row->numOfvotes = isset($item->numOfvotes) ? $item->numOfvotes : '';
        if (isset($item->author)) {
            $row->author = new stdClass;
            //$row->author->id = $item->author->id;
            $row->author->name = $item->author->name;
            //$row->author->username = $item->author->username;
            $row->author->link = $item->author->link;
            $row->author->avatar = $item->author->avatar;
            if (isset($item->author->profile)) {
                unset($item->author->profile->plugins);
            }
            $row->author->profile = $item->author->profile;
            if (isset($row->author->profile->url)) {
                $row->author->profile->url = htmlspecialchars($row->author->profile->url, ENT_QUOTES, 'UTF-8');
            }
        }
        $row->numOfComments = $item->numOfComments;
        $row->events = $item->event;
        $row->language = $item->language;
        return $row;
    }

    public function execPlugins($item, $view, $task)
    {
        jimport('joomla.filesystem.file');
        jimport('joomla.filesystem.folder');
        $params = K2HelperUtilities::getParams('com_k2');
        $limitstart = JRequest::getInt('limitstart');
        // Import plugins
        $dispatcher = JDispatcher::getInstance();
        JPluginHelper::importPlugin('content');

        if (!isset($this->isSigInstalled)) {
            $this->isSigInstalled = (
            JFile::exists(JPATH_SITE.'/plugins/content/jw_sigpro.php') ||
            JFile::exists(JPATH_SITE.'/plugins/content/jw_sigpro/jw_sigpro.php') ||
            JFile::exists(JPATH_SITE.'/plugins/content/jw_sigpro/jw_sigpro/jw_sigpro.php')
            );
        }

        if (!$this->isSigInstalled) {
            $item->gallery = null;
        }

        // Gallery
        if (($view == 'item' && $item->params->get('itemImageGallery')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemImageGallery')) || ($view == 'relatedByTag')) {
            if ($item->gallery) {
                if (JString::strpos($item->gallery, 'flickr.com') === false) {
                    $item->gallery = "{gallery}{$item->id}{/gallery}";
                    if (!JFolder::exists(JPATH_SITE.'/media/k2/galleries/'.$item->id)) {
                        $item->gallery = null;
                    }
                }
                $params->set('galleries_rootfolder', 'media/k2/galleries');

                if ($view == 'item') {
                    $width = (int)$item->params->get('itemImageGalleryWidth');
                    $height = (int)$item->params->get('itemImageGalleryHeight');
                } else {
                    $width = (int)$item->params->get('catItemImageGalleryWidth');
                    $height = (int)$item->params->get('catItemImageGalleryHeight');
                }

                if ($width && $height) {
                    if (JString::strpos($item->gallery, 'flickr.com') !== false) {
                        $sigParams = JComponentHelper::getParams('com_sigpro');
                        $item->gallery = str_replace('{/gallery}', ':'.$sigParams->get('flickrImageCount', 20).':'.$width.':'.$height.'{/gallery}', $item->gallery);
                    } else {
                        $item->gallery = str_replace('{/gallery}', ':'.$width.':'.$height.'{/gallery}', $item->gallery);
                    }
                }

                $item->text = $item->gallery;
                if (K2_JVERSION == '15') {
                    $dispatcher->trigger('onPrepareContent', array(
                        &$item,
                        &$params,
                        $limitstart
                    ));
                } else {
                    $dispatcher->trigger('onContentPrepare', array(
                        'com_k2.'.$view.'-gallery',
                        &$item,
                        &$params,
                        $limitstart
                    ));
                }
                $item->gallery = $item->text;
            }
        }

        // Video
        if (($view == 'item' && $item->params->get('itemVideo')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemVideo')) || ($view == 'latest' && $item->params->get('latestItemVideo')) || ($view == 'relatedByTag')) {
            if (!empty($item->video) && JString::substr($item->video, 0, 1) !== '{') {
                $item->video = $item->video;
                $item->videoType = 'embedded';
            } else {
                $item->videoType = 'allvideos';
                $params->set('afolder', 'media/k2/audio');
                $params->set('vfolder', 'media/k2/videos');

                if (stripos($item->video, 'remote}') !== false) {
                    preg_match("#}(.*?){/#s", $item->video, $matches);
                    if (stripos($matches[1], 'http') === false) {
                        $item->video = str_replace($matches[1], JURI::root().$matches[1], $item->video);
                    }
                }

                if ($view == 'item') {
                    $params->set('vwidth', $item->params->get('itemVideoWidth'));
                    $params->set('vheight', $item->params->get('itemVideoHeight'));
                    $params->set('autoplay', $item->params->get('itemVideoAutoPlay'));
                } elseif ($view == 'latest') {
                    $params->set('vwidth', $item->params->get('latestItemVideoWidth'));
                    $params->set('vheight', $item->params->get('latestItemVideoHeight'));
                    $params->set('autoplay', $item->params->get('latestItemVideoAutoPlay'));
                } else {
                    $params->set('vwidth', $item->params->get('catItemVideoWidth'));
                    $params->set('vheight', $item->params->get('catItemVideoHeight'));
                    $params->set('autoplay', $item->params->get('catItemVideoAutoPlay'));
                }

                $item->text = $item->video;
                if (K2_JVERSION == '15') {
                    $dispatcher->trigger('onPrepareContent', array(
                        &$item,
                        &$params,
                        $limitstart
                    ));
                } else {
                    $dispatcher->trigger('onContentPrepare', array(
                        'com_k2.'.$view.'-media',
                        &$item,
                        &$params,
                        $limitstart
                    ));
                }
                $item->video = $item->text;
            }
        }

        // Plugins
        $item->text = '';
        $params->set('vfolder', null);
        $params->set('afolder', null);
        $params->set('vwidth', null);
        $params->set('vheight', null);
        $params->set('autoplay', null);
        $params->set('galleries_rootfolder', null);
        $params->set('enabledownload', null);

        if ($view == 'item') {
            if ($item->params->get('itemIntroText')) {
                $item->text .= $item->introtext;
            }
            if ($item->params->get('itemFullText')) {
                $item->text .= '{K2Splitter}'.$item->fulltext;
            }
        } elseif ($view == 'latest') {
            if ($item->params->get('latestItemIntroText')) {
                $item->text .= $item->introtext;
            }
        } else {
            switch ($task) {
                case '':
                case 'category':
                    if ($item->params->get('catItemIntroText')) {
                        $item->text .= $item->introtext;
                    }
                    break;

                case 'user':
                    if ($item->params->get('userItemIntroText')) {
                        $item->text .= $item->introtext;
                    }
                    break;

                case 'tag':
                    if ($item->params->get('tagItemIntroText')) {
                        $item->text .= $item->introtext;
                    }
                    break;

                default:
                    if ($item->params->get('genericItemIntroText')) {
                        $item->text .= $item->introtext;
                    }
                    break;
            }
        }
        $item->event = new stdClass;
        if (K2_JVERSION != '15') {
            $item->event->BeforeDisplay = '';
            $item->event->AfterDisplay = '';

            $dispatcher->trigger('onContentPrepare', array(
                'com_k2.'.$view,
                &$item,
                &$params,
                $limitstart
            ));

            $results = $dispatcher->trigger('onContentAfterTitle', array(
                'com_k2.'.$view,
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->AfterDisplayTitle = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onContentBeforeDisplay', array(
                'com_k2.'.$view,
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->BeforeDisplayContent = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onContentAfterDisplay', array(
                'com_k2.'.$view,
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->AfterDisplayContent = trim(implode("\n", $results));
        } else {
            $results = $dispatcher->trigger('onBeforeDisplay', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->BeforeDisplay = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onAfterDisplay', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->AfterDisplay = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onAfterDisplayTitle', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->AfterDisplayTitle = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onBeforeDisplayContent', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->BeforeDisplayContent = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onAfterDisplayContent', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->AfterDisplayContent = trim(implode("\n", $results));

            $dispatcher->trigger('onPrepareContent', array(
                &$item,
                &$params,
                $limitstart
            ));
        }

        // K2 plugins
        $item->event->K2BeforeDisplay = '';
        $item->event->K2AfterDisplay = '';
        $item->event->K2AfterDisplayTitle = '';
        $item->event->K2BeforeDisplayContent = '';
        $item->event->K2AfterDisplayContent = '';

        if (($view == 'item' && $item->params->get('itemK2Plugins')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemK2Plugins')) || ($view == 'itemlist' && $task == 'user' && $item->params->get('userItemK2Plugins')) || ($view == 'itemlist' && ($task == 'search' || $task == 'tag' || $task == 'date'))) {
            JPluginHelper::importPlugin('k2');

            $results = $dispatcher->trigger('onK2BeforeDisplay', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2BeforeDisplay = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onK2AfterDisplay', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2AfterDisplay = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onK2AfterDisplayTitle', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2AfterDisplayTitle = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onK2BeforeDisplayContent', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2BeforeDisplayContent = trim(implode("\n", $results));

            $results = $dispatcher->trigger('onK2AfterDisplayContent', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2AfterDisplayContent = trim(implode("\n", $results));

            $dispatcher->trigger('onK2PrepareContent', array(
                &$item,
                &$params,
                $limitstart
            ));
        }

        if ($view == 'item') {
            @list($item->introtext, $item->fulltext) = explode('{K2Splitter}', $item->text);
        } else {
            $item->introtext = $item->text;
        }

        // Extra fields plugins
        if (($view == 'item' && $item->params->get('itemExtraFields')) || ($view == 'itemlist' && ($task == '' || $task == 'category') && $item->params->get('catItemExtraFields')) || ($view == 'itemlist' && $task == 'tag' && $item->params->get('tagItemExtraFields')) || ($view == 'itemlist' && ($task == 'search' || $task == 'date') && $item->params->get('genericItemExtraFields'))) {
            if (count($item->extra_fields) && is_array($item->extra_fields)) {
                foreach ($item->extra_fields as $key => $extraField) {
                    if ($extraField->type == 'textarea' || $extraField->type == 'textfield') {
                        $tmp = new JObject();
                        $tmp->text = $extraField->value;
                        if (K2_JVERSION != '15') {
                            $dispatcher->trigger('onContentPrepare', array(
                                'com_k2.'.$view,
                                &$tmp,
                                &$params,
                                $limitstart
                            ));
                        } else {
                            $dispatcher->trigger('onPrepareContent', array(
                                &$tmp,
                                &$params,
                                $limitstart
                            ));
                        }
                        $dispatcher->trigger('onK2PrepareContent', array(
                            &$tmp,
                            &$params,
                            $limitstart
                        ));
                        $extraField->value = $tmp->text;
                    }
                }
            }
        }
        return $item;
    }

    public function hit($id)
    {
        $row = JTable::getInstance('K2Item', 'Table');
        $row->hit($id);
    }

    public function vote()
    {
        $application = JFactory::getApplication();
        JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');

        // Get item
        $item = JTable::getInstance('K2Item', 'Table');
        $item->load(JRequest::getInt('itemID'));

        // Get category
        $category = JTable::getInstance('K2Category', 'Table');
        $category->load($item->catid);

        // Access check
        $user = JFactory::getUser();
        if (K2_JVERSION != '15') {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($category->access, $user->getAuthorisedViewLevels())) {
                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        } else {
            if ($item->access > $user->get('aid', 0) || $category->access > $user->get('aid', 0)) {
                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }

        // Published check
        if (!$item->published || $item->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }
        if (!$category->published || $category->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        $rate = JRequest::getVar('user_rating', 0, '', 'int');

        if ($rate >= 1 && $rate <= 5) {
            $db = JFactory::getDbo();
            $userIP = $_SERVER['REMOTE_ADDR'];
            $query = "SELECT * FROM #__k2_rating WHERE itemID =".(int)$item->id;
            $db->setQuery($query);
            $rating = $db->loadObject();

            if (!$rating) {
                $query = "INSERT INTO #__k2_rating ( itemID, lastip, rating_sum, rating_count ) VALUES ( ".(int)$item->id.", ".$db->Quote($userIP).", {$rate}, 1 )";
                $db->setQuery($query);
                $db->query();
                echo JText::_('K2_THANKS_FOR_RATING');
            } else {
                if ($userIP != ($rating->lastip)) {
                    $query = "UPDATE #__k2_rating"." SET rating_count = rating_count + 1, rating_sum = rating_sum + {$rate}, lastip = ".$db->Quote($userIP)." WHERE itemID = {$item->id}";
                    $db->setQuery($query);
                    $db->query();
                    echo JText::_('K2_THANKS_FOR_RATING');
                } else {
                    echo JText::_('K2_YOU_HAVE_ALREADY_RATED_THIS_ITEM');
                }
            }
        }
        $application->close();
    }

    public function getRating($id)
    {
        $id = (int)$id;
        static $K2RatingsInstances = array();
        if (array_key_exists($id, $K2RatingsInstances)) {
            return $K2RatingsInstances[$id];
        }
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_rating WHERE itemID = ".$id;
        $db->setQuery($query);
        $vote = $db->loadObject();
        $K2RatingsInstances[$id] = $vote;
        return $K2RatingsInstances[$id];
    }

    public function getVotesNum($itemID = null)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $xhr = false;
        if (is_null($itemID)) {
            $itemID = JRequest::getInt('itemID');
            $xhr = true;
        }
        $vote = $this->getRating($itemID);
        if (!is_null($vote)) {
            $rating_count = intval($vote->rating_count);
        } else {
            $rating_count = 0;
        }
        if ($rating_count != 1) {
            $result = "(".$rating_count." ".JText::_('K2_VOTES').")";
        } else {
            $result = "(".$rating_count." ".JText::_('K2_VOTE').")";
        }
        if ($xhr) {
            echo $result;
            $application->close();
        } else {
            return $result;
        }
    }

    public function getVotesPercentage($itemID = null)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $db = JFactory::getDbo();
        $xhr = false;
        $result = 0;
        if (is_null($itemID)) {
            $itemID = JRequest::getInt('itemID');
            $xhr = true;
        }
        $vote = $this->getRating($itemID);
        if (!is_null($vote) && $vote->rating_count != 0) {
            $result = number_format(intval($vote->rating_sum) / intval($vote->rating_count), 2) * 20;
        }
        if ($xhr) {
            echo $result;
            $application->close();
        } else {
            return $result;
        }
    }

    public function comment()
    {
        $application = JFactory::getApplication();
        jimport('joomla.mail.helper');
        JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
        $params = K2HelperUtilities::getParams('com_k2');
        $user = JFactory::getUser();
        $config = JFactory::getConfig();
        $response = new JObject();

        // Get item
        $item = JTable::getInstance('K2Item', 'Table');
        $item->load(JRequest::getInt('itemID'));

        // Get category
        $category = JTable::getInstance('K2Category', 'Table');
        $category->load($item->catid);

        // Access check
        if (K2_JVERSION != '15') {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($category->access, $user->getAuthorisedViewLevels())) {
                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        } else {
            if ($item->access > $user->get('aid', 0) || $category->access > $user->get('aid', 0)) {
                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }

        // Published check
        if (!$item->published || $item->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }
        if (!$category->published || $category->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Check permissions
        if ((($params->get('comments') == '2') && ($user->id > 0) && K2HelperPermissions::canAddComment($item->catid)) || ($params->get('comments') == '1')) {

            // If new antispam settings are not saved, show a message to the comments form and stop the comment submission
            $antispamProtection = $params->get('antispam', null);
            if (
                $antispamProtection === null ||
                (($antispamProtection == 'recaptcha' || $antispamProtection == 'both') && !$params->get('recaptcha_private_key')) ||
                (($antispamProtection == 'akismet' || $antispamProtection == 'both') && !$params->get('akismetApiKey'))
            ) {
                $response->message = JText::_('K2_ANTISPAM_SETTINGS_ERROR');
                $response->cssClass = 'k2FormLogError';
                echo json_encode($response);
                $application->close();
            }

            $row = JTable::getInstance('K2Comment', 'Table');

            if (!$row->bind(JRequest::get('post'))) {
                $response->message = $row->getError();
                $response->cssClass = 'k2FormLogError';
                echo json_encode($response);
                $application->close();
            }

            $row->commentText = JRequest::getString('commentText', '', 'default');
            $row->commentText = strip_tags($row->commentText);

            // Clean vars
            $filter = JFilterInput::getInstance();
            $row->userName = $filter->clean($row->userName, 'username');
            if ($row->commentURL && preg_match('/^((http|https|ftp):\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,6}((:[0-9]{1,5})?\/.*)?$/i', $row->commentURL)) {
                $url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $row->commentURL);
                $url = str_replace(';//', '://', $url);
                if ($url != '') {
                    $url = (!strstr($url, '://')) ? 'http://'.$url : $url;
                    $url = preg_replace('/&([^#])(?![a-z]{2,8};)/', '&#038;$1', $url);
                    $row->commentURL = $url;
                }
            } else {
                $row->commentURL = '';
            }

            $datenow = JFactory::getDate();
            $row->commentDate = K2_JVERSION == '15' ? $datenow->toMySQL() : $datenow->toSql();

            if (!$user->guest) {
                $row->userID = $user->id;
                $row->commentEmail = $user->email;
                $row->userName = $user->name;
            }

            $userName = trim($row->userName);
            $commentEmail = trim($row->commentEmail);
            $commentText = trim($row->commentText);
            $commentURL = trim($row->commentURL);

            if (empty($userName) || $userName == JText::_('K2_ENTER_YOUR_NAME') || empty($commentText) || $commentText == JText::_('K2_ENTER_YOUR_MESSAGE_HERE') || empty($commentEmail) || $commentEmail == JText::_('K2_ENTER_YOUR_EMAIL_ADDRESS')) {
                $response->message = JText::_('K2_YOU_NEED_TO_FILL_IN_ALL_REQUIRED_FIELDS');
                $response->cssClass = 'k2FormLogError';
                echo json_encode($response);
                $application->close();
            }

            if (!JMailHelper::isEmailAddress($commentEmail)) {
                $response->message = JText::_('K2_INVALID_EMAIL_ADDRESS');
                $response->cssClass = 'k2FormLogError';
                echo json_encode($response);
                $application->close();
            }

            if ($user->guest) {
                $db = JFactory::getDbo();
                $query = "SELECT COUNT(*) FROM #__users WHERE name=".$db->Quote($userName)." OR email=".$db->Quote($commentEmail);
                $db->setQuery($query);
                $result = $db->loadresult();
                if ($result > 0) {
                    $response->message = JText::_('K2_THE_NAME_OR_EMAIL_ADDRESS_YOU_TYPED_IS_ALREADY_IN_USE');
                    $response->cssClass = 'k2FormLogError';
                    echo json_encode($response);
                    $application->close();
                }
            }

            // Google reCAPTCHA
            if ($params->get('antispam') == 'recaptcha' || $params->get('antispam') == 'both') {
                if ($user->guest || $params->get('recaptchaForRegistered', 1)) {
                    if ($params->get('recaptchaV2')) {
                        require_once JPATH_SITE.'/components/com_k2/helpers/utilities.php';
                        if (!K2HelperUtilities::verifyRecaptcha()) {
                            $response->message = JText::_('K2_COULD_NOT_VERIFY_THAT_YOU_ARE_NOT_A_ROBOT');
                            $response->cssClass = 'k2FormLogError';
                            echo json_encode($response);
                            $application->close();
                        }
                    } else {
                        if (!function_exists('_recaptcha_qsencode')) {
                            require_once(JPATH_SITE.'/media/k2/assets/vendors/google/recaptcha_legacy/recaptcha.php');
                        }
                        $privatekey = trim($params->get('recaptcha_private_key'));
                        $recaptcha_challenge_field = isset($_POST["recaptcha_challenge_field"]) ? $_POST["recaptcha_challenge_field"] : '';
                        $recaptcha_response_field = isset($_POST["recaptcha_response_field"]) ? $_POST["recaptcha_response_field"] : '';
                        $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $recaptcha_challenge_field, $recaptcha_response_field);
                        if (!$resp->is_valid) {
                            $response->message = JText::_('K2_THE_WORDS_YOU_TYPED_DID_NOT_MATCH_THE_ONES_DISPLAYED_PLEASE_TRY_AGAIN');
                            $response->cssClass = 'k2FormLogError';
                            echo json_encode($response);
                            $application->close();
                        }
                    }
                }
            }

            // Akismet
            if ($params->get('antispam') == 'akismet' || $params->get('antispam') == 'both') {
                if ($user->guest || $params->get('akismetForRegistered', 1)) {
                    if ($params->get('akismetApiKey')) {
                        require_once(JPATH_SITE.'/media/k2/assets/vendors/achingbrain/php5-akismet/akismet.class.php');
                        $akismetApiKey = trim($params->get('akismetApiKey'));
                        $akismet = new Akismet(JURI::root(false), $akismetApiKey);
                        $akismet->setCommentAuthor($userName);
                        $akismet->setCommentAuthorEmail($commentEmail);
                        $akismet->setCommentAuthorURL($commentURL);
                        $akismet->setCommentContent($commentText);
                        $akismet->setPermalink(JURI::root(false).'index.php?option=com_k2&view=item&id='.JRequest::getInt('itemID'));
                        try {
                            if ($akismet->isCommentSpam()) {
                                $response->message = JText::_('K2_SPAM_ATTEMPT_HAS_BEEN_DETECTED_THE_COMMENT_HAS_BEEN_REJECTED');
                                $response->cssClass = 'k2FormLogError';
                                echo json_encode($response);
                                $application->close();
                            }
                        } catch (Exception $e) {
                            $response->message = $e->getMessage();
                            $response->cssClass = 'k2FormLogSuccess';
                            echo json_encode($response);
                            $application->close();
                        }
                    }
                }
            }

            if ($commentURL == JText::_('K2_ENTER_YOUR_SITE_URL') || $commentURL == "") {
                $row->commentURL = null;
            } else {
                if (substr(trim($commentURL), 0, 4) != 'http') {
                    $row->commentURL = 'http://'.$commentURL;
                }
            }

            if ($params->get('commentsPublishing', false)) {
                $row->published = 1;
            } else {
                $row->published = 0;
                // Auto publish comments for users with administrative permissions
                if (K2_JVERSION != '15') {
                    if ($user->authorise('core.admin')) {
                        $row->published = 1;
                    }
                } else {
                    if ($user->gid > 23) {
                        $row->published = 1;
                    }
                }
            }

            if (!$row->store()) {
                $response->message = $row->getError();
                $response->cssClass = 'k2FormLogError';
                echo json_encode($response);
                $application->close();
            }

            if ($row->published) {
                $caching = K2_JVERSION == '30' ? $config->get('caching') : $config->getValue('config.caching');
                if ($caching && $user->guest) {
                    $response->message = JText::_('K2_THANK_YOU_YOUR_COMMENT_WILL_BE_PUBLISHED_SHORTLY');
                    $response->cssClass = 'k2FormLogSuccess';
                    echo json_encode($response);
                } else {
                    $response->message = JText::_('K2_COMMENT_ADDED_REFRESHING_PAGE');
                    $response->cssClass = 'k2FormLogSuccess';
                    $response->refresh = 1;
                    echo json_encode($response);
                }
            } else {
                $response->message = JText::_('K2_COMMENT_ADDED_AND_WAITING_FOR_APPROVAL');
                $response->cssClass = 'k2FormLogSuccess';
                echo json_encode($response);
            }
        }
        $application->close();
    }

    public function getItemTags($itemID)
    {
        $itemID = (int)$itemID;
        static $K2ItemTagsInstances = array();
        if (isset($K2ItemTagsInstances[$itemID])) {
            return $K2ItemTagsInstances[$itemID];
        }
        $db = JFactory::getDbo();
        $query = "SELECT tag.*
            FROM #__k2_tags AS tag
            JOIN #__k2_tags_xref AS xref ON tag.id = xref.tagID
            WHERE tag.published=1
            AND xref.itemID = ".(int)$itemID." ORDER BY xref.id ASC";

        $db->setQuery($query);
        $rows = $db->loadObjectList();
        $K2ItemTagsInstances[$itemID] = $rows;
        return $K2ItemTagsInstances[$itemID];
    }

    public function getItemExtraFields($itemExtraFields, &$item = null)
    {
        static $K2ItemExtraFieldsInstances = array();
        if ($item && isset($K2ItemExtraFieldsInstances[$item->id])) {
            $this->buildAliasBasedExtraFields($K2ItemExtraFieldsInstances[$item->id], $item);
            return $K2ItemExtraFieldsInstances[$item->id];
        }

        jimport('joomla.filesystem.file');
        $db = JFactory::getDbo();
        $jsonObjects = json_decode($itemExtraFields);
        $imgExtensions = array(
            'jpg',
            'jpeg',
            'gif',
            'png'
        );
        $params = K2HelperUtilities::getParams('com_k2');

        if (count($jsonObjects) < 1) {
            return null;
        }

        foreach ($jsonObjects as $object) {
            $extraFieldsIDs[] = $object->id;
        }
        JArrayHelper::toInteger($extraFieldsIDs);
        $condition = @implode(',', $extraFieldsIDs);

        $query = "SELECT extraFieldsGroup FROM #__k2_categories WHERE id=".(int)$item->catid;
        $db->setQuery($query);
        $group = $db->loadResult();

        $query = "SELECT * FROM #__k2_extra_fields WHERE `group` = ".(int)$group." AND published=1 AND (id IN ({$condition}) OR `type` = 'header') ORDER BY ordering ASC";
        $db->setQuery($query);
        $rows = $db->loadObjectList();
        $size = count($rows);

        for ($i = 0; $i < $size; $i++) {
            $value = '';
            $rawValue = '';
            $values = array();
            foreach ($jsonObjects as $object) {
                if ($rows[$i]->id == $object->id) {
                    if ($rows[$i]->type == 'textfield' || $rows[$i]->type == 'textarea' || $rows[$i]->type == 'date') {
                        $value = $object->value;
                        if ($rows[$i]->type == 'date' && $value) {
                            $rawValue = $value;
                            $offset = (K2_JVERSION != '15') ? null : 0;
                            $value = JHTML::_('date', $value, JText::_('K2_DATE_FORMAT_LC'), $offset);
                        }
                    } elseif ($rows[$i]->type == 'image') {
                        if ($object->value) {
                            $src = '';
                            if (JString::strpos('://', $object->value) === false) {
                                $src .= JURI::root(true).'/';
                            }
                            $src .= $object->value;
                            $src = str_replace('\\', '/', $src);
                            $value = '<img src="'.$src.'" alt="'.$rows[$i]->name.'" />';
                        } else {
                            $value = false;
                        }
                    } elseif ($rows[$i]->type == 'labels') {
                        $labels = explode(',', $object->value);
                        if (!is_array($labels)) {
                            $labels = (array)$labels;
                        }
                        $value = '';
                        foreach ($labels as $label) {
                            $label = JString::trim($label);
                            if ($label != '') {
                                $label = str_replace('-', ' ', $label);
                                $value .= '<a href="'.JRoute::_('index.php?option=com_k2&view=itemlist&task=search&searchword=' . urlencode($label)) . '">'.$label.'</a>';
                            }
                        }
                    } elseif ($rows[$i]->type == 'select' || $rows[$i]->type == 'radio') {
                        foreach (json_decode($rows[$i]->value) as $option) {
                            if ($option->value == $object->value) {
                                $value .= $option->name;
                            }
                        }
                    } elseif ($rows[$i]->type == 'multipleSelect') {
                        foreach (json_decode($rows[$i]->value) as $option) {
                            if (@in_array($option->value, $object->value)) {
                                $values[] = $option->name;
                            }
                        }
                        $value = @implode(', ', $values);
                    } elseif ($rows[$i]->type == 'csv') {
                        $array = $object->value;
                        if (count($array)) {
                            $value .= '<table cellspacing="0" cellpadding="0" class="csvTable">';
                            foreach ($array as $key => $row) {
                                $value .= '<tr>';
                                foreach ($row as $cell) {
                                    $value .= ($key > 0) ? '<td>'.$cell.'</td>' : '<th>'.$cell.'</th>';
                                }
                                $value .= '</tr>';
                            }
                            $value .= '</table>';
                        }
                    } else {
                        switch ($object->value[2]) {
                            case 'same':
                            default:
                                $attributes = '';
                                break;

                            case 'new':
                                $attributes = 'target="_blank"';
                                break;

                            case 'popup':
                                $attributes = 'class="classicPopup" rel="{\'x\':'.$params->get('linkPopupWidth').',\'y\':'.$params->get('linkPopupHeight').'}"';
                                break;

                            case 'lightbox':

                                // Joomla modal required
                                if (!defined('K2_JOOMLA_MODAL_REQUIRED')) {
                                    define('K2_JOOMLA_MODAL_REQUIRED', true);
                                }

                                $filename = @basename($object->value[1]);
                                $extension = JFile::getExt($filename);
                                if (!empty($extension) && in_array($extension, $imgExtensions)) {
                                    $attributes = 'data-k2-modal="image"';
                                } else {
                                    $attributes = 'data-k2-modal="iframe"';
                                }
                                break;
                        }
                        $object->value[0] = JString::trim($object->value[0]);
                        $object->value[1] = JString::trim($object->value[1]);

                        if ($object->value[1] && $object->value[1] != 'http://' && $object->value[1] != 'https://') {
                            if ($object->value[0] == '') {
                                $object->value[0] = $object->value[1];
                            }
                            $rows[$i]->url = $object->value[1];
                            $rows[$i]->text = $object->value[0];
                            $rows[$i]->attributes = $attributes;
                            $value = '<a href="'.$object->value[1].'" '.$attributes.'>'.$object->value[0].'</a>';
                        } else {
                            $value = false;
                        }
                    }
                }
            }

            if ($rows[$i]->type == 'header') {
                $tmp = json_decode($rows[$i]->value);
                if (!$tmp[0]->displayInFrontEnd) {
                    $value = null;
                } else {
                    $value = $tmp[0]->value;
                }
            }

            // Detect alias
            $tmpValues = json_decode($rows[$i]->value);
            if (isset($tmpValues[0]) && isset($tmpValues[0]->alias) && !empty($tmpValues[0]->alias)) {
                $rows[$i]->alias = $tmpValues[0]->alias;
            } else {
                $filter = JFilterInput::getInstance();
                $rows[$i]->alias = $filter->clean($rows[$i]->name, 'WORD');
                if (!$rows[$i]->alias) {
                    $rows[$i]->alias = 'extraField'.$rows[$i]->id;
                }
            }

            if (JString::trim($value) != '') {
                if (JString::trim($rawValue) != '') {
                    $rows[$i]->rawValue = $rawValue;
                }
                $rows[$i]->value = $value;
                if (!is_null($item)) {
                    if (!isset($item->extraFields)) {
                        $item->extraFields = new stdClass;
                    }
                    $tmpAlias = $rows[$i]->alias;
                    $item->extraFields->$tmpAlias = $rows[$i];
                }
            } else {
                unset($rows[$i]);
            }
        }

        if ($item) {
            $K2ItemExtraFieldsInstances[$item->id] = $rows;
        }
        $this->buildAliasBasedExtraFields($K2ItemExtraFieldsInstances[$item->id], $item);
        return $K2ItemExtraFieldsInstances[$item->id];
    }

    public function buildAliasBasedExtraFields($extraFields, &$item)
    {
        if (is_null($item)) {
            return false;
        }
        if (!isset($item->extraFields)) {
            $item->extraFields = new stdClass;
        }
        foreach ($extraFields as $extraField) {
            $tmpAlias = $extraField->alias;
            $item->extraFields->$tmpAlias = $extraField;
        }
    }

    public function getItemAttachments($itemID)
    {
        $itemID = (int)$itemID;
        static $K2ItemAttachmentsInstances = array();
        if (isset($K2ItemAttachmentsInstances[$itemID])) {
            return $K2ItemAttachmentsInstances[$itemID];
        }
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_attachments WHERE itemID=".$itemID;
        $db->setQuery($query);
        $rows = $db->loadObjectList();
        foreach ($rows as $row) {
            $hash = version_compare(JVERSION, '3.0', 'ge') ? JApplication::getHash($row->id) : JUtility::getHash($row->id);
            $row->link = JRoute::_('index.php?option=com_k2&view=item&task=download&id='.$row->id.'_'.$hash);
        }
        $K2ItemAttachmentsInstances[$itemID] = $rows;
        return $K2ItemAttachmentsInstances[$itemID];
    }

    public function getItemComments($itemID, $limitstart, $limit, $published = true)
    {
        $params = K2HelperUtilities::getParams('com_k2');
        $order = $params->get('commentsOrdering', 'DESC');
        $ordering = ($order == 'DESC') ? 'DESC' : 'ASC';
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_comments WHERE itemID=".(int)$itemID;
        if ($published) {
            $query .= " AND published=1 ";
        }
        $query .= " ORDER BY commentDate {$ordering}";
        $db->setQuery($query, $limitstart, $limit);
        $rows = $db->loadObjectList();
        return $rows;
    }

    public function countItemComments($itemID, $published = true)
    {
        $itemID = (int)$itemID;
        $index = $itemID.'_'.(int)$published;
        static $K2ItemCommentsCountInstances = array();
        if (isset($K2ItemCommentsCountInstances[$index])) {
            return $K2ItemCommentsCountInstances[$index];
        }
        $db = JFactory::getDbo();
        $query = "SELECT COUNT(*) FROM #__k2_comments WHERE itemID=".$itemID;
        if ($published) {
            $query .= " AND published=1 ";
        }
        $db->setQuery($query);
        $result = $db->loadResult();
        $K2ItemCommentsCountInstances[$index] = $result;
        return $K2ItemCommentsCountInstances[$index];
    }

    public function checkin()
    {
        $application = JFactory::getApplication();
        $id = JRequest::getInt('cid');
        if ($id) {
            $row = JTable::getInstance('K2Item', 'Table');
            $row->load($id);
            $row->checkin();
        } else {
            // Clean up SIGPro
            $sigProFolder = JRequest::getCmd('sigProFolder');
            if ($sigProFolder && !is_numeric($sigProFolder) && JFolder::exists(JPATH_SITE.'/media/k2/galleries/'.$sigProFolder)) {
                JFolder::delete(JPATH_SITE.'/media/k2/galleries/'.$sigProFolder);
            }
        }
        $application->close();
    }

    public function getPreviousItem($id, $catid, $ordering)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $id = (int)$id;
        $catid = (int)$catid;
        $ordering = (int)$ordering;
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        if (K2_JVERSION != '15') {
            $accessCondition = ' AND access IN('.implode(',', $user->getAuthorisedViewLevels()).')';
        } else {
            $accessCondition = ' AND access <= '.$user->aid;
            ;
        }

        $languageCondition = '';
        if (K2_JVERSION != '15') {
            if ($application->getLanguageFilter()) {
                $languageCondition = "AND language IN (".$db->quote(JFactory::getLanguage()->getTag()).",".$db->quote('*').")";
            }
        }

        if ($ordering == "0") {
            $query = "SELECT * FROM #__k2_items WHERE id < {$id} AND catid={$catid} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) {$accessCondition} AND trash=0 {$languageCondition} ORDER BY ordering DESC";
        } else {
            $query = "SELECT * FROM #__k2_items WHERE id != {$id} AND catid={$catid} AND ordering < {$ordering} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) {$accessCondition} AND trash=0 {$languageCondition} ORDER BY ordering DESC";
        }

        $db->setQuery($query, 0, 1);
        $row = $db->loadObject();
        return $row;
    }

    public function getNextItem($id, $catid, $ordering)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $id = (int)$id;
        $catid = (int)$catid;
        $ordering = (int)$ordering;
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        if (K2_JVERSION != '15') {
            $accessCondition = ' AND access IN('.implode(',', $user->getAuthorisedViewLevels()).')';
        } else {
            $accessCondition = ' AND access <= '.$user->aid;
            ;
        }

        $languageCondition = '';
        if (K2_JVERSION != '15') {
            if ($application->getLanguageFilter()) {
                $languageCondition = "AND language IN (".$db->quote(JFactory::getLanguage()->getTag()).",".$db->quote('*').")";
            }
        }

        if ($ordering == "0") {
            $query = "SELECT * FROM #__k2_items WHERE id > {$id} AND catid={$catid} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) {$accessCondition} AND trash=0 {$languageCondition} ORDER BY ordering ASC";
        } else {
            $query = "SELECT * FROM #__k2_items WHERE id != {$id} AND catid={$catid} AND ordering > {$ordering} AND published=1 AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." ) AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." ) {$accessCondition} AND trash=0 {$languageCondition} ORDER BY ordering ASC";
        }
        $db->setQuery($query, 0, 1);
        $row = $db->loadObject();
        return $row;
    }

    public function getUserProfile($id = null)
    {
        $db = JFactory::getDbo();
        if (is_null($id)) {
            $id = JRequest::getInt('id');
        }

        static $K2UsersInstances = array();
        if (isset($K2UsersInstances[$id])) {
            return $K2UsersInstances[$id];
        }

        $query = "SELECT id, gender, description, image, url, `group`, plugins FROM #__k2_users WHERE userID={$id}";
        $db->setQuery($query);
        $row = $db->loadObject();
        $K2UsersInstances[$id] = $row;
        return $row;
    }
}
models/itemlist.php000060400000130767150751650350010413 0ustar00<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.model');

JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_k2/tables');

class K2ModelItemlist extends K2Model
{
    public function getData($ordering = null)
    {
        $user = JFactory::getUser();
        $aid = $user->get('aid');
        $db = JFactory::getDbo();
        $params = K2HelperUtilities::getParams('com_k2');
        $limitstart = JRequest::getInt('limitstart');
        $limit = JRequest::getInt('limit');
        $task = JRequest::getCmd('task');

        if ($task == 'search') {
            $params->set('googleSearch', 0);
        }

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        if (JRequest::getWord('format') == 'feed') {
            $limit = $params->get('feedLimit');
        }

        $query = "SELECT i.*,";

        if ($ordering == 'modified') {
            $query .= " CASE WHEN i.modified = 0 THEN i.created ELSE i.modified END as lastChanged, ";
        }

        $query .= " c.name as categoryname,c.id as categoryid, c.alias as categoryalias, c.params as categoryparams";

        if ($ordering == 'best') {
            $query .= ", (r.rating_sum/r.rating_count) AS rating";
        }

        $query .= " FROM #__k2_items as i RIGHT JOIN #__k2_categories AS c ON c.id = i.catid";

        if ($ordering == 'best') {
            $query .= " LEFT JOIN #__k2_rating r ON r.itemID = i.id";
        }

        /*
        // Changed the query for the tag case for better performance
        if ($task == 'tag') {
            $query .= " LEFT JOIN #__k2_tags_xref AS tags_xref ON tags_xref.itemID = i.id LEFT JOIN #__k2_tags AS tags ON tags.id = tags_xref.tagID";
        }
        */

        if ($task == 'user' && !$user->guest && $user->id == JRequest::getInt('id')) {
            $query .= " WHERE ";
        } else {
            $query .= " WHERE i.published = 1 AND ";
        }

        if (K2_JVERSION != '15') {
            $query .= "i.access IN(".implode(',', $user->getAuthorisedViewLevels()).")"." AND i.trash = 0"." AND c.published = 1"." AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).")"." AND c.trash = 0";

            $application = JFactory::getApplication();
            $languageFilter = $application->getLanguageFilter();
            if ($languageFilter) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND c.language IN (".$db->quote($languageTag).", ".$db->quote('*').") AND i.language IN (".$db->quote($languageTag).", ".$db->quote('*').")";
            }
        } else {
            $query .= "i.access <= {$aid}"." AND i.trash = 0"." AND c.published = 1"." AND c.access <= {$aid}"." AND c.trash = 0";
        }

        if (!($task == 'user' && !$user->guest && $user->id == JRequest::getInt('id'))) {
            $query .= " AND ( i.publish_up = ".$db->Quote($nullDate)." OR i.publish_up <= ".$db->Quote($now)." )";
            $query .= " AND ( i.publish_down = ".$db->Quote($nullDate)." OR i.publish_down >= ".$db->Quote($now)." )";
        }

        // Build query depending on task
        switch ($task) {

            case 'category':
                $id = JRequest::getInt('id');

                $category = JTable::getInstance('K2Category', 'Table');
                $category->load($id);
                $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);

                if ($cparams->get('inheritFrom')) {
                    $parent = JTable::getInstance('K2Category', 'Table');
                    $parent->load($cparams->get('inheritFrom'));
                    $cparams = class_exists('JParameter') ? new JParameter($parent->params) : new JRegistry($parent->params);
                }

                if ($cparams->get('catCatalogMode')) {
                    $query .= " AND c.id={$id} ";
                } else {
                    $categories = $this->getCategoryTree($id);
                    $sql = @implode(',', $categories);
                    $query .= " AND c.id IN ({$sql})";
                }

                break;

            case 'user':
                $id = JRequest::getInt('id');
                $query .= " AND i.created_by={$id} AND i.created_by_alias=''";
                $categories = $params->get('userCategoriesFilter', null);
                if (is_array($categories)) {
                    $categories = array_filter($categories);
                    JArrayHelper::toInteger($categories);
                    if (count($categories)) {
                        $query .= " AND c.id IN(".implode(',', $categories).")";
                    }
                }
                if (is_string($categories) && $categories > 0) {
                    $query .= " AND c.id = {$categories}";
                }
                break;

            case 'search':
                $badchars = array(
                    '#',
                    '>',
                    '<',
                    '\\'
                );
                $search = JString::trim(JString::str_ireplace($badchars, '', JRequest::getString('searchword', null)));
                $sql = $this->prepareSearch($search);
                if (!empty($sql)) {
                    $query .= $sql;
                } else {
                    $rows = array();
                    return $rows;
                }
                break;

            case 'date':
                if ((JRequest::getInt('month')) && (JRequest::getInt('year'))) {
                    $month = JRequest::getInt('month');
                    $year = JRequest::getInt('year');
                    $query .= " AND MONTH(i.created) = {$month} AND YEAR(i.created)={$year} ";
                    if (JRequest::getInt('day')) {
                        $day = JRequest::getInt('day');
                        $query .= " AND DAY(i.created) = {$day}";
                    }

                    if (JRequest::getInt('catid')) {
                        $catid = JRequest::getInt('catid');
                        $query .= " AND c.id={$catid}";
                    }
                }
                break;

            case 'tag':
                $tag = JRequest::getString('tag');
                jimport('joomla.filesystem.file');
                if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_joomfish/joomfish.php') && $task == 'tag') {
                    $registry = JFactory::getConfig();
                    $lang = K2_JVERSION == '30' ? $registry->get('jflang') : $registry->getValue('config.jflang');

                    $sql = " SELECT reference_id FROM #__jf_content as jfc LEFT JOIN #__languages as jfl ON jfc.language_id = jfl.".K2_JF_ID;
                    $sql .= " WHERE jfc.value = ".$db->Quote($tag);
                    $sql .= " AND jfc.reference_table = 'k2_tags'";
                    $sql .= " AND jfc.reference_field = 'name' AND jfc.published=1";

                    $db->setQuery($sql, 0, 1);
                    $result = $db->loadResult();
                }

                if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_falang/falang.php') && $task == 'tag') {
                    $registry = JFactory::getConfig();
                    $lang = K2_JVERSION == '30' ? $registry->get('jflang') : $registry->getValue('config.jflang');

                    $sql = " SELECT reference_id FROM #__falang_content as fc LEFT JOIN #__languages as fl ON fc.language_id = fl.lang_id";
                    $sql .= " WHERE fc.value = ".$db->Quote($tag);
                    $sql .= " AND fc.reference_table = 'k2_tags'";
                    $sql .= " AND fc.reference_field = 'name' AND fc.published=1";

                    $db->setQuery($sql, 0, 1);
                    $result = $db->loadResult();
                }

                if (!isset($result) || $result < 1) {
                    $sql = "SELECT id FROM #__k2_tags WHERE name=".$db->Quote($tag);
                    $db->setQuery($sql, 0, 1);
                    $result = $db->loadResult();
                }

                $query .= " AND i.id IN (SELECT itemID FROM #__k2_tags_xref WHERE tagID=".(int)$result.")";

                /*
                if (isset($result) && $result > 0) {
                    $query .= " AND (tags.id) = {$result}";
                } else {
                    $query .= " AND (tags.name) = ".$db->Quote($tag);
                }
                */

                $categories = $params->get('categoriesFilter', null);
                if (is_array($categories)) {
                    JArrayHelper::toInteger($categories);
                    $query .= " AND c.id IN(".implode(',', $categories).")";
                }
                if (is_string($categories)) {
                    $query .= " AND c.id = {$categories}";
                }
                break;

            default:
                $searchIDs = $params->get('categories');

                if (is_array($searchIDs) && count($searchIDs)) {
                    if ($params->get('catCatalogMode')) {
                        $sql = @implode(',', $searchIDs);
                        $query .= " AND c.id IN ({$sql})";
                    } else {
                        $result = $this->getCategoryTree($searchIDs);
                        if (count($result)) {
                            $sql = @implode(',', $result);
                            $query .= " AND c.id IN ({$sql})";
                        }
                    }
                }

                break;
        }

        // Set featured flag
        if ($task == 'category' || empty($task)) {
            if (JRequest::getInt('featured') == '0') {
                $query .= " AND i.featured != 1";
            } elseif (JRequest::getInt('featured') == '2') {
                $query .= " AND i.featured = 1";
            }
        }

        // Remove duplicates
        //$query .= " GROUP BY i.id";

        // Set ordering
        switch ($ordering) {

            case 'date':
                $orderby = 'i.created ASC';
                break;

            case 'rdate':
                $orderby = 'i.created DESC';
                break;

            case 'alpha':
                $orderby = 'i.title';
                break;

            case 'ralpha':
                $orderby = 'i.title DESC';
                break;

            case 'order':
                if (JRequest::getInt('featured') == '2') {
                    $orderby = 'i.featured_ordering';
                } else {
                    $orderby = 'c.ordering, i.ordering';
                }
                break;

            case 'rorder':
                if (JRequest::getInt('featured') == '2') {
                    $orderby = 'i.featured_ordering DESC';
                } else {
                    $orderby = 'c.ordering DESC, i.ordering DESC';
                }
                break;

            case 'featured':
                $orderby = 'i.featured DESC, i.created DESC';
                break;

            case 'hits':
                $orderby = 'i.hits DESC';
                break;

            case 'rand':
                $orderby = 'RAND()';
                break;

            case 'best':
                $orderby = 'rating DESC';
                break;

            case 'modified':
                $orderby = 'lastChanged DESC';
                break;

            case 'publishUp':
                $orderby = 'i.publish_up DESC';
                break;

            case 'id':
            default:
                $orderby = 'i.id DESC';
                break;
        }

        $query .= " ORDER BY ".$orderby;
        $dispatcher = JDispatcher::getInstance();
        JPluginHelper::importPlugin('k2');
        $dispatcher->trigger('onK2BeforeSetQuery', array(&$query));
        $db->setQuery($query, $limitstart, $limit);
        $rows = $db->loadObjectList();
        return $rows;
    }

    public function getTotal()
    {
        $user = JFactory::getUser();
        $aid = $user->get('aid');
        $db = JFactory::getDbo();
        $params = K2HelperUtilities::getParams('com_k2');
        $task = JRequest::getCmd('task');

        if ($task == 'search') {
            $params->set('googleSearch', 0);
        }

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        $query = "SELECT COUNT(*) FROM #__k2_items as i RIGHT JOIN #__k2_categories c ON c.id = i.catid";

        if ($task == 'tag') {
            $query .= " LEFT JOIN #__k2_tags_xref tags_xref ON tags_xref.itemID = i.id LEFT JOIN #__k2_tags tags ON tags.id = tags_xref.tagID";
        }

        if ($task == 'user' && !$user->guest && $user->id == JRequest::getInt('id')) {
            $query .= " WHERE ";
        } else {
            $query .= " WHERE i.published = 1 AND ";
        }

        if (K2_JVERSION != '15') {
            $query .= "i.access IN(".implode(',', $user->getAuthorisedViewLevels()).")"." AND i.trash = 0"." AND c.published = 1"." AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).")"." AND c.trash = 0";

            $application = JFactory::getApplication();
            $languageFilter = $application->getLanguageFilter();
            if ($languageFilter) {
                $languageTag = JFactory::getLanguage()->getTag();
                $query .= " AND c.language IN (".$db->quote($languageTag).", ".$db->quote('*').")
                        AND i.language IN (".$db->quote($languageTag).", ".$db->quote('*').")";
            }
        } else {
            $query .= "i.access <= {$aid}"." AND i.trash = 0"." AND c.published = 1"." AND c.access <= {$aid}"." AND c.trash = 0";
        }

        $query .= " AND ( i.publish_up = ".$db->Quote($nullDate)." OR i.publish_up <= ".$db->Quote($now)." )";
        $query .= " AND ( i.publish_down = ".$db->Quote($nullDate)." OR i.publish_down >= ".$db->Quote($now)." )";

        // Build query depending on task
        switch ($task) {

            case 'category':
                $id = JRequest::getInt('id');

                $category = JTable::getInstance('K2Category', 'Table');
                $category->load($id);
                $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);

                if ($cparams->get('inheritFrom')) {
                    $parent = JTable::getInstance('K2Category', 'Table');
                    $parent->load($cparams->get('inheritFrom'));
                    $cparams = class_exists('JParameter') ? new JParameter($parent->params) : new JRegistry($parent->params);
                }

                if ($cparams->get('catCatalogMode')) {
                    $query .= " AND c.id={$id} ";
                } else {
                    $categories = $this->getCategoryTree($id);
                    $sql = @implode(',', $categories);
                    $query .= " AND c.id IN ({$sql})";
                }

                break;

            case 'user':
                $id = JRequest::getInt('id');
                $query .= " AND i.created_by={$id} AND i.created_by_alias=''";
                $categories = $params->get('userCategoriesFilter', null);
                if (is_array($categories)) {
                    $categories = array_filter($categories);
                    JArrayHelper::toInteger($categories);
                    if (count($categories)) {
                        $query .= " AND c.id IN(".implode(',', $categories).")";
                    }
                }
                if (is_string($categories) && $categories > 0) {
                    $query .= " AND c.id = {$categories}";
                }
                break;

            case 'search':
                $badchars = array(
                    '#',
                    '>',
                    '<',
                    '\\'
                );
                $search = trim(str_replace($badchars, '', JRequest::getString('searchword', null)));
                $sql = $this->prepareSearch($search);
                if (!empty($sql)) {
                    $query .= $sql;
                } else {
                    $result = 0;
                    return $result;
                }
                break;

            case 'date':
                if ((JRequest::getInt('month')) && (JRequest::getInt('year'))) {
                    $month = JRequest::getInt('month');
                    $year = JRequest::getInt('year');
                    $query .= " AND MONTH(i.created) = {$month} AND YEAR(i.created)={$year} ";
                    if (JRequest::getInt('day')) {
                        $day = JRequest::getInt('day');
                        $query .= " AND DAY(i.created) = {$day}";
                    }

                    if (JRequest::getInt('catid')) {
                        $catid = JRequest::getInt('catid');
                        $query .= " AND c.id={$catid}";
                    }
                }
                break;

            case 'tag':
                $tag = JRequest::getString('tag');
                jimport('joomla.filesystem.file');
                if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_joomfish/joomfish.php') && $task == 'tag') {
                    $registry = JFactory::getConfig();
                    $lang = K2_JVERSION == '30' ? $registry->get('jflang') : $registry->getValue('config.jflang');

                    $sql = " SELECT reference_id FROM #__jf_content as jfc LEFT JOIN #__languages as jfl ON jfc.language_id = jfl.".K2_JF_ID;
                    $sql .= " WHERE jfc.value = ".$db->Quote($tag);
                    $sql .= " AND jfc.reference_table = 'k2_tags'";
                    $sql .= " AND jfc.reference_field = 'name' AND jfc.published=1";

                    $db->setQuery($sql, 0, 1);
                    $result = $db->loadResult();
                }

                if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_falang/falang.php') && $task == 'tag') {
                    $registry = JFactory::getConfig();
                    $lang = K2_JVERSION == '30' ? $registry->get('jflang') : $registry->getValue('config.jflang');

                    $sql = " SELECT reference_id FROM #__falang_content as fc LEFT JOIN #__languages as fl ON fc.language_id = fl.lang_id";
                    $sql .= " WHERE fc.value = ".$db->Quote($tag);
                    $sql .= " AND fc.reference_table = 'k2_tags'";
                    $sql .= " AND fc.reference_field = 'name' AND fc.published=1";

                    $db->setQuery($sql, 0, 1);
                    $result = $db->loadResult();
                }

                if (isset($result) && $result > 0) {
                    $query .= " AND (tags.id) = {$result}";
                } else {
                    $query .= " AND (tags.name) = ".$db->Quote($tag);
                }
                $categories = $params->get('categoriesFilter', null);
                if (is_array($categories)) {
                    $query .= " AND c.id IN(".implode(',', $categories).")";
                }
                if (is_string($categories)) {
                    $query .= " AND c.id = {$categories}";
                }
                break;

            default:
                $searchIDs = $params->get('categories');

                if (is_array($searchIDs) && count($searchIDs)) {
                    if ($params->get('catCatalogMode')) {
                        $sql = @implode(',', $searchIDs);
                        $query .= " AND c.id IN ({$sql})";
                    } else {
                        $result = $this->getCategoryTree($searchIDs);
                        if (count($result)) {
                            $sql = @implode(',', $result);
                            $query .= " AND c.id IN ({$sql})";
                        }
                    }
                }

                break;
        }

        // Set featured flag
        if ($task == 'category' || empty($task)) {
            if (JRequest::getVar('featured') == '0') {
                $query .= " AND i.featured != 1";
            } elseif (JRequest::getVar('featured') == '2') {
                $query .= " AND i.featured = 1";
            }
        }
        $dispatcher = JDispatcher::getInstance();
        JPluginHelper::importPlugin('k2');
        $dispatcher->trigger('onK2BeforeSetQuery', array(&$query));
        $db->setQuery($query);
        $result = $db->loadResult();
        return $result;
    }

    public function getCategoryTree($categories, $associations = false)
    {
        $application = JFactory::getApplication();
        $db = JFactory::getDbo();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        if (!is_array($categories)) {
            $categories = (array)$categories;
        }
        JArrayHelper::toInteger($categories);
        $categories = array_unique($categories);
        sort($categories);
        $key = implode('|', $categories);
        $clientID = $application->getClientId();
        static $K2CategoryTreeInstances = array();
        if (isset($K2CategoryTreeInstances[$clientID]) && array_key_exists($key, $K2CategoryTreeInstances[$clientID])) {
            return $K2CategoryTreeInstances[$clientID][$key];
        }
        $array = $categories;
        while (count($array)) {
            $query = "SELECT id
                        FROM #__k2_categories
                        WHERE parent IN (".implode(',', $array).")
                        AND id NOT IN (".implode(',', $array).") ";
            if ($application->isSite()) {
                $query .= "
                                AND published=1
                                AND trash=0";
                if (K2_JVERSION != '15') {
                    $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).")";
                    if ($application->getLanguageFilter()) {
                        $query .= " AND language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
                    }
                } else {
                    $query .= " AND access<={$aid}";
                }
            }
            $db->setQuery($query);
            $array = K2_JVERSION == '30' ? $db->loadColumn() : $db->loadResultArray();
            $categories = array_merge($categories, $array);
        }
        JArrayHelper::toInteger($categories);
        $categories = array_unique($categories);
        $K2CategoryTreeInstances[$clientID][$key] = $categories;
        return $categories;
    }

    // Deprecated function, left for compatibility reasons
    public function getCategoryChildren($catid, $clear = false)
    {
        static $array = array();
        if ($clear) {
            $array = array();
        }
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $catid = (int)$catid;
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_categories WHERE parent={$catid} AND published=1 AND trash=0 AND access<={$aid} ORDER BY ordering ";
        $db->setQuery($query);
        $rows = $db->loadObjectList();

        foreach ($rows as $row) {
            array_push($array, $row->id);
            if ($this->hasChildren($row->id)) {
                $this->getCategoryChildren($row->id);
            }
        }
        return $array;
    }

    // Deprecated function, left for compatibility reasons
    public function hasChildren($id)
    {
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $id = (int)$id;
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_categories WHERE parent={$id} AND published=1 AND trash=0 AND access<={$aid} ";
        $db->setQuery($query);
        $rows = $db->loadObjectList();

        if (count($rows)) {
            return true;
        } else {
            return false;
        }
    }

    public function getCategoryFirstChildren($catid, $ordering = null)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = $user->get('aid');
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__k2_categories WHERE parent={$catid} AND published=1 AND trash=0";

        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($application->getLanguageFilter()) {
                $query .= " AND language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
            }
        } else {
            $query .= " AND access<={$aid} ";
        }

        switch ($ordering) {

            case 'order':
                $order = " ordering ASC";
                break;

            case 'alpha':
                $order = " name ASC";
                break;

            case 'ralpha':
                $order = " name DESC";
                break;

            case 'reversedefault':
                $order = " id DESC";
                break;

            default:
                $order = " id ASC";
                break;
        }

        $query .= " ORDER BY {$order}";

        $db->setQuery($query);
        $rows = $db->loadObjectList();
        if ($db->getErrorNum()) {
            echo $db->stderr();
            return false;
        }

        return $rows;
    }

    public function countCategoryItems($id)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $id = (int)$id;
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        $categories = $this->getCategoryTree($id);
        $query = "SELECT COUNT(*) FROM #__k2_items WHERE catid IN (".implode(',', $categories).") AND published=1 AND trash=0";

        if (K2_JVERSION != '15') {
            $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($application->getLanguageFilter()) {
                $query .= " AND language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
            }
        } else {
            $query .= " AND access<=".$aid;
        }

        $query .= " AND ( publish_up = ".$db->Quote($nullDate)." OR publish_up <= ".$db->Quote($now)." )";
        $query .= " AND ( publish_down = ".$db->Quote($nullDate)." OR publish_down >= ".$db->Quote($now)." )";
        $db->setQuery($query);
        $total = $db->loadResult();
        return $total;
    }

    public function getUserProfile($id = null)
    {
        $db = JFactory::getDbo();
        if (is_null($id)) {
            $id = JRequest::getInt('id');
        } else {
            $id = (int)$id;
        }
        $query = "SELECT id, gender, description, image, url, `group`, plugins FROM #__k2_users WHERE userID={$id}";
        $db->setQuery($query);
        $row = $db->loadObject();
        return $row;
    }

    public function getAuthorLatest($itemID, $limit, $userID)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $itemID = (int)$itemID;
        $userID = (int)$userID;
        $limit = (int)$limit;
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        $query = "SELECT i.*, c.alias as categoryalias FROM #__k2_items as i
            LEFT JOIN #__k2_categories c ON c.id = i.catid
            WHERE i.id != {$itemID}
            AND i.published = 1
            AND ( i.publish_up = ".$db->Quote($nullDate)." OR i.publish_up <= ".$db->Quote($now)." )
            AND ( i.publish_down = ".$db->Quote($nullDate)." OR i.publish_down >= ".$db->Quote($now)." ) ";

        if (K2_JVERSION != '15') {
            $query .= " AND i.access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($application->getLanguageFilter()) {
                $query .= " AND i.language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
            }
        } else {
            $query .= " AND i.access <= {$aid} ";
        }

        $query .= " AND i.trash = 0
            AND i.created_by = {$userID}
            AND i.created_by_alias=''
            AND c.published = 1 ";

        if (K2_JVERSION != '15') {
            $query .= " AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($application->getLanguageFilter()) {
                $query .= " AND c.language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
            }
        } else {
            $query .= " AND c.access <= {$aid} ";
        }

        $query .= " AND c.trash = 0
            ORDER BY i.created DESC";

        $db->setQuery($query, 0, $limit);
        $rows = $db->loadObjectList();

        foreach ($rows as $item) {
            // Image
            $item->imageXSmall = '';
            $item->imageSmall = '';
            $item->imageMedium = '';
            $item->imageLarge = '';
            $item->imageXLarge = '';

            if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_XS.jpg')) {
                $item->imageXSmall = JURI::root(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_XS.jpg';
            }

            if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_S.jpg')) {
                $item->imageSmall = JURI::root(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_S.jpg';
            }

            if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg')) {
                $item->imageMedium = JURI::root(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_M.jpg';
            }

            if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg')) {
                $item->imageLarge = JURI::root(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_L.jpg';
            }

            if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_XL.jpg')) {
                $item->imageXLarge = JURI::root(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_XL.jpg';
            }

            if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$item->id).'_Generic.jpg')) {
                $item->imageGeneric = JURI::root(true).'/media/k2/items/cache/'.md5("Image".$item->id).'_Generic.jpg';
            }
        }

        return $rows;
    }

    public function getRelatedItems($itemID, $tags, $params)
    {
        $application = JFactory::getApplication();
        $limit = $params->get('itemRelatedLimit', 10);
        $itemID = (int)$itemID;
        foreach ($tags as $tag) {
            $tagIDs[] = $tag->id;
        }
        JArrayHelper::toInteger($tagIDs);
        $sql = implode(',', $tagIDs);

        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');
        $db = JFactory::getDbo();

        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        $query = "SELECT itemID FROM #__k2_tags_xref WHERE tagID IN ({$sql}) AND itemID!={$itemID} GROUP BY itemID";
        $db->setQuery($query);
        $itemsIDs = K2_JVERSION == '30' ? $db->loadColumn() : $db->loadResultArray();

        if (!count($itemsIDs)) {
            return array();
        }

        $sql = implode(',', $itemsIDs);

        $query = "SELECT i.*, c.alias as categoryalias FROM #__k2_items as i
            LEFT JOIN #__k2_categories c ON c.id = i.catid
            WHERE i.published = 1
            AND ( i.publish_up = ".$db->Quote($nullDate)." OR i.publish_up <= ".$db->Quote($now)." )
            AND ( i.publish_down = ".$db->Quote($nullDate)." OR i.publish_down >= ".$db->Quote($now)." ) ";

        if (K2_JVERSION != '15') {
            $query .= " AND i.access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($application->getLanguageFilter()) {
                $query .= " AND i.language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
            }
        } else {
            $query .= " AND i.access <= {$aid} ";
        }

        $query .= " AND i.trash = 0
                AND c.published = 1 ";

        if (K2_JVERSION != '15') {
            $query .= " AND c.access IN(".implode(',', $user->getAuthorisedViewLevels()).") ";
            if ($application->getLanguageFilter()) {
                $query .= " AND c.language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
            }
        } else {
            $query .= " AND c.access <= {$aid} ";
        }

        $query .= " AND c.trash = 0
                AND (i.id) IN ({$sql})
                ORDER BY i.created DESC";

        $db->setQuery($query, 0, $limit);
        $rows = $db->loadObjectList();
        K2Model::addIncludePath(JPATH_COMPONENT.'/models');
        $model = K2Model::getInstance('Item', 'K2Model');
        for ($key = 0; $key < sizeof($rows); $key++) {
            if (!$params->get('itemRelatedMedia')) {
                $rows[$key]->video = null;
            }
            if (!$params->get('itemRelatedImageGallery')) {
                $rows[$key]->gallery = null;
            }
            $rows[$key] = $model->prepareItem($rows[$key], 'relatedByTag', '');
            $rows[$key] = $model->execPlugins($rows[$key], 'relatedByTag', '');
            K2HelperUtilities::setDefaultImage($rows[$key], 'relatedByTag', $params);
        }
        return $rows;
    }

    public function prepareSearch($search)
    {
        jimport('joomla.filesystem.file');
        $db = JFactory::getDbo();
        $language = JFactory::getLanguage();
        $defaultLang = $language->getDefault();
        $currentLang = $language->getTag();
        $length = JString::strlen($search);
        $sql = '';

        if (JRequest::getVar('categories')) {
            $categories = @explode(',', JRequest::getVar('categories'));
            JArrayHelper::toInteger($categories);
            $sql .= " AND c.id IN (".@implode(',', $categories).") ";
        }

        if (empty($search)) {
            return $sql;
        }

        if (JString::substr($search, 0, 1) == '"' && JString::substr($search, $length - 1, 1) == '"') {
            $type = 'exact';
        } else {
            $type = 'any';
        }

        if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_joomfish/joomfish.php') && $currentLang != $defaultLang) {
            $conditions = array();
            $search_ignore = array();

            $ignoreFile = $language->getLanguagePath().'/'.$currentLang.'/'.$currentLang.'.ignore.php';

            if (JFile::exists($ignoreFile)) {
                include $ignoreFile;
            }

            if ($type == 'exact') {
                $word = JString::substr($search, 1, $length - 2);

                if (JString::strlen($word) > 3 && !in_array($word, $search_ignore)) {
                    $escaped = K2_JVERSION == '15' ? $db->getEscaped($word, true) : $db->escape($word, true);
                    $langField = K2_JVERSION == '15' ? 'code' : 'lang_code';
                    $word = $db->Quote('%'.$escaped.'%', false);

                    $jfQuery = " SELECT reference_id FROM #__jf_content as jfc LEFT JOIN #__languages as jfl ON jfc.language_id = jfl.".K2_JF_ID;
                    $jfQuery .= " WHERE jfc.reference_table = 'k2_items'";
                    $jfQuery .= " AND jfl.".$langField."=".$db->Quote($currentLang);
                    $jfQuery .= " AND jfc.published=1";
                    $jfQuery .= " AND jfc.value LIKE ".$word;
                    $jfQuery .= " AND (jfc.reference_field = 'title'
                        OR jfc.reference_field = 'introtext'
                        OR jfc.reference_field = 'fulltext'
                        OR jfc.reference_field = 'image_caption'
                        OR jfc.reference_field = 'image_credits'
                        OR jfc.reference_field = 'video_caption'
                        OR jfc.reference_field = 'video_credits'
                        OR jfc.reference_field = 'extra_fields_search'
                        OR jfc.reference_field = 'metadesc'
                        OR jfc.reference_field = 'metakey'
                    )";
                    $db->setQuery($jfQuery);
                    $result = K2_JVERSION == '30' ? $db->loadColumn() : $db->loadResultArray();
                    $result = @array_unique($result);
                    JArrayHelper::toInteger($result);
                    if (count($result)) {
                        $conditions[] = "i.id IN(".implode(',', $result).")";
                    }
                }
            } else {
                $search = explode(' ', JString::strtolower($search));
                foreach ($search as $searchword) {
                    if (JString::strlen($searchword) > 3 && !in_array($searchword, $search_ignore)) {
                        $escaped = K2_JVERSION == '15' ? $db->getEscaped($searchword, true) : $db->escape($searchword, true);
                        $word = $db->Quote('%'.$escaped.'%', false);
                        $langField = K2_JVERSION == '15' ? 'code' : 'lang_code';

                        $jfQuery = " SELECT reference_id FROM #__jf_content as jfc LEFT JOIN #__languages as jfl ON jfc.language_id = jfl.".K2_JF_ID;
                        $jfQuery .= " WHERE jfc.reference_table = 'k2_items'";
                        $jfQuery .= " AND jfl.".$langField."=".$db->Quote($currentLang);
                        $jfQuery .= " AND jfc.published=1";
                        $jfQuery .= " AND jfc.value LIKE ".$word;
                        $jfQuery .= " AND (jfc.reference_field = 'title'
                            OR jfc.reference_field = 'introtext'
                            OR jfc.reference_field = 'fulltext'
                            OR jfc.reference_field = 'image_caption'
                            OR jfc.reference_field = 'image_credits'
                            OR jfc.reference_field = 'video_caption'
                            OR jfc.reference_field = 'video_credits'
                            OR jfc.reference_field = 'extra_fields_search'
                            OR jfc.reference_field = 'metadesc'
                            OR jfc.reference_field = 'metakey'
                        )";
                        $db->setQuery($jfQuery);
                        $result = K2_JVERSION == '30' ? $db->loadColumn() : $db->loadResultArray();
                        $result = @array_unique($result);
                        foreach ($result as $id) {
                            $allIDs[] = $id;
                        }

                        if (JFile::exists(JPATH_ADMINISTRATOR.'/components/com_joomfish/joomfish.php') && $currentLang != $defaultLang) {
                            if (isset($allIDs) && count($allIDs)) {
                                JArrayHelper::toInteger($allIDs);
                                $conditions[] = "i.id IN(".implode(',', $allIDs).")";
                            }
                        }
                    }
                }
            }

            if (count($conditions)) {
                $sql .= " AND (".implode(" OR ", $conditions).")";
            }
        } else {
            $escaped = K2_JVERSION == '15' ? $db->getEscaped($search, true) : $db->escape($search, true);
            $quoted = $db->Quote('%'.$escaped.'%', false);

            if ($type == 'exact') {
                $text = JString::trim($search, '"');
                $escaped = K2_JVERSION == '15' ? $db->getEscaped($text, true) : $db->escape($text, true);
                $quoted = $db->Quote('%'.$escaped.'%', false);
                $sql .= " AND ( LOWER(i.title) = ".$quoted." OR LOWER(i.introtext) = ".$quoted." OR LOWER(i.`fulltext`) = ".$quoted." OR LOWER(i.extra_fields_search) = ".$quoted." OR LOWER(i.image_caption) = ".$quoted." OR LOWER(i.image_credits) = ".$quoted." OR LOWER(i.video_caption) = ".$quoted." OR LOWER(i.video_credits) = ".$quoted." OR LOWER(i.metadesc) = ".$quoted." OR LOWER(i.metakey) = ".$quoted.") ";
            } else {
                $escaped = K2_JVERSION == '15' ? $db->getEscaped($search, true) : $db->escape($search, true);
                $text = $db->Quote($escaped);
                $sql .= " AND ( LOWER(i.title) LIKE ".$quoted." OR LOWER(i.introtext) LIKE ".$quoted." OR LOWER(i.`fulltext`) LIKE ".$quoted." OR LOWER(i.extra_fields_search) LIKE ".$quoted." OR LOWER(i.image_caption) LIKE ".$quoted." OR LOWER(i.image_credits) LIKE ".$quoted." OR LOWER(i.video_caption) LIKE ".$quoted." OR LOWER(i.video_credits) LIKE ".$quoted." OR LOWER(i.metadesc) LIKE ".$quoted." OR LOWER(i.metakey) LIKE ".$quoted.") ";
            }
        }

        return $sql;
    }

    public function getModuleItems($moduleID)
    {
        $db = JFactory::getDbo();
        $query = "SELECT * FROM #__modules WHERE id={$moduleID} AND published=1 AND client_id=0";
        $db->setQuery($query, 0, 1);
        $module = $db->loadObject();
        $format = JRequest::getWord('format');
        if (is_null($module)) {
            JError::raiseError(404, JText::_('K2_NOT_FOUND'));
        } else {
            $params = class_exists('JParameter') ? new JParameter($module->params) : new JRegistry($module->params);
            switch ($module->module) {

                case 'mod_k2_content':
                    require_once(JPATH_SITE.'/modules/mod_k2_content/helper.php');
                    $helper = new modK2ContentHelper;
                    $items = $helper->getItems($params, $format);
                    break;

                case 'mod_k2_comments':
                    if ($params->get('module_usage') == 1) {
                        JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                    }

                    require_once(JPATH_SITE.'/modules/mod_k2_comments/helper.php');
                    $helper = new modK2CommentsHelper;
                    $items = $helper->getLatestComments($params);

                    foreach ($items as $item) {
                        $item->title = $item->userName.' '.JText::_('K2_COMMENTED_ON').' '.$item->title;
                        $item->introtext = $item->commentText;
                        $item->created = $item->commentDate;
                        $item->id = $item->itemID;
                    }
                    break;

                default:
                    JError::raiseError(404, JText::_('K2_NOT_FOUND'));
            }

            $result = new JObject;
            $result->items = $items;
            $result->title = $module->title;
            $result->module = $module->module;
            $result->params = $module->params;
            return $result;
        }
    }

    public function getCategoriesTree()
    {
        $application = JFactory::getApplication();
        $clientID = $application->getClientId();
        $db = JFactory::getDbo();
        $user = JFactory::getUser();
        $aid = (int)$user->get('aid');

        $query = "SELECT id, name,  parent  FROM #__k2_categories";
        if ($application->isSite()) {
            $query .= " WHERE published=1  AND trash=0";
            if (K2_JVERSION != '15') {
                $query .= " AND access IN(".implode(',', $user->getAuthorisedViewLevels()).")";
                if ($application->getLanguageFilter()) {
                    $query .= " AND language IN(".$db->Quote(JFactory::getLanguage()->getTag()).", ".$db->Quote('*').")";
                }
            } else {
                $query .= " AND access<={$aid}";
            }
        }
        $query .= " ORDER BY parent ";
        $db->setQuery($query);
        $categories = $db->loadObjectList();
        $tree = array();
        return $this->buildTree($categories);
    }

    public function buildTree(array &$categories, $parent = 0)
    {
        $branch = array();

        foreach ($categories as &$category) {
            if ($category->parent == $parent) {
                $children = $this->buildTree($categories, $category->id);
                if ($children) {
                    $category->children = $children;
                }
                $branch[$category->id] = $category;
            }
        }
        return $branch;
    }

    public function getTreePath($tree, $id)
    {
        if (array_key_exists($id, $tree)) {
            return array($id);
        } else {
            foreach ($tree as $key => $root) {
                if (isset($root->children) && is_array($root->children)) {
                    $retry = $this->getTreePath($root->children, $id);

                    if ($retry) {
                        $retry[] = $key;
                        return $retry;
                    }
                }
            }
        }

        return null;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit