Skip to content

Instantly share code, notes, and snippets.

zjbennett

Block or report user

Report or block zjbennett

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zjbennett
zjbennett / clean.ps1
Last active Feb 18, 2019
Powershell Script for cleaning and removing v2.5 and upgrade to 3.5
View clean.ps1
# 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 Sep 19, 2018
PHP code for Trigger with Action
View pdocrud.php
<?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 Aug 13, 2018
Code to add Last Login to Profile Builder.
View functions.php
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 );
View PDOCRUD.php
<?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");
@zjbennett
zjbennett / functions.php
Last active Aug 7, 2018
G-Form Submission that take the booking form and places the submission into a table.
View functions.php
<?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' ),
You can’t perform that action at this time.