| Server IP : 172.67.201.108 / Your IP : 216.73.216.68 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/home2/domains/licampfair.com/wp-content/plugins/lcs-tickets/ |
Upload File : |
<?php
/*
Plugin Name: LCS PDF Tickets
Plugin URI: http://www.latcomsystems.com/
Description: PDF tickets for forms.
Version: 1.0
Author: LatCom Systems
Author URI: http://www.latcomsystems.com/
License: Proprietary
*/
global $wp_version;
ini_set('user_agent',apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) ));
add_shortcode( 'lcs_ticket_href', 'lcs_ticket_href' );
function lcs_ticket_href($atts)
{
$url = site_url().'/attend-pdf-ticket/?'.http_build_query($_GET);
//***************** update MailChimp ****************
/*
require_once('mailchimp/mailchimp.php');
$mailchimp = new \Drewm\MailChimp('4dba38e1e67f7ffbda0c8e1829a59f22-us9');
$result = $mailchimp->call('lists/subscribe', array(
'id' => 'dd3f368f20',
'email' => array('email'=>$_GET['email']),
'merge_vars' => array(
'FNAME'=>$_GET['fname'],
'LNAME'=>$_GET['lname'],
'MMERGE6'=>$_GET['zip'],
'MMERGE10'=>$_GET['address'],
'MMERGE11'=>$_GET['city'],
'MMERGE12'=>$_GET['state'],
'MMERGE13'=>$_GET['phone'],
'MMERGE9'=>'Celebrate Auto Signup',
'CLBTKTLINK'=>$ticket_link,
),
'double_optin' => false,
'update_existing' => true,
'replace_interests' => false,
'send_welcome' => true,
));
*/
//var_dump($result);
/*
if ($result['status'] == 'error') :
$form_message = '<span style="color:red;">Error! '.$result['error'].'</span>';
else :
$form_message .= '<span style="color:green;">Successfully added to list. Thank you!</span>';
endif;
*/
//*************************************************
/*
$diag = '<--'.PHP_EOL;
$diag .= '$result:'.PHP_EOL;
$diag .= print_r($result, true);
$diag .= '$_
GET:'.PHP_EOL;
$diag .= print_r($_GET, true);
$diag .= PHP_EOL.'-->'.PHP_EOL;
return $diag.'<a href="'.$url.'" style="font-size:18pt;">Click here to download your ticket!</a>';
*/
return '<a href="'.$url.'" style="font-size:18pt;">Click here to download your ticket!</a>';
}
class PageTemplater {
private static $instance;
protected $templates;
public static function get_instance() {
if( null == self::$instance ) {
self::$instance = new PageTemplater();
}
return self::$instance;
}
private function __construct() {
$this->templates = array();
if ( version_compare( floatval($GLOBALS['wp_version']), '4.7', '<' ) ) { //*** version 4.6 and earlier
add_filter(
'page_attributes_dropdown_pages_args',
array( $this, 'register_project_templates' )
);
} else { //*** version 4.7 and later
add_filter(
'theme_page_templates', array( $this, 'add_new_template' )
); }
add_filter(
'wp_insert_post_data',
array( $this, 'register_project_templates' )
);
add_filter(
'template_include',
array( $this, 'view_project_template')
);
$this->templates = array(
'lcs-ticket-template.php' => 'LCS PDF Ticket Template',
);
}
public function register_project_templates( $atts ) {
$cache_key = 'page_templates-' . md5( get_theme_root() . '/' . get_stylesheet() );
$templates = wp_get_theme()->get_page_templates();
if ( empty( $templates ) ) {
$templates = array();
}
wp_cache_delete( $cache_key , 'themes');
$templates = array_merge( $templates, $this->templates );
wp_cache_add( $cache_key, $templates, 'themes', 1800 );
return $atts;
}
public function add_new_template( $posts_templates ) {
$posts_templates = array_merge( $posts_templates, $this->templates );
return $posts_templates;
}
public function view_project_template( $template ) {
global $post;
if (!isset($this->templates[get_post_meta(
$post->ID, '_wp_page_template', true
)] ) ) {
return $template;
}
$file = plugin_dir_path(__FILE__). get_post_meta(
$post->ID, '_wp_page_template', true
);
if( file_exists( $file ) ) {
return $file;
}
else { echo $file; }
return $template;
}
}
add_action( 'plugins_loaded', array( 'PageTemplater', 'get_instance' ) );
/***************** Custom CSS for Gravity forms **************/
wp_enqueue_style( 'lcs-gravity-forms-style', plugins_url('lcs_gravity_forms.css', __FILE__ ), array(), filemtime(dirname(__FILE__).'/lcs_gravity_forms.css'));
/**
* Gravity Wiz // Gravity Forms // Send Manual Notifications
*
* Provides a custom notification event that allows you to create notifications that can be sent
* manually (via Gravity Forms "Resend Notifications" feature).
*
* @version 1.2
* @author David Smith <[email protected]>
* @license GPL-2.0+
* @link http://gravitywiz.com/send-manual-notifications-with-gravity-forms/
*/
class GW_Manual_Notifications {
private static $instance = null;
public static function get_instance() {
if( null == self::$instance )
self::$instance = new self;
return self::$instance;
}
private function __construct() {
add_filter( 'gform_notification_events', array( $this, 'add_manual_notification_event' ) );
add_filter( 'gform_before_resend_notifications', array( $this, 'add_notification_filter' ) );
}
public function add_notification_filter( $form ) {
add_filter( 'gform_notification', array( $this, 'evaluate_notification_conditional_logic' ), 10, 3 );
return $form;
}
public function add_manual_notification_event( $events ) {
$events['manual'] = __( 'Send Manually' );
return $events;
}
public function evaluate_notification_conditional_logic( $notification, $form, $entry ) {
// if it fails conditional logic, suppress it
if( $notification['event'] == 'manual' && ! GFCommon::evaluate_conditional_logic( rgar( $notification, 'conditionalLogic' ), $form, $entry ) ) {
add_filter( 'gform_pre_send_email', array( $this, 'abort_next_notification' ) );
}
return $notification;
}
public function abort_next_notification( $args ) {
remove_filter( 'gform_pre_send_email', array( $this, 'abort_next_notification' ) );
$args['abort_email'] = true;
return $args;
}
}
function gw_manual_notifications() {
return GW_Manual_Notifications::get_instance();
}
gw_manual_notifications();
//************** manipulate tracking fields *****************
//add_filter( 'gform_pre_submission_filter', 'lcs_gravity_form_tracking' );
function lcs_gravity_form_tracking($form)
{
//error_log('['.date("D M d, Y H:i:s").' '.__METHOD__.'] ['.__FILE__.' Line: '.__LINE__.'] $form = '.print_r($form, true).PHP_EOL, 3, '/home/home2/domains/celeberateshowcase.com/dump.log');
return $form;
}
?>