Skip to content

Instantly share code, notes, and snippets.

View javimata's full-sized avatar
💭
#CodeAndo

Javi Mata javimata

💭
#CodeAndo
View GitHub Profile
<?php
$array_images = array();
$imagen = $this->item->imagenes;
$array_images[0] = $imagen;
$imagenes = json_decode($this->item->images);
if (count($imagenes)):
@javimata
javimata / final
Last active April 26, 2016 17:51
Archivo administrator/components/com_catalogo/models/producto.php
public function save($data)
{
$app = JFactory::getApplication();
$generaThumbs = JComponentHelper::getParams('com_catalogo')->get('generaThumbs');
$ancho = JComponentHelper::getParams('com_catalogo')->get('anchoThumbs');
if (isset($data['images']) && is_array($data['images']))
{
$images = $data['images'];
<!DOCTYPE html>
<html lang="es-es" dir="ltr">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8" />
<meta name="keywords" content="primaria, kinder, maternal, Neill, cambridge, ingles, sistema uno, lexium, roboteando, Guadalajara, Jalisco, metropolitano, robotica" />
<meta name="description" content="Un método educativo centrado en el clima de libertad, de confianza personal y de desarrollo democrático. Contamos con Jardín de niños y Primaria, basada en el Sistema Uno y Lexium y diversos talleres como robótica." />
<meta name="generator" content="Joomla! - Open Source Content Management" />
<title>Artículos: Editar - Neill School - Administración</title>
//Support for file field: file_1
$input = JFactory::getApplication()->input;
$files = $input->files->get('jform');
if(!empty($files['file_1'])){
jimport('joomla.filesystem.file');
$file = $files['file_1'];
//Check if the server found any error.
$fileError = $file['error'];
$message = '';
@javimata
javimata / fields.php
Created February 10, 2018 01:34
obtener params
<?php
$contenido = 'Aqui iria el contenido {jForm type="text" value="nombre"} de prueba {jForm test="probandox"} test.';
$regex = '/{jForm\s(.*?)}/i';
preg_match_all($regex, $contenido, $matches, PREG_SET_ORDER);
if ($matches)
{
foreach ($matches as $match)
@javimata
javimata / eventos.js
Last active March 15, 2020 22:21
Script para agregar eventos de Google Analytics a los enlaces de teléfono y email de manera automática
(function ($) {
$(document).ready(function () {
/**
* Asigna una clase en base al tipo de enlace
*/
$('a[href^=tel]').addClass("link-phone");
$('a[href^=mailto]').addClass("link-email").attr("target", "_blank");
$('a[href*="wa.me"]').addClass("link-whatsapp").attr("target", "_blank");
@javimata
javimata / regex thank you page
Last active January 15, 2019 23:29
Regex analytics thank you page
(.*)contact_posted\=true(.*)
checker
https://www.regextester.com/?fam=107058
@javimata
javimata / eventos_js.js
Created July 25, 2019 21:44
Add events with JS pure
/**
* Activacion e incrustación de clases para eventos
*/
document.querySelectorAll('a[href^="tel"]').forEach( element => {
element.classList.add("link-phone");
element.addEventListener('click', function() {
if (typeof gtag == 'function') {
gtag('event', 'click', { 'event_category': 'telefono', 'event_label': 'llamada' });
};
if (typeof ga == 'function') {
@javimata
javimata / eventos.js
Last active March 15, 2020 22:28
Configuración de eventos FB Pixel & Google Analytics
/*
* CONFIGURACION DE ADD TO CART
* Debemos identificar el click en el botón
*/
var button = document.getElementById('addToCartButton');
button.addEventListener( 'click', function() {
fbq('track', 'AddToCart', {
content_name: 'Nombre del producto',
content_category: 'Categoria del producto',
content_ids: ['1'],
@javimata
javimata / composer.json
Last active April 28, 2021 14:22
API Shopify update stock
{
"require": {
"phpclassic/php-shopify": "^1.1"
}
}