Skip to content

Instantly share code, notes, and snippets.

@joshfeck
joshfeck / movie_list.php
Created August 16, 2012 15:51
Alternate movie table template. Removes category filtering and adds film title. Use in place of the stock movie list table
<?php
/*
Shortcode Name: Espresso Table
Author: Seth Shoultes
Contact:
Website: http://www.eventespresso.com
Description: Modified movie listing like table. Allows you to show events within a certain number number of days into the future and a qty. The example below only shows 3 events that start within 30 days from the current date.
Usage Example: [ESPRESSO_MOVIE_TABLE max_days="30" qty="3"]
Custom CSS for the table display
Notes: This file should be stored in your "/wp-content/uploads/espresso/templates/" folder and you should have the custom_includes.php files installed in your "/wp-content/uploads/espresso/" directory.
@joshfeck
joshfeck / test-page.php
Created October 11, 2012 16:56
super simple page WordPress page template for troubleshooting purposes. when selected, it will only display the content of the page
<?php
/*
Template Name: Testpage
*/
?>
<html>
<body>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
@joshfeck
joshfeck / event_list_display.php
Last active October 11, 2015 23:08
Alternate event_list_display.php template for use with the REM. Adds some support for themeroller and short event descriptions.
<?php
//This is the event list template page.
//This is a template file for displaying an event lsit on a page.
//There should be a copy of this file in your wp-content/uploads/espresso/ folder.
/*
* use the following shortcodes in a page or post:
* [EVENT_LIST]
* [EVENT_LIST limit=1]
* [EVENT_LIST show_expired=true]
* [EVENT_LIST show_deleted=true]
@joshfeck
joshfeck / template.php
Created November 9, 2012 21:14
invoice.php template for Event Espresso
<?php
//Added by Imon
if (isset($_SESSION['espresso_session']['id'])) {
unset($_SESSION['espresso_session']['id']);
}
define('FPDF_FONTPATH', EVENT_ESPRESSO_PLUGINFULLPATH . 'class/fpdf/font/');
require_once EVENT_ESPRESSO_PLUGINFULLPATH . 'class/fpdf/fpdf.php';
@joshfeck
joshfeck / staffsc.php
Created November 20, 2012 00:24
Staff shortcode that displays the email address on the front-end of the site. Copy and paste into the custom files add-on's custom_functions.php file.
if (!function_exists('espresso_staff_sc')) {
function espresso_staff_sc($atts) {
global $wpdb, $espresso_premium, $this_event_id;
if ($espresso_premium != true)
return;
empty($atts) ? '' : extract($atts);
@joshfeck
joshfeck / avaialble_spaces.php.
Created November 20, 2012 19:27
Adds number of available spaces next to each available event date. This block of code replaces the <ul> in the recurring event manager template's event_list_display.php
<ul>
<?php foreach ($events_group as $e) :
$num_attendees = get_number_of_attendees_reg_limit($e['event_id'], 'num_attendees');//Get the number of attendees. Please visit http://eventespresso.com/forums/?p=247 for available parameters for the get_number_of_attendees_reg_limit() function.
echo '<li>';
if ($num_attendees >= $e['reg_limit']) :
echo '<span class="error">';
else :
echo '<a href="'.$e['registration_url'].'">';
endif;
if ($e['start_date'] != $e['end_date']) :
@joshfeck
joshfeck / index.php
Created November 21, 2012 17:40
fixes form inputs on Event Espresso>Template settings for version 3.1.28.4 | replaces event-espresso/includes/admin-files/template-settings/index.php
<?php
function event_espresso_manage_templates() {
global $wpdb, $org_options;
//print_r($org_options);
if (isset($_POST['update_org'])) {
$org_options['display_description_on_multi_reg_page'] = !empty($_POST['display_description_on_multi_reg_page']) ? $_POST['display_description_on_multi_reg_page'] : 'N';
$org_options['display_short_description_in_event_list'] = !empty($_POST['display_short_description_in_event_list']) ? $_POST['display_short_description_in_event_list'] : 'N';
$org_options['display_address_in_event_list'] = !empty($_POST['display_address_in_event_list']) ? $_POST['display_address_in_event_list'] : 'N';
$org_options['display_address_in_regform'] = !empty($_POST['display_address_in_regform']) ? $_POST['display_address_in_regform'] : 'N';
@joshfeck
joshfeck / disabled_time.php
Last active December 11, 2015 05:28
Shows unavailable time slots and disables them from being selected.
<?php
switch ( $org_options['time_reg_limit'] ) {//This checks to see if the time slots are controlled by registration limits.
case 'Y':
//If the time slot is controlled by a registration limit.
//Then we need to check if there are enough spaces available.
//if (($time->reg_limit == 0)||($time->reg_limit > 0 && $time->reg_limit >=$num_attendees))
//If enough spaces are available, then show this time slot
if ($time->available_spaces > 0){
$html .= '<option' . $selected . ' value="' . $time->id . '">' . event_date_display($time->start_time, get_option('time_format')) . ' - ' . event_date_display($time->end_time, get_option('time_format')) . " ($time->available_spaces " . __('available spaces', 'event_espresso') . ")" . '</option>';}
@joshfeck
joshfeck / ideal_button.php
Created January 24, 2013 15:48
ideal button for ideal_vars.php
<img alt="Pay using iDeal" src="<?php echo EVENT_ESPRESSO_PLUGINFULLURL; ?>gateways/ideal/ideal-mollie-logo.png">
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
function mycustom_filter_gettext( $translated, $original, $domain ) {
// This is an array of original strings
// and what they should be replaced with
$strings = array(
'Register' => 'Sign up',
'Confirm and go to payment page' => 'Complete registration',