Skip to content

Instantly share code, notes, and snippets.

View xnau's full-sized avatar

Roland Barker xnau

View GitHub Profile
@xnau
xnau / pdb-log-running-total.php
Last active February 9, 2025 04:02
Shows how to set up a running total with the Participants Database Participant Log plugin
<?php
/**
* Plugin Name: PDb Log Running Total
* Description: keeps a running total for each record
* Version: 2.1
*/
/*
* this plugin keeps a cumulative total for each record by subtracting or adding
@xnau
xnau / pdb_literal_relations_field.php
Last active January 29, 2025 18:16
Shows how to set up a field that holds a literal list of relations for the Participants Database Multi-Relational plugin
<?php
/**
* Plugin Name: PDb Multi-Relational Literal Relations Field
* Description: Maintains a field in the database with a list of the record's relations
* Version: 0.1
*/
/*
* this is designed to maintain a field in the record that can be used for simple filtering
@xnau
xnau / pdbmrdb_record.php
Created January 26, 2025 20:12
Provides a utility class for the Participants Database Multi-Relational plugin that can be used in a shortcode template
<?php
/**
* Plugin Name: PDb Multi-Relational Utility Class
* Description: Provides a utility class for showing a record's relations
* Version: 0.1
*/
class pdbmrdb_record {
@xnau
xnau / pdb-list-userfilter.php
Last active January 31, 2025 18:32
Shows how to filter a Participants Database list display based on data from the user's Participants Database record
<?php
/**
* list of records based on the user's data
*
* the name of the user's group is in a field named group_membership
* when they open the page, the list shortcode is filtered to only show members of the same group
*
*/
if ( is_user_logged_in() ) :
@xnau
xnau / xnau-sqlite-fix.php
Created November 10, 2024 21:02
Performs some simple compatibility fixes for running WordPress using SQLite
<?php
/**
* Plugin Name: Participants Database SQLite Fix
* Description: Fixes certain syntax issues with plugin db queries
* Author: Roland Barker, xnau webdesign
* Version: 1.1
* Author URI: https://xnau.com
* License: GPL3
*/
@xnau
xnau / pdb-list-enumerated.php
Last active September 26, 2024 22:25
Participants Database list display template to demonstrate how to use a placeholder field to show an enumeration column
<?php
/**
* template that demonstrates how to use a placeholder field to show an enumeration column
*
*/
$enum_field = 'rank'; // name of the placeholder field
$records_per_page = $this->pagination->size;
$numeration = 1;
@xnau
xnau / pdb-age-detail-format-tag.php
Created March 31, 2024 07:04
Shows how to create a custom format tag for a Participants Database calculated field
<?php
/**
* Plugin Name: PDB Age Detail Format Tag
* Description: shows how to add a custom formatting tag for use in a Participants Database calculated field
* Version: 1.0
*
*/
class PDb_age_detail_format_tag
@xnau
xnau / pdb-admin-exclusive-options.php
Last active April 1, 2024 21:08
Plugin to enable the exclusive option feature in the admin record edit in Participants Database
<?php
/**
* Plugin Name: PDB Admin Exclusive Options
* Description: enables exclusive options in the admin record editor
* Version: 1.1
*/
class pdb_admin_exclusive_options {
@xnau
xnau / pdb-session-init.php
Created March 17, 2024 01:05
WordPress MU plugin for initializing a php session early in the load cycle
<?php
/*
* Plugin Name: Participants Database Session initializer
* Plugin URI: https://wordpress.org/plugins/participants-database/
* Description: Attempts to initate a php session before headers are sent
* Author: xnau webdesign
* Version: 0.1
* Author URI: http://xnau.com
*/
@xnau
xnau / pdb-a-unminify-js.php
Created March 1, 2024 18:31
Shows how to override javascript minification in Participants Database
<?php
/**
* Plugin Name: PDB Don't Minify JS
* Description: overrides the use of built-in minified javascript in Participants Database
*/
add_filter( 'pdb-use_minified_assets', function($enabled){
return false;
} );