Skip to content

Instantly share code, notes, and snippets.

View uzielweb's full-sized avatar

Uziel Almeida Oliveira uzielweb

View GitHub Profile
@uzielweb
uzielweb / importArticles.php
Last active November 14, 2023 08:51
Import Articles Cli for Joomla 4, importing articles from form2content and Joomla Articles
<?php
/*
Instructions for use:
- To skip the first 100 articles, use the argument "--skip 100".
- To manually define the limit of records to be imported, use the argument "-Limit" followed by the desired number, for example, "-Limit 50".
- To define the start date of import, use the argument "--start_date" followed by the date in "Yyyy-MM-DD" format, for example, "--start_date 2023-01-01".
- To define the end of importation, use the argument "--end_date" followed by the date in "Yyyy-MM-DD" format, for example, "--end_date 2023-12-31".
- To define the category of origin, use the argument "--source_category" followed by the desired ID, for example, "-source_category 10".
- To define the destination category, use the argument "--destination_category" followed by the desired category ID, for example, "--destination_category 5".
- To select Joomla Standard Articles from the Content table in the old database, use the argument "-standard_articles True".
@uzielweb
uzielweb / custom-bootstrap-m-p.css
Created July 23, 2023 00:21
Custom Bootstrap Margins and Paddings
/* Custom Bootstrap Margins by Uziel Almeida Oliveira */
/* p-1 until p-20 */
.p-1 {
padding: calc(var(--bs-gutter-x) * .125)
}
.p-2 {
padding: calc(var(--bs-gutter-x) * .25)
}
.p-3 {
padding: calc(var(--bs-gutter-x) * .5)
@uzielweb
uzielweb / custom-bootstrap-ratios.css
Last active July 22, 2023 23:56
Custom Bootstrap Ratios
/* Custom Ratios for Bootstrap 5 */
.ratio-1x1 {
--bs-aspect-ratio: 100%;
}
.ratio-1x2 {
--bs-aspect-ratio: 200%;
}
.ratio-2x1 {
--bs-aspect-ratio: 50%;
}
@uzielweb
uzielweb / phpfontawesome-joomla.php
Created November 29, 2022 00:16
php fontawesome for Joomla
<?php
// change $content with your html content
// replace any <i class fa fa-xxx> with svg equivalent
// fa-b, fa-brands, fa-light, fa-regular, fa-solid, fa-duotone, fas, far, fal, fab, fad
preg_match_all('@<' . 'i class="fa-(.*) fa-(.*)"' . '>@Us', $content, $newmatches);
$svgMatchs = $newmatches[2];
foreach ($svgMatchs as $key=>$svgMatch) {
$svgFile = JPATH_BASE.$tpath . '/svgs/' . $newmatches[1][$key] . '/' . $svgMatch . '.svg';
@uzielweb
uzielweb / svg-custom-icons-from-tags-classes.html
Last active October 16, 2022 06:12
Add SVG custom content based on tag class
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT" crossorigin="anonymous">
<title>Title</title>
<style>
body{
color: red;
@uzielweb
uzielweb / gist:322d0573d1dff0cfa7ac86f94c8a3a4d
Created December 13, 2021 03:45
Wordpress --- Filtering Events based on custom field inside custom post type
<?php
// developed by Daniel Paz and Uziel
$tipo = $_GET['tipo'];
$categoria = $_GET['categoria'];
?>
<form action="" method="get">
<div class="vistoboot">
<div class="container">
<div class="row align-items-end">
<div class="col-md">
@uzielweb
uzielweb / span-to-col-helixultimate.js
Created September 18, 2021 07:57
Change span to col-md- classes in Helix Ultimate
// add class row to sp-column when children has any part of class with span in the classname
jQuery(document).ready(function ($) {
$('.sp-column').each(function () {
// get the children class names with span in the classname
var childrenClasses = $(this).children().map(function () { return this.className; }).get().join(' ');
// if children has any part of class with span in the classname
if (childrenClasses.indexOf('span') > -1) { $(this).addClass('row'); }
// change parte of classname with span to col-md-
$(this).children().each(function () {
var className = $(this).attr('class');
@uzielweb
uzielweb / bootstrap2-to-bootstrap5
Last active August 19, 2022 13:29
Bootstrap 2 to Bootstrap 5 workaround adapt
/*
Classes "span" não são interpretadas por Bootstrap 3 e superiores, deixando tudo desalinhado e desproporcional ou "acavalado".
Esse pequeno hack abaixo permite que, pelo CSS, essas divs com classes legadas do Bootstrap 2 possam ser mais bem adaptadas ao visual moderno do Bootstrap 4 que usa flex-box no css.
*/
/*
Span classes are not interpreted by Bootstrap 3 and higher, leaving everything out of alignment and disproportionate or 'overturned'.
This little hack below allows, through CSS, these divs with legacy Bootstrap 2 classes to be better adapted to the modern look of Bootstrap 4 that uses flex-box in css.
@uzielweb
uzielweb / gist:1dca06d0586b24e87a7410dcfd03ce6f
Created May 18, 2021 05:50
Update Menu Types after Joomla Upgrade from 2.5 to 3
UPDATE `#__menu` SET `menutype` = 'main' WHERE `g4t1l_menu`.`menutype` = 'menu'
@uzielweb
uzielweb / .htaccess
Created March 9, 2021 15:12 — forked from drakakisgeo/.htaccess
Joomla .htaccess for extra security
###############################################################################
## The Master .htaccess
##
## Version 2.5 (proposed) - May 16th, 2011
##
## ----------
## This file is designed to be the template .htaccess file to put on your new
## sites, increasing your site's security and performance. It is not meant to
## be just dropped in your site, though. You should go through all of its
## sections and modify it to match your site. Most notably, all instances of