Skip to content

Instantly share code, notes, and snippets.

View renekreijveld's full-sized avatar

Rene Kreijveld renekreijveld

View GitHub Profile
@renekreijveld
renekreijveld / clidemo_1.5.php
Last active August 29, 2015 13:56
Example CLI script for Joomla 1.5
<?php
// Joomla 1.5 example CLI script
// Written by: Rene Kreijveld, email [at] renekreijveld.nl
// 05-feb-2014
// Set flag that this is a parent file
define('_JEXEC', 1);
define('DS', DIRECTORY_SEPARATOR);
define('JPATH_BASE', dirname(__DIR__));
@renekreijveld
renekreijveld / clidemo_2.5.php
Last active August 29, 2015 13:56
Example CLI script for Joomla 2.5
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* Joomla 2.5 example CLI script
* Written by: Rene Kreijveld, email [at] renekreijveld.nl
* 05-feb-2014
@renekreijveld
renekreijveld / clidemo_3.2.php
Last active October 24, 2022 03:00
Example CLI script for Joomla 3,2
<?php
/**
* @package Joomla.Cli
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* Joomla 3.2 example CLI script
* Written by: Rene Kreijveld, email [at] renekreijveld.nl
* 05-feb-2014
@renekreijveld
renekreijveld / jfunctions
Last active June 12, 2018 07:22
General bash functions for use in jooma scripts
#!/bin/sh
# jfunctions - general bash functions for use in Joomla bash scripts
# Supports Joomla versions 2.5 - 3.x
#
# Copyright 2014 - 2016 Rene Kreijveld - r.kreijveld@dsd.nu
#
# This program is free software; you may redistribute it and/or modify it.
#
# Version history
#!/bin/sh
# jrestore - Restore a local site backup
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
# General variables
VERSION=1.0
@renekreijveld
renekreijveld / createthumbs
Last active August 29, 2015 14:01
Create smaller image and thumbnail from file upload field in RSForm!Pro
function resizeImage($CurWidth,$CurHeight,$MaxSize,$DestFolder,$SrcImage,$Quality,$ImageType){
if($CurWidth <= 0 || $CurHeight <= 0){
return false;
}
$ImageScale = min($MaxSize/$CurWidth, $MaxSize/$CurHeight);
$NewWidth = ceil($ImageScale*$CurWidth);
$NewHeight = ceil($ImageScale*$CurHeight);
$NewCanves = imagecreatetruecolor($NewWidth, $NewHeight);
if(imagecopyresampled($NewCanves, $SrcImage,0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight)){
switch(strtolower($ImageType)){
@renekreijveld
renekreijveld / geocide.php
Created May 23, 2014 12:11
A simple function/script for geocoding Address using Google Maps API.
<?php
/* A simple function/script for geocoding Address using Google Maps API.
* Please check Google Maps API FAQ & Terms for more info.
*
* @author Abdullah Rubiyath
*/
/**
* Returns a Lat and Lng from an Address using Google Geocoder API. It does not
@renekreijveld
renekreijveld / sitesbackup
Last active August 29, 2015 14:03
Find Joomla instances and backup them
#!/bin/sh
# sitesbackup -- Find Joomla instances and backup them
# Supports all Joomla versions
# Requires jbackupstore script
#
# Backups older than 5 days are automatically cleaned
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
@renekreijveld
renekreijveld / jbackupstore
Created July 3, 2014 11:22
Create a full backup of a Joomla website to tar gzip file and store in backup directory
#!/bin/sh
# jbackupstore -- Create a full backup of a Joomla website to tar gzip file and store in backup directory
#
# Copyright 2012 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
#
# Warning! This script needs the file joomlafunctions. This has to be installed in the same directory as this script.
#
@renekreijveld
renekreijveld / jfindfiles
Last active March 11, 2021 07:03
Find unused and used content files in your Joomla website
#!/bin/sh
# jfindfiles -- Find used and unused content files in your Joomla website
#
# This scripts supports Joomla versions 2.5 - 3.x
#
# Copyright 2014 Rene Kreijveld - email@renekreijveld.nl
#
# This program is free software; you may redistribute it and/or modify it.
#