Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/digicom.tar

digicom.php000064400000010623151160563660006703 0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Content.joomla
 *
 * @copyright   Copyright (C) 2005 - 2017 Open Source Matters, Inc. All
rights reserved.
 * @license     GNU General Public License version 2 or later; see
LICENSE.txt
 */

defined('_JEXEC') or die;
JLoader::register('NotiflyMessageHelper', JPATH_ADMINISTRATOR .
'/components/com_notifly/helpers/message.php');
JLoader::discover('DigiComSiteHelper', JPATH_SITE .
'/components/com_digicom/helpers');
jimport('joomla.filesystem.file');

/**
 * Example Content Plugin
 *
 * @since  1.6
 */
class PlgNotiflyDigicom extends JPlugin
{
	public function __construct(&$subject , $params)
	{
		if (!$this->exists()) {
			return;
		}
		
		$input = JFactory::getApplication()->input;
		$this->extension = $input->get('option');
		$this->view = $input->get('view');

		// Load language file for use throughout the plugin
		JFactory::getLanguage()->load('com_digicom', JPATH_ROOT);

		parent::__construct($subject, $params);
	}

	/**
	 * Tests if EasyBlog exists
	 *
	 * @since	4.0
	 * @access	private
	 */
	private function exists()
	{
		static $exists = null;

		if (is_null($exists)) {
			$file = JPATH_ADMINISTRATOR .
'/components/com_digicom/helpers/digicom.php';
			$exists = JFile::exists($file);

			if ($exists) {
				return true;
			}
		}

		return false;
	}

	/**
	 * Utility method to act on a user after it has been saved.
	 *
	 * This method creates a contact for the saved user
	 *
	 * @param   array    $user     Holds the new user data.
	 * @param   boolean  $isnew    True if a new user is stored.
	 * @param   boolean  $success  True if user was succesfully stored in the
database.
	 * @param   string   $msg      Message.
	 *
	 * @return  boolean
	 *
	 * @since   1.6
	 */
	public function onDigicomAfterPlaceOrder($order_id, $items, $tax,
$customerInfo)
	{
		// check if event is enabled
		if(!$this->params->get('enable_purchase', 0))
		{
			return false;
		}

		$customer = $customerInfo->_customer;
		// Ensure the user id is really an int
		$user_id = (int) $customer->id;

		// If the user id appears invalid then bail out just in case
		if (empty($user_id))
		{
			return false;
		}

		// we have items
    	foreach ($items as $key => $item) {
			// register users registration event
			$this->logPurchaseEvent($customer, $item);
    	}

		// JError::raiseWarning('',
JText::_('PLG_NOTIFLY_JOOMLA_ERR_FAILED_CREATING_CONTACT'));

		return true;
	}

	public function logPurchaseEvent($customer, $item)
	{
		$images = json_decode($item->images, true);
		$imageIntro = $images['image_intro'];
		$plugin = $this->getPluginInfo();
		
		$extension_id = $plugin->extension_id;
		$template = 'new_product_purchase';
		$template = $this->getTemplateInfo($extension_id);

		$table = $this->getTable();
		$table->template_id = $template->id;
		$table->extension_id = $extension_id;

		// process the event url
		$link = DigiComSiteHelperRoute::getProductRoute($item->id,
$item->catid, $item->language);
		$table->url = $link;

		if(!$template->image_disable)
		{
			if($imageIntro){
				$table->image_url = Juri::root() . $imageIntro;
			}
			else
			{
				$table->image_url =  $template->image_url;
			}
		}
		
		// get location from helper
		$ip = NotiflyMessageHelper::getRealIpAddr();
		$location = NotiflyMessageHelper::getLocation($ip);
		
		$table->title 	= $item->name;
		$table->name 	= $customer->name;
		$table->email 	= $customer->email;
		$table->ip 		= $ip;

		$table->city = $location['city'];
		$table->state = $location['region_name'];
		$table->country = $location['country_name'];
		
		$table->created = JHtml::date('now', 'Y-m-d
H:i:s');
		$table->published = 1;
		
		$table->store();

		// if(JFactory::getUser()->authorise('core.delete',
'com_notifly.event')){
			// print_r($table->created);die;
		// }

		return true;
	}

	public function getPluginInfo(){
		$db = JFactory::getDBO();
		$sql = "SELECT * from `#__extensions` WHERE `type` =
'plugin' AND `folder` = 'notifly' AND `element` =
'digicom'";
		$db->setQuery($sql);
		return $db->loadObject();
	}
	public function getTemplateInfo($extension_id){
		$db = JFactory::getDBO();
		$sql = "SELECT * from `#__notifly_templates` WHERE `extension_id` =
'".$extension_id."' AND `alias` =
'new_product_purchase'";
		$db->setQuery($sql);
		return $db->loadObject();
	}

	public function getTable()
	{
		JTable::addIncludePath(JPATH_ADMINISTRATOR .
'/components/com_notifly/tables');
		return JTable::getInstance('Event', 'NotiflyTable',
array());
	}

}
digicom.xml000064400000003205151160563660006712 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="notifly" method="upgrade">
	<name>plg_notifly_digicom</name>
	<author>ThemeXpert</author>
	<creationDate>November 2010</creationDate>
	<copyright>Copyright (C) 2005 - 2017 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>info@themexpert.com</authorEmail>
	<authorUrl>www.themexpert.com</authorUrl>
	<version>1.0.0</version>
	<description>PLG_NOTIFLY_DIGICOM_XML_DESCRIPTION</description>
	<files>
		<filename plugin="digicom">digicom.php</filename>
		<folder>media</folder>
	</files>
	<scriptfile>script.php</scriptfile>
	<languages folder="language">
		<language
tag="en-GB">en-GB/en-GB.plg_notifly_digicom.ini</language>
		<language
tag="en-GB">en-GB/en-GB.plg_notifly_digicom.sys.ini</language>
	</languages>
<!-- 	
	<media destination="com_notifly" folder="media">
        <folder>integrations</folder>
    </media>
 -->
	<config>
		<fields name="params">
			<fieldset name="basic">
				<field
					name="enable_purchase"
					type="radio"
					label="enable_purchase"
					description="enable_purchase"
					class="btn-group btn-group-yesno"
					default="1"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field>

				<!-- <field 
					name="enable_renew"
					type="radio"
					label="enable_renew"
					description="enable_renew"
					class="btn-group btn-group-yesno"
					default="1"
					>
					<option value="1">JYES</option>
					<option value="0">JNO</option>
				</field> -->

			</fieldset>
		</fields>
	</config>

</extension>
media/logo.png000064400000013155151160563660007307 0ustar00�PNG


IHDR����'�tEXtSoftwareAdobe
ImageReadyq�e<*iTXtXML:com.adobe.xmp<?xpacket
begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP
Core 5.6-c132 79.159284, 2016/04/19-13:13:40        "> <rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
xmp:CreatorTool="Adobe Photoshop CC 2015.5 (Macintosh)"
xmpMM:InstanceID="xmp.iid:0F606B2AB0C411E7AE6F9DEDDB13D255"
xmpMM:DocumentID="xmp.did:0F606B2BB0C411E7AE6F9DEDDB13D255">
<xmpMM:DerivedFrom
stRef:instanceID="xmp.iid:0F606B28B0C411E7AE6F9DEDDB13D255"
stRef:documentID="xmp.did:0F606B29B0C411E7AE6F9DEDDB13D255"/>
</rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket
end="r"?>��r2�IDATx��]	ؖS~Ɩ�}�C�d�H#kdoi$5�PY#��R3�QTH�"%�2I��,Q�H�P��Ϲ�s����~�wy��z�1�y��~�s��T)--�"l�N_�B��P(1JL�B��Pb*JL�B��Pb*JL�S�Pb*��
�S�Pb*��
EV�>�'�R�)���j#7�k���
I"Li�=t��Ydd��#�t6�o#��Qb
�x#��_��1�	{��*%f!������0���Xv6	\C_�3_ho�#}�T
0�
���P��K412��#�8�D>X_�3�F�g���{}��a��?#����.J%f�����b�jU�F#/ЂJJ�-�j��RG��+���7���0�#��<b�k����\�F#5����7��6�R�����3\hd����\/6�ذ)S*]�3f`�3�7#-��G�h�RD��
�����O�Y�s�OJ%f�����F�s�����ks%f�p������0vU�}����\��Qb�C
����Կ��H�&6Jt��F�Yv4ҏ$q��YT�odx|'^���E���im�0v%g�����-��B��	!f��&c�郄�ߊ�<��^a����aw�#m��t4R�6rd��D��#��
�P�a�w�Z�1���
D�$wu?�j{nǞ�5�9Y��cF�-NSĔ�٤��%!�dp,�tz�8�{}��@�aOEL�ـ�t�)��#?�[��l�ŽN�)��KL���7��q�x���縚4j���^gq���R'�ļ�������b��/����b�5���Br�R&��<���h��HG�]l��{��H����>��u5=�s��?�C�ve��k4R���C�jF��u��u$%��ˍ�C����Q�����1��T��-G��FT�7�?f����t���6͂�s��q��֟��o��cd2
9Eȉٕdqɑ\J"��Q��x
��@�묣گcd��qh����I����b��c��!$��п8n�X�N}#S2X'��$�o�:�<�����w��������ܗQ�?"�HW�b����=
���|��u��J���Cș�o\�5�}ݔ9h���F�bA�o;��5�3���n��F�p�a�U���>KB�GU.V�
"�B��o��X欍�U^�
aHD|���uFRe_�1Â�(�@��yy����tX-6>�[�I	��!���Z��֑}�%N��uާE�����J�<;��P�_/�

�E6�j{�8[��0M2ϑ��zX��q5?B"^~����ƒp?=
]CBL,u�����,TӀj��
~Ƨ�,��peu0�Hl�.��F�sդ�V|�"s�0|�$f1�9N�����9`�v��*�^��~��K�9��Oy�H�"�.�$���Jt��B���<���"y�8n=gN̂8jd�?ǵ^3I
�@̳i��˂�X��d���>�aO�����ZQ&��NVb�{�-��՜!A,Do�\ǖ'v��q����DP��G%f2�
ǫ���P��A�#���:��v^�Y�R��!g�M.K�Tb&p��$!Gxr{��:Ը.6��"TI�7���t۰,"��}��^A���Č7!���cMw#��L��R�F�����Ѱ��~��޻p��_�/�
B�!!�8��X7у���g�ʇ�8�=ֹ3�:�/1��s�
֏�Č8�
һ���PN���:^�&U�j�p�0��
>���F�]`��q�!Q���686G�?�kB�
;z7�A�8N�Y��h=�HADƫ}5zm"�m�k>kz��E���fpU���%f�ٟ�D��7�6��F)�Y���$(L:�9�A|�J�hn���?��p
����c��F��BqϿD��VT�.@�("CH�H.EǺuJ�h~E��Dd��ה�P������.J��Lp�_j�D�AO��LvRbF�p
	����Y����g}�yT��p�-d]$6�=����H�~UbF��\�q�>R�&�˧�T*"6�|�E�$�4͂��q����/I"fٍܷV-�|�;�1�s��X�7�[N��H1�j�c4~����)W�Z��CJM�ĻT�<W�&�`%f���4��R�B�H�@2�WuS)˕D6�Z�����y�"���5�9A'6B�5h
�C)��Q1��-a��8���Yt��0�Ĭʙ�QZ�A���g�tk9��J�Y�^�@��JK{Al3��x^E�������Az�`���t]C��HMک�;gqO�{7�����2>�����io���X9���}{�!v	z�x�>�:�,Rb&Op�����A��g�f岄�����Q�\u�6J2A�@�_�C#}�
�%�9���Ey��}��W����	�X�/���n�2�iҵ�|�ØCi��g��Zs�(�+1�����m���t
+�3I�O��]L!���V�?i=�˕��FŬ�T�,�!�0�����x=*���p�Tlk[�_O�#��GU%f��j�
�7|�~��~3dPU��_а���9^��DD��isp��Č���B�g��3��T�����G��/�qv�xM$~�,�M��n�?��?*1���Ž���{RE��>�:���xh��:�ђhÃ��u��a@e
xZSM�p<��hB�C�3��*�f�Yk".�X��F���M��r�3�R�f��Se��7b}�K���a�ͩ�]~�4�Px��3~���*
����\P�p�Í)R��o��d-�����C��/(1はHH5H��&�sA�#�>�3ny4����6�1ȔG�ؕ���3�Nl�emrS���C��/�����b{[^�q��%�ͪ>	p����֌9C"�gC����h9��M����OWώ�x�k	'}o	�K�3"��s���st^�Dd��.T����|L��PbF#1[H��h亽ʦ��!צh�W�
���VbF��[�#<7���>"��d��i�"�ľ�p�Q���ϊx?[��t�LAl|N%պ�a+�
��&���3�]b�����8���,�3Z؜C�&W�toZ�'s�[�x.԰�@m��tw��Z��By�;�k.���yTW����RE��bUb*�)�A/��W(1C�gh
�Q�*1È	$h�!�B�*
Ԁ3�JLEgP�s�/�L���B�Y�$T�~�J"A���$��
��M���B�k�LP$�\#v��и��bn��]H�	��6/��W�F��)w�ݩ���<����x][���H�F�%
�~��oI:1)1��C�煉Ͽ�7�9�W��)�H��G��3�F<�����	G;�|�3G���9>o�T����
t�i_���+,@}
:���R6ه�)�*B	r��?���
�V����2�#ג�"紐�r/�mf�!�	_
v���w��h�"D3g��u̔a��A��?�p�q!��V�q�u/'���'fA��!�)�#0�-�r��uu�!&T�b���H�E�ZIr.u
e�~O$���ѱ��#l�Qq2~P�ؕ?���̀���m��\D��sJH��ئ	����x<C=j����i����7_.�t�b��}�Z��'d���(2);����.�C��;F1�Ec�6�Bۿ����J�re�{�������-z��=(�Xt�QlL~J1��b�1:C�T���9�?7�E|��Y���|
l���Щ����=���Vl;����F�\�L��c���#���HyA���ۨ��;�����_��{�좗��1�y��Q�z�fE
'���D�6$$���p,�m�4�vۉ f
���0;�!�9I
Z��O���Ľ(6�[+�e�x	)˜����	�)&;�oE�}
�%q�>bw\[�友�Y����0?h���hIc¥q~/���1!%��������[���B;�/���m�z�&�
�QB^���6�X�b�B�v�F顣TZ7Ƒtk~�9b7�JZi?����{��|,�_c�j~�Q��HK>(.��7��jb�t/������wQD��u.����p���Zې=W�y.��"�z�����4�^%9�꪿/Ă[�)���5,�s���5��e��u�ubC����~�K��;Iб��`��n��|猪|Rl��x�d�3���TW��kHX�.�Q��������2,'�9�G^%��c#�XnPdžȬAÕF>
8;`�-�L�J!.���GՀc��0d*�%��s'��T�p�ҾJ$w��ѓ��FКz�֛�I��"��^$�$��ȫ|O�Opw�{8�F
��3Ə���6I�һ(��w���=�F�:��릋�5��v,(-�D��5Ղ;YH��p,�8#8��s,��9�Vx��I9_��v{{@��e��Zqv��b}�YQG</�4�𯎑�#�m���R���b]��Q�2�ޑ�-��`
�~���m�G������dS���Ŝ�j�h*����(
J[�3f�1�3߭���ذe$�G���ʋ8!���Z��->����A�nD�r�����<�+1������VQދ:$d�/�W���%[ą�ҙF_�NE^%�F%�
����o���D�c�u��6%f���8lH��
w�Mu�@�3}UJ�b
���ȫbÈ��jE���P茩Pb*JL�S�Pb*JL�S�Pb*��
�S��T(��
�S��T(��
%�BQ�O�yL����IEND�B`�script.php000064400000003776151160563660006607
0ustar00<?php
/**
 * @package		Quix
 * @author 		ThemeXpert http://www.themexpert.com
 * @copyright	Copyright (c) 2010-2015 ThemeXpert. All rights reserved.
 * @license 	GNU General Public License version 3 or later; see LICENSE.txt
 * @since 		1.0.0
 */

defined('_JEXEC') or die;

class plgNotiflyDigicomInstallerScript
{	

	function preflight( $type, $parent ) {
		// if($type == 'install' or $type ==
'discover_install'){
		// 	self::insertTemplateInfo();
		// }
		return;
	}


	/**
	 * Function to perform changes during install
	 *
	 * @param   JInstallerAdapterComponent  $parent  The class calling this
method
	 *
	 * @return  void
	 *
	 * @since   3.4
	 */
	public function postflight($parent)
	{
		self::insertTemplateInfo();
		return;
	}
	
	/**
	* enable necessary plugins to avoid bad experience
	*/
	function insertTemplateInfo()
	{
		$db = JFactory::getDBO();
		$sql = "SELECT extension_id from `#__extensions` WHERE `type` =
'plugin' AND `folder` = 'notifly' AND `element` =
'digicom'";
		$db->setQuery($sql);
		$plugin = $db->loadObject();

		$sql = "SELECT * from `#__notifly_templates` WHERE `extension_id` =
'".$plugin->extension_id."'";
		$db->setQuery($sql);
		$templates = $db->loadObjectList();
		

		if(!count($templates)){
			// Create a new query object.
			$query = $db->getQuery(true);

			// Insert columns.
			$columns = array('extension_id', 'name',
'alias', 'message', 'state',
'published', 'access', 'language');

			// Insert values.
			$values = array($plugin->extension_id, $db->quote('NEW
PRODUCT PURCHASE'), $db->quote('new_product_purchase'),
$db->quote('{{name}} from {{ country }} just purchased!
**{{title_with_link}}**
			
			{{ time_ago }}'), '1', '1', '0',
$db->quote('*'));

			// Prepare the insert query.
			$query
			    ->insert($db->quoteName('#__notifly_templates'))
			    ->columns($db->quoteName($columns))
			    ->values(implode(',', $values));

			// Set the query using our newly populated query object and execute it.
			$db->setQuery($query);
			$db->execute();
			
		}

		return true;

	}

}