Skip to content

Instantly share code, notes, and snippets.

Avatar

Roland Barker xnau

View GitHub Profile
@xnau
xnau / pdb-wp-user-shortcodes.php
Last active May 18, 2023 10:08
Provides shortcodes for showing Participants Database content according to the logged-in WordPress user.
View pdb-wp-user-shortcodes.php
<?php
/**
* Plugin Name: PDB WP User Shortcodes
* Description: defines several shortcodes for use with Participants Database and WordPress Users
*/
class PDb_User_List_Shortcodes {
/**
* @var string name of the user ID field
@xnau
xnau / pdb-check-link-match.php
Last active May 7, 2023 19:07
Shows how to set up a duplicate record check on a link-type field
View pdb-check-link-match.php
@xnau
xnau / pdb-list-sort-columns.php
Last active April 20, 2023 06:31
Shows how to set up a click-to-sort header for a Participants Database list table template
View pdb-list-sort-columns.php
<?php
/**
* @version 1.0
*
* template for participants list shortcode output
*
* this demonstrates how to add a click-to-sort header to the list
*
*/
@xnau
xnau / pdb-autocomplete-cache.php
Created April 12, 2023 04:32
Shows how to turn off caching of the autocomplete terms in Particinats Database Combo Multisearch
View pdb-autocomplete-cache.php
<?php
/**
* Plugin Name: PDB Autosuggest Term Cache Set
* Description: shows how to set the cache time for the Combo Multisearch autrosuggest term list
*
*/
// set the cache time to 1 second, effectively bypassing it
add_filter( 'pdbcms-autosuggest_term_list_expiration', function( $cache_time ) { return 1; } );
@xnau
xnau / pdb-custom-format-tag.php
Last active April 10, 2023 20:34
Shows how to define a custom format tag for a caclulated field in Participants Database
View pdb-custom-format-tag.php
<?php
/**
* Plugin Name: PDB Custom Format Tag
* Description: shows how to add a custom formatting tag for use in a Participants Database calculated field
* Version: 1.0
* Tutorial: https://xnau.com/using-custom-format-tags-for-calculation-fields/
*
* this requires Participants Database version 2.4.8 or later!
*/
@xnau
xnau / pdb-generate-member-id.php
Last active April 2, 2023 00:48
Demonstrates a way to generate and provide a unique ID for new signups and new records in Participants Database
View pdb-generate-member-id.php
<?php
/**
* Plugin Name: PDB Generate Member ID
* Description: provides a unique ID for new signups and new records in Participants Database
* Version: 2.1
*/
class pdb_generate_member_id {
/**
@xnau
xnau / pdb-multi-field-match-import.php
Last active March 28, 2023 04:10
Demonstrates how to set up a multiple-field match when a signup form is submitted or importing a CSV to Participants Database
View pdb-multi-field-match-import.php
<?php
/*
* Plugin Name: PDb Multi-Field Match Import
* Description: Demonstrates how to set up a multiple-field match when a signup form is submitted or importing a CSV to Participants Database
* Version: 2.0
*
*/
class PDb_Multifield_Match_Import {
/**
@xnau
xnau / pdb-record-approval-switch.php
Created January 21, 2023 18:01
Shows how to control which Participants Database fields are availble for editing based on the user's approval status
View pdb-record-approval-switch.php
<?php
/*
* when the user opens their record for editing, we check on their approval status
* and then select the shortcode to use based on that.
*/
switch ( $this->participant_values['approved'] ) {
case 'yes' :
echo do_shortcode( '[pdb_record]' );
break;
@xnau
xnau / pdb-email-cron.php
Last active January 17, 2023 05:21
Shows how to set up a Participants Database email that will automatically send when conditions are met
View pdb-email-cron.php
<?php
/**
* Plugin Name: PDB Email Cron
* Plugin URI: https://xnau.com/?p=7354
* Description: Provides a basic framework for setting up an automated Participants Database email send
* Version: 1.0
* Author: xnau webdesign
* Author URI: https://xnau.com
* License: GPL2
@xnau
xnau / pdb-custom-sum.php
Last active January 15, 2023 19:56
Shows how to set up a custom calculation on a Participants Database Participant Log
View pdb-custom-sum.php
<?php
/**
* Plugin Name: PDB Custom Log Sum
* Description: calculates a summary value for a participant log
*/
class pdb_custom_log_sum {
/**