This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* 3-20-17 updated to run on pdb-before_submit_update filer | |
* | |
*/ | |
add_filter( 'pdb-before_submit_update', 'pdb_otu_regenerate_pid' ); | |
/** | |
* regenerates the private id for the current record | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* this code assumes that there is some value in the participant's record that | |
* determines what groups they will have access to | |
*/ | |
$pid = filter_input( INPUT_GET, 'pid', FILTER_SANITIZE_STRING ); | |
$id = Participants_Db::get_participant_id( $pid ); | |
if ( $id ) : | |
$user_record = Participants_Db::get_participant( $id ); | |
// change this to use whatever value it is you need to determine what groups to show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this sets the type of control to use when building the multi search control | |
add_filter( 'pdb-combo-multisearch-search_control_type', 'xnau_set_search_control_type', 10, 2 ); | |
// this sets the field type for the purpose of adding the search as a query filter | |
add_filter( 'pdbmps-field-filter', 'xnau_set_search_control_type', 10, 2 ); | |
function xnau_set_search_control_type( $form_element, $field ) | |
{ | |
if ( $field->name === 'state' ) { | |
$form_element = 'multi-checkbox'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* example of a single template with tabs and excluded groups | |
* | |
* | |
*/ | |
// first establish the set og group to show for this record type | |
if ( $this->participant_values['type'] == 'customer' ) { | |
$allowed_groups = array( 'main', 'address', 'personal' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* default template for displaying a single record | |
* | |
* This one calculates a person's age from a field named "birthdate" and shows it in a field named "age" | |
*/ | |
$record = new PDb_Template( $this ); | |
$date_field = 'birthdate'; | |
$age_field = 'age'; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
template for participants list shortcode output demonstrating a directory-style responsive layout | |
this template demonstrates a "table-less" reponsive layout for the list of records | |
*/ | |
?> | |
<div class="wrap <?php echo $this->wrap_class ?>" id="<?php echo $this->list_anchor ?>"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* custom template for signup form | |
* | |
*/ | |
// this is the name of the field you want to insert the value into | |
$ip_field = 'user_ip'; | |
?> | |
<div class="wrap <?php echo $this->wrap_class ?>" > |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// determine the range of dates to show | |
$start = date( 'M j,Y', strtotime( '-7 days' ) ); // the date 7 days ago | |
$end = date( 'M j,Y' ); // today's date | |
// now build the shortcode with the date range filter | |
echo do_shortcode( '[pdb_list filter="date_recorded>=' . $start . '&date_recorded<=' . $end . '" ]' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// determine the range of dates to show | |
$start = date( 'M 01,Y' ); // first day of the current month | |
$end = date( 'M t,Y' ); // last day of the current month | |
// now build the shortcode with the date range filter | |
echo do_shortcode( '[pdb_list filter="date_recorded>=' . $start . '&date_recorded<=' . $end . '" ]' ); | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* bootstrap template for signup form | |
* | |
* this demonstrates how to set the default value of a field in the template | |
* | |
* outputs a Twitter Bootstrap-compatible form | |
* http://twitter.github.com/bootstrap/index.html | |
* | |
* @version 0.3 |