Skip to content

Instantly share code, notes, and snippets.

function flightdeck_event_created_email($params) {
global $wpdb;
$event_id = $params['event_id'];
$sql = "SELECT evt.id, evt.event_name, evt.start_date, evt.end_date, se.start_time, se.end_time, v.name as venue_name, v.address, v.address2, v.city, v.state, v.zip FROM " . EVENTS_DETAIL_TABLE . " evt ";
$sql .= "LEFT JOIN " . EVENTS_VENUE_REL_TABLE . " r ON r.event_id = evt.id LEFT JOIN " . EVENTS_VENUE_TABLE . " v ON v.id=r.venue_id ";
$sql .= "LEFT JOIN " . EVENTS_START_END_TABLE . " se ON se.event_id = evt.id ";
$sql .= "WHERE evt.id=" . $event_id;
$event = array_shift($wpdb->get_results($sql));
$body = "";
// This goes in the themes functions.php
function fullwood_logout_url() {
// Gets the current user
$current_user = wp_get_current_user();
// Gets their roles
$current_user_roles = $current_user->roles;
// Checks to see if they have the client role
if (in_array('client', $current_user_roles)) {
function espresso_email_after_payment($payment_data) {
global $org_options;
if ($payment_data['payment_status'] == 'Completed') {
event_espresso_send_payment_notification(array('attendee_id' => $payment_data['attendee_id'], 'registration_id' => $payment_data['registration_id']));
$send_admin_email = 'true';
if ( is_user_logged_in() ) {
$send_admin_email = 'false';
}
<?php if ( is_user_logged_in() ) { ?>
<form method="post" action="<?php echo home_url(); ?>/?download_invoice=true&amp;admin=true&amp;registration_id=<?php echo $registration_id ?>" >
<input type="submit" class="print_button noPrint" value="<?php _e('Download Invoice', 'event_espresso'); ?>">
</form>
<?php } ?>
@dbarkley
dbarkley / gist:9641180
Created March 19, 2014 13:03
VendorTxCode
// Horrible code to forful Vendor Tx Code requirement
$referrer_sql = "SELECT * FROM wp_events_answer WHERE attendee_id = \"$attendee_id\" and question_id = \"12\"";
if (!$referrer_row = $wpdb->get_row($referrer_sql)) {
$referrer = "website-default";
} else {
$referrer = $referrer_row->answer;
}
<?php if ($payment_status == 'Completed') { ?>
<tr>
<td>Your Tickets</td>
<td>
<?php
echo custom_espresso_ticket_links($registration_id, $attendee_id, $txn_id);
?>
</td>
</tr>
<?php } ?>
function custom_espresso_ticket_links($registration_id, $attendee_id, $txn_id, $email = FALSE) {
global $wpdb;
$sql = "SELECT * FROM " . EVENTS_ATTENDEE_TABLE;
if (espresso_is_primary_attendee($attendee_id) != true) {
$sql .= " WHERE id = '" . $attendee_id . "' ";
} else {
$sql .= " WHERE txn_id = '" . $txn_id . "' ";
}
//echo $sql;
<?php
$seller_name = "website";
$text_field_name = "text12";
if ( is_user_logged_in() ) {
global $current_user;
get_currentuserinfo();
$roles = $current_user->roles;
if (in_array("seller", $roles)) {
$seller_name = "$current_user->user_login";
}
function admin_emails_function() {
$admin_emails = array();
$args = array(
'role' => 'Administrator',
'fields' => 'all_with_meta'
);
$user_query = new WP_User_Query( $args );
$admins = $user_query->get_results();
foreach ($admins as $admin) {
$admin_emails[] = $admin->user_email;