Skip to content

Instantly share code, notes, and snippets.

Avatar

Tony Partridge tonypartridge

View GitHub Profile
@tonypartridge
tonypartridge / Joomla RSVP Pro - Sym Linker
Created Jan 10, 2019
Local Development Phing build script to sym link RSVP Pro Project structure
View Joomla RSVP Pro - Sym Linker
<?xml version="1.0" encoding="UTF-8"?>
<!-- Usage - run phing -f linker.xml -Dp=/var/www/je -->
<project name="linker" default="link" basedir=".">
<property name="URI.base" value="./"/>
<resolvepath propertyName="URI.base" file="${URI.base}"/>
<property name="p" value="" />
<property name="component" value="com_rsvppro"/>
<property name="rootPath" value="${URI.base}"/>
@tonypartridge
tonypartridge / bulk_sessions.php
Created Oct 16, 2018
Bulk Session inserter for Joomla! replace the database connection details with your own database details.
View bulk_sessions.php
<?php
// Simple script to insert lots of sessions to Joomla _session table.
$limit = 20000;
// Database connection using mysqli
$dbname = 'j33jq';
$dbuser = 'root';
$dbpass = 'root';
@tonypartridge
tonypartridge / wpExportParseUrlRedirect.php
Created Jul 12, 2018
Simple PHP Script to parse Wordpress posts xml export to get the relative url and prepare for Joomla! com_redirects, note using J2XML with WP Import plugin to import content quickly.
View wpExportParseUrlRedirect.php
<?php
// Make sure the WP File is called wpxmlfile.xml
$xmlfile = file_get_contents('wpxmlfile.xml');
$wpfile = simplexml_load_string($xmlfile)->channel;
// Set the parent menu item alias for the posts to be accessed under
// Assumed at present it is 'News with the alias news'
$newParentAlias = '/news/';
View Joomla Accessing User Custom Fields
<?php
/** In this scenario I have a custom field, type list with the name 'company-name' for my users **/
$user = JFactory::getUser();
JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); // Load the custom fields helper
$ProfileFields = FieldsHelper::getFields('com_users.user', $user, true);
foreach ($ProfileFields as $field) {
@tonypartridge
tonypartridge / default.xml
Last active Jun 26, 2018
Markup for pre-setting filters in Joomla! Admin menu items, this one is for com_content
View default.xml
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_CONTENT_ARTICLES_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_CONTENT_ARTICLES_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<fields name="request">
<fieldset name="request"
>
View gist:57750a6c349a86a62e09fb7e2ee64bca
{"field20":"40","field120":"60","field27":["1"],"field1":["VSimexRPuXNuFEng"],"field22":["1"],"field2":["wEmlaFFzH"],"field3":["QRaAfuSoQJn"],"field4":["oLqqdvAB"],"field5":"vIMJuU ofwnvszwaqik, [url=http:\/\/aqdrbzyjcyiy.com\/]aqdrbzyjcyiy[\/url], [link=http:\/\/oxuzfknyjbin.com\/]oxuzfknyjbin[\/link], http:\/\/cntzorajsini.com\/","field6":"KuRVPJLkaUYUGHs","field7":"eLzwiuKcnW","field9":["1"],"field10":["1"],"field11":["0"],"field13":["0"],"field14":["1"],"field15":["vIMJuU <a href="http://ofwnvszwaqik.com/" />ofwnvszwaqik, [url=http:\/\/aqdrbzyjcyiy.com\/]aqdrbzyjcyiy[\/url], [link=http:\/\/oxuzfknyjbin.com\/]oxuzfknyjbin[\/link], http:\/\/cntzorajsini.com\/"],"field16":["1"],"field18":["vIMJuU <a href="http://ofwnvszwaqik.com/" />ofwnvszwaqik, [url=http:\/\/aqdrbzyjcyiy.com\/]aqdrbzyjcyiy[\/url], [link=http:\/\/oxuzfknyjbin.com\/]oxuzfknyjbin[\/link], http:\/\/cntzorajsini.com\/"],"field19":["vIMJuU <a href="http://ofwnvszwaqik.com/" />ofwnvszwaqik, [url=http:\/\/aqdrbzyjcyiy.com\/]aqdrbzyjcyiy[\/url]
@tonypartridge
tonypartridge / latestadded_events.php
Last active Jan 4, 2017
JEvents Latest Added Events Query / Setup
View latestadded_events.php
<p><?php echo JText::_("JEV_CPANEL_LATEST_EVENTS_ADDED_DESC"); ?> </p>
<?php
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
// Select all records from the user profile table where key begins with "custom.".
// Order it by the ordering field.
View keybase.md

Keybase proof

I hereby claim:

  • I am tonypartridge on github.
  • I am tonypartridge (https://keybase.io/tonypartridge) on keybase.
  • I have a public key whose fingerprint is F2DB E915 4714 271E 2EFD D8A6 F058 BCD0 E8F6 B0CE

To claim this, I am signing this object: