Skip to content

Instantly share code, notes, and snippets.

@zjbennett
zjbennett / clean.ps1
Last active February 18, 2019 09:34
Powershell Script for cleaning and removing v2.5 and upgrade to 3.5
# Set the values as needed
$QoS = "HKLM:\Software\Policies\Microsoft\Windows\QoS\Lync QoS"
#Copy Node Config
Write-Host "Copy the Node Config to Desktop" -ForegroundColor Green
Copy-Item "C:\TestNode\NodeConfig.xml" -Destination "C:\Users\modtest\Desktop"
#Delete TestNode Folder
Write-Host "Deleting Directory and Files" -ForegroundColor Green
Remove-Item -path "C:\TestNode\*.*" -Recurse
@zjbennett
zjbennett / pdocrud.php
Created September 19, 2018 13:52
PHP code for Trigger with Action
<?php
global $current_user;
get_currentuserinfo();
$userid = get_userdata($current_user->ID);
//adds Bootstrap Styling
$pdocrud = new PDOCrud(false, "pure", "pure");
$pdocrud->setTriggerOperation("wp_booking", array("int_id" => array("type" => "fixed", "val" =>"$userid->user_id")),array(),
"update", "after_btn_switch_update");
//renames columns and displays specific columns
$pdocrud->colRename("booking_profname", "Professional Name");
@zjbennett
zjbennett / functions.php
Created August 13, 2018 10:12
Code to add Last Login to Profile Builder.
function wppbc_save_user_last_login( $login = '' ) {
if( empty( $login ) )
return;
$user = get_user_by( 'login', $login );
$now = date('Y-m-d H:i:s');
update_user_meta( $user->ID, 'last_login', $now );
@zjbennett
zjbennett / functions.php
Last active August 7, 2018 13:43
G-Form Submission that take the booking form and places the submission into a table.
<?php
add_action( 'gform_after_submission_1', 'input_fields', 10, 2 );
function input_fields( $entry, $form ) {
global $wpdb;
$result = $wpdb->insert('wp_booking', array(
'booking_profname' => rgar( $entry, '4' ),
'booking_language' => rgar( $entry, '18' ),
'booking_gender' => rgar( $entry, '5' ),
'booking_date' => rgar( $entry, '7' ),
<?php
global $current_user;
get_currentuserinfo();
$userid = get_userdata($current_user->ID);
//adds Bootstrap Styling
$pdocrud = new PDOCrud(false, "pure", "pure");
//renames columns and displays specific columns
$pdocrud->colRename("booking_id", "Booking ID");
$pdocrud->colRename("booking_profname", "Professional Name");
$pdocrud->colRename("booking_language", "Language");