Skip to content

Instantly share code, notes, and snippets.

View joomdonation's full-sized avatar

Tuan Pham Ngoc joomdonation

View GitHub Profile
ALTER TABLE `jos_ucm_content` DROP COLUMN `core_xreference`;
INSERT INTO `jos_content_types` (`type_id`, `type_title`, `type_alias`, `table`, `rules`, `field_mappings`, `router`, `content_history_options`) VALUES
(1, 'Article', 'com_content.article', '{\"special\":{\"dbtable\":\"#__content\",\"key\":\"id\",\"type\":\"ArticleTable\",\"prefix\":\"Joomla\\\\Component\\\\Content\\\\Administrator\\\\Table\\\\\",\"config\":\"array()\"},\"common\":{\"dbtable\":\"#__ucm_content\",\"key\":\"ucm_id\",\"type\":\"Corecontent\",\"prefix\":\"Joomla\\\\CMS\\\\Table\\\\\",\"config\":\"array()\"}}', '', '{\"common\":{\"core_content_item_id\":\"id\",\"core_title\":\"title\",\"core_state\":\"state\",\"core_alias\":\"alias\",\"core_created_time\":\"created\",\"core_modified_time\":\"modified\",\"core_body\":\"introtext\", \"core_hits\":\"hits\",\"core_publish_up\":\"publish_up\",\"core_publish_down\":\"publish_down\",\"core_access\":\"access\", \"core_params\":\"attribs\", \"core_featured\":\"featured\", \"core_metadata\":\"meta
@joomdonation
joomdonation / override.site-fullcalendar-default.min.js
Last active September 23, 2022 09:16
Customize FullCalendar Event Display
(function (document, Joomla) {
document.addEventListener('DOMContentLoaded', function () {
var calendarEl = document.getElementById('eb_full_calendar');
var calendarOptions = Joomla.getOptions('calendarOptions');
calendarOptions['eventDidMount'] = function (arg) {
if (arg.event.extendedProps.tooltip) {
var element = jQuery(arg.el);
element.tooltip({
title: arg.event.extendedProps.tooltip,
@joomdonation
joomdonation / gist:be9c80bab25c5519348c529a9c94ecb3
Created September 12, 2020 02:40
Redirect From OSE to Membership Pro
<?php
$_REQUEST['option'] = 'com_osmembership';
$_REQUEST['task'] = 'recurring_payment_confirm';
$_REQUEST['payment_method'] = 'os_paypal';
require_once '../../../index.php';
<?php
class plgInstallerSample extends JPlugin
{
public function onInstallerBeforePackageDownload(&$url, &$headers)
{
$uri = JUri::getInstance($url);
$uri->setVar('blahblah', 'blahblah');
$uri->setVar('pid', 'xx');
$uri->setVar('token', 'xxxxxx-xxxxxx-xxxxxx');
$url = $uri->toString();
<?php
class EventbookingHelper
{
/**
* Convert payment amount to USD currency in case the currency is not supported by the payment gateway
*
* @param $amount
* @param $currency
*
* @return float
<?php
/**
* @package Joomla
* @subpackage Event Booking
* @author Tuan Pham Ngoc
* @copyright Copyright (C) 2010 - 2018 Ossolution Team
* @license GNU/GPL, see LICENSE.php
*/
defined('_JEXEC') or die;
public function delete_attachments()
{
$db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select('attachments')
->from('#__helpdeskpro_tickets')
->where('attachments != ""')
->where('YEAR(created_date) <= 2019');
$db->setQuery($query);
$messages = $db->loadObjectList();
@joomdonation
joomdonation / modal.php
Created February 13, 2017 08:26
Joomla 3.6.5 modal fix
<?php
/**
* @package Joomla.Administrator
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
<?php
/**
* Convert payment amount to USD currency in case the currency is not supported by the payment gateway
*
* @param $amount
* @param $currency
*
* @return float
*/
public static function convertAmountToUSD($amount, $currency)
<?php
public function test_paygate()
{
require_once JPATH_ROOT . '/components/com_eventbooking/payments/paygatepayweb3/paygate.payweb3.php';
$payWeb3 = new PayGate_PayWeb3();
$payWeb3->setEncryptionKey('secret');
$requestData = array(
'PAYGATE_ID' => '10011072130',
'REFERENCE' => 'REGISTRATION#40',